@credenza3/passport-evm 0.2.14 → 0.2.15

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 (68) hide show
  1. package/dist/{App-Wia4PtZj.js → App-Cr6VD6df.js} +18 -18
  2. package/dist/{App-Wia4PtZj.js.map → App-Cr6VD6df.js.map} +1 -1
  3. package/dist/{Button-DQF5ozBA.js → Button-DM2mshI-.js} +4 -4
  4. package/dist/{Button-DQF5ozBA.js.map → Button-DM2mshI-.js.map} +1 -1
  5. package/dist/{ButtonBack-DvGpisEx.js → ButtonBack-otOBxyhm.js} +4 -4
  6. package/dist/{ButtonBack-DvGpisEx.js.map → ButtonBack-otOBxyhm.js.map} +1 -1
  7. package/dist/{ButtonLink-CnqMPV_K.js → ButtonLink-DdkyW6UH.js} +3 -3
  8. package/dist/{ButtonLink-CnqMPV_K.js.map → ButtonLink-DdkyW6UH.js.map} +1 -1
  9. package/dist/{ConfirmAccount-maB7UG4l.js → ConfirmAccount-D-yQ5kf2.js} +9 -9
  10. package/dist/{ConfirmAccount-maB7UG4l.js.map → ConfirmAccount-D-yQ5kf2.js.map} +1 -1
  11. package/dist/{ContentHeader-BaJaDjWx.js → ContentHeader-yEGO8i6j.js} +3 -3
  12. package/dist/{ContentHeader-BaJaDjWx.js.map → ContentHeader-yEGO8i6j.js.map} +1 -1
  13. package/dist/{Error-BiK-7xSE.js → Error-NChFqGBT.js} +5 -5
  14. package/dist/{Error-BiK-7xSE.js.map → Error-NChFqGBT.js.map} +1 -1
  15. package/dist/{Input-DUKrjNKy.js → Input-DZj3Qj-n.js} +4 -4
  16. package/dist/{Input-DUKrjNKy.js.map → Input-DZj3Qj-n.js.map} +1 -1
  17. package/dist/{Label-B6QknVWJ.js → Label-D8cc_Ruk.js} +3 -3
  18. package/dist/{Label-B6QknVWJ.js.map → Label-D8cc_Ruk.js.map} +1 -1
  19. package/dist/{Loader-BE-Im2nj.js → Loader-B-YyFNIZ.js} +3 -3
  20. package/dist/{Loader-BE-Im2nj.js.map → Loader-B-YyFNIZ.js.map} +1 -1
  21. package/dist/{Login-CtSOlSyr.js → Login-CTrNVHVw.js} +9 -9
  22. package/dist/{Login-CtSOlSyr.js.map → Login-CTrNVHVw.js.map} +1 -1
  23. package/dist/{Logout-B800HSbi.js → Logout-CXBHnpw7.js} +6 -6
  24. package/dist/{Logout-B800HSbi.js.map → Logout-CXBHnpw7.js.map} +1 -1
  25. package/dist/{Nav-DCSwoiJH.js → Nav-Cr9PNYvH.js} +5 -5
  26. package/dist/{Nav-DCSwoiJH.js.map → Nav-Cr9PNYvH.js.map} +1 -1
  27. package/dist/{PassportId-DAaB1XWa.js → PassportId-CWVGIloj.js} +6 -6
  28. package/dist/{PassportId-DAaB1XWa.js.map → PassportId-CWVGIloj.js.map} +1 -1
  29. package/dist/{Payment-BmYpvwo4.js → Payment-CT0OPhHK.js} +10 -10
  30. package/dist/{Payment-BmYpvwo4.js.map → Payment-CT0OPhHK.js.map} +1 -1
  31. package/dist/{PaymentResult-DZuIruqo.js → PaymentResult-t52a3o97.js} +4 -4
  32. package/dist/{PaymentResult-DZuIruqo.js.map → PaymentResult-t52a3o97.js.map} +1 -1
  33. package/dist/{Profile-tRXSqEc3.js → Profile-D5MYXt-3.js} +7 -7
  34. package/dist/{Profile-tRXSqEc3.js.map → Profile-D5MYXt-3.js.map} +1 -1
  35. package/dist/{ProgressVideo-BagG3L4D.js → ProgressVideo-jNSI7qda.js} +5 -5
  36. package/dist/{ProgressVideo-BagG3L4D.js.map → ProgressVideo-jNSI7qda.js.map} +1 -1
  37. package/dist/{RichAlert-CwmQG5Yw.js → RichAlert-Bqj9XlBF.js} +6 -6
  38. package/dist/{RichAlert-CwmQG5Yw.js.map → RichAlert-Bqj9XlBF.js.map} +1 -1
  39. package/dist/{Scanner-D95fceZb.js → Scanner-CVGsVag-.js} +6 -6
  40. package/dist/{Scanner-D95fceZb.js.map → Scanner-CVGsVag-.js.map} +1 -1
  41. package/dist/{SendTokens-B7kN0i4B.js → SendTokens-civUV4zC.js} +7 -7
  42. package/dist/{SendTokens-B7kN0i4B.js.map → SendTokens-civUV4zC.js.map} +1 -1
  43. package/dist/{Sign-DPsEZJ1b.js → Sign-Ce60RADN.js} +6 -6
  44. package/dist/{Sign-DPsEZJ1b.js.map → Sign-Ce60RADN.js.map} +1 -1
  45. package/dist/{Stripe.service-DsBTXwjW.js → Stripe.service-oXsybcus.js} +3 -3
  46. package/dist/{Stripe.service-DsBTXwjW.js.map → Stripe.service-oXsybcus.js.map} +1 -1
  47. package/dist/{UpdateProfile-B1-_zhaW.js → UpdateProfile-CoUeMS1r.js} +10 -10
  48. package/dist/{UpdateProfile-B1-_zhaW.js.map → UpdateProfile-CoUeMS1r.js.map} +1 -1
  49. package/dist/{UserInfo-BKyPCmoD.js → UserInfo-xJVmkkkH.js} +4 -4
  50. package/dist/{UserInfo-BKyPCmoD.js.map → UserInfo-xJVmkkkH.js.map} +1 -1
  51. package/dist/{Wallet-BoMVtroj.js → Wallet-D6R6CjFq.js} +7 -7
  52. package/dist/{Wallet-BoMVtroj.js.map → Wallet-D6R6CjFq.js.map} +1 -1
  53. package/dist/{each-DjUcdxN5.js → each-D1y4pI2R.js} +2 -2
  54. package/dist/{each-DjUcdxN5.js.map → each-D1y4pI2R.js.map} +1 -1
  55. package/dist/{html-BlYQK6xb.js → html-CpZ2yh53.js} +3 -3
  56. package/dist/{html-BlYQK6xb.js.map → html-CpZ2yh53.js.map} +1 -1
  57. package/dist/{index-E5orRkcN.js → index-BjcW8vls.js} +571 -571
  58. package/dist/{index-E5orRkcN.js.map → index-BjcW8vls.js.map} +1 -1
  59. package/dist/{index-client-D2elGsHz.js → index-client-3un-JMX3.js} +2 -2
  60. package/dist/{index-client-D2elGsHz.js.map → index-client-3un-JMX3.js.map} +1 -1
  61. package/dist/{input-bKLUSlKu.js → input-BlDCJfWz.js} +3 -3
  62. package/dist/{input-bKLUSlKu.js.map → input-BlDCJfWz.js.map} +1 -1
  63. package/dist/{legacy-CYskm441.js → legacy-BnQw8ZSv.js} +2 -2
  64. package/dist/{legacy-CYskm441.js.map → legacy-BnQw8ZSv.js.map} +1 -1
  65. package/dist/passport.es.js +1 -1
  66. package/dist/passport.umd.js +3 -3
  67. package/dist/passport.umd.js.map +1 -1
  68. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@import"https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap";.crdz-ui *,.crdz-ui :before,.crdz-ui :after{font-family:Poppins,serif;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}.crdz-ui :before,.crdz-ui :after{--tw-content: ""}.crdz-ui hr{height:0;color:inherit;border-top-width:1px}.crdz-ui abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.crdz-ui h1,.crdz-ui h2,.crdz-ui h3,.crdz-ui h4,.crdz-ui h5,.crdz-ui h6{font-size:inherit;font-weight:inherit}.crdz-ui a{color:inherit;text-decoration:inherit}.crdz-ui b,.crdz-ui strong{font-weight:bolder}.crdz-ui code,.crdz-ui kbd,.crdz-ui samp,.crdz-ui pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.crdz-ui small{font-size:80%}.crdz-ui sub,.crdz-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.crdz-ui sub{bottom:-.25em}.crdz-ui sup{top:-.5em}.crdz-ui table{text-indent:0;border-color:inherit;border-collapse:collapse}.crdz-ui button,.crdz-ui select{text-transform:none}.crdz-ui button,.crdz-ui [type=button],.crdz-ui [type=reset],.crdz-ui [type=submit]{font-size:100%;-webkit-appearance:button;background-image:none}.crdz-ui :-moz-focusring{outline:auto}.crdz-ui :-moz-ui-invalid{box-shadow:none}.crdz-ui progress{vertical-align:baseline}.crdz-ui ::-webkit-inner-spin-button,.crdz-ui ::-webkit-outer-spin-button{height:auto}.crdz-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.crdz-ui ::-webkit-search-decoration{-webkit-appearance:none}.crdz-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.crdz-ui summary{display:list-item}.crdz-ui blockquote,.crdz-ui dl,.crdz-ui dd,.crdz-ui h1,.crdz-ui h2,.crdz-ui h3,.crdz-ui h4,.crdz-ui h5,.crdz-ui h6,.crdz-ui hr,.crdz-ui figure,.crdz-ui p,.crdz-ui span,.crdz-ui label,.crdz-ui pre{margin:0;letter-spacing:normal!important}.crdz-ui label{text-transform:initial!important}.crdz-ui fieldset{margin:0;padding:0}.crdz-ui legend{padding:0}.crdz-ui ol,.crdz-ui ul,.crdz-ui menu{list-style:none;margin:0;padding:0}.crdz-ui dialog{padding:0}.crdz-ui textarea{resize:vertical}.crdz-ui input::-moz-placeholder,.crdz-ui textarea::-moz-placeholder{opacity:1;color:#9ca3af}.crdz-ui input::placeholder,.crdz-ui textarea::placeholder{opacity:1;color:#9ca3af}.crdz-ui button,.crdz-ui [role=button]{cursor:pointer}.crdz-ui :disabled{cursor:default}.crdz-ui img,.crdz-ui svg,.crdz-ui video,.crdz-ui canvas,.crdz-ui audio,.crdz-ui iframe,.crdz-ui embed,.crdz-ui object{display:block;vertical-align:middle;opacity:1}.crdz-ui [hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.crtw-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.crtw-pointer-events-none{pointer-events:none!important}.crtw-invisible{visibility:hidden!important}.crtw-fixed{position:fixed!important}.crtw-absolute{position:absolute!important}.crtw-relative{position:relative!important}.crtw-bottom-0{bottom:0!important}.crtw-left-0{left:0!important}.crtw-right-0{right:0!important}.crtw-top-0{top:0!important}.crtw-top-\\[8px\\]{top:8px!important}.crtw-z-10{z-index:10!important}.crtw-z-50{z-index:50!important}.crtw-z-\\[-1\\]{z-index:-1!important}.crtw-z-\\[1050\\]{z-index:1050!important}.crtw-float-right{float:right!important}.crtw-m-2{margin:.5rem!important}.crtw-m-3\\.5{margin:.875rem!important}.crtw-m-5{margin:1.25rem!important}.crtw-mx-1\\.5{margin-left:.375rem!important;margin-right:.375rem!important}.crtw-mx-auto{margin-left:auto!important;margin-right:auto!important}.crtw-my-0{margin-top:0!important;margin-bottom:0!important}.crtw-my-0\\.5{margin-top:.125rem!important;margin-bottom:.125rem!important}.crtw-my-4{margin-top:1rem!important;margin-bottom:1rem!important}.crtw-my-5{margin-top:1.25rem!important;margin-bottom:1.25rem!important}.crtw-mb-1{margin-bottom:.25rem!important}.crtw-mb-1\\.5{margin-bottom:.375rem!important}.crtw-mb-2{margin-bottom:.5rem!important}.crtw-mb-2\\.5{margin-bottom:.625rem!important}.crtw-mb-3{margin-bottom:.75rem!important}.crtw-mb-3\\.5{margin-bottom:.875rem!important}.crtw-mb-4{margin-bottom:1rem!important}.crtw-mb-5{margin-bottom:1.25rem!important}.crtw-mb-6{margin-bottom:1.5rem!important}.crtw-mb-9{margin-bottom:2.25rem!important}.crtw-mb-\\[30px\\]{margin-bottom:30px!important}.crtw-ml-1{margin-left:.25rem!important}.crtw-ml-1\\.5{margin-left:.375rem!important}.crtw-ml-2\\.5{margin-left:.625rem!important}.crtw-mr-0\\.5{margin-right:.125rem!important}.crtw-mr-1\\.5{margin-right:.375rem!important}.crtw-mr-14{margin-right:3.5rem!important}.crtw-mr-2{margin-right:.5rem!important}.crtw-mt-0\\.5{margin-top:.125rem!important}.crtw-mt-1{margin-top:.25rem!important}.crtw-mt-1\\.5{margin-top:.375rem!important}.crtw-mt-2\\.5{margin-top:.625rem!important}.crtw-mt-3\\.5{margin-top:.875rem!important}.crtw-mt-4{margin-top:1rem!important}.crtw-mt-6{margin-top:1.5rem!important}.crtw-mt-9{margin-top:2.25rem!important}.crtw-mt-\\[-10px\\]{margin-top:-10px!important}.crtw-mt-\\[5px\\]{margin-top:5px!important}.crtw-box-border{box-sizing:border-box!important}.crtw-block{display:block!important}.crtw-flex{display:flex!important}.crtw-inline-flex{display:inline-flex!important}.crtw-hidden{display:none!important}.crtw-h-1\\.5{height:.375rem!important}.crtw-h-11{height:2.75rem!important}.crtw-h-3{height:.75rem!important}.crtw-h-4{height:1rem!important}.crtw-h-64{height:16rem!important}.crtw-h-7{height:1.75rem!important}.crtw-h-8{height:2rem!important}.crtw-h-9{height:2.25rem!important}.crtw-h-\\[30px\\]{height:30px!important}.crtw-h-\\[50px\\]{height:50px!important}.crtw-h-\\[53px\\]{height:53px!important}.crtw-h-full{height:100%!important}.crtw-max-h-full{max-height:100%!important}.crtw-min-h-\\[155px\\]{min-height:155px!important}.crtw-min-h-screen{min-height:100vh!important}.crtw-w-1\\.5{width:.375rem!important}.crtw-w-1\\/2{width:50%!important}.crtw-w-11{width:2.75rem!important}.crtw-w-16{width:4rem!important}.crtw-w-4{width:1rem!important}.crtw-w-40{width:10rem!important}.crtw-w-56{width:14rem!important}.crtw-w-64{width:16rem!important}.crtw-w-8{width:2rem!important}.crtw-w-\\[110px\\]{width:110px!important}.crtw-w-\\[70px\\]{width:70px!important}.crtw-w-\\[90px\\]{width:90px!important}.crtw-w-full{width:100%!important}.crtw-min-w-16{min-width:4rem!important}.crtw-max-w-\\[30px\\]{max-width:30px!important}.crtw-max-w-\\[380px\\]{max-width:380px!important}.crtw-max-w-xs{max-width:20rem!important}.crtw-flex-1{flex:1 1 0%!important}@keyframes crtw-spin{to{transform:rotate(360deg)}}.crtw-animate-spin{animation:crtw-spin 1s linear infinite!important}.crtw-cursor-pointer{cursor:pointer!important}.crtw-appearance-none{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important}.crtw-flex-row{flex-direction:row!important}.crtw-flex-col{flex-direction:column!important}.crtw-items-start{align-items:flex-start!important}.crtw-items-center{align-items:center!important}.crtw-justify-start{justify-content:flex-start!important}.crtw-justify-center{justify-content:center!important}.crtw-justify-between{justify-content:space-between!important}.crtw-justify-items-center{justify-items:center!important}.crtw-gap-10{gap:2.5rem!important}.crtw-gap-14{gap:3.5rem!important}.crtw-gap-2\\.5{gap:.625rem!important}.crtw-gap-3{gap:.75rem!important}.crtw-gap-4{gap:1rem!important}.crtw-gap-6{gap:1.5rem!important}.crtw-gap-9{gap:2.25rem!important}.crtw-gap-\\[22px\\]{gap:22px!important}.crtw-overflow-hidden{overflow:hidden!important}.crtw-overflow-y-scroll{overflow-y:scroll!important}.crtw-whitespace-normal{white-space:normal!important}.crtw-break-words{overflow-wrap:break-word!important}.crtw-break-all{word-break:break-all!important}.crtw-rounded{border-radius:.25rem!important}.crtw-rounded-\\[10px\\]{border-radius:10px!important}.crtw-rounded-\\[3px\\]{border-radius:3px!important}.crtw-rounded-full{border-radius:9999px!important}.crtw-rounded-lg{border-radius:.5rem!important}.crtw-rounded-md{border-radius:.375rem!important}.crtw-rounded-sm{border-radius:.125rem!important}.crtw-rounded-xl{border-radius:.75rem!important}.crtw-border{border-width:1px!important}.crtw-border-0{border-width:0px!important}.crtw-border-2{border-width:2px!important}.crtw-border-b-2{border-bottom-width:2px!important}.crtw-border-t-2{border-top-width:2px!important}.crtw-border-\\[\\#990008\\]{--tw-border-opacity: 1 !important;border-color:rgb(153 0 8 / var(--tw-border-opacity, 1))!important}.crtw-border-\\[\\#d9d9d9\\]{--tw-border-opacity: 1 !important;border-color:rgb(217 217 217 / var(--tw-border-opacity, 1))!important}.crtw-border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))!important}.crtw-border-blue-800{--tw-border-opacity: 1 !important;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-200{--tw-border-opacity: 1 !important;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-300{--tw-border-opacity: 1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-400{--tw-border-opacity: 1 !important;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-700{--tw-border-opacity: 1 !important;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))!important}.crtw-bg-black{--tw-bg-opacity: 1 !important;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))!important}.crtw-bg-black\\/70{background-color:#000000b3!important}.crtw-bg-gray-200{--tw-bg-opacity: 1 !important;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))!important}.crtw-bg-gray-300{--tw-bg-opacity: 1 !important;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))!important}.crtw-bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))!important}.crtw-bg-red-500{--tw-bg-opacity: 1 !important;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))!important}.crtw-bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))!important}.crtw-fill-black{fill:#000!important}.crtw-fill-red-500{fill:#ef4444!important}.crtw-p-0{padding:0!important}.crtw-p-2\\.5{padding:.625rem!important}.crtw-p-px{padding:1px!important}.crtw-px-0{padding-left:0!important;padding-right:0!important}.crtw-px-0\\.5{padding-left:.125rem!important;padding-right:.125rem!important}.crtw-px-2{padding-left:.5rem!important;padding-right:.5rem!important}.crtw-px-2\\.5{padding-left:.625rem!important;padding-right:.625rem!important}.crtw-px-4{padding-left:1rem!important;padding-right:1rem!important}.crtw-px-5{padding-left:1.25rem!important;padding-right:1.25rem!important}.crtw-px-\\[22px\\]{padding-left:22px!important;padding-right:22px!important}.crtw-py-0{padding-top:0!important;padding-bottom:0!important}.crtw-py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.crtw-py-2\\.5{padding-top:.625rem!important;padding-bottom:.625rem!important}.crtw-py-4{padding-top:1rem!important;padding-bottom:1rem!important}.crtw-pb-2{padding-bottom:.5rem!important}.crtw-pb-9{padding-bottom:2.25rem!important}.crtw-pl-5{padding-left:1.25rem!important}.crtw-pr-1\\.5{padding-right:.375rem!important}.crtw-pr-5{padding-right:1.25rem!important}.crtw-pt-11{padding-top:2.75rem!important}.crtw-pt-4{padding-top:1rem!important}.crtw-pt-5{padding-top:1.25rem!important}.crtw-pt-\\[3px\\]{padding-top:3px!important}.crtw-text-left{text-align:left!important}.crtw-text-center{text-align:center!important}.crtw-text-right{text-align:right!important}.crtw-text-justify{text-align:justify!important}.crtw-font-\\[\\'Poppins\\'\\]{font-family:Poppins!important}.crtw-font-\\[\\'poppins\\'\\],.crtw-font-\\[poppins\\]{font-family:poppins!important}.crtw-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.crtw-text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.crtw-text-\\[10px\\]{font-size:10px!important}.crtw-text-\\[13px\\]{font-size:13px!important}.crtw-text-\\[21px\\]{font-size:21px!important}.crtw-text-\\[9px\\]{font-size:9px!important}.crtw-text-base{font-size:1rem!important;line-height:1.5rem!important}.crtw-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.crtw-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.crtw-text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.crtw-text-xs{font-size:.75rem!important;line-height:1rem!important}.crtw-font-bold{font-weight:700!important}.crtw-font-medium{font-weight:500!important}.crtw-font-semibold{font-weight:600!important}.crtw-uppercase{text-transform:uppercase!important}.crtw-text-\\[\\#121e2b\\]{--tw-text-opacity: 1 !important;color:rgb(18 30 43 / var(--tw-text-opacity, 1))!important}.crtw-text-\\[\\#990008\\]{--tw-text-opacity: 1 !important;color:rgb(153 0 8 / var(--tw-text-opacity, 1))!important}.crtw-text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity, 1))!important}.crtw-text-blue-600{--tw-text-opacity: 1 !important;color:rgb(37 99 235 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-400{--tw-text-opacity: 1 !important;color:rgb(156 163 175 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-600{--tw-text-opacity: 1 !important;color:rgb(75 85 99 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-700{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-800{--tw-text-opacity: 1 !important;color:rgb(31 41 55 / var(--tw-text-opacity, 1))!important}.crtw-text-hightlightColor{--tw-text-opacity: 1 !important;color:rgb(11 114 224 / var(--tw-text-opacity, 1))!important}.crtw-text-red-500{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1))!important}.crtw-text-red-600{--tw-text-opacity: 1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1))!important}.crtw-text-textMain{--tw-text-opacity: 1 !important;color:rgb(31 31 31 / var(--tw-text-opacity, 1))!important}.crtw-text-warningTextColor{--tw-text-opacity: 1 !important;color:rgb(153 0 8 / var(--tw-text-opacity, 1))!important}.crtw-text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.crtw-underline{text-decoration-line:underline!important}.crtw-no-underline{text-decoration-line:none!important}.crtw-placeholder-\\[\\#d9d9d9\\]::-moz-placeholder{--tw-placeholder-opacity: 1 !important;color:rgb(217 217 217 / var(--tw-placeholder-opacity, 1))!important}.crtw-placeholder-\\[\\#d9d9d9\\]::placeholder{--tw-placeholder-opacity: 1 !important;color:rgb(217 217 217 / var(--tw-placeholder-opacity, 1))!important}.crtw-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.crtw-outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.crtw-backdrop-blur-lg{--tw-backdrop-blur: blur(16px) !important;-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important;backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important}.crtw-backdrop-blur-md{--tw-backdrop-blur: blur(12px) !important;-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important;backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important}.first\\:crtw-rounded-l:first-child{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.last\\:crtw-rounded-r:last-child{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.hover\\:crtw-bg-gray-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))!important}.hover\\:crtw-bg-gray-800:hover{--tw-bg-opacity: 1 !important;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))!important}.hover\\:crtw-text-blue-800:hover{--tw-text-opacity: 1 !important;color:rgb(30 64 175 / var(--tw-text-opacity, 1))!important}.focus\\:crtw-border-\\[\\#121e2b\\]:focus{--tw-border-opacity: 1 !important;border-color:rgb(18 30 43 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-border-\\[\\#990008\\]:focus{--tw-border-opacity: 1 !important;border-color:rgb(153 0 8 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-border-blue-800:focus{--tw-border-opacity: 1 !important;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-border-blue-900:focus{--tw-border-opacity: 1 !important;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-text-blue-900:focus{--tw-text-opacity: 1 !important;color:rgb(30 58 138 / var(--tw-text-opacity, 1))!important}.focus\\:crtw-outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.focus\\:crtw-outline-0:focus{outline-width:0px!important}.disabled\\:crtw-bg-\\[\\#d9d9d9\\]:disabled{--tw-bg-opacity: 1 !important;background-color:rgb(217 217 217 / var(--tw-bg-opacity, 1))!important}.crtw-group:hover .group-hover\\:crtw-visible{visibility:visible!important}@media (min-width: 640px){.sm\\:crtw-m-4{margin:1rem!important}.sm\\:crtw-mb-px{margin-bottom:1px!important}.sm\\:crtw-max-w-\\[360px\\]{max-width:360px!important}.sm\\:crtw-max-w-md{max-width:28rem!important}.sm\\:crtw-px-1\\.5{padding-left:.375rem!important;padding-right:.375rem!important}.sm\\:crtw-pt-2{padding-top:.5rem!important}.sm\\:crtw-pt-\\[50px\\]{padding-top:50px!important}.sm\\:crtw-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.sm\\:crtw-text-\\[11px\\]{font-size:11px!important}.sm\\:crtw-text-base{font-size:1rem!important;line-height:1.5rem!important}.sm\\:crtw-text-sm{font-size:.875rem!important;line-height:1.25rem!important}}@media (min-width: 768px){.md\\:crtw-text-2xl{font-size:1.5rem!important;line-height:2rem!important}}@media (min-height: 650px){.sm-tall\\:crtw-max-h-\\[650px\\]{max-height:650px!important}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- (function(Ar,en){typeof exports=="object"&&typeof module<"u"?en(exports):typeof define=="function"&&define.amd?define(["exports"],en):(Ar=typeof globalThis<"u"?globalThis:Ar||self,en(Ar.CredenzaPassport={}))})(this,function(Ar){"use strict";var nN=Ar=>{throw TypeError(Ar)};var iN=(Ar,en,si)=>en.has(Ar)||nN("Cannot "+si);var Zn=(Ar,en,si)=>(iN(Ar,en,"read from private field"),si?si.call(Ar):en.get(Ar)),s5=(Ar,en,si)=>en.has(Ar)?nN("Cannot add the same private member more than once"):en instanceof WeakSet?en.add(Ar):en.set(Ar,si),o5=(Ar,en,si,Dd)=>(iN(Ar,en,"write to private field"),Dd?Dd.call(Ar,si):en.set(Ar,si),si);var To,Ri,jT;const si={version:"0.2.14"},Dd=!1;var j0=Array.isArray,fN=Array.prototype.indexOf,cg=Array.from,lg=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,u5=Object.getOwnPropertyDescriptors,pN=Object.prototype,mN=Array.prototype,ug=Object.getPrototypeOf,d5=Object.isExtensible;const Bo=()=>{};function h5(t){return typeof(t==null?void 0:t.then)=="function"}function gN(t){return t()}function Wd(t){for(var e=0;e<t.length;e++)t[e]()}function vN(t,e,r=!1){return t===void 0?r?e():e:t}const Ti=2,f5=4,Q0=8,dg=16,Is=32,ol=64,hg=128,zn=256,J0=512,Gn=1024,Os=2048,Io=4096,Us=8192,fg=16384,p5=32768,$0=65536,yN=1<<17,wN=1<<19,m5=1<<20,pg=1<<21,Oo=Symbol("$state"),g5=Symbol("legacy props"),bN=Symbol(""),kN=typeof requestIdleCallback>"u"?t=>setTimeout(t,1):requestIdleCallback;let Zd=[],zd=[];function v5(){var t=Zd;Zd=[],Wd(t)}function y5(){var t=zd;zd=[],Wd(t)}function Gd(t){Zd.length===0&&queueMicrotask(v5),Zd.push(t)}function _N(t){zd.length===0&&kN(y5),zd.push(t)}function EN(){Zd.length>0&&v5(),zd.length>0&&y5()}function w5(t){return t===this.v}function b5(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function mg(t){return!b5(t,this.v)}function CN(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function SN(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function AN(t){throw new Error("https://svelte.dev/e/effect_orphan")}function RN(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function TN(){throw new Error("https://svelte.dev/e/hydration_failed")}function NN(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function xN(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function BN(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function IN(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let al=!1,ON=!1;function UN(){al=!0}const gg=1,vg=2,k5=4,MN=8,PN=16,VN=1,FN=2,_5=4,LN=8,DN=16,WN=1,ZN=2,yg="[",Y0="[!",wg="]",Da={},fn=Symbol(),zN="http://www.w3.org/1999/xhtml",GN="@attach";function E5(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let or=null;function X0(t){or=t}function Le(t,e=!1,r){var n=or={p:or,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};al&&!e&&(or.l={s:null,u:null,r1:[],r2:Uo(!1)}),Sg(()=>{n.d=!0})}function De(t){const e=or;if(e!==null){t!==void 0&&(e.x=t);const o=e.e;if(o!==null){var r=Jt,n=Qt;e.e=null;try{for(var i=0;i<o.length;i++){var s=o[i];ns(s.effect),oi(s.reaction),rp(s.fn)}}finally{ns(r),oi(n)}}or=e.p,e.m=!0}return t||{}}function cl(){return!al||or!==null&&or.l===null}function ll(t){if(typeof t!="object"||t===null||Oo in t)return t;const e=ug(t);if(e!==pN&&e!==mN)return t;var r=new Map,n=j0(t),i=Mo(0),s=Qt,o=a=>{var c=Qt;oi(s);var l=a();return oi(c),l};return n&&r.set("length",Mo(t.length)),new Proxy(t,{defineProperty(a,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&xN();var u=r.get(c);return u===void 0?u=o(()=>{var d=Mo(l.value);return r.set(c,d),d}):X(u,l.value,!0),!0},deleteProperty(a,c){var l=r.get(c);if(l===void 0){if(c in a){const h=o(()=>Mo(fn));r.set(c,h),bg(i)}}else{if(n&&typeof c=="string"){var u=r.get("length"),d=Number(c);Number.isInteger(d)&&d<u.v&&X(u,d)}X(l,fn),bg(i)}return!0},get(a,c,l){var f;if(c===Oo)return t;var u=r.get(c),d=c in a;if(u===void 0&&(!d||(f=sl(a,c))!=null&&f.writable)&&(u=o(()=>{var p=ll(d?a[c]:fn),v=Mo(p);return v}),r.set(c,u)),u!==void 0){var h=C(u);return h===fn?void 0:h}return Reflect.get(a,c,l)},getOwnPropertyDescriptor(a,c){var l=Reflect.getOwnPropertyDescriptor(a,c);if(l&&"value"in l){var u=r.get(c);u&&(l.value=C(u))}else if(l===void 0){var d=r.get(c),h=d==null?void 0:d.v;if(d!==void 0&&h!==fn)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return l},has(a,c){var h;if(c===Oo)return!0;var l=r.get(c),u=l!==void 0&&l.v!==fn||Reflect.has(a,c);if(l!==void 0||Jt!==null&&(!u||(h=sl(a,c))!=null&&h.writable)){l===void 0&&(l=o(()=>{var f=u?ll(a[c]):fn,p=Mo(f);return p}),r.set(c,l));var d=C(l);if(d===fn)return!1}return u},set(a,c,l,u){var S;var d=r.get(c),h=c in a;if(n&&c==="length")for(var f=l;f<d.v;f+=1){var p=r.get(f+"");p!==void 0?X(p,fn):f in a&&(p=o(()=>Mo(fn)),r.set(f+"",p))}if(d===void 0)(!h||(S=sl(a,c))!=null&&S.writable)&&(d=o(()=>Mo(void 0)),X(d,ll(l)),r.set(c,d));else{h=d.v!==fn;var v=o(()=>ll(l));X(d,v)}var m=Reflect.getOwnPropertyDescriptor(a,c);if(m!=null&&m.set&&m.set.call(u,l),!h){if(n&&typeof c=="string"){var w=r.get("length"),_=Number(c);Number.isInteger(_)&&_>=w.v&&X(w,_+1)}bg(i)}return!0},ownKeys(a){C(i);var c=Reflect.ownKeys(a).filter(d=>{var h=r.get(d);return h===void 0||h.v!==fn});for(var[l,u]of r)u.v!==fn&&!(l in a)&&c.push(l);return c},setPrototypeOf(){BN()}})}function bg(t,e=1){X(t,t.v+e)}function C5(t){try{if(t!==null&&typeof t=="object"&&Oo in t)return t[Oo]}catch{}return t}function HN(t,e){return Object.is(C5(t),C5(e))}function ul(t){var e=Ti|Os,r=Qt!==null&&(Qt.f&Ti)!==0?Qt:null;return Jt===null||r!==null&&(r.f&zn)!==0?e|=zn:Jt.f|=m5,{ctx:or,deps:null,effects:null,equals:w5,f:e,fn:t,reactions:null,rv:0,v:null,wv:0,parent:r??Jt}}function je(t){const e=ul(t);return e.equals=mg,e}function S5(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)Bi(e[r])}}function jN(t){for(var e=t.parent;e!==null;){if((e.f&Ti)===0)return e;e=e.parent}return null}function A5(t){var e,r=Jt;ns(jN(t));try{S5(t),e=W5(t)}finally{ns(r)}return e}function R5(t){var e=A5(t);if(t.equals(e)||(t.v=e,t.wv=L5()),!hl){var r=(Vo||(t.f&zn)!==0)&&t.deps!==null?Io:Gn;xi(t,r)}}const Hd=new Map;function Uo(t,e){var r={f:0,v:t,reactions:null,equals:w5,rv:0,wv:0};return r}function Mo(t,e){const r=Uo(t);return YN(r),r}function me(t,e=!1,r=!0){var i;const n=Uo(t);return e||(n.equals=mg),al&&r&&or!==null&&or.l!==null&&((i=or.l).s??(i.s=[])).push(n),n}function QN(t,e){return X(t,ue(()=>C(t))),e}function X(t,e,r=!1){Qt!==null&&!rs&&cl()&&(Qt.f&(Ti|dg))!==0&&!($r!=null&&$r[1].includes(t)&&$r[0]===Qt)&&IN();let n=r?ll(e):e;return dl(t,n)}function dl(t,e){if(!t.equals(e)){var r=t.v;hl?Hd.set(t,e):Hd.set(t,r),t.v=e,(t.f&Ti)!==0&&((t.f&Os)!==0&&A5(t),xi(t,(t.f&zn)===0?Gn:Io)),t.wv=L5(),N5(t,Os),cl()&&Jt!==null&&(Jt.f&Gn)!==0&&(Jt.f&(Is|ol))===0&&(ai===null?XN([t]):ai.push(t))}return e}function T5(t,e=1){var r=C(t),n=e===1?r++:r--;return X(t,r),n}function N5(t,e){var r=t.reactions;if(r!==null)for(var n=cl(),i=r.length,s=0;s<i;s++){var o=r[s],a=o.f;(a&Os)===0&&(!n&&o===Jt||(xi(o,e),(a&(Gn|zn))!==0&&((a&Ti)!==0?N5(o,Io):_g(o))))}}function jd(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function JN(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let dt=!1;function Hn(t){dt=t}let Dt;function On(t){if(t===null)throw jd(),Da;return Dt=t}function Ms(){return On(ts(Dt))}function ie(t){if(dt){if(ts(Dt)!==null)throw jd(),Da;Dt=t}}function Cn(t=1){if(dt){for(var e=t,r=Dt;e--;)r=ts(r);Dt=r}}function K0(){for(var t=0,e=Dt;;){if(e.nodeType===8){var r=e.data;if(r===wg){if(t===0)return e;t-=1}else(r===yg||r===Y0)&&(t+=1)}var n=ts(e);e.remove(),e=n}}function x5(t){if(!t||t.nodeType!==8)throw jd(),Da;return t.data}var B5,I5,O5,U5;function kg(){if(B5===void 0){B5=window,I5=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;O5=sl(e,"firstChild").get,U5=sl(e,"nextSibling").get,d5(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),d5(r)&&(r.__t=void 0)}}function Po(t=""){return document.createTextNode(t)}function Ni(t){return O5.call(t)}function ts(t){return U5.call(t)}function se(t,e){if(!dt)return Ni(t);var r=Ni(Dt);if(r===null)r=Dt.appendChild(Po());else if(e&&r.nodeType!==3){var n=Po();return r==null||r.before(n),On(n),n}return On(r),r}function xe(t,e){if(!dt){var r=Ni(t);return r instanceof Comment&&r.data===""?ts(r):r}return Dt}function le(t,e=1,r=!1){let n=dt?Dt:t;for(var i;e--;)i=n,n=ts(n);if(!dt)return n;var s=n==null?void 0:n.nodeType;if(r&&s!==3){var o=Po();return n===null?i==null||i.after(o):n.before(o),On(o),o}return On(n),n}function M5(t){t.textContent=""}function $N(t){var e=Jt;if((e.f&p5)===0){if((e.f&hg)===0)throw t;e.fn(t)}else P5(t,e)}function P5(t,e){for(;e!==null;){if((e.f&hg)!==0)try{e.fn(t);return}catch{}e=e.parent}throw t}let Qd=!1,Jd=null,Wa=!1,hl=!1;function V5(t){hl=t}let $d=[],tK=[],Qt=null,rs=!1;function oi(t){Qt=t}let Jt=null;function ns(t){Jt=t}let $r=null;function YN(t){Qt!==null&&Qt.f&pg&&($r===null?$r=[Qt,[t]]:$r[1].push(t))}let Sn=null,jn=0,ai=null;function XN(t){ai=t}let F5=1,q0=0,Vo=!1;function L5(){return++F5}function Yd(t){var d;var e=t.f;if((e&Os)!==0)return!0;if((e&Io)!==0){var r=t.deps,n=(e&zn)!==0;if(r!==null){var i,s,o=(e&J0)!==0,a=n&&Jt!==null&&!Vo,c=r.length;if(o||a){var l=t,u=l.parent;for(i=0;i<c;i++)s=r[i],(o||!((d=s==null?void 0:s.reactions)!=null&&d.includes(l)))&&(s.reactions??(s.reactions=[])).push(l);o&&(l.f^=J0),a&&u!==null&&(u.f&zn)===0&&(l.f^=zn)}for(i=0;i<c;i++)if(s=r[i],Yd(s)&&R5(s),s.wv>t.wv)return!0}(!n||Jt!==null&&!Vo)&&xi(t,Gn)}return!1}function D5(t,e,r=!0){var n=t.reactions;if(n!==null)for(var i=0;i<n.length;i++){var s=n[i];$r!=null&&$r[1].includes(t)&&$r[0]===Qt||((s.f&Ti)!==0?D5(s,e,!1):e===s&&(r?xi(s,Os):(s.f&Gn)!==0&&xi(s,Io),_g(s)))}}function W5(t){var f;var e=Sn,r=jn,n=ai,i=Qt,s=Vo,o=$r,a=or,c=rs,l=t.f;Sn=null,jn=0,ai=null,Vo=(l&zn)!==0&&(rs||!Wa||Qt===null),Qt=(l&(Is|ol))===0?t:null,$r=null,X0(t.ctx),rs=!1,q0++,t.f|=pg;try{var u=(0,t.fn)(),d=t.deps;if(Sn!==null){var h;if(ep(t,jn),d!==null&&jn>0)for(d.length=jn+Sn.length,h=0;h<Sn.length;h++)d[jn+h]=Sn[h];else t.deps=d=Sn;if(!Vo)for(h=jn;h<d.length;h++)((f=d[h]).reactions??(f.reactions=[])).push(t)}else d!==null&&jn<d.length&&(ep(t,jn),d.length=jn);if(cl()&&ai!==null&&!rs&&d!==null&&(t.f&(Ti|Io|Os))===0)for(h=0;h<ai.length;h++)D5(ai[h],t);return i!==null&&i!==t&&(q0++,ai!==null&&(n===null?n=ai:n.push(...ai))),u}catch(p){$N(p)}finally{Sn=e,jn=r,ai=n,Qt=i,Vo=s,$r=o,X0(a),rs=c,t.f^=pg}}function KN(t,e){let r=e.reactions;if(r!==null){var n=fN.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(e.f&Ti)!==0&&(Sn===null||!Sn.includes(e))&&(xi(e,Io),(e.f&(zn|J0))===0&&(e.f^=J0),S5(e),ep(e,0))}function ep(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)KN(t,r[n])}function tp(t){var e=t.f;if((e&fg)===0){xi(t,Gn);var r=Jt,n=Wa;Jt=t,Wa=!0;try{(e&dg)!==0?ox(t):H5(t),G5(t);var i=W5(t);t.teardown=typeof i=="function"?i:null,t.wv=F5;var s;Dd&&ON&&(t.f&Os)!==0&&t.deps}finally{Wa=n,Jt=r}}}function qN(){try{RN()}catch(t){if(Jd!==null)P5(t,Jd);else throw t}}function Z5(){var t=Wa;try{var e=0;for(Wa=!0;$d.length>0;){e++>1e3&&qN();var r=$d,n=r.length;$d=[];for(var i=0;i<n;i++){var s=tx(r[i]);ex(s)}Hd.clear()}}finally{Qd=!1,Wa=t,Jd=null}}function ex(t){var e=t.length;if(e!==0)for(var r=0;r<e;r++){var n=t[r];(n.f&(fg|Us))===0&&Yd(n)&&(tp(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?Q5(n):n.fn=null))}}function _g(t){Qd||(Qd=!0,queueMicrotask(Z5));for(var e=Jd=t;e.parent!==null;){e=e.parent;var r=e.f;if((r&(ol|Is))!==0){if((r&Gn)===0)return;e.f^=Gn}}$d.push(e)}function tx(t){for(var e=[],r=t;r!==null;){var n=r.f,i=(n&(Is|ol))!==0,s=i&&(n&Gn)!==0;if(!s&&(n&Us)===0){(n&f5)!==0?e.push(r):i?r.f^=Gn:Yd(r)&&tp(r);var o=r.first;if(o!==null){r=o;continue}}var a=r.parent;for(r=r.next;r===null&&a!==null;)r=a.next,a=a.parent}return e}function ge(t){for(var e;;){if(EN(),$d.length===0)return Qd=!1,Jd=null,e;Qd=!0,Z5()}}function C(t){var e=t.f,r=(e&Ti)!==0;if(Qt!==null&&!rs){if(!($r!=null&&$r[1].includes(t))||$r[0]!==Qt){var n=Qt.deps;t.rv<q0&&(t.rv=q0,Sn===null&&n!==null&&n[jn]===t?jn++:Sn===null?Sn=[t]:(!Vo||!Sn.includes(t))&&Sn.push(t))}}else if(r&&t.deps===null&&t.effects===null){var i=t,s=i.parent;s!==null&&(s.f&zn)===0&&(i.f^=zn)}return r&&(i=t,Yd(i)&&R5(i)),hl&&Hd.has(t)?Hd.get(t):t.v}function Eg(t){return t&&C(t)}function ue(t){var e=rs;try{return rs=!0,t()}finally{rs=e}}const rx=-7169;function xi(t,e){t.f=t.f&rx|e}function be(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Oo in t)Cg(t);else if(!Array.isArray(t))for(let e in t){const r=t[e];typeof r=="object"&&r&&Oo in r&&Cg(r)}}}function Cg(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{Cg(t[n],e)}catch{}const r=ug(t);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=u5(r);for(let i in n){const s=n[i].get;if(s)try{s.call(t)}catch{}}}}}function z5(t){Jt===null&&Qt===null&&AN(),Qt!==null&&(Qt.f&zn)!==0&&Jt===null&&SN(),hl&&CN()}function nx(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function fl(t,e,r,n=!0){var i=Jt,s={ctx:or,deps:null,nodes_start:null,nodes_end:null,f:t|Os,first:null,fn:e,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(r)try{tp(s),s.f|=p5}catch(c){throw Bi(s),c}else e!==null&&_g(s);var o=r&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&(m5|hg))===0;if(!o&&n&&(i!==null&&nx(s,i),Qt!==null&&(Qt.f&Ti)!==0)){var a=Qt;(a.effects??(a.effects=[])).push(s)}return s}function Sg(t){const e=fl(Q0,null,!1);return xi(e,Gn),e.teardown=t,e}function Ag(t){z5();var e=Jt!==null&&(Jt.f&Is)!==0&&or!==null&&!or.m;if(e){var r=or;(r.e??(r.e=[])).push({fn:t,effect:Jt,reaction:Qt})}else{var n=rp(t);return n}}function ix(t){return z5(),np(t)}function sx(t){const e=fl(ol,t,!0);return(r={})=>new Promise(n=>{r.outro?Fo(e,()=>{Bi(e),n(void 0)}):(Bi(e),n(void 0))})}function rp(t){return fl(f5,t,!1)}function Ye(t,e){var r=or,n={effect:null,ran:!1};r.l.r1.push(n),n.effect=np(()=>{t(),!n.ran&&(n.ran=!0,X(r.l.r2,!0),ue(e))})}function ar(){var t=or;np(()=>{if(C(t.l.r2)){for(var e of t.l.r1){var r=e.effect;(r.f&Gn)!==0&&xi(r,Io),Yd(r)&&tp(r),e.ran=!1}t.l.r2.v=!1}})}function np(t){return fl(Q0,t,!0)}function Te(t,e=[],r=ul){const n=e.map(r);return Za(()=>t(...n.map(C)))}function Za(t,e=0){return fl(Q0|dg|e,t,!0)}function Ps(t,e=!0){return fl(Q0|Is,t,!0,e)}function G5(t){var e=t.teardown;if(e!==null){const r=hl,n=Qt;V5(!0),oi(null);try{e.call(null)}finally{V5(r),oi(n)}}}function H5(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){var n=r.next;(r.f&ol)!==0?r.parent=null:Bi(r,e),r=n}}function ox(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&Is)===0&&Bi(e),e=r}}function Bi(t,e=!0){var r=!1;(e||(t.f&wN)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(j5(t.nodes_start,t.nodes_end),r=!0),H5(t,e&&!r),ep(t,0),xi(t,fg);var n=t.transitions;if(n!==null)for(const s of n)s.stop();G5(t);var i=t.parent;i!==null&&i.first!==null&&Q5(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=null}function j5(t,e){for(;t!==null;){var r=t===e?null:ts(t);t.remove(),t=r}}function Q5(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Fo(t,e){var r=[];Rg(t,r,!0),J5(r,()=>{Bi(t),e&&e()})}function J5(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var i of t)i.out(n)}else e()}function Rg(t,e,r){if((t.f&Us)===0){if(t.f^=Us,t.transitions!==null)for(const o of t.transitions)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var i=n.next,s=(n.f&$0)!==0||(n.f&Is)!==0;Rg(n,e,s?r:!1),n=i}}}function Xd(t){$5(t,!0)}function $5(t,e){if((t.f&Us)!==0){t.f^=Us;for(var r=t.first;r!==null;){var n=r.next,i=(r.f&$0)!==0||(r.f&Is)!==0;$5(r,i?e:!1),r=n}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}function ax(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const cx=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function lx(t){return cx.includes(t)}const ux={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function dx(t){return t=t.toLowerCase(),ux[t]??t}const hx=["touchstart","touchmove"];function fx(t){return hx.includes(t)}function px(t,e){if(e){const r=document.body;t.autofocus=!0,Gd(()=>{document.activeElement===r&&t.focus()})}}let Y5=!1;function X5(){Y5||(Y5=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const r of t.target.elements)(e=r.__on_r)==null||e.call(r)})},{capture:!0}))}function K5(t){var e=Qt,r=Jt;oi(null),ns(null);try{return t()}finally{oi(e),ns(r)}}function mx(t,e,r,n=r){t.addEventListener(e,()=>K5(r));const i=t.__on_r;i?t.__on_r=()=>{i(),n(!0)}:t.__on_r=()=>n(!0),X5()}const q5=new Set,Tg=new Set;function e6(t,e,r,n={}){function i(s){if(n.capture||Kd.call(e,s),!s.cancelBubble)return K5(()=>r==null?void 0:r.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Gd(()=>{e.addEventListener(t,i,n)}):e.addEventListener(t,i,n),i}function pn(t,e,r,n,i){var s={capture:n,passive:i},o=e6(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Sg(()=>{e.removeEventListener(t,o,s)})}function gx(t){for(var e=0;e<t.length;e++)q5.add(t[e]);for(var r of Tg)r(t)}function Kd(t){var _;var e=this,r=e.ownerDocument,n=t.type,i=((_=t.composedPath)==null?void 0:_.call(t))||[],s=i[0]||t.target,o=0,a=t.__root;if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var l=i.indexOf(e);if(l===-1)return;c<=l&&(o=c)}if(s=i[o]||t.target,s!==e){lg(t,"currentTarget",{configurable:!0,get(){return s||r}});var u=Qt,d=Jt;oi(null),ns(null);try{for(var h,f=[];s!==null;){var p=s.assignedSlot||s.parentNode||s.host||null;try{var v=s["__"+n];if(v!=null&&(!s.disabled||t.target===s))if(j0(v)){var[m,...w]=v;m.apply(s,[t,...w])}else v.call(s,t)}catch(S){h?f.push(S):h=S}if(t.cancelBubble||p===e||p===null)break;s=p}if(h){for(let S of f)queueMicrotask(()=>{throw S});throw h}}finally{t.__root=e,delete t.currentTarget,oi(u),ns(d)}}}function t6(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function is(t,e){var r=Jt;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function fe(t,e){var r=(e&WN)!==0,n=(e&ZN)!==0,i,s=!t.startsWith("<!>");return()=>{if(dt)return is(Dt,null),Dt;i===void 0&&(i=t6(s?t:"<!>"+t),r||(i=Ni(i)));var o=n||I5?document.importNode(i,!0):i.cloneNode(!0);if(r){var a=Ni(o),c=o.lastChild;is(a,c)}else is(o,o);return o}}function Er(t=""){if(!dt){var e=Po(t+"");return is(e,e),e}var r=Dt;return r.nodeType!==3&&(r.before(r=Po()),On(r)),is(r,r),r}function et(){if(dt)return is(Dt,null),Dt;var t=document.createDocumentFragment(),e=document.createComment(""),r=Po();return t.append(e,r),is(e,r),t}function J(t,e){if(dt){Jt.nodes_end=Dt,Ms();return}t!==null&&t.before(e)}function Ke(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function r6(t,e){return n6(t,e)}function vx(t,e){kg(),e.intro=e.intro??!1;const r=e.target,n=dt,i=Dt;try{for(var s=Ni(r);s&&(s.nodeType!==8||s.data!==yg);)s=ts(s);if(!s)throw Da;Hn(!0),On(s),Ms();const o=n6(t,{...e,anchor:s});if(Dt===null||Dt.nodeType!==8||Dt.data!==wg)throw jd(),Da;return Hn(!1),o}catch(o){if(o===Da)return e.recover===!1&&TN(),kg(),M5(r),Hn(!1),r6(t,e);throw o}finally{Hn(n),On(i)}}const pl=new Map;function n6(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:o=!0}){kg();var a=new Set,c=d=>{for(var h=0;h<d.length;h++){var f=d[h];if(!a.has(f)){a.add(f);var p=fx(f);e.addEventListener(f,Kd,{passive:p});var v=pl.get(f);v===void 0?(document.addEventListener(f,Kd,{passive:p}),pl.set(f,1)):pl.set(f,v+1)}}};c(cg(q5)),Tg.add(c);var l=void 0,u=sx(()=>{var d=r??e.appendChild(Po());return Ps(()=>{if(s){Le({});var h=or;h.c=s}i&&(n.$$events=i),dt&&is(d,null),l=t(d,n)||{},dt&&(Jt.nodes_end=Dt),s&&De()}),()=>{var p;for(var h of a){e.removeEventListener(h,Kd);var f=pl.get(h);--f===0?(document.removeEventListener(h,Kd),pl.delete(h)):pl.set(h,f)}Tg.delete(c),d!==r&&((p=d.parentNode)==null||p.removeChild(d))}});return Ng.set(l,u),l}let Ng=new WeakMap;function yx(t,e){const r=Ng.get(t);return r?(Ng.delete(t),r(e)):Promise.resolve()}const xg=0,ip=1,Bg=2;function Yr(t,e,r,n,i){dt&&Ms();var s=t,o=cl(),a=or,c=fn,l,u,d,h=o?Uo(void 0):me(void 0,!1,!1),f=o?Uo(void 0):me(void 0,!1,!1),p=!1;function v(w,_){p=!0,_&&(ns(m),oi(m),X0(a));try{w===ip&&n&&(u?Xd(u):u=Ps(()=>n(s,h))),w!==xg&&l&&Fo(l,()=>l=null),w!==ip&&u&&Fo(u,()=>u=null),w!==Bg&&d&&Fo(d,()=>d=null)}finally{_&&(X0(null),oi(null),ns(null),ge())}}var m=Za(()=>{if(c===(c=e()))return;let w=dt&&h5(c)===(s.data===Y0);if(w&&(s=K0(),On(s),Hn(!1),w=!0),h5(c)){var _=c;p=!1,_.then(S=>{_===c&&(dl(h,S),v(ip,!0))},S=>{if(_===c)throw dl(f,S),v(Bg,!0),f.v}),dt||Gd(()=>{p||v(xg,!0)})}else dl(h,c),v(ip,!1);return w&&Hn(!0),()=>c=fn});dt&&(s=Dt)}function Ce(t,e,[r,n]=[0,0]){dt&&r===0&&Ms();var i=t,s=null,o=null,a=fn,c=r>0?$0:0,l=!1;const u=(h,f=!0)=>{l=!0,d(f,h)},d=(h,f)=>{if(a===(a=h))return;let p=!1;if(dt&&n!==-1){if(r===0){const m=x5(i);m===yg?n=0:m===Y0?n=1/0:(n=parseInt(m.substring(1)),n!==n&&(n=a?1/0:-1))}const v=n>r;!!a===v&&(i=K0(),On(i),Hn(!1),p=!0,n=-1)}a?(s?Xd(s):f&&(s=Ps(()=>f(i))),o&&Fo(o,()=>{o=null})):(o?Xd(o):f&&(o=Ps(()=>f(i,[r+1,n]))),s&&Fo(s,()=>{s=null})),p&&Hn(!0)};Za(()=>{l=!1,e(u),l||d(null,null)},c),dt&&(i=Dt)}function ml(t,e){return e}function wx(t,e,r,n){for(var i=[],s=e.length,o=0;o<s;o++)Rg(e[o].e,i,!0);var a=s>0&&i.length===0&&r!==null;if(a){var c=r.parentNode;M5(c),c.append(r),n.clear(),Lo(t,e[0].prev,e[s-1].next)}J5(i,()=>{for(var l=0;l<s;l++){var u=e[l];a||(n.delete(u.k),Lo(t,u.prev,u.next)),Bi(u.e,!a)}})}function gl(t,e,r,n,i,s=null){var o=t,a={flags:e,items:new Map,first:null},c=(e&k5)!==0;if(c){var l=t;o=dt?On(Ni(l)):l.appendChild(Po())}dt&&Ms();var u=null,d=!1,h=je(()=>{var f=r();return j0(f)?f:f==null?[]:cg(f)});Za(()=>{var f=C(h),p=f.length;if(d&&p===0)return;d=p===0;let v=!1;if(dt){var m=x5(o)===Y0;m!==(p===0)&&(o=K0(),On(o),Hn(!1),v=!0)}if(dt){for(var w=null,_,S=0;S<p;S++){if(Dt.nodeType===8&&Dt.data===wg){o=Dt,v=!0,Hn(!1);break}var T=f[S],x=n(T,S);_=i6(Dt,a,w,null,T,x,S,i,e,r),a.items.set(x,_),w=_}p>0&&On(K0())}dt||bx(f,a,o,i,e,n,r),s!==null&&(p===0?u?Xd(u):u=Ps(()=>s(o)):u!==null&&Fo(u,()=>{u=null})),v&&Hn(!0),C(h)}),dt&&(o=Dt)}function bx(t,e,r,n,i,s,o){var q,L,Q,Y;var a=(i&MN)!==0,c=(i&(gg|vg))!==0,l=t.length,u=e.items,d=e.first,h=d,f,p=null,v,m=[],w=[],_,S,T,x;if(a)for(x=0;x<l;x+=1)_=t[x],S=s(_,x),T=u.get(S),T!==void 0&&((q=T.a)==null||q.measure(),(v??(v=new Set)).add(T));for(x=0;x<l;x+=1){if(_=t[x],S=s(_,x),T=u.get(S),T===void 0){var O=h?h.e.nodes_start:r;p=i6(O,e,p,p===null?e.first:p.next,_,S,x,n,i,o),u.set(S,p),m=[],w=[],h=p.next;continue}if(c&&kx(T,_,x,i),(T.e.f&Us)!==0&&(Xd(T.e),a&&((L=T.a)==null||L.unfix(),(v??(v=new Set)).delete(T))),T!==h){if(f!==void 0&&f.has(T)){if(m.length<w.length){var U=w[0],I;p=U.prev;var Z=m[0],W=m[m.length-1];for(I=0;I<m.length;I+=1)s6(m[I],U,r);for(I=0;I<w.length;I+=1)f.delete(w[I]);Lo(e,Z.prev,W.next),Lo(e,p,Z),Lo(e,W,U),h=U,p=W,x-=1,m=[],w=[]}else f.delete(T),s6(T,h,r),Lo(e,T.prev,T.next),Lo(e,T,p===null?e.first:p.next),Lo(e,p,T),p=T;continue}for(m=[],w=[];h!==null&&h.k!==S;)(h.e.f&Us)===0&&(f??(f=new Set)).add(h),w.push(h),h=h.next;if(h===null)continue;T=h}m.push(T),p=T,h=T.next}if(h!==null||f!==void 0){for(var P=f===void 0?[]:cg(f);h!==null;)(h.e.f&Us)===0&&P.push(h),h=h.next;var D=P.length;if(D>0){var G=(i&k5)!==0&&l===0?r:null;if(a){for(x=0;x<D;x+=1)(Q=P[x].a)==null||Q.measure();for(x=0;x<D;x+=1)(Y=P[x].a)==null||Y.fix()}wx(e,P,G,u)}}a&&Gd(()=>{var re;if(v!==void 0)for(T of v)(re=T.a)==null||re.apply()}),Jt.first=e.first&&e.first.e,Jt.last=p&&p.e}function kx(t,e,r,n){(n&gg)!==0&&dl(t.v,e),(n&vg)!==0?dl(t.i,r):t.i=r}function i6(t,e,r,n,i,s,o,a,c,l){var u=(c&gg)!==0,d=(c&PN)===0,h=u?d?me(i,!1,!1):Uo(i):i,f=(c&vg)===0?o:Uo(o),p={i:f,v:h,k:s,a:null,e:null,prev:r,next:n};try{return p.e=Ps(()=>a(t,h,f,l),dt),p.e.prev=r&&r.e,p.e.next=n&&n.e,r===null?e.first=p:(r.next=p,r.e.next=p.e),n!==null&&(n.prev=p,n.e.prev=p.e),p}finally{}}function s6(t,e,r){for(var n=t.next?t.next.e.nodes_start:r,i=e?e.e.nodes_start:r,s=t.e.nodes_start;s!==n;){var o=ts(s);i.before(s),s=o}}function Lo(t,e,r){e===null?t.first=r:(e.next=r,e.e.next=r&&r.e),r!==null&&(r.prev=e,r.e.prev=e&&e.e)}function Ig(t,e,r=!1,n=!1,i=!1){var s=t,o="";Te(()=>{var a=Jt;if(o===(o=e()??"")){dt&&Ms();return}if(a.nodes_start!==null&&(j5(a.nodes_start,a.nodes_end),a.nodes_start=a.nodes_end=null),o!==""){if(dt){Dt.data;for(var c=Ms(),l=c;c!==null&&(c.nodeType!==8||c.data!=="");)l=c,c=ts(c);if(c===null)throw jd(),Da;is(Dt,l),s=On(c);return}var u=o+"";r?u=`<svg>${u}</svg>`:n&&(u=`<math>${u}</math>`);var d=t6(u);if((r||n)&&(d=Ni(d)),is(Ni(d),d.lastChild),r||n)for(;Ni(d);)s.before(Ni(d));else s.before(d)}})}function Ii(t,e,r,n,i){var a;dt&&Ms();var s=(a=e.$$slots)==null?void 0:a[r],o=!1;s===!0&&(s=e[r==="default"?"children":r],o=!0),s===void 0||s(t,o?()=>n:n)}function Xr(t,e,r){dt&&Ms();var n=t,i,s;Za(()=>{i!==(i=e())&&(s&&(Fo(s),s=null),i&&(s=Ps(()=>r(n,i))))},$0),dt&&(n=Dt)}function Do(t,e){Gd(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}function _x(t,e){var r=void 0,n;Za(()=>{r!==(r=e())&&(n&&(Bi(n),n=null),r&&(n=Ps(()=>{rp(()=>r(t))})))})}function o6(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=o6(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Ex(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=o6(t))&&(n&&(n+=" "),n+=e);return n}function Cx(t){return typeof t=="object"?Ex(t):t??""}const a6=[...`
2
+ (function(Ar,en){typeof exports=="object"&&typeof module<"u"?en(exports):typeof define=="function"&&define.amd?define(["exports"],en):(Ar=typeof globalThis<"u"?globalThis:Ar||self,en(Ar.CredenzaPassport={}))})(this,function(Ar){"use strict";var nN=Ar=>{throw TypeError(Ar)};var iN=(Ar,en,si)=>en.has(Ar)||nN("Cannot "+si);var Zn=(Ar,en,si)=>(iN(Ar,en,"read from private field"),si?si.call(Ar):en.get(Ar)),s5=(Ar,en,si)=>en.has(Ar)?nN("Cannot add the same private member more than once"):en instanceof WeakSet?en.add(Ar):en.set(Ar,si),o5=(Ar,en,si,Dd)=>(iN(Ar,en,"write to private field"),Dd?Dd.call(Ar,si):en.set(Ar,si),si);var To,Ri,jT;const si={version:"0.2.15"},Dd=!1;var j0=Array.isArray,fN=Array.prototype.indexOf,cg=Array.from,lg=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,u5=Object.getOwnPropertyDescriptors,pN=Object.prototype,mN=Array.prototype,ug=Object.getPrototypeOf,d5=Object.isExtensible;const Bo=()=>{};function h5(t){return typeof(t==null?void 0:t.then)=="function"}function gN(t){return t()}function Wd(t){for(var e=0;e<t.length;e++)t[e]()}function vN(t,e,r=!1){return t===void 0?r?e():e:t}const Ti=2,f5=4,Q0=8,dg=16,Is=32,ol=64,hg=128,zn=256,J0=512,Gn=1024,Os=2048,Io=4096,Us=8192,fg=16384,p5=32768,$0=65536,yN=1<<17,wN=1<<19,m5=1<<20,pg=1<<21,Oo=Symbol("$state"),g5=Symbol("legacy props"),bN=Symbol(""),kN=typeof requestIdleCallback>"u"?t=>setTimeout(t,1):requestIdleCallback;let Zd=[],zd=[];function v5(){var t=Zd;Zd=[],Wd(t)}function y5(){var t=zd;zd=[],Wd(t)}function Gd(t){Zd.length===0&&queueMicrotask(v5),Zd.push(t)}function _N(t){zd.length===0&&kN(y5),zd.push(t)}function EN(){Zd.length>0&&v5(),zd.length>0&&y5()}function w5(t){return t===this.v}function b5(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function mg(t){return!b5(t,this.v)}function CN(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function SN(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function AN(t){throw new Error("https://svelte.dev/e/effect_orphan")}function RN(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function TN(){throw new Error("https://svelte.dev/e/hydration_failed")}function NN(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function xN(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function BN(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function IN(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let al=!1,ON=!1;function UN(){al=!0}const gg=1,vg=2,k5=4,MN=8,PN=16,VN=1,FN=2,_5=4,LN=8,DN=16,WN=1,ZN=2,yg="[",Y0="[!",wg="]",Da={},fn=Symbol(),zN="http://www.w3.org/1999/xhtml",GN="@attach";function E5(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let or=null;function X0(t){or=t}function Le(t,e=!1,r){var n=or={p:or,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};al&&!e&&(or.l={s:null,u:null,r1:[],r2:Uo(!1)}),Sg(()=>{n.d=!0})}function De(t){const e=or;if(e!==null){t!==void 0&&(e.x=t);const o=e.e;if(o!==null){var r=Jt,n=Qt;e.e=null;try{for(var i=0;i<o.length;i++){var s=o[i];ns(s.effect),oi(s.reaction),rp(s.fn)}}finally{ns(r),oi(n)}}or=e.p,e.m=!0}return t||{}}function cl(){return!al||or!==null&&or.l===null}function ll(t){if(typeof t!="object"||t===null||Oo in t)return t;const e=ug(t);if(e!==pN&&e!==mN)return t;var r=new Map,n=j0(t),i=Mo(0),s=Qt,o=a=>{var c=Qt;oi(s);var l=a();return oi(c),l};return n&&r.set("length",Mo(t.length)),new Proxy(t,{defineProperty(a,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&xN();var u=r.get(c);return u===void 0?u=o(()=>{var d=Mo(l.value);return r.set(c,d),d}):X(u,l.value,!0),!0},deleteProperty(a,c){var l=r.get(c);if(l===void 0){if(c in a){const h=o(()=>Mo(fn));r.set(c,h),bg(i)}}else{if(n&&typeof c=="string"){var u=r.get("length"),d=Number(c);Number.isInteger(d)&&d<u.v&&X(u,d)}X(l,fn),bg(i)}return!0},get(a,c,l){var f;if(c===Oo)return t;var u=r.get(c),d=c in a;if(u===void 0&&(!d||(f=sl(a,c))!=null&&f.writable)&&(u=o(()=>{var p=ll(d?a[c]:fn),v=Mo(p);return v}),r.set(c,u)),u!==void 0){var h=C(u);return h===fn?void 0:h}return Reflect.get(a,c,l)},getOwnPropertyDescriptor(a,c){var l=Reflect.getOwnPropertyDescriptor(a,c);if(l&&"value"in l){var u=r.get(c);u&&(l.value=C(u))}else if(l===void 0){var d=r.get(c),h=d==null?void 0:d.v;if(d!==void 0&&h!==fn)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return l},has(a,c){var h;if(c===Oo)return!0;var l=r.get(c),u=l!==void 0&&l.v!==fn||Reflect.has(a,c);if(l!==void 0||Jt!==null&&(!u||(h=sl(a,c))!=null&&h.writable)){l===void 0&&(l=o(()=>{var f=u?ll(a[c]):fn,p=Mo(f);return p}),r.set(c,l));var d=C(l);if(d===fn)return!1}return u},set(a,c,l,u){var S;var d=r.get(c),h=c in a;if(n&&c==="length")for(var f=l;f<d.v;f+=1){var p=r.get(f+"");p!==void 0?X(p,fn):f in a&&(p=o(()=>Mo(fn)),r.set(f+"",p))}if(d===void 0)(!h||(S=sl(a,c))!=null&&S.writable)&&(d=o(()=>Mo(void 0)),X(d,ll(l)),r.set(c,d));else{h=d.v!==fn;var v=o(()=>ll(l));X(d,v)}var m=Reflect.getOwnPropertyDescriptor(a,c);if(m!=null&&m.set&&m.set.call(u,l),!h){if(n&&typeof c=="string"){var w=r.get("length"),_=Number(c);Number.isInteger(_)&&_>=w.v&&X(w,_+1)}bg(i)}return!0},ownKeys(a){C(i);var c=Reflect.ownKeys(a).filter(d=>{var h=r.get(d);return h===void 0||h.v!==fn});for(var[l,u]of r)u.v!==fn&&!(l in a)&&c.push(l);return c},setPrototypeOf(){BN()}})}function bg(t,e=1){X(t,t.v+e)}function C5(t){try{if(t!==null&&typeof t=="object"&&Oo in t)return t[Oo]}catch{}return t}function HN(t,e){return Object.is(C5(t),C5(e))}function ul(t){var e=Ti|Os,r=Qt!==null&&(Qt.f&Ti)!==0?Qt:null;return Jt===null||r!==null&&(r.f&zn)!==0?e|=zn:Jt.f|=m5,{ctx:or,deps:null,effects:null,equals:w5,f:e,fn:t,reactions:null,rv:0,v:null,wv:0,parent:r??Jt}}function je(t){const e=ul(t);return e.equals=mg,e}function S5(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)Bi(e[r])}}function jN(t){for(var e=t.parent;e!==null;){if((e.f&Ti)===0)return e;e=e.parent}return null}function A5(t){var e,r=Jt;ns(jN(t));try{S5(t),e=W5(t)}finally{ns(r)}return e}function R5(t){var e=A5(t);if(t.equals(e)||(t.v=e,t.wv=L5()),!hl){var r=(Vo||(t.f&zn)!==0)&&t.deps!==null?Io:Gn;xi(t,r)}}const Hd=new Map;function Uo(t,e){var r={f:0,v:t,reactions:null,equals:w5,rv:0,wv:0};return r}function Mo(t,e){const r=Uo(t);return YN(r),r}function me(t,e=!1,r=!0){var i;const n=Uo(t);return e||(n.equals=mg),al&&r&&or!==null&&or.l!==null&&((i=or.l).s??(i.s=[])).push(n),n}function QN(t,e){return X(t,ue(()=>C(t))),e}function X(t,e,r=!1){Qt!==null&&!rs&&cl()&&(Qt.f&(Ti|dg))!==0&&!($r!=null&&$r[1].includes(t)&&$r[0]===Qt)&&IN();let n=r?ll(e):e;return dl(t,n)}function dl(t,e){if(!t.equals(e)){var r=t.v;hl?Hd.set(t,e):Hd.set(t,r),t.v=e,(t.f&Ti)!==0&&((t.f&Os)!==0&&A5(t),xi(t,(t.f&zn)===0?Gn:Io)),t.wv=L5(),N5(t,Os),cl()&&Jt!==null&&(Jt.f&Gn)!==0&&(Jt.f&(Is|ol))===0&&(ai===null?XN([t]):ai.push(t))}return e}function T5(t,e=1){var r=C(t),n=e===1?r++:r--;return X(t,r),n}function N5(t,e){var r=t.reactions;if(r!==null)for(var n=cl(),i=r.length,s=0;s<i;s++){var o=r[s],a=o.f;(a&Os)===0&&(!n&&o===Jt||(xi(o,e),(a&(Gn|zn))!==0&&((a&Ti)!==0?N5(o,Io):_g(o))))}}function jd(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function JN(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let dt=!1;function Hn(t){dt=t}let Dt;function On(t){if(t===null)throw jd(),Da;return Dt=t}function Ms(){return On(ts(Dt))}function ie(t){if(dt){if(ts(Dt)!==null)throw jd(),Da;Dt=t}}function Cn(t=1){if(dt){for(var e=t,r=Dt;e--;)r=ts(r);Dt=r}}function K0(){for(var t=0,e=Dt;;){if(e.nodeType===8){var r=e.data;if(r===wg){if(t===0)return e;t-=1}else(r===yg||r===Y0)&&(t+=1)}var n=ts(e);e.remove(),e=n}}function x5(t){if(!t||t.nodeType!==8)throw jd(),Da;return t.data}var B5,I5,O5,U5;function kg(){if(B5===void 0){B5=window,I5=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;O5=sl(e,"firstChild").get,U5=sl(e,"nextSibling").get,d5(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),d5(r)&&(r.__t=void 0)}}function Po(t=""){return document.createTextNode(t)}function Ni(t){return O5.call(t)}function ts(t){return U5.call(t)}function se(t,e){if(!dt)return Ni(t);var r=Ni(Dt);if(r===null)r=Dt.appendChild(Po());else if(e&&r.nodeType!==3){var n=Po();return r==null||r.before(n),On(n),n}return On(r),r}function xe(t,e){if(!dt){var r=Ni(t);return r instanceof Comment&&r.data===""?ts(r):r}return Dt}function le(t,e=1,r=!1){let n=dt?Dt:t;for(var i;e--;)i=n,n=ts(n);if(!dt)return n;var s=n==null?void 0:n.nodeType;if(r&&s!==3){var o=Po();return n===null?i==null||i.after(o):n.before(o),On(o),o}return On(n),n}function M5(t){t.textContent=""}function $N(t){var e=Jt;if((e.f&p5)===0){if((e.f&hg)===0)throw t;e.fn(t)}else P5(t,e)}function P5(t,e){for(;e!==null;){if((e.f&hg)!==0)try{e.fn(t);return}catch{}e=e.parent}throw t}let Qd=!1,Jd=null,Wa=!1,hl=!1;function V5(t){hl=t}let $d=[],tK=[],Qt=null,rs=!1;function oi(t){Qt=t}let Jt=null;function ns(t){Jt=t}let $r=null;function YN(t){Qt!==null&&Qt.f&pg&&($r===null?$r=[Qt,[t]]:$r[1].push(t))}let Sn=null,jn=0,ai=null;function XN(t){ai=t}let F5=1,q0=0,Vo=!1;function L5(){return++F5}function Yd(t){var d;var e=t.f;if((e&Os)!==0)return!0;if((e&Io)!==0){var r=t.deps,n=(e&zn)!==0;if(r!==null){var i,s,o=(e&J0)!==0,a=n&&Jt!==null&&!Vo,c=r.length;if(o||a){var l=t,u=l.parent;for(i=0;i<c;i++)s=r[i],(o||!((d=s==null?void 0:s.reactions)!=null&&d.includes(l)))&&(s.reactions??(s.reactions=[])).push(l);o&&(l.f^=J0),a&&u!==null&&(u.f&zn)===0&&(l.f^=zn)}for(i=0;i<c;i++)if(s=r[i],Yd(s)&&R5(s),s.wv>t.wv)return!0}(!n||Jt!==null&&!Vo)&&xi(t,Gn)}return!1}function D5(t,e,r=!0){var n=t.reactions;if(n!==null)for(var i=0;i<n.length;i++){var s=n[i];$r!=null&&$r[1].includes(t)&&$r[0]===Qt||((s.f&Ti)!==0?D5(s,e,!1):e===s&&(r?xi(s,Os):(s.f&Gn)!==0&&xi(s,Io),_g(s)))}}function W5(t){var f;var e=Sn,r=jn,n=ai,i=Qt,s=Vo,o=$r,a=or,c=rs,l=t.f;Sn=null,jn=0,ai=null,Vo=(l&zn)!==0&&(rs||!Wa||Qt===null),Qt=(l&(Is|ol))===0?t:null,$r=null,X0(t.ctx),rs=!1,q0++,t.f|=pg;try{var u=(0,t.fn)(),d=t.deps;if(Sn!==null){var h;if(ep(t,jn),d!==null&&jn>0)for(d.length=jn+Sn.length,h=0;h<Sn.length;h++)d[jn+h]=Sn[h];else t.deps=d=Sn;if(!Vo)for(h=jn;h<d.length;h++)((f=d[h]).reactions??(f.reactions=[])).push(t)}else d!==null&&jn<d.length&&(ep(t,jn),d.length=jn);if(cl()&&ai!==null&&!rs&&d!==null&&(t.f&(Ti|Io|Os))===0)for(h=0;h<ai.length;h++)D5(ai[h],t);return i!==null&&i!==t&&(q0++,ai!==null&&(n===null?n=ai:n.push(...ai))),u}catch(p){$N(p)}finally{Sn=e,jn=r,ai=n,Qt=i,Vo=s,$r=o,X0(a),rs=c,t.f^=pg}}function KN(t,e){let r=e.reactions;if(r!==null){var n=fN.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(e.f&Ti)!==0&&(Sn===null||!Sn.includes(e))&&(xi(e,Io),(e.f&(zn|J0))===0&&(e.f^=J0),S5(e),ep(e,0))}function ep(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)KN(t,r[n])}function tp(t){var e=t.f;if((e&fg)===0){xi(t,Gn);var r=Jt,n=Wa;Jt=t,Wa=!0;try{(e&dg)!==0?ox(t):H5(t),G5(t);var i=W5(t);t.teardown=typeof i=="function"?i:null,t.wv=F5;var s;Dd&&ON&&(t.f&Os)!==0&&t.deps}finally{Wa=n,Jt=r}}}function qN(){try{RN()}catch(t){if(Jd!==null)P5(t,Jd);else throw t}}function Z5(){var t=Wa;try{var e=0;for(Wa=!0;$d.length>0;){e++>1e3&&qN();var r=$d,n=r.length;$d=[];for(var i=0;i<n;i++){var s=tx(r[i]);ex(s)}Hd.clear()}}finally{Qd=!1,Wa=t,Jd=null}}function ex(t){var e=t.length;if(e!==0)for(var r=0;r<e;r++){var n=t[r];(n.f&(fg|Us))===0&&Yd(n)&&(tp(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?Q5(n):n.fn=null))}}function _g(t){Qd||(Qd=!0,queueMicrotask(Z5));for(var e=Jd=t;e.parent!==null;){e=e.parent;var r=e.f;if((r&(ol|Is))!==0){if((r&Gn)===0)return;e.f^=Gn}}$d.push(e)}function tx(t){for(var e=[],r=t;r!==null;){var n=r.f,i=(n&(Is|ol))!==0,s=i&&(n&Gn)!==0;if(!s&&(n&Us)===0){(n&f5)!==0?e.push(r):i?r.f^=Gn:Yd(r)&&tp(r);var o=r.first;if(o!==null){r=o;continue}}var a=r.parent;for(r=r.next;r===null&&a!==null;)r=a.next,a=a.parent}return e}function ge(t){for(var e;;){if(EN(),$d.length===0)return Qd=!1,Jd=null,e;Qd=!0,Z5()}}function C(t){var e=t.f,r=(e&Ti)!==0;if(Qt!==null&&!rs){if(!($r!=null&&$r[1].includes(t))||$r[0]!==Qt){var n=Qt.deps;t.rv<q0&&(t.rv=q0,Sn===null&&n!==null&&n[jn]===t?jn++:Sn===null?Sn=[t]:(!Vo||!Sn.includes(t))&&Sn.push(t))}}else if(r&&t.deps===null&&t.effects===null){var i=t,s=i.parent;s!==null&&(s.f&zn)===0&&(i.f^=zn)}return r&&(i=t,Yd(i)&&R5(i)),hl&&Hd.has(t)?Hd.get(t):t.v}function Eg(t){return t&&C(t)}function ue(t){var e=rs;try{return rs=!0,t()}finally{rs=e}}const rx=-7169;function xi(t,e){t.f=t.f&rx|e}function be(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Oo in t)Cg(t);else if(!Array.isArray(t))for(let e in t){const r=t[e];typeof r=="object"&&r&&Oo in r&&Cg(r)}}}function Cg(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{Cg(t[n],e)}catch{}const r=ug(t);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=u5(r);for(let i in n){const s=n[i].get;if(s)try{s.call(t)}catch{}}}}}function z5(t){Jt===null&&Qt===null&&AN(),Qt!==null&&(Qt.f&zn)!==0&&Jt===null&&SN(),hl&&CN()}function nx(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function fl(t,e,r,n=!0){var i=Jt,s={ctx:or,deps:null,nodes_start:null,nodes_end:null,f:t|Os,first:null,fn:e,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(r)try{tp(s),s.f|=p5}catch(c){throw Bi(s),c}else e!==null&&_g(s);var o=r&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&(m5|hg))===0;if(!o&&n&&(i!==null&&nx(s,i),Qt!==null&&(Qt.f&Ti)!==0)){var a=Qt;(a.effects??(a.effects=[])).push(s)}return s}function Sg(t){const e=fl(Q0,null,!1);return xi(e,Gn),e.teardown=t,e}function Ag(t){z5();var e=Jt!==null&&(Jt.f&Is)!==0&&or!==null&&!or.m;if(e){var r=or;(r.e??(r.e=[])).push({fn:t,effect:Jt,reaction:Qt})}else{var n=rp(t);return n}}function ix(t){return z5(),np(t)}function sx(t){const e=fl(ol,t,!0);return(r={})=>new Promise(n=>{r.outro?Fo(e,()=>{Bi(e),n(void 0)}):(Bi(e),n(void 0))})}function rp(t){return fl(f5,t,!1)}function Ye(t,e){var r=or,n={effect:null,ran:!1};r.l.r1.push(n),n.effect=np(()=>{t(),!n.ran&&(n.ran=!0,X(r.l.r2,!0),ue(e))})}function ar(){var t=or;np(()=>{if(C(t.l.r2)){for(var e of t.l.r1){var r=e.effect;(r.f&Gn)!==0&&xi(r,Io),Yd(r)&&tp(r),e.ran=!1}t.l.r2.v=!1}})}function np(t){return fl(Q0,t,!0)}function Te(t,e=[],r=ul){const n=e.map(r);return Za(()=>t(...n.map(C)))}function Za(t,e=0){return fl(Q0|dg|e,t,!0)}function Ps(t,e=!0){return fl(Q0|Is,t,!0,e)}function G5(t){var e=t.teardown;if(e!==null){const r=hl,n=Qt;V5(!0),oi(null);try{e.call(null)}finally{V5(r),oi(n)}}}function H5(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){var n=r.next;(r.f&ol)!==0?r.parent=null:Bi(r,e),r=n}}function ox(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&Is)===0&&Bi(e),e=r}}function Bi(t,e=!0){var r=!1;(e||(t.f&wN)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(j5(t.nodes_start,t.nodes_end),r=!0),H5(t,e&&!r),ep(t,0),xi(t,fg);var n=t.transitions;if(n!==null)for(const s of n)s.stop();G5(t);var i=t.parent;i!==null&&i.first!==null&&Q5(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=null}function j5(t,e){for(;t!==null;){var r=t===e?null:ts(t);t.remove(),t=r}}function Q5(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Fo(t,e){var r=[];Rg(t,r,!0),J5(r,()=>{Bi(t),e&&e()})}function J5(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var i of t)i.out(n)}else e()}function Rg(t,e,r){if((t.f&Us)===0){if(t.f^=Us,t.transitions!==null)for(const o of t.transitions)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var i=n.next,s=(n.f&$0)!==0||(n.f&Is)!==0;Rg(n,e,s?r:!1),n=i}}}function Xd(t){$5(t,!0)}function $5(t,e){if((t.f&Us)!==0){t.f^=Us;for(var r=t.first;r!==null;){var n=r.next,i=(r.f&$0)!==0||(r.f&Is)!==0;$5(r,i?e:!1),r=n}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}function ax(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const cx=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function lx(t){return cx.includes(t)}const ux={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function dx(t){return t=t.toLowerCase(),ux[t]??t}const hx=["touchstart","touchmove"];function fx(t){return hx.includes(t)}function px(t,e){if(e){const r=document.body;t.autofocus=!0,Gd(()=>{document.activeElement===r&&t.focus()})}}let Y5=!1;function X5(){Y5||(Y5=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const r of t.target.elements)(e=r.__on_r)==null||e.call(r)})},{capture:!0}))}function K5(t){var e=Qt,r=Jt;oi(null),ns(null);try{return t()}finally{oi(e),ns(r)}}function mx(t,e,r,n=r){t.addEventListener(e,()=>K5(r));const i=t.__on_r;i?t.__on_r=()=>{i(),n(!0)}:t.__on_r=()=>n(!0),X5()}const q5=new Set,Tg=new Set;function e6(t,e,r,n={}){function i(s){if(n.capture||Kd.call(e,s),!s.cancelBubble)return K5(()=>r==null?void 0:r.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Gd(()=>{e.addEventListener(t,i,n)}):e.addEventListener(t,i,n),i}function pn(t,e,r,n,i){var s={capture:n,passive:i},o=e6(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Sg(()=>{e.removeEventListener(t,o,s)})}function gx(t){for(var e=0;e<t.length;e++)q5.add(t[e]);for(var r of Tg)r(t)}function Kd(t){var _;var e=this,r=e.ownerDocument,n=t.type,i=((_=t.composedPath)==null?void 0:_.call(t))||[],s=i[0]||t.target,o=0,a=t.__root;if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var l=i.indexOf(e);if(l===-1)return;c<=l&&(o=c)}if(s=i[o]||t.target,s!==e){lg(t,"currentTarget",{configurable:!0,get(){return s||r}});var u=Qt,d=Jt;oi(null),ns(null);try{for(var h,f=[];s!==null;){var p=s.assignedSlot||s.parentNode||s.host||null;try{var v=s["__"+n];if(v!=null&&(!s.disabled||t.target===s))if(j0(v)){var[m,...w]=v;m.apply(s,[t,...w])}else v.call(s,t)}catch(S){h?f.push(S):h=S}if(t.cancelBubble||p===e||p===null)break;s=p}if(h){for(let S of f)queueMicrotask(()=>{throw S});throw h}}finally{t.__root=e,delete t.currentTarget,oi(u),ns(d)}}}function t6(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function is(t,e){var r=Jt;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function fe(t,e){var r=(e&WN)!==0,n=(e&ZN)!==0,i,s=!t.startsWith("<!>");return()=>{if(dt)return is(Dt,null),Dt;i===void 0&&(i=t6(s?t:"<!>"+t),r||(i=Ni(i)));var o=n||I5?document.importNode(i,!0):i.cloneNode(!0);if(r){var a=Ni(o),c=o.lastChild;is(a,c)}else is(o,o);return o}}function Er(t=""){if(!dt){var e=Po(t+"");return is(e,e),e}var r=Dt;return r.nodeType!==3&&(r.before(r=Po()),On(r)),is(r,r),r}function et(){if(dt)return is(Dt,null),Dt;var t=document.createDocumentFragment(),e=document.createComment(""),r=Po();return t.append(e,r),is(e,r),t}function J(t,e){if(dt){Jt.nodes_end=Dt,Ms();return}t!==null&&t.before(e)}function Ke(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function r6(t,e){return n6(t,e)}function vx(t,e){kg(),e.intro=e.intro??!1;const r=e.target,n=dt,i=Dt;try{for(var s=Ni(r);s&&(s.nodeType!==8||s.data!==yg);)s=ts(s);if(!s)throw Da;Hn(!0),On(s),Ms();const o=n6(t,{...e,anchor:s});if(Dt===null||Dt.nodeType!==8||Dt.data!==wg)throw jd(),Da;return Hn(!1),o}catch(o){if(o===Da)return e.recover===!1&&TN(),kg(),M5(r),Hn(!1),r6(t,e);throw o}finally{Hn(n),On(i)}}const pl=new Map;function n6(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:o=!0}){kg();var a=new Set,c=d=>{for(var h=0;h<d.length;h++){var f=d[h];if(!a.has(f)){a.add(f);var p=fx(f);e.addEventListener(f,Kd,{passive:p});var v=pl.get(f);v===void 0?(document.addEventListener(f,Kd,{passive:p}),pl.set(f,1)):pl.set(f,v+1)}}};c(cg(q5)),Tg.add(c);var l=void 0,u=sx(()=>{var d=r??e.appendChild(Po());return Ps(()=>{if(s){Le({});var h=or;h.c=s}i&&(n.$$events=i),dt&&is(d,null),l=t(d,n)||{},dt&&(Jt.nodes_end=Dt),s&&De()}),()=>{var p;for(var h of a){e.removeEventListener(h,Kd);var f=pl.get(h);--f===0?(document.removeEventListener(h,Kd),pl.delete(h)):pl.set(h,f)}Tg.delete(c),d!==r&&((p=d.parentNode)==null||p.removeChild(d))}});return Ng.set(l,u),l}let Ng=new WeakMap;function yx(t,e){const r=Ng.get(t);return r?(Ng.delete(t),r(e)):Promise.resolve()}const xg=0,ip=1,Bg=2;function Yr(t,e,r,n,i){dt&&Ms();var s=t,o=cl(),a=or,c=fn,l,u,d,h=o?Uo(void 0):me(void 0,!1,!1),f=o?Uo(void 0):me(void 0,!1,!1),p=!1;function v(w,_){p=!0,_&&(ns(m),oi(m),X0(a));try{w===ip&&n&&(u?Xd(u):u=Ps(()=>n(s,h))),w!==xg&&l&&Fo(l,()=>l=null),w!==ip&&u&&Fo(u,()=>u=null),w!==Bg&&d&&Fo(d,()=>d=null)}finally{_&&(X0(null),oi(null),ns(null),ge())}}var m=Za(()=>{if(c===(c=e()))return;let w=dt&&h5(c)===(s.data===Y0);if(w&&(s=K0(),On(s),Hn(!1),w=!0),h5(c)){var _=c;p=!1,_.then(S=>{_===c&&(dl(h,S),v(ip,!0))},S=>{if(_===c)throw dl(f,S),v(Bg,!0),f.v}),dt||Gd(()=>{p||v(xg,!0)})}else dl(h,c),v(ip,!1);return w&&Hn(!0),()=>c=fn});dt&&(s=Dt)}function Ce(t,e,[r,n]=[0,0]){dt&&r===0&&Ms();var i=t,s=null,o=null,a=fn,c=r>0?$0:0,l=!1;const u=(h,f=!0)=>{l=!0,d(f,h)},d=(h,f)=>{if(a===(a=h))return;let p=!1;if(dt&&n!==-1){if(r===0){const m=x5(i);m===yg?n=0:m===Y0?n=1/0:(n=parseInt(m.substring(1)),n!==n&&(n=a?1/0:-1))}const v=n>r;!!a===v&&(i=K0(),On(i),Hn(!1),p=!0,n=-1)}a?(s?Xd(s):f&&(s=Ps(()=>f(i))),o&&Fo(o,()=>{o=null})):(o?Xd(o):f&&(o=Ps(()=>f(i,[r+1,n]))),s&&Fo(s,()=>{s=null})),p&&Hn(!0)};Za(()=>{l=!1,e(u),l||d(null,null)},c),dt&&(i=Dt)}function ml(t,e){return e}function wx(t,e,r,n){for(var i=[],s=e.length,o=0;o<s;o++)Rg(e[o].e,i,!0);var a=s>0&&i.length===0&&r!==null;if(a){var c=r.parentNode;M5(c),c.append(r),n.clear(),Lo(t,e[0].prev,e[s-1].next)}J5(i,()=>{for(var l=0;l<s;l++){var u=e[l];a||(n.delete(u.k),Lo(t,u.prev,u.next)),Bi(u.e,!a)}})}function gl(t,e,r,n,i,s=null){var o=t,a={flags:e,items:new Map,first:null},c=(e&k5)!==0;if(c){var l=t;o=dt?On(Ni(l)):l.appendChild(Po())}dt&&Ms();var u=null,d=!1,h=je(()=>{var f=r();return j0(f)?f:f==null?[]:cg(f)});Za(()=>{var f=C(h),p=f.length;if(d&&p===0)return;d=p===0;let v=!1;if(dt){var m=x5(o)===Y0;m!==(p===0)&&(o=K0(),On(o),Hn(!1),v=!0)}if(dt){for(var w=null,_,S=0;S<p;S++){if(Dt.nodeType===8&&Dt.data===wg){o=Dt,v=!0,Hn(!1);break}var T=f[S],x=n(T,S);_=i6(Dt,a,w,null,T,x,S,i,e,r),a.items.set(x,_),w=_}p>0&&On(K0())}dt||bx(f,a,o,i,e,n,r),s!==null&&(p===0?u?Xd(u):u=Ps(()=>s(o)):u!==null&&Fo(u,()=>{u=null})),v&&Hn(!0),C(h)}),dt&&(o=Dt)}function bx(t,e,r,n,i,s,o){var q,L,Q,Y;var a=(i&MN)!==0,c=(i&(gg|vg))!==0,l=t.length,u=e.items,d=e.first,h=d,f,p=null,v,m=[],w=[],_,S,T,x;if(a)for(x=0;x<l;x+=1)_=t[x],S=s(_,x),T=u.get(S),T!==void 0&&((q=T.a)==null||q.measure(),(v??(v=new Set)).add(T));for(x=0;x<l;x+=1){if(_=t[x],S=s(_,x),T=u.get(S),T===void 0){var O=h?h.e.nodes_start:r;p=i6(O,e,p,p===null?e.first:p.next,_,S,x,n,i,o),u.set(S,p),m=[],w=[],h=p.next;continue}if(c&&kx(T,_,x,i),(T.e.f&Us)!==0&&(Xd(T.e),a&&((L=T.a)==null||L.unfix(),(v??(v=new Set)).delete(T))),T!==h){if(f!==void 0&&f.has(T)){if(m.length<w.length){var U=w[0],I;p=U.prev;var Z=m[0],W=m[m.length-1];for(I=0;I<m.length;I+=1)s6(m[I],U,r);for(I=0;I<w.length;I+=1)f.delete(w[I]);Lo(e,Z.prev,W.next),Lo(e,p,Z),Lo(e,W,U),h=U,p=W,x-=1,m=[],w=[]}else f.delete(T),s6(T,h,r),Lo(e,T.prev,T.next),Lo(e,T,p===null?e.first:p.next),Lo(e,p,T),p=T;continue}for(m=[],w=[];h!==null&&h.k!==S;)(h.e.f&Us)===0&&(f??(f=new Set)).add(h),w.push(h),h=h.next;if(h===null)continue;T=h}m.push(T),p=T,h=T.next}if(h!==null||f!==void 0){for(var P=f===void 0?[]:cg(f);h!==null;)(h.e.f&Us)===0&&P.push(h),h=h.next;var D=P.length;if(D>0){var G=(i&k5)!==0&&l===0?r:null;if(a){for(x=0;x<D;x+=1)(Q=P[x].a)==null||Q.measure();for(x=0;x<D;x+=1)(Y=P[x].a)==null||Y.fix()}wx(e,P,G,u)}}a&&Gd(()=>{var re;if(v!==void 0)for(T of v)(re=T.a)==null||re.apply()}),Jt.first=e.first&&e.first.e,Jt.last=p&&p.e}function kx(t,e,r,n){(n&gg)!==0&&dl(t.v,e),(n&vg)!==0?dl(t.i,r):t.i=r}function i6(t,e,r,n,i,s,o,a,c,l){var u=(c&gg)!==0,d=(c&PN)===0,h=u?d?me(i,!1,!1):Uo(i):i,f=(c&vg)===0?o:Uo(o),p={i:f,v:h,k:s,a:null,e:null,prev:r,next:n};try{return p.e=Ps(()=>a(t,h,f,l),dt),p.e.prev=r&&r.e,p.e.next=n&&n.e,r===null?e.first=p:(r.next=p,r.e.next=p.e),n!==null&&(n.prev=p,n.e.prev=p.e),p}finally{}}function s6(t,e,r){for(var n=t.next?t.next.e.nodes_start:r,i=e?e.e.nodes_start:r,s=t.e.nodes_start;s!==n;){var o=ts(s);i.before(s),s=o}}function Lo(t,e,r){e===null?t.first=r:(e.next=r,e.e.next=r&&r.e),r!==null&&(r.prev=e,r.e.prev=e&&e.e)}function Ig(t,e,r=!1,n=!1,i=!1){var s=t,o="";Te(()=>{var a=Jt;if(o===(o=e()??"")){dt&&Ms();return}if(a.nodes_start!==null&&(j5(a.nodes_start,a.nodes_end),a.nodes_start=a.nodes_end=null),o!==""){if(dt){Dt.data;for(var c=Ms(),l=c;c!==null&&(c.nodeType!==8||c.data!=="");)l=c,c=ts(c);if(c===null)throw jd(),Da;is(Dt,l),s=On(c);return}var u=o+"";r?u=`<svg>${u}</svg>`:n&&(u=`<math>${u}</math>`);var d=t6(u);if((r||n)&&(d=Ni(d)),is(Ni(d),d.lastChild),r||n)for(;Ni(d);)s.before(Ni(d));else s.before(d)}})}function Ii(t,e,r,n,i){var a;dt&&Ms();var s=(a=e.$$slots)==null?void 0:a[r],o=!1;s===!0&&(s=e[r==="default"?"children":r],o=!0),s===void 0||s(t,o?()=>n:n)}function Xr(t,e,r){dt&&Ms();var n=t,i,s;Za(()=>{i!==(i=e())&&(s&&(Fo(s),s=null),i&&(s=Ps(()=>r(n,i))))},$0),dt&&(n=Dt)}function Do(t,e){Gd(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}function _x(t,e){var r=void 0,n;Za(()=>{r!==(r=e())&&(n&&(Bi(n),n=null),r&&(n=Ps(()=>{rp(()=>r(t))})))})}function o6(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=o6(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Ex(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=o6(t))&&(n&&(n+=" "),n+=e);return n}function Cx(t){return typeof t=="object"?Ex(t):t??""}const a6=[...`
3
3
  \r\f \v\uFEFF`];function Sx(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,o=0;(o=n.indexOf(i,o))>=0;){var a=o+s;(o===0||a6.includes(n[o-1]))&&(a===n.length||a6.includes(n[a]))?n=(o===0?"":n.substring(0,o))+n.substring(a+1):o=a}}return n===""?null:n}function c6(t,e=!1){var r=e?" !important;":";",n="";for(var i in t){var s=t[i];s!=null&&s!==""&&(n+=" "+i+": "+s+r)}return n}function Og(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Ax(t,e){if(e){var r="",n,i;if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,o=0,a=!1,c=[];n&&c.push(...Object.keys(n).map(Og)),i&&c.push(...Object.keys(i).map(Og));var l=0,u=-1;const v=t.length;for(var d=0;d<v;d++){var h=t[d];if(a?h==="/"&&t[d-1]==="*"&&(a=!1):s?s===h&&(s=!1):h==="/"&&t[d+1]==="*"?a=!0:h==='"'||h==="'"?s=h:h==="("?o++:h===")"&&o--,!a&&s===!1&&o===0){if(h===":"&&u===-1)u=d;else if(h===";"||d===v-1){if(u!==-1){var f=Og(t.substring(l,u).trim());if(!c.includes(f)){h!==";"&&d++;var p=t.substring(l,d).trim();r+=" "+p+";"}}l=d+1,u=-1}}}}return n&&(r+=c6(n)),i&&(r+=c6(i,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function Pr(t,e,r,n,i,s){var o=t.__className;if(dt||o!==r||o===void 0){var a=Sx(r,n,s);(!dt||a!==t.getAttribute("class"))&&(a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a)),t.__className=r}else if(s&&i!==s)for(var c in s){var l=!!s[c];(i==null||l!==!!i[c])&&t.classList.toggle(c,l)}return s}function Ug(t,e={},r,n){for(var i in r){var s=r[i];e[i]!==s&&(r[i]==null?t.style.removeProperty(i):t.style.setProperty(i,s,n))}}function Oi(t,e,r,n){var i=t.__style;if(dt||i!==e){var s=Ax(e,n);(!dt||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else n&&(Array.isArray(n)?(Ug(t,r==null?void 0:r[0],n[0]),Ug(t,r==null?void 0:r[1],n[1],"important")):Ug(t,r,n));return n}function Mg(t,e,r){if(t.multiple){if(e==null)return;if(!j0(e))return JN();for(var n of t.options)n.selected=e.includes(l6(n));return}for(n of t.options){var i=l6(n);if(HN(i,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function Rx(t,e){let r=!0;rp(()=>{e&&Mg(t,ue(e),r),r=!1;var n=new MutationObserver(()=>{var i=t.__value;Mg(t,i)});return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),()=>{n.disconnect()}})}function l6(t){return"__value"in t?t.__value:t.value}const vl=Symbol("class"),qd=Symbol("style"),u6=Symbol("is custom element"),d6=Symbol("is html");function Pg(t){if(dt){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;it(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var i=t.checked;it(t,"checked",null),t.checked=i}}};t.__on_r=r,_N(r),X5()}}function Vg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function it(t,e,r,n){var i=f6(t);dt&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||i[e]!==(i[e]=r)&&(e==="loading"&&(t[bN]=r),r==null?t.removeAttribute(e):typeof r!="string"&&m6(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function Tx(t,e,r,n,i=!1){var s=f6(t),o=s[u6],a=!s[d6];let c=dt&&o;c&&Hn(!1);var l=e||{},u=t.tagName==="OPTION";for(var d in e)d in r||(r[d]=null);r.class?r.class=Cx(r.class):(n||r[vl])&&(r.class=null),r[qd]&&(r.style??(r.style=null));var h=m6(t);for(const S in r){let T=r[S];if(u&&S==="value"&&T==null){t.value=t.__value="",l[S]=T;continue}if(S==="class"){var f=t.namespaceURI==="http://www.w3.org/1999/xhtml";Pr(t,f,T,n,e==null?void 0:e[vl],r[vl]),l[S]=T,l[vl]=r[vl];continue}if(S==="style"){Oi(t,T,e==null?void 0:e[qd],r[qd]),l[S]=T,l[qd]=r[qd];continue}var p=l[S];if(!(T===p&&!(T===void 0&&t.hasAttribute(S)))){l[S]=T;var v=S[0]+S[1];if(v!=="$$")if(v==="on"){const x={},O="$$"+S;let U=S.slice(2);var m=lx(U);if(ax(U)&&(U=U.slice(0,-7),x.capture=!0),!m&&p){if(T!=null)continue;t.removeEventListener(U,l[O],x),l[O]=null}if(T!=null)if(m)t[`__${U}`]=T,gx([U]);else{let I=function(Z){l[S].call(this,Z)};l[O]=e6(U,t,I,x)}else m&&(t[`__${U}`]=void 0)}else if(S==="style")it(t,S,T);else if(S==="autofocus")px(t,!!T);else if(!o&&(S==="__value"||S==="value"&&T!=null))t.value=t.__value=T;else if(S==="selected"&&u)Vg(t,T);else{var w=S;a||(w=dx(w));var _=w==="defaultValue"||w==="defaultChecked";if(T==null&&!o&&!_)if(s[S]=null,w==="value"||w==="checked"){let x=t;const O=e===void 0;if(w==="value"){let U=x.defaultValue;x.removeAttribute(w),x.defaultValue=U,x.value=x.__value=O?U:null}else{let U=x.defaultChecked;x.removeAttribute(w),x.defaultChecked=U,x.checked=O?U:!1}}else t.removeAttribute(S);else _||h.includes(w)&&(o||typeof T!="string")?t[w]=T:typeof T!="function"&&it(t,w,T)}}}return c&&Hn(!0),l}function h6(t,e,r=[],n,i=!1,s=ul){const o=r.map(s);var a=void 0,c={},l=t.nodeName==="SELECT",u=!1;Za(()=>{var d=e(...o.map(C)),h=Tx(t,a,d,n,i);u&&l&&"value"in d&&Mg(t,d.value,!1);for(let p of Object.getOwnPropertySymbols(c))d[p]||Bi(c[p]);for(let p of Object.getOwnPropertySymbols(d)){var f=d[p];p.description===GN&&(!a||f!==a[p])&&(c[p]&&Bi(c[p]),c[p]=Ps(()=>_x(t,()=>f))),h[p]=f}a=h}),l&&Rx(t,()=>a.value),u=!0}function f6(t){return t.__attributes??(t.__attributes={[u6]:t.nodeName.includes("-"),[d6]:t.namespaceURI===zN})}var p6=new Map;function m6(t){var e=p6.get(t.nodeName);if(e)return e;p6.set(t.nodeName,e=[]);for(var r,n=t,i=Element.prototype;i!==n;){r=u5(n);for(var s in r)r[s].set&&e.push(s);n=ug(n)}return e}function Fg(t,e,r=e){var n=cl();mx(t,"input",i=>{var s=i?t.defaultValue:t.value;if(s=Lg(t)?Dg(s):s,r(s),n&&s!==(s=e())){var o=t.selectionStart,a=t.selectionEnd;t.value=s??"",a!==null&&(t.selectionStart=o,t.selectionEnd=Math.min(a,t.value.length))}}),(dt&&t.defaultValue!==t.value||ue(e)==null&&t.value)&&r(Lg(t)?Dg(t.value):t.value),np(()=>{var i=e();Lg(t)&&i===Dg(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Lg(t){var e=t.type;return e==="number"||e==="range"}function Dg(t){return t===""?null:+t}function Wg(t){return function(...e){var r=e[0];return r.preventDefault(),t==null?void 0:t.apply(this,e)}}function st(t=!1){const e=or,r=e.l.u;if(!r)return;let n=()=>be(e.s);if(t){let i=0,s={};const o=ul(()=>{let a=!1;const c=e.s;for(const l in c)c[l]!==s[l]&&(s[l]=c[l],a=!0);return a&&i++,i});n=()=>C(o)}r.b.length&&ix(()=>{g6(e,n),Wd(r.b)}),Ag(()=>{const i=ue(()=>r.m.map(gN));return()=>{for(const s of i)typeof s=="function"&&s()}}),r.a.length&&Ag(()=>{g6(e,n),Wd(r.a)})}function g6(t,e){if(t.l.s)for(const r of t.l.s)C(r);e()}function Ze(t,e,r){var n;t.$$events||(t.$$events={}),(n=t.$$events)[e]||(n[e]=[]),t.$$events[e].push(r)}function ze(t){for(var e in t)e in this&&(this[e]=t[e])}let sp=!1,Zg=Symbol();function ht(t,e,r){const n=r[e]??(r[e]={store:null,source:me(void 0),unsubscribe:Bo});if(n.store!==t&&!(Zg in r))if(n.unsubscribe(),n.store=t??null,t==null)n.source.v=void 0,n.unsubscribe=Bo;else{var i=!0;n.unsubscribe=zg(t,s=>{i?n.source.v=s:X(n.source,s)}),i=!1}return t&&Zg in r?ve(t):C(n.source)}function tn(){const t={};function e(){Sg(()=>{for(var r in t)t[r].unsubscribe();lg(t,Zg,{enumerable:!1,value:!0})})}return[t,e]}function Nx(t,e,r){return t.set(r),e}function xx(t){var e=sp;try{return sp=!1,[t(),sp]}finally{sp=e}}const Bx={get(t,e){if(!t.exclude.includes(e))return C(t.version),e in t.special?t.special[e]():t.props[e]},set(t,e,r){return e in t.special||(t.special[e]=ye({get[e](){return t.props[e]}},e,_5)),t.special[e](r),T5(t.version),!0},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},deleteProperty(t,e){return t.exclude.includes(e)||(t.exclude.push(e),T5(t.version)),!0},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function eh(t,e){return new Proxy({props:t,exclude:e,special:{},version:Uo(0)},Bx)}function v6(t){var e;return((e=t.ctx)==null?void 0:e.d)??!1}function ye(t,e,r,n){var O;var i=(r&VN)!==0,s=!al||(r&FN)!==0,o=(r&LN)!==0,a=(r&DN)!==0,c=!1,l;o?[l,c]=xx(()=>t[e]):l=t[e];var u=Oo in t||g5 in t,d=o&&(((O=sl(t,e))==null?void 0:O.set)??(u&&e in t&&(U=>t[e]=U)))||void 0,h=n,f=!0,p=!1,v=()=>(p=!0,f&&(f=!1,a?h=ue(n):h=n),h);l===void 0&&n!==void 0&&(d&&s&&NN(),l=v(),d&&d(l));var m;if(s)m=()=>{var U=t[e];return U===void 0?v():(f=!0,p=!1,U)};else{var w=(i?ul:je)(()=>t[e]);w.f|=yN,m=()=>{var U=C(w);return U!==void 0&&(h=void 0),U===void 0?h:U}}if((r&_5)===0&&s)return m;if(d){var _=t.$$legacy;return function(U,I){return arguments.length>0?((!s||!I||_||c)&&d(I?m():U),U):m()}}var S=!1,T=me(l),x=ul(()=>{var U=m(),I=C(T);return S?(S=!1,I):T.v=U});return o&&C(x),i||(x.equals=mg),function(U,I){if(arguments.length>0){const Z=I?C(x):s&&o?ll(U):U;if(!x.equals(Z)){if(S=!0,X(T,Z),p&&h!==void 0&&(h=Z),v6(x))return U;ue(()=>C(x))}return U}return v6(x)?x.v:C(x)}}function Ge(t){return new Ix(t)}class Ix{constructor(e){s5(this,To);s5(this,Ri);var s;var r=new Map,n=(o,a)=>{var c=me(a,!1,!1);return r.set(o,c),c};const i=new Proxy({...e.props||{},$$events:{}},{get(o,a){return C(r.get(a)??n(a,Reflect.get(o,a)))},has(o,a){return a===g5?!0:(C(r.get(a)??n(a,Reflect.get(o,a))),Reflect.has(o,a))},set(o,a,c){return X(r.get(a)??n(a,c),c),Reflect.set(o,a,c)}});o5(this,Ri,(e.hydrate?vx:r6)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover})),(!((s=e==null?void 0:e.props)!=null&&s.$$host)||e.sync===!1)&&ge(),o5(this,To,i.$$events);for(const o of Object.keys(Zn(this,Ri)))o==="$set"||o==="$destroy"||o==="$on"||lg(this,o,{get(){return Zn(this,Ri)[o]},set(a){Zn(this,Ri)[o]=a},enumerable:!0});Zn(this,Ri).$set=o=>{Object.assign(i,o)},Zn(this,Ri).$destroy=()=>{yx(Zn(this,Ri))}}$set(e){Zn(this,Ri).$set(e)}$on(e,r){Zn(this,To)[e]=Zn(this,To)[e]||[];const n=(...i)=>r.call(this,...i);return Zn(this,To)[e].push(n),()=>{Zn(this,To)[e]=Zn(this,To)[e].filter(i=>i!==n)}}$destroy(){Zn(this,Ri).$destroy()}}To=new WeakMap,Ri=new WeakMap;function yl(t){or===null&&E5(),al&&or.l!==null?Ox(or).m.push(t):Ag(()=>{const e=ue(t);if(typeof e=="function")return e})}function wl(t){or===null&&E5(),yl(()=>()=>ue(t))}function Ox(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function zg(t,e,r){if(t==null)return e(void 0),r&&r(void 0),Bo;const n=ue(()=>t.subscribe(e,r));return n.unsubscribe?()=>n.unsubscribe():n}const bl=[];function Ux(t,e){return{subscribe:mn(t,e).subscribe}}function mn(t,e=Bo){let r=null;const n=new Set;function i(a){if(b5(t,a)&&(t=a,r)){const c=!bl.length;for(const l of n)l[1](),bl.push(l,t);if(c){for(let l=0;l<bl.length;l+=2)bl[l][0](bl[l+1]);bl.length=0}}}function s(a){i(a(t))}function o(a,c=Bo){const l=[a,c];return n.add(l),n.size===1&&(r=e(i,s)||Bo),a(t),()=>{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:i,update:s,subscribe:o}}function Gg(t,e,r){const n=!Array.isArray(t),i=n?[t]:t;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Ux(r,(o,a)=>{let c=!1;const l=[];let u=0,d=Bo;const h=()=>{if(u)return;d();const p=e(n?l[0]:l,o,a);s?o(p):d=typeof p=="function"?p:Bo},f=i.map((p,v)=>zg(p,m=>{l[v]=m,u&=~(1<<v),c&&h()},()=>{u|=1<<v}));return c=!0,h(),function(){Wd(f),d(),c=!1}})}function ve(t){let e;return zg(t,r=>e=r)(),e}var Mx=Object.defineProperty,y6=t=>{throw TypeError(t)},Px=(t,e,r)=>e in t?Mx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H=(t,e,r)=>Px(t,typeof e!="symbol"?e+"":e,r),Hg=(t,e,r)=>e.has(t)||y6("Cannot "+r),A=(t,e,r)=>(Hg(t,e,"read from private field"),r?r.call(t):e.get(t)),K=(t,e,r)=>e.has(t)?y6("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),M=(t,e,r,n)=>(Hg(t,e,"write to private field"),e.set(t,r),r),pe=(t,e,r)=>(Hg(t,e,"access private method"),r),th=(t,e,r,n)=>({set _(i){M(t,e,i)},get _(){return A(t,e,n)}});const op="6.13.4";function Vx(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;s<n.length;s++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=t,i}async function zr(t){const e=Object.keys(t);return(await Promise.all(e.map(r=>Promise.resolve(t[r])))).reduce((r,n,i)=>(r[e[i]]=n,r),{})}function Me(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&Vx(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function kl(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(kl).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n<t.length;n++)r+=e[t[n]>>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return kl(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${kl(r)}: ${kl(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Tr(t,e){return t&&t.code===e}function rh(t){return Tr(t,"CALL_EXCEPTION")}function cr(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${kl(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+kl(a))}}s.push(`code=${e}`),s.push(`version=${op}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Me(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Me(i,{shortMessage:n}),i}function oe(t,e,r,n){if(!t)throw cr(e,r,n)}function F(t,e,r,n){oe(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function ap(t,e,r){r==null&&(r=""),r&&(r=": "+r),oe(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),oe(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Fx=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function cp(t){oe(Fx.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function ss(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),oe(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function w6(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s<n.length;s++)n[s]=parseInt(t.substring(i,i+2),16),i+=2;return n}F(!1,"invalid BytesLike value",e||"value",t)}function Ne(t,e){return w6(t,e,!1)}function Gr(t,e){return w6(t,e,!0)}function er(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function _l(t){return er(t,!0)||t instanceof Uint8Array}const b6="0123456789abcdef";function Ee(t){const e=Ne(t);let r="0x";for(let n=0;n<e.length;n++){const i=e[n];r+=b6[(i&240)>>4]+b6[i&15]}return r}function Tt(t){return"0x"+t.map(e=>Ee(e).substring(2)).join("")}function Vs(t){return er(t,!0)?(t.length-2)/2:Ne(t).length}function tr(t,e,r){const n=Ne(t);return r!=null&&r>n.length&&oe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),Ee(n.slice(e??0,r??n.length))}function k6(t){let e=Ee(t).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}function _6(t,e,r){const n=Ne(t);oe(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),Ee(i)}function ci(t,e){return _6(t,e,!0)}function nh(t,e){return _6(t,e,!1)}const lp=BigInt(0),Ui=BigInt(1),jg=9007199254740991;function El(t,e){const r=Cl(t,"value"),n=BigInt(qe(e,"width"));if(oe(r>>n===lp,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-Ui){const i=(Ui<<n)-Ui;return-((~r&i)+Ui)}return r}function ih(t,e){let r=We(t,"value");const n=BigInt(qe(e,"width")),i=Ui<<n-Ui;if(r<lp){r=-r,oe(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const s=(Ui<<n)-Ui;return(~r&s)+Ui}else oe(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return r}function Fs(t,e){const r=Cl(t,"value"),n=BigInt(qe(e,"bits"));return r&(Ui<<n)-Ui}function We(t,e){switch(typeof t){case"bigint":return t;case"number":return F(Number.isInteger(t),"underflow",e||"value",t),F(t>=-9007199254740991&&t<=jg,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){F(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}F(!1,"invalid BigNumberish value",e||"value",t)}function Cl(t,e){const r=We(t,e);return oe(r>=lp,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const E6="0123456789abcdef";function za(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=E6[r>>4],e+=E6[r&15];return BigInt(e)}return We(t)}function qe(t,e){switch(typeof t){case"bigint":return F(t>=-9007199254740991&&t<=jg,"overflow",e||"value",t),Number(t);case"number":return F(Number.isInteger(t),"underflow",e||"value",t),F(t>=-9007199254740991&&t<=jg,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return qe(BigInt(t),e)}catch(r){F(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}F(!1,"invalid numeric value",e||"value",t)}function sh(t){return qe(za(t))}function li(t,e){let r=Cl(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const n=qe(e,"width");for(oe(n*2>=r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<n*2;)r="0"+r}return"0x"+r}function Hr(t){const e=Cl(t,"value");if(e===lp)return new Uint8Array([]);let r=e.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let i=0;i<n.length;i++){const s=i*2;n[i]=parseInt(r.substring(s,s+2),16)}return n}function Ls(t){let e=Ee(_l(t)?t:Hr(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const up="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let dp=null;function Lx(t){if(dp==null){dp={};for(let r=0;r<up.length;r++)dp[up[r]]=BigInt(r)}const e=dp[t];return F(e!=null,"invalid base58 value","letter",t),e}const Dx=BigInt(0),Qg=BigInt(58);function hp(t){const e=Ne(t);let r=za(e),n="";for(;r;)n=up[Number(r%Qg)]+n,r/=Qg;for(let i=0;i<e.length&&!e[i];i++)n=up[0]+n;return n}function Jg(t){let e=Dx;for(let r=0;r<t.length;r++)e*=Qg,e+=Lx(t[r]);return e}function $g(t){t=atob(t);const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return Ne(e)}function Yg(t){const e=Ne(t);let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}var oh;class fp{constructor(e,r,n){H(this,"filter"),H(this,"emitter"),K(this,oh),M(this,oh,r),Me(this,{emitter:e,filter:n})}async removeListener(){A(this,oh)!=null&&await this.emitter.off(this.filter,A(this,oh))}}oh=new WeakMap;function Wx(t,e,r,n,i){F(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function C6(t,e,r,n,i){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let s=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function Zx(t,e,r,n,i){return t==="OVERLONG"?(F(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),C6(t,e,r))}const Xg=Object.freeze({error:Wx,ignore:C6,replace:Zx});function S6(t,e){e==null&&(e=Xg.error);const r=Ne(t,"bytes"),n=[];let i=0;for(;i<r.length;){const s=r[i++];if(!(s>>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=s&(1<<8-o-1)-1;for(let l=0;l<o;l++){let u=r[i];if((u&192)!=128){i+=e("MISSING_CONTINUE",i,r,n),c=null;break}c=c<<6|u&63,i++}if(c!==null){if(c>1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,c);continue}if(c<=a){i+=e("OVERLONG",i-1-o,r,n,c);continue}n.push(c)}}return n}function Vr(t,e){F(typeof t=="string","invalid string value","str",t),e!=null&&(cp(e),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);F(n<t.length&&(s&64512)===56320,"invalid surrogate pair","str",t);const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function zx(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ds(t,e){return zx(S6(t,e))}function A6(t,e){return S6(Vr(t,e))}function R6(t){async function e(r,n){oe(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();oe(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),oe(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=cr("request timeout","TIMEOUT"),o.abort()},r.timeout);n&&n.addListener(()=>{s=cr("request cancelled","CANCELLED"),o.abort()});const c={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal};let l;try{l=await fetch(r.url,c)}catch(f){throw clearTimeout(a),s||f}clearTimeout(a);const u={};l.headers.forEach((f,p)=>{u[p.toLowerCase()]=f});const d=await l.arrayBuffer(),h=d==null?null:new Uint8Array(d);return{statusCode:l.status,statusMessage:l.statusText,headers:u,body:h}}return e}const Gx=12,Hx=250;let T6=R6();const jx=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Qx=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Kg=!1;async function N6(t,e){try{const r=t.match(jx);if(!r)throw new Error("invalid data");return new zo(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?$g(r[3]):Yx(r[3]))}catch{return new zo(599,"BAD REQUEST (invalid data: URI)",{},null,new gn(t))}}function x6(t){async function e(r,n){try{const i=r.match(Qx);if(!i)throw new Error("invalid link");return new gn(`${t}${i[2]}`)}catch{return new zo(599,"BAD REQUEST (invalid IPFS URI)",{},null,new gn(r))}}return e}const pp={data:N6,ipfs:x6("https://gateway.ipfs.io/ipfs/")},B6=new WeakMap;var Sl,Ga;class qg{constructor(e){K(this,Sl),K(this,Ga),M(this,Sl,[]),M(this,Ga,!1),B6.set(e,()=>{if(!A(this,Ga)){M(this,Ga,!0);for(const r of A(this,Sl))setTimeout(()=>{r()},0);M(this,Sl,[])}})}addListener(e){oe(!A(this,Ga),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),A(this,Sl).push(e)}get cancelled(){return A(this,Ga)}checkSignal(){oe(!this.cancelled,"cancelled","CANCELLED",{})}}Sl=new WeakMap,Ga=new WeakMap;function mp(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var ah,ch,os,Wo,lh,uh,rn,ui,Zo,Al,Rl,Tl,Ws,as,Ha,Nl,dh;const Jx=class a5{constructor(e){K(this,Nl),K(this,ah),K(this,ch),K(this,os),K(this,Wo),K(this,lh),K(this,uh),K(this,rn),K(this,ui),K(this,Zo),K(this,Al),K(this,Rl),K(this,Tl),K(this,Ws),K(this,as),K(this,Ha),M(this,uh,String(e)),M(this,ah,!1),M(this,ch,!0),M(this,os,{}),M(this,Wo,""),M(this,lh,3e5),M(this,as,{slotInterval:Hx,maxAttempts:Gx}),M(this,Ha,null)}get url(){return A(this,uh)}set url(e){M(this,uh,String(e))}get body(){return A(this,rn)==null?null:new Uint8Array(A(this,rn))}set body(e){if(e==null)M(this,rn,void 0),M(this,ui,void 0);else if(typeof e=="string")M(this,rn,Vr(e)),M(this,ui,"text/plain");else if(e instanceof Uint8Array)M(this,rn,e),M(this,ui,"application/octet-stream");else if(typeof e=="object")M(this,rn,Vr(JSON.stringify(e))),M(this,ui,"application/json");else throw new Error("invalid body")}hasBody(){return A(this,rn)!=null}get method(){return A(this,Wo)?A(this,Wo):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),M(this,Wo,String(e).toUpperCase())}get headers(){const e=Object.assign({},A(this,os));return A(this,Zo)&&(e.authorization=`Basic ${Yg(Vr(A(this,Zo)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&A(this,ui)&&(e["content-type"]=A(this,ui)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){A(this,os)[String(e).toLowerCase()]=String(r)}clearHeaders(){M(this,os,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return A(this,Zo)||null}setCredentials(e,r){F(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),M(this,Zo,`${e}:${r}`)}get allowGzip(){return A(this,ch)}set allowGzip(e){M(this,ch,!!e)}get allowInsecureAuthentication(){return!!A(this,ah)}set allowInsecureAuthentication(e){M(this,ah,!!e)}get timeout(){return A(this,lh)}set timeout(e){F(e>=0,"timeout must be non-zero","timeout",e),M(this,lh,e)}get preflightFunc(){return A(this,Al)||null}set preflightFunc(e){M(this,Al,e)}get processFunc(){return A(this,Rl)||null}set processFunc(e){M(this,Rl,e)}get retryFunc(){return A(this,Tl)||null}set retryFunc(e){M(this,Tl,e)}get getUrlFunc(){return A(this,Ha)||T6}set getUrlFunc(e){M(this,Ha,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${A(this,rn)?Ee(A(this,rn)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(A(this,as).slotInterval=e.slotInterval),e.maxAttempts!=null&&(A(this,as).maxAttempts=e.maxAttempts)}send(){return oe(A(this,Ws)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),M(this,Ws,new qg(this)),pe(this,Nl,dh).call(this,0,I6()+this.timeout,0,this,new zo(0,"",{},null,this))}cancel(){oe(A(this,Ws)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=B6.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();oe(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new a5(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,M(i,os,Object.assign({},A(this,os))),A(this,rn)&&M(i,rn,new Uint8Array(A(this,rn))),M(i,ui,A(this,ui)),i}clone(){const e=new a5(this.url);return M(e,Wo,A(this,Wo)),A(this,rn)&&M(e,rn,A(this,rn)),M(e,ui,A(this,ui)),M(e,os,Object.assign({},A(this,os))),M(e,Zo,A(this,Zo)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),M(e,Al,A(this,Al)),M(e,Rl,A(this,Rl)),M(e,Tl,A(this,Tl)),M(e,as,Object.assign({},A(this,as))),M(e,Ha,A(this,Ha)),e}static lockConfig(){Kg=!0}static getGateway(e){return pp[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Kg)throw new Error("gateways locked");pp[e]=r}static registerGetUrl(e){if(Kg)throw new Error("gateways locked");T6=e}static createGetUrlFunc(e){return R6()}static createDataGateway(){return N6}static createIpfsGatewayFunc(e){return x6(e)}};ah=new WeakMap,ch=new WeakMap,os=new WeakMap,Wo=new WeakMap,lh=new WeakMap,uh=new WeakMap,rn=new WeakMap,ui=new WeakMap,Zo=new WeakMap,Al=new WeakMap,Rl=new WeakMap,Tl=new WeakMap,Ws=new WeakMap,as=new WeakMap,Ha=new WeakMap,Nl=new WeakSet,dh=async function(t,e,r,n,i){var s,o,a;if(t>=A(this,as).maxAttempts)return i.makeServerError("exceeded maximum retry limit");oe(I6()<=e,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),r>0&&await Xx(r);let c=this.clone();const l=(c.url.split(":")[0]||"").toLowerCase();if(l in pp){const h=await pp[l](c.url,mp(A(n,Ws)));if(h instanceof zo){let f=h;if(this.processFunc){mp(A(n,Ws));try{f=await this.processFunc(c,f)}catch(p){(p.throttle==null||typeof p.stall!="number")&&f.makeServerError("error in post-processing function",p).assertOk()}}return f}c=h}this.preflightFunc&&(c=await this.preflightFunc(c));const u=await this.getUrlFunc(c,mp(A(n,Ws)));let d=new zo(u.statusCode,u.statusMessage,u.headers,u.body,n);if(d.statusCode===301||d.statusCode===302){try{const h=d.headers.location||"";return pe(s=c.redirect(h),Nl,dh).call(s,t+1,e,0,n,d)}catch{}return d}else if(d.statusCode===429&&(this.retryFunc==null||await this.retryFunc(c,d,t))){const h=d.headers["retry-after"];let f=A(this,as).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(f=parseInt(h)),pe(o=c.clone(),Nl,dh).call(o,t+1,e,f,n,d)}if(this.processFunc){mp(A(n,Ws));try{d=await this.processFunc(c,d)}catch(h){(h.throttle==null||typeof h.stall!="number")&&d.makeServerError("error in post-processing function",h).assertOk();let f=A(this,as).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return h.stall>=0&&(f=h.stall),pe(a=c.clone(),Nl,dh).call(a,t+1,e,f,n,d)}}return d};let gn=Jx;var gp,vp,yp,di,hh,xl;const $x=class sN{constructor(e,r,n,i,s){K(this,gp),K(this,vp),K(this,yp),K(this,di),K(this,hh),K(this,xl),M(this,gp,e),M(this,vp,r),M(this,yp,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),M(this,di,i==null?null:new Uint8Array(i)),M(this,hh,s||null),M(this,xl,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${A(this,di)?Ee(A(this,di)):"null"}>`}get statusCode(){return A(this,gp)}get statusMessage(){return A(this,vp)}get headers(){return Object.assign({},A(this,yp))}get body(){return A(this,di)==null?null:new Uint8Array(A(this,di))}get bodyText(){try{return A(this,di)==null?"":Ds(A(this,di))}catch{oe(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{oe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,r){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new sN(599,n,this.headers,this.body,A(this,hh)||void 0);return M(i,xl,{message:e,error:r}),i}throwThrottleError(e,r){r==null?r=-1:F(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Me(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return A(this,di)!=null}get request(){return A(this,hh)}ok(){return A(this,xl).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=A(this,xl);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{A(this,di)&&(i=Ds(A(this,di)))}catch{}oe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};gp=new WeakMap,vp=new WeakMap,yp=new WeakMap,di=new WeakMap,hh=new WeakMap,xl=new WeakMap;let zo=$x;function I6(){return new Date().getTime()}function Yx(t){return Vr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function Xx(t){return new Promise(e=>setTimeout(e,t))}const Kx=BigInt(-1),Mi=BigInt(0),Bl=BigInt(1),qx=BigInt(5),Il={};let Ol="0000";for(;Ol.length<80;)Ol+=Ol;function ja(t){let e=Ol;for(;e.length<t;)e+=e;return BigInt("1"+e.substring(0,t))}function fh(t,e,r){const n=BigInt(e.width);if(e.signed){const i=Bl<<n-Bl;oe(r==null||t>=-i&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t>Mi?t=El(Fs(t,n),n):t=-El(Fs(-t,n),n)}else{const i=Bl<<n;oe(r==null||t>=0&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t=(t%i+i)%i&i-Bl}return t}function ev(t){typeof t=="number"&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")e=!1;else{const s=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);F(s,"invalid fixed format","format",t),e=s[1]!=="u",r=parseInt(s[2]),n=parseInt(s[3])}}else if(t){const s=t,o=(a,c,l)=>s[a]==null?l:(F(typeof s[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,s[a]),s[a]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}F(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),F(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function eB(t,e){let r="";t<Mi&&(r="-",t*=Kx);let n=t.toString();if(e===0)return r+n;for(;n.length<=e;)n=Ol+n;const i=n.length-e;for(n=n.substring(0,i)+"."+n.substring(i);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return r+n}var cs,nr,Un,gr,Qa,Zs,tv,rv,nv,iv;const O6=class Md{constructor(e,r,n){K(this,gr),H(this,"format"),K(this,cs),K(this,nr),K(this,Un),H(this,"_value"),ss(e,Il,"FixedNumber"),M(this,nr,r),M(this,cs,n);const i=eB(r,n.decimals);Me(this,{format:n.name,_value:i}),M(this,Un,ja(n.decimals))}get signed(){return A(this,cs).signed}get width(){return A(this,cs).width}get decimals(){return A(this,cs).decimals}get value(){return A(this,nr)}addUnsafe(e){return pe(this,gr,tv).call(this,e)}add(e){return pe(this,gr,tv).call(this,e,"add")}subUnsafe(e){return pe(this,gr,rv).call(this,e)}sub(e){return pe(this,gr,rv).call(this,e,"sub")}mulUnsafe(e){return pe(this,gr,nv).call(this,e)}mul(e){return pe(this,gr,nv).call(this,e,"mul")}mulSignal(e){pe(this,gr,Qa).call(this,e);const r=A(this,nr)*A(e,nr);return oe(r%A(this,Un)===Mi,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),pe(this,gr,Zs).call(this,r/A(this,Un),"mulSignal")}divUnsafe(e){return pe(this,gr,iv).call(this,e)}div(e){return pe(this,gr,iv).call(this,e,"div")}divSignal(e){oe(A(e,nr)!==Mi,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),pe(this,gr,Qa).call(this,e);const r=A(this,nr)*A(this,Un);return oe(r%A(e,nr)===Mi,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),pe(this,gr,Zs).call(this,r/A(e,nr),"divSignal")}cmp(e){let r=this.value,n=e.value;const i=this.decimals-e.decimals;return i>0?n*=ja(i):i<0&&(r*=ja(-i)),r<n?-1:r>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=A(this,nr);return A(this,nr)<Mi&&(e-=A(this,Un)-Bl),e=A(this,nr)/A(this,Un)*A(this,Un),pe(this,gr,Zs).call(this,e,"floor")}ceiling(){let e=A(this,nr);return A(this,nr)>Mi&&(e+=A(this,Un)-Bl),e=A(this,nr)/A(this,Un)*A(this,Un),pe(this,gr,Zs).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=qx*ja(r-1);let i=this.value+n;const s=ja(r);return i=i/s*s,fh(i,A(this,cs),"round"),new Md(Il,i,A(this,cs))}isZero(){return A(this,nr)===Mi}isNegative(){return A(this,nr)<Mi}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Md.fromString(this.toString(),e)}static fromValue(e,r,n){const i=r==null?0:qe(r),s=ev(n);let o=We(e,"value");const a=i-s.decimals;if(a>0){const c=ja(a);oe(o%c===Mi,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=ja(-a));return fh(o,s,"fromValue"),new Md(Il,o,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);F(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=ev(r);let s=n[2]||"0",o=n[3]||"";for(;o.length<i.decimals;)o+=Ol;oe(o.substring(i.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),o=o.substring(0,i.decimals);const a=BigInt(n[1]+s+o);return fh(a,i,"fromString"),new Md(Il,a,i)}static fromBytes(e,r){let n=za(Ne(e,"value"));const i=ev(r);return i.signed&&(n=El(n,i.width)),fh(n,i,"fromBytes"),new Md(Il,n,i)}};cs=new WeakMap,nr=new WeakMap,Un=new WeakMap,gr=new WeakSet,Qa=function(t){F(this.format===t.format,"incompatible format; use fixedNumber.toFormat","other",t)},Zs=function(t,e){return t=fh(t,A(this,cs),e),new O6(Il,t,A(this,cs))},tv=function(t,e){return pe(this,gr,Qa).call(this,t),pe(this,gr,Zs).call(this,A(this,nr)+A(t,nr),e)},rv=function(t,e){return pe(this,gr,Qa).call(this,t),pe(this,gr,Zs).call(this,A(this,nr)-A(t,nr),e)},nv=function(t,e){return pe(this,gr,Qa).call(this,t),pe(this,gr,Zs).call(this,A(this,nr)*A(t,nr)/A(this,Un),e)},iv=function(t,e){return oe(A(t,nr)!==Mi,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),pe(this,gr,Qa).call(this,t),pe(this,gr,Zs).call(this,A(this,nr)*A(this,Un)/A(t,nr),e)};let wp=O6;function tB(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function U6(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function M6(t,e,r,n){const i=[];for(;r<e+1+n;){const s=P6(t,r);i.push(s.result),r+=s.consumed,oe(r<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:i}}function P6(t,e){oe(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=n=>{oe(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=U6(t,e+1,n);return r(e+1+n+i),M6(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),M6(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=U6(t,e+1,n);r(e+1+n+i);const s=Ee(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=Ee(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:tB(t[e])}}function Ul(t){const e=Ne(t,"data"),r=P6(e,0);return F(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function V6(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function F6(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(F6(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=V6(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(Ne(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=V6(e.length);return r.unshift(183+r.length),r.concat(e)}const L6="0123456789abcdef";function zs(t){let e="0x";for(const r of F6(t))e+=L6[r>>4],e+=L6[r&15];return e}const D6=["wei","kwei","mwei","gwei","szabo","finney","ether"];function sv(t,e){let r=18;if(typeof e=="string"){const n=D6.indexOf(e);F(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=qe(e,"unit"));return wp.fromValue(t,r,{decimals:r,width:512}).toString()}function ov(t,e){F(typeof t=="string","value must be a string","value",t);let r=18;if(typeof e=="string"){const n=D6.indexOf(e);F(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=qe(e,"unit"));return wp.fromString(t,{decimals:r,width:512}).value}function W6(t){return sv(t,18)}function Z6(t){return ov(t,18)}function av(t){const e=Ne(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Ee(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const An=32,cv=new Uint8Array(An),rB=["then"],bp={},z6=new WeakMap;function Ja(t){return z6.get(t)}function G6(t,e){z6.set(t,e)}function ph(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function lv(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof Ml?lv(Ja(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof Ml&&(o=lv(Ja(o),o,r)),n[i]=o),n},{})}var mh;const nB=class Z0 extends Array{constructor(...e){const r=e[0];let n=e[1],i=(e[2]||[]).slice(),s=!0;r!==bp&&(n=e,i=[],s=!1),super(n.length),K(this,mh),n.forEach((c,l)=>{this[l]=c});const o=i.reduce((c,l)=>(typeof l=="string"&&c.set(l,(c.get(l)||0)+1),c),new Map);if(G6(this,Object.freeze(n.map((c,l)=>{const u=i[l];return u!=null&&o.get(u)===1?u:null}))),M(this,mh,[]),A(this,mh)==null&&A(this,mh),!s)return;Object.freeze(this);const a=new Proxy(this,{get:(c,l,u)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){const h=qe(l,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const f=c[h];return f instanceof Error&&ph(`index ${h}`,f),f}if(rB.indexOf(l)>=0)return Reflect.get(c,l,u);const d=c[l];if(d instanceof Function)return function(...h){return d.apply(this===u?c:this,h)};if(!(l in c))return c.getValue.apply(this===u?c:this,[l])}return Reflect.get(c,l,u)}});return G6(a,Ja(this)),a}toArray(e){const r=[];return this.forEach((n,i)=>{n instanceof Error&&ph(`index ${i}`,n),e&&n instanceof Z0&&(n=n.toArray(e)),r.push(n)}),r}toObject(e){const r=Ja(this);return r.reduce((n,i,s)=>(oe(i!=null,`value at index ${s} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),lv(r,this,e)),{})}slice(e,r){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const n=Ja(this),i=[],s=[];for(let o=e;o<r;o++)i.push(this[o]),s.push(n[o]);return new Z0(bp,i,s)}filter(e,r){const n=Ja(this),i=[],s=[];for(let o=0;o<this.length;o++){const a=this[o];a instanceof Error&&ph(`index ${o}`,a),e.call(r,a,o,this)&&(i.push(a),s.push(n[o]))}return new Z0(bp,i,s)}map(e,r){const n=[];for(let i=0;i<this.length;i++){const s=this[i];s instanceof Error&&ph(`index ${i}`,s),n.push(e.call(r,s,i,this))}return n}getValue(e){const r=Ja(this).indexOf(e);if(r===-1)return;const n=this[r];return n instanceof Error&&ph(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,r){return new Z0(bp,e,r)}};mh=new WeakMap;let Ml=nB;function H6(t){const e=[],r=function(n,i){if(Array.isArray(i))for(let s in i){const o=n.slice();o.push(s);try{r(o,i[s])}catch(a){e.push({path:o,error:a})}}};return r([],t),e}function j6(t){let e=Hr(t);return oe(e.length<=An,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:An,offset:e.length}),e.length!==An&&(e=Gr(Tt([cv.slice(e.length%An),e]))),e}class Gs{constructor(e,r,n,i){H(this,"name"),H(this,"type"),H(this,"localName"),H(this,"dynamic"),Me(this,{name:e,type:r,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,r){F(!1,e,this.localName,r)}}var Go,Ho,gh,kp;class uv{constructor(){K(this,gh),K(this,Go),K(this,Ho),M(this,Go,[]),M(this,Ho,0)}get data(){return Tt(A(this,Go))}get length(){return A(this,Ho)}appendWriter(e){return pe(this,gh,kp).call(this,Gr(e.data))}writeBytes(e){let r=Gr(e);const n=r.length%An;return n&&(r=Gr(Tt([r,cv.slice(n)]))),pe(this,gh,kp).call(this,r)}writeValue(e){return pe(this,gh,kp).call(this,j6(e))}writeUpdatableValue(){const e=A(this,Go).length;return A(this,Go).push(cv),M(this,Ho,A(this,Ho)+An),r=>{A(this,Go)[e]=j6(r)}}}Go=new WeakMap,Ho=new WeakMap,gh=new WeakSet,kp=function(t){return A(this,Go).push(t),M(this,Ho,A(this,Ho)+t.length),t.length};var Qn,Jn,$a,Pl,Ya,vh,dv,Q6;const iB=class oN{constructor(e,r,n){K(this,vh),H(this,"allowLoose"),K(this,Qn),K(this,Jn),K(this,$a),K(this,Pl),K(this,Ya),Me(this,{allowLoose:!!r}),M(this,Qn,Gr(e)),M(this,$a,0),M(this,Pl,null),M(this,Ya,n??1024),M(this,Jn,0)}get data(){return Ee(A(this,Qn))}get dataLength(){return A(this,Qn).length}get consumed(){return A(this,Jn)}get bytes(){return new Uint8Array(A(this,Qn))}subReader(e){const r=new oN(A(this,Qn).slice(A(this,Jn)+e),this.allowLoose,A(this,Ya));return M(r,Pl,this),r}readBytes(e,r){let n=pe(this,vh,Q6).call(this,0,e,!!r);return pe(this,vh,dv).call(this,e),M(this,Jn,A(this,Jn)+n.length),n.slice(0,e)}readValue(){return za(this.readBytes(An))}readIndex(){return sh(this.readBytes(An))}};Qn=new WeakMap,Jn=new WeakMap,$a=new WeakMap,Pl=new WeakMap,Ya=new WeakMap,vh=new WeakSet,dv=function(t){var e;if(A(this,Pl))return pe(e=A(this,Pl),vh,dv).call(e,t);M(this,$a,A(this,$a)+t),oe(A(this,Ya)<1||A(this,$a)<=A(this,Ya)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${A(this,Ya)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Gr(A(this,Qn)),offset:A(this,Jn),length:t,info:{bytesRead:A(this,$a),dataLength:this.dataLength}})},Q6=function(t,e,r){let n=Math.ceil(e/An)*An;return A(this,Jn)+n>A(this,Qn).length&&(this.allowLoose&&r&&A(this,Jn)+e<=A(this,Qn).length?n=e:oe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Gr(A(this,Qn)),length:A(this,Qn).length,offset:A(this,Jn)+n})),A(this,Qn).slice(A(this,Jn),A(this,Jn)+n)};let sB=iB;function $n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function hv(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function J6(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");$n(t.outputLen),$n(t.blockLen)}function Vl(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function $6(t,e){hv(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const fv=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y6=t=>t instanceof Uint8Array,_p=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ep=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ls=(t,e)=>t<<32-e|t>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const oB=async()=>{};async function X6(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);const s=Date.now()-n;s>=0&&s<e||(await oB(),n+=s)}}function aB(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fl(t){if(typeof t=="string"&&(t=aB(t)),!Y6(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function cB(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!Y6(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class pv{clone(){return this._cloneInto()}}const lB={}.toString;function K6(t,e){if(e!==void 0&&lB.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function Cp(t){const e=n=>t().update(Fl(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function uB(t=32){if(fv&&typeof fv.getRandomValues=="function")return fv.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class q6 extends pv{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,J6(e);const n=Fl(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Vl(this),this.iHash.update(e),this}digestInto(e){Vl(this),hv(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Sp=(t,e,r)=>new q6(t,e).update(r).digest();Sp.create=(t,e)=>new q6(t,e);function dB(t,e,r,n){J6(t);const i=K6({dkLen:32,asyncTick:10},n),{c:s,dkLen:o,asyncTick:a}=i;if($n(s),$n(o),$n(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Fl(e),l=Fl(r),u=new Uint8Array(o),d=Sp.create(t,c),h=d._cloneInto().update(l);return{c:s,dkLen:o,asyncTick:a,DK:u,PRF:d,PRFSalt:h}}function hB(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function mv(t,e,r,n){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:c}=dB(t,e,r,n);let l;const u=new Uint8Array(4),d=Ep(u),h=new Uint8Array(a.outputLen);for(let f=1,p=0;p<s;f++,p+=a.outputLen){const v=o.subarray(p,p+a.outputLen);d.setInt32(0,f,!1),(l=c._cloneInto(l)).update(u).digestInto(h),v.set(h.subarray(0,v.length));for(let m=1;m<i;m++){a._cloneInto(l).update(h).digestInto(h);for(let w=0;w<v.length;w++)v[w]^=h[w]}}return hB(a,c,o,l,h)}function fB(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class gv extends pv{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ep(this.buffer)}update(e){Vl(this);const{view:r,buffer:n,blockLen:i}=this;e=Fl(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Ep(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Vl(this),$6(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)r[d]=0;fB(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=Ep(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}}const pB=(t,e,r)=>t&e^~t&r,mB=(t,e,r)=>t&e^t&r^e&r,gB=new Uint32Array([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]),jo=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qo=new Uint32Array(64);class vB extends gv{constructor(){super(64,32,8,!1),this.A=jo[0]|0,this.B=jo[1]|0,this.C=jo[2]|0,this.D=jo[3]|0,this.E=jo[4]|0,this.F=jo[5]|0,this.G=jo[6]|0,this.H=jo[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)Qo[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const h=Qo[d-15],f=Qo[d-2],p=ls(h,7)^ls(h,18)^h>>>3,v=ls(f,17)^ls(f,19)^f>>>10;Qo[d]=v+Qo[d-7]+p+Qo[d-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const h=ls(a,6)^ls(a,11)^ls(a,25),f=u+h+pB(a,c,l)+gB[d]+Qo[d]|0,p=(ls(n,2)^ls(n,13)^ls(n,22))+mB(n,i,s)|0;u=l,l=c,c=a,a=o+f|0,o=s,s=i,i=n,n=f+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){Qo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ll=Cp(()=>new vB),Ap=BigInt(2**32-1),vv=BigInt(32);function e8(t,e=!1){return e?{h:Number(t&Ap),l:Number(t>>vv&Ap)}:{h:Number(t>>vv&Ap)|0,l:Number(t&Ap)|0}}function t8(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=e8(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const yB=(t,e)=>BigInt(t>>>0)<<vv|BigInt(e>>>0),wB=(t,e,r)=>t>>>r,bB=(t,e,r)=>t<<32-r|e>>>r,kB=(t,e,r)=>t>>>r|e<<32-r,_B=(t,e,r)=>t<<32-r|e>>>r,EB=(t,e,r)=>t<<64-r|e>>>r-32,CB=(t,e,r)=>t>>>r-32|e<<64-r,SB=(t,e)=>e,AB=(t,e)=>t,r8=(t,e,r)=>t<<r|e>>>32-r,n8=(t,e,r)=>e<<r|t>>>32-r,i8=(t,e,r)=>e<<r-32|t>>>64-r,s8=(t,e,r)=>t<<r-32|e>>>64-r;function RB(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const TB=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),NB=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,xB=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),BB=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,IB=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),OB=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,vt={fromBig:e8,split:t8,toBig:yB,shrSH:wB,shrSL:bB,rotrSH:kB,rotrSL:_B,rotrBH:EB,rotrBL:CB,rotr32H:SB,rotr32L:AB,rotlSH:r8,rotlSL:n8,rotlBH:i8,rotlBL:s8,add:RB,add3L:TB,add3H:NB,add4L:xB,add4H:BB,add5H:OB,add5L:IB},[UB,MB]=vt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Jo=new Uint32Array(80),$o=new Uint32Array(80);class PB extends gv{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:h,Gh:f,Gl:p,Hh:v,Hl:m}=this;return[e,r,n,i,s,o,a,c,l,u,d,h,f,p,v,m]}set(e,r,n,i,s,o,a,c,l,u,d,h,f,p,v,m){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=h|0,this.Gh=f|0,this.Gl=p|0,this.Hh=v|0,this.Hl=m|0}process(e,r){for(let S=0;S<16;S++,r+=4)Jo[S]=e.getUint32(r),$o[S]=e.getUint32(r+=4);for(let S=16;S<80;S++){const T=Jo[S-15]|0,x=$o[S-15]|0,O=vt.rotrSH(T,x,1)^vt.rotrSH(T,x,8)^vt.shrSH(T,x,7),U=vt.rotrSL(T,x,1)^vt.rotrSL(T,x,8)^vt.shrSL(T,x,7),I=Jo[S-2]|0,Z=$o[S-2]|0,W=vt.rotrSH(I,Z,19)^vt.rotrBH(I,Z,61)^vt.shrSH(I,Z,6),P=vt.rotrSL(I,Z,19)^vt.rotrBL(I,Z,61)^vt.shrSL(I,Z,6),D=vt.add4L(U,P,$o[S-7],$o[S-16]),G=vt.add4H(D,O,W,Jo[S-7],Jo[S-16]);Jo[S]=G|0,$o[S]=D|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:h,Fh:f,Fl:p,Gh:v,Gl:m,Hh:w,Hl:_}=this;for(let S=0;S<80;S++){const T=vt.rotrSH(d,h,14)^vt.rotrSH(d,h,18)^vt.rotrBH(d,h,41),x=vt.rotrSL(d,h,14)^vt.rotrSL(d,h,18)^vt.rotrBL(d,h,41),O=d&f^~d&v,U=h&p^~h&m,I=vt.add5L(_,x,U,MB[S],$o[S]),Z=vt.add5H(I,w,T,O,UB[S],Jo[S]),W=I|0,P=vt.rotrSH(n,i,28)^vt.rotrBH(n,i,34)^vt.rotrBH(n,i,39),D=vt.rotrSL(n,i,28)^vt.rotrBL(n,i,34)^vt.rotrBL(n,i,39),G=n&s^n&a^s&a,q=i&o^i&c^o&c;w=v|0,_=m|0,v=f|0,m=p|0,f=d|0,p=h|0,{h:d,l:h}=vt.add(l|0,u|0,Z|0,W|0),l=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const L=vt.add3L(W,D,q);n=vt.add3H(L,Z,P,G),i=L|0}({h:n,l:i}=vt.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=vt.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=vt.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=vt.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:h}=vt.add(this.Eh|0,this.El|0,d|0,h|0),{h:f,l:p}=vt.add(this.Fh|0,this.Fl|0,f|0,p|0),{h:v,l:m}=vt.add(this.Gh|0,this.Gl|0,v|0,m|0),{h:w,l:_}=vt.add(this.Hh|0,this.Hl|0,w|0,_|0),this.set(n,i,s,o,a,c,l,u,d,h,f,p,v,m,w,_)}roundClean(){Jo.fill(0),$o.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const yv=Cp(()=>new PB);function VB(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}const o8=VB(),a8=o8.crypto||o8.msCrypto;function c8(t){switch(t){case"sha256":return Ll.create();case"sha512":return yv.create()}F(!1,"invalid hashing algorithm name","algorithm",t)}function FB(t,e){const r={sha256:Ll,sha512:yv}[t];return F(r!=null,"invalid hmac algorithm","algorithm",t),Sp.create(r,e)}function LB(t,e,r,n,i){const s={sha256:Ll,sha512:yv}[i];return F(s!=null,"invalid pbkdf2 algorithm","algorithm",i),mv(s,t,e,{c:r,dkLen:n})}function DB(t){oe(a8!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),F(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return a8.getRandomValues(e),e}let l8=!1;const u8=function(t,e,r){return FB(t,e).update(r).digest()};let d8=u8;function Hs(t,e,r){const n=Ne(e,"key"),i=Ne(r,"data");return Ee(d8(t,n,i))}Hs._=u8,Hs.lock=function(){l8=!0},Hs.register=function(t){if(l8)throw new Error("computeHmac is locked");d8=t},Object.freeze(Hs);const[h8,f8,p8]=[[],[],[]],WB=BigInt(0),yh=BigInt(1),ZB=BigInt(2),zB=BigInt(7),GB=BigInt(256),HB=BigInt(113);for(let t=0,e=yh,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],h8.push(2*(5*n+r)),f8.push((t+1)*(t+2)/2%64);let i=WB;for(let s=0;s<7;s++)e=(e<<yh^(e>>zB)*HB)%GB,e&ZB&&(i^=yh<<(yh<<BigInt(s))-yh);p8.push(i)}const[jB,QB]=t8(p8,!0),m8=(t,e,r)=>r>32?i8(t,e,r):r8(t,e,r),g8=(t,e,r)=>r>32?s8(t,e,r):n8(t,e,r);function JB(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],d=m8(l,u,1)^r[a],h=g8(l,u,1)^r[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=f8[o],c=m8(i,s,a),l=g8(i,s,a),u=h8[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=jB[n],t[1]^=QB[n]}r.fill(0)}class wv extends pv{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,$n(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=_p(this.state)}keccak(){JB(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Vl(this);const{blockLen:r,state:n}=this;e=Fl(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Vl(this,!1),hv(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return $n(e),this.xofInto(new Uint8Array(e))}digestInto(e){if($6(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new wv(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const $B=(t,e,r)=>Cp(()=>new wv(e,t,r)),YB=$B(1,136,256/8);let v8=!1;const y8=function(t){return YB(t)};let w8=y8;function rr(t){const e=Ne(t,"data");return Ee(w8(e))}rr._=y8,rr.lock=function(){v8=!0},rr.register=function(t){if(v8)throw new TypeError("keccak256 is locked");w8=t},Object.freeze(rr);const XB=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),b8=Uint8Array.from({length:16},(t,e)=>e),KB=b8.map(t=>(9*t+5)%16);let bv=[b8],kv=[KB];for(let t=0;t<4;t++)for(let e of[bv,kv])e.push(e[t].map(r=>XB[r]));const k8=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),qB=bv.map((t,e)=>t.map(r=>k8[e][r])),eI=kv.map((t,e)=>t.map(r=>k8[e][r])),tI=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),rI=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Rp=(t,e)=>t<<e|t>>>32-e;function _8(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const Tp=new Uint32Array(16);class nI extends gv{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let f=0;f<16;f++,r+=4)Tp[f]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,o=s,a=this.h2|0,c=a,l=this.h3|0,u=l,d=this.h4|0,h=d;for(let f=0;f<5;f++){const p=4-f,v=tI[f],m=rI[f],w=bv[f],_=kv[f],S=qB[f],T=eI[f];for(let x=0;x<16;x++){const O=Rp(n+_8(f,s,a,l)+Tp[w[x]]+v,S[x])+d|0;n=d,d=l,l=Rp(a,10)|0,a=s,s=O}for(let x=0;x<16;x++){const O=Rp(i+_8(p,o,c,u)+Tp[_[x]]+m,T[x])+h|0;i=h,h=u,u=Rp(c,10)|0,c=o,o=O}}this.set(this.h1+a+u|0,this.h2+l+h|0,this.h3+d+i|0,this.h4+n+o|0,this.h0+s+c|0)}roundClean(){Tp.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const iI=Cp(()=>new nI);let E8=!1;const C8=function(t){return iI(t)};let S8=C8;function js(t){const e=Ne(t,"data");return Ee(S8(e))}js._=C8,js.lock=function(){E8=!0},js.register=function(t){if(E8)throw new TypeError("ripemd160 is locked");S8=t},Object.freeze(js);let A8=!1;const R8=function(t,e,r,n,i){return LB(t,e,r,n,i)};let T8=R8;function Pi(t,e,r,n,i){const s=Ne(t,"password"),o=Ne(e,"salt");return Ee(T8(s,o,r,n,i))}Pi._=R8,Pi.lock=function(){A8=!0},Pi.register=function(t){if(A8)throw new Error("pbkdf2 is locked");T8=t},Object.freeze(Pi);let N8=!1;const x8=function(t){return new Uint8Array(DB(t))};let B8=x8;function Yn(t){return B8(t)}Yn._=x8,Yn.lock=function(){N8=!0},Yn.register=function(t){if(N8)throw new Error("randomBytes is locked");B8=t},Object.freeze(Yn);const Wt=(t,e)=>t<<e|t>>>32-e;function I8(t,e,r,n,i,s){let o=t[e++]^r[n++],a=t[e++]^r[n++],c=t[e++]^r[n++],l=t[e++]^r[n++],u=t[e++]^r[n++],d=t[e++]^r[n++],h=t[e++]^r[n++],f=t[e++]^r[n++],p=t[e++]^r[n++],v=t[e++]^r[n++],m=t[e++]^r[n++],w=t[e++]^r[n++],_=t[e++]^r[n++],S=t[e++]^r[n++],T=t[e++]^r[n++],x=t[e++]^r[n++],O=o,U=a,I=c,Z=l,W=u,P=d,D=h,G=f,q=p,L=v,Q=m,Y=w,re=_,de=S,ee=T,ae=x;for(let Se=0;Se<8;Se+=2)W^=Wt(O+re|0,7),q^=Wt(W+O|0,9),re^=Wt(q+W|0,13),O^=Wt(re+q|0,18),L^=Wt(P+U|0,7),de^=Wt(L+P|0,9),U^=Wt(de+L|0,13),P^=Wt(U+de|0,18),ee^=Wt(Q+D|0,7),I^=Wt(ee+Q|0,9),D^=Wt(I+ee|0,13),Q^=Wt(D+I|0,18),Z^=Wt(ae+Y|0,7),G^=Wt(Z+ae|0,9),Y^=Wt(G+Z|0,13),ae^=Wt(Y+G|0,18),U^=Wt(O+Z|0,7),I^=Wt(U+O|0,9),Z^=Wt(I+U|0,13),O^=Wt(Z+I|0,18),D^=Wt(P+W|0,7),G^=Wt(D+P|0,9),W^=Wt(G+D|0,13),P^=Wt(W+G|0,18),Y^=Wt(Q+L|0,7),q^=Wt(Y+Q|0,9),L^=Wt(q+Y|0,13),Q^=Wt(L+q|0,18),re^=Wt(ae+ee|0,7),de^=Wt(re+ae|0,9),ee^=Wt(de+re|0,13),ae^=Wt(ee+de|0,18);i[s++]=o+O|0,i[s++]=a+U|0,i[s++]=c+I|0,i[s++]=l+Z|0,i[s++]=u+W|0,i[s++]=d+P|0,i[s++]=h+D|0,i[s++]=f+G|0,i[s++]=p+q|0,i[s++]=v+L|0,i[s++]=m+Q|0,i[s++]=w+Y|0,i[s++]=_+re|0,i[s++]=S+de|0,i[s++]=T+ee|0,i[s++]=x+ae|0}function Dl(t,e,r,n,i){let s=n+0,o=n+16*i;for(let a=0;a<16;a++)r[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a<i;a++,s+=16,e+=16)I8(r,o,t,e,r,s),a>0&&(o+=16),I8(r,s,t,e+=16,r,o)}function O8(t,e,r){const n=K6({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:o,dkLen:a,asyncTick:c,maxmem:l,onProgress:u}=n;if($n(i),$n(s),$n(o),$n(a),$n(c),$n(l),u!==void 0&&typeof u!="function")throw new Error("progressCb should be function");const d=128*s,h=d/4;if(i<=1||i&i-1||i>=2**(d/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/d)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const f=d*(i+o);if(f>l)throw new Error(`Scrypt: parameters too large, ${f} (128 * r * (N + p)) > ${l} (maxmem)`);const p=mv(Ll,t,e,{c:1,dkLen:d*o}),v=_p(p),m=_p(new Uint8Array(d*i)),w=_p(new Uint8Array(d));let _=()=>{};if(u){const S=2*i*o,T=Math.max(Math.floor(S/1e4),1);let x=0;_=()=>{x++,u&&(!(x%T)||x===S)&&u(x/S)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:h,V:m,B32:v,B:p,tmp:w,blockMixCb:_,asyncTick:c}}function U8(t,e,r,n,i){const s=mv(Ll,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function sI(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:c,B32:l,B:u,tmp:d,blockMixCb:h}=O8(t,e,r);for(let f=0;f<s;f++){const p=a*f;for(let v=0;v<a;v++)c[v]=l[p+v];for(let v=0,m=0;v<n-1;v++)Dl(c,m,c,m+=a,i),h();Dl(c,(n-1)*a,l,p,i),h();for(let v=0;v<n;v++){const m=l[p+a-16]%n;for(let w=0;w<a;w++)d[w]=l[p+w]^c[m*a+w];Dl(d,0,l,p,i),h()}}return U8(t,o,u,c,d)}async function oI(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:c,B32:l,B:u,tmp:d,blockMixCb:h,asyncTick:f}=O8(t,e,r);for(let p=0;p<s;p++){const v=a*p;for(let w=0;w<a;w++)c[w]=l[v+w];let m=0;await X6(n-1,f,()=>{Dl(c,m,c,m+=a,i),h()}),Dl(c,(n-1)*a,l,v,i),h(),await X6(n,f,()=>{const w=l[v+a-16]%n;for(let _=0;_<a;_++)d[_]=l[v+_]^c[w*a+_];Dl(d,0,l,v,i),h()})}return U8(t,o,u,c,d)}let M8=!1,P8=!1;const V8=async function(t,e,r,n,i,s,o){return await oI(t,e,{N:r,r:n,p:i,dkLen:s,onProgress:o})},F8=function(t,e,r,n,i,s){return sI(t,e,{N:r,r:n,p:i,dkLen:s})};let L8=V8,D8=F8;async function Qs(t,e,r,n,i,s,o){const a=Ne(t,"passwd"),c=Ne(e,"salt");return Ee(await L8(a,c,r,n,i,s,o))}Qs._=V8,Qs.lock=function(){P8=!0},Qs.register=function(t){if(P8)throw new Error("scrypt is locked");L8=t},Object.freeze(Qs);function Js(t,e,r,n,i,s){const o=Ne(t,"passwd"),a=Ne(e,"salt");return Ee(D8(o,a,r,n,i,s))}Js._=F8,Js.lock=function(){M8=!0},Js.register=function(t){if(M8)throw new Error("scryptSync is locked");D8=t},Object.freeze(Js);const W8=function(t){return c8("sha256").update(t).digest()},Z8=function(t){return c8("sha512").update(t).digest()};let z8=W8,G8=Z8,H8=!1,j8=!1;function vn(t){const e=Ne(t,"data");return Ee(z8(e))}vn._=W8,vn.lock=function(){H8=!0},vn.register=function(t){if(H8)throw new Error("sha256 is locked");z8=t},Object.freeze(vn);function Wl(t){const e=Ne(t,"data");return Ee(G8(e))}Wl._=Z8,Wl.lock=function(){j8=!0},Wl.register=function(t){if(j8)throw new Error("sha512 is locked");G8=t},Object.freeze(vn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Q8=BigInt(0),Np=BigInt(1),aI=BigInt(2),xp=t=>t instanceof Uint8Array,cI=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Zl(t){if(!xp(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=cI[t[r]];return e}function J8(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function _v(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function zl(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let n=0;n<r.length;n++){const i=n*2,s=t.slice(i,i+2),o=Number.parseInt(s,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[n]=o}return r}function Xa(t){return _v(Zl(t))}function Ev(t){if(!xp(t))throw new Error("Uint8Array expected");return _v(Zl(Uint8Array.from(t).reverse()))}function Gl(t,e){return zl(t.toString(16).padStart(e*2,"0"))}function Cv(t,e){return Gl(t,e).reverse()}function lI(t){return zl(J8(t))}function Vi(t,e,r){let n;if(typeof e=="string")try{n=zl(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(xp(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function wh(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!xp(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function uI(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function dI(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function hI(t){let e;for(e=0;t>Q8;t>>=Np,e+=1);return e}function fI(t,e){return t>>BigInt(e)&Np}const pI=(t,e,r)=>t|(r?Np:Q8)<<BigInt(e),Sv=t=>(aI<<BigInt(t-1))-Np,Av=t=>new Uint8Array(t),$8=t=>Uint8Array.from(t);function Y8(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Av(t),i=Av(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...u)=>r(i,n,...u),c=(u=Av())=>{i=a($8([0]),u),n=a(),u.length!==0&&(i=a($8([1]),u),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const d=[];for(;u<e;){n=a();const h=n.slice();d.push(h),u+=n.length}return wh(...d)};return(u,d)=>{o(),c(u);let h;for(;!(h=d(l()));)c();return o(),h}}const mI={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function bh(t,e,r={}){const n=(i,s,o)=>{const a=mI[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const gI=Object.freeze(Object.defineProperty({__proto__:null,bitGet:fI,bitLen:hI,bitMask:Sv,bitSet:pI,bytesToHex:Zl,bytesToNumberBE:Xa,bytesToNumberLE:Ev,concatBytes:wh,createHmacDrbg:Y8,ensureBytes:Vi,equalBytes:uI,hexToBytes:zl,hexToNumber:_v,numberToBytesBE:Gl,numberToBytesLE:Cv,numberToHexUnpadded:J8,numberToVarBytesBE:lI,utf8ToBytes:dI,validateObject:bh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Kr=BigInt(0),Nr=BigInt(1),Ka=BigInt(2),vI=BigInt(3),Rv=BigInt(4),X8=BigInt(5),K8=BigInt(8);BigInt(9),BigInt(16);function Mn(t,e){const r=t%e;return r>=Kr?r:e+r}function yI(t,e,r){if(r<=Kr||e<Kr)throw new Error("Expected power/modulo > 0");if(r===Nr)return Kr;let n=Nr;for(;e>Kr;)e&Nr&&(n=n*t%r),t=t*t%r,e>>=Nr;return n}function hi(t,e,r){let n=t;for(;e-- >Kr;)n*=n,n%=r;return n}function Tv(t,e){if(t===Kr||e<=Kr)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Mn(t,e),n=e,i=Kr,s=Nr;for(;r!==Kr;){const o=n/r,a=n%r,c=i-s*o;n=r,r=a,i=s,s=c}if(n!==Nr)throw new Error("invert: does not exist");return Mn(i,e)}function wI(t){const e=(t-Nr)/Ka;let r,n,i;for(r=t-Nr,n=0;r%Ka===Kr;r/=Ka,n++);for(i=Ka;i<t&&yI(i,e,t)!==t-Nr;i++);if(n===1){const o=(t+Nr)/Rv;return function(a,c){const l=a.pow(c,o);if(!a.eql(a.sqr(l),c))throw new Error("Cannot find square root");return l}}const s=(r+Nr)/Ka;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=n,l=o.pow(o.mul(o.ONE,i),r),u=o.pow(a,s),d=o.pow(a,r);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let h=1;for(let p=o.sqr(d);h<c&&!o.eql(p,o.ONE);h++)p=o.sqr(p);const f=o.pow(l,Nr<<BigInt(c-h-1));l=o.sqr(f),u=o.mul(u,f),d=o.mul(d,l),c=h}return u}}function bI(t){if(t%Rv===vI){const e=(t+Nr)/Rv;return function(r,n){const i=r.pow(n,e);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(t%K8===X8){const e=(t-X8)/K8;return function(r,n){const i=r.mul(n,Ka),s=r.pow(i,e),o=r.mul(n,s),a=r.mul(r.mul(o,Ka),s),c=r.mul(o,r.sub(a,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return wI(t)}const kI=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function _I(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=kI.reduce((n,i)=>(n[i]="function",n),e);return bh(t,r)}function EI(t,e,r){if(r<Kr)throw new Error("Expected power > 0");if(r===Kr)return t.ONE;if(r===Nr)return e;let n=t.ONE,i=e;for(;r>Kr;)r&Nr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Nr;return n}function CI(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function q8(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function SI(t,e,r=!1,n={}){if(t<=Kr)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=q8(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=bI(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:Sv(i),ZERO:Kr,ONE:Nr,create:c=>Mn(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Kr<=c&&c<t},is0:c=>c===Kr,isOdd:c=>(c&Nr)===Nr,neg:c=>Mn(-c,t),eql:(c,l)=>c===l,sqr:c=>Mn(c*c,t),add:(c,l)=>Mn(c+l,t),sub:(c,l)=>Mn(c-l,t),mul:(c,l)=>Mn(c*l,t),pow:(c,l)=>EI(a,c,l),div:(c,l)=>Mn(c*Tv(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Tv(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>CI(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>r?Cv(c,s):Gl(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?Ev(c):Xa(c)}});return Object.freeze(a)}function e9(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function t9(t){const e=e9(t);return e+Math.ceil(e/2)}function AI(t,e,r=!1){const n=t.length,i=e9(e),s=t9(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?Xa(t):Ev(t),a=Mn(o,e-Nr)+Nr;return r?Cv(a,i):Gl(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const RI=BigInt(0),Nv=BigInt(1);function TI(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>RI;)s&Nv&&(o=o.add(a)),a=a.double(),s>>=Nv;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let l=i,u=l;for(let d=0;d<o;d++){u=l,c.push(u);for(let h=1;h<a;h++)u=u.add(l),c.push(u);l=u.double()}return c},wNAF(i,s,o){const{windows:a,windowSize:c}=n(i);let l=t.ZERO,u=t.BASE;const d=BigInt(2**i-1),h=2**i,f=BigInt(i);for(let p=0;p<a;p++){const v=p*c;let m=Number(o&d);o>>=f,m>c&&(m-=h,o+=Nv);const w=v,_=v+Math.abs(m)-1,S=p%2!==0,T=m<0;m===0?u=u.add(r(S,s[w])):l=l.add(r(T,s[_]))}return{p:l,f:u}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let l=s.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&s.set(i,a(l))),this.wNAF(c,l,o)}}}function r9(t){return _I(t.Fp),bh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...q8(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function NI(t){const e=r9(t);bh(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:xI,hexToBytes:BI}=gI,qa={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(t){const{Err:e}=qa;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:xI(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=qa,r=typeof t=="string"?BI(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=qa._parseInt(r.subarray(2)),{d:o,l:a}=qa._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,r=l=>{const u=l.toString(16);return u.length&1?`0${u}`:u},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},$s=BigInt(0),fi=BigInt(1);BigInt(2);const n9=BigInt(3);BigInt(4);function II(t){const e=NI(t),{Fp:r}=e,n=e.toBytes||((p,v,m)=>{const w=v.toAffine();return wh(Uint8Array.from([4]),r.toBytes(w.x),r.toBytes(w.y))}),i=e.fromBytes||(p=>{const v=p.subarray(1),m=r.fromBytes(v.subarray(0,r.BYTES)),w=r.fromBytes(v.subarray(r.BYTES,2*r.BYTES));return{x:m,y:w}});function s(p){const{a:v,b:m}=e,w=r.sqr(p),_=r.mul(w,p);return r.add(r.add(_,r.mul(p,v)),m)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(p){return typeof p=="bigint"&&$s<p&&p<e.n}function a(p){if(!o(p))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(p){const{allowedPrivateKeyLengths:v,nByteLength:m,wrapPrivateKey:w,n:_}=e;if(v&&typeof p!="bigint"){if(p instanceof Uint8Array&&(p=Zl(p)),typeof p!="string"||!v.includes(p.length))throw new Error("Invalid key");p=p.padStart(m*2,"0")}let S;try{S=typeof p=="bigint"?p:Xa(Vi("private key",p,m))}catch{throw new Error(`private key must be ${m} bytes, hex or bigint, not ${typeof p}`)}return w&&(S=Mn(S,_)),a(S),S}const l=new Map;function u(p){if(!(p instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(v,m,w){if(this.px=v,this.py=m,this.pz=w,v==null||!r.isValid(v))throw new Error("x required");if(m==null||!r.isValid(m))throw new Error("y required");if(w==null||!r.isValid(w))throw new Error("z required")}static fromAffine(v){const{x:m,y:w}=v||{};if(!v||!r.isValid(m)||!r.isValid(w))throw new Error("invalid affine point");if(v instanceof d)throw new Error("projective point not allowed");const _=S=>r.eql(S,r.ZERO);return _(m)&&_(w)?d.ZERO:new d(m,w,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(v){const m=r.invertBatch(v.map(w=>w.pz));return v.map((w,_)=>w.toAffine(m[_])).map(d.fromAffine)}static fromHex(v){const m=d.fromAffine(i(Vi("pointHex",v)));return m.assertValidity(),m}static fromPrivateKey(v){return d.BASE.multiply(c(v))}_setWindowSize(v){this._WINDOW_SIZE=v,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:v,y:m}=this.toAffine();if(!r.isValid(v)||!r.isValid(m))throw new Error("bad point: x or y not FE");const w=r.sqr(m),_=s(v);if(!r.eql(w,_))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:v}=this.toAffine();if(r.isOdd)return!r.isOdd(v);throw new Error("Field doesn't support isOdd")}equals(v){u(v);const{px:m,py:w,pz:_}=this,{px:S,py:T,pz:x}=v,O=r.eql(r.mul(m,x),r.mul(S,_)),U=r.eql(r.mul(w,x),r.mul(T,_));return O&&U}negate(){return new d(this.px,r.neg(this.py),this.pz)}double(){const{a:v,b:m}=e,w=r.mul(m,n9),{px:_,py:S,pz:T}=this;let x=r.ZERO,O=r.ZERO,U=r.ZERO,I=r.mul(_,_),Z=r.mul(S,S),W=r.mul(T,T),P=r.mul(_,S);return P=r.add(P,P),U=r.mul(_,T),U=r.add(U,U),x=r.mul(v,U),O=r.mul(w,W),O=r.add(x,O),x=r.sub(Z,O),O=r.add(Z,O),O=r.mul(x,O),x=r.mul(P,x),U=r.mul(w,U),W=r.mul(v,W),P=r.sub(I,W),P=r.mul(v,P),P=r.add(P,U),U=r.add(I,I),I=r.add(U,I),I=r.add(I,W),I=r.mul(I,P),O=r.add(O,I),W=r.mul(S,T),W=r.add(W,W),I=r.mul(W,P),x=r.sub(x,I),U=r.mul(W,Z),U=r.add(U,U),U=r.add(U,U),new d(x,O,U)}add(v){u(v);const{px:m,py:w,pz:_}=this,{px:S,py:T,pz:x}=v;let O=r.ZERO,U=r.ZERO,I=r.ZERO;const Z=e.a,W=r.mul(e.b,n9);let P=r.mul(m,S),D=r.mul(w,T),G=r.mul(_,x),q=r.add(m,w),L=r.add(S,T);q=r.mul(q,L),L=r.add(P,D),q=r.sub(q,L),L=r.add(m,_);let Q=r.add(S,x);return L=r.mul(L,Q),Q=r.add(P,G),L=r.sub(L,Q),Q=r.add(w,_),O=r.add(T,x),Q=r.mul(Q,O),O=r.add(D,G),Q=r.sub(Q,O),I=r.mul(Z,L),O=r.mul(W,G),I=r.add(O,I),O=r.sub(D,I),I=r.add(D,I),U=r.mul(O,I),D=r.add(P,P),D=r.add(D,P),G=r.mul(Z,G),L=r.mul(W,L),D=r.add(D,G),G=r.sub(P,G),G=r.mul(Z,G),L=r.add(L,G),P=r.mul(D,L),U=r.add(U,P),P=r.mul(Q,L),O=r.mul(q,O),O=r.sub(O,P),P=r.mul(q,D),I=r.mul(Q,I),I=r.add(I,P),new d(O,U,I)}subtract(v){return this.add(v.negate())}is0(){return this.equals(d.ZERO)}wNAF(v){return f.wNAFCached(this,l,v,m=>{const w=r.invertBatch(m.map(_=>_.pz));return m.map((_,S)=>_.toAffine(w[S])).map(d.fromAffine)})}multiplyUnsafe(v){const m=d.ZERO;if(v===$s)return m;if(a(v),v===fi)return this;const{endo:w}=e;if(!w)return f.unsafeLadder(this,v);let{k1neg:_,k1:S,k2neg:T,k2:x}=w.splitScalar(v),O=m,U=m,I=this;for(;S>$s||x>$s;)S&fi&&(O=O.add(I)),x&fi&&(U=U.add(I)),I=I.double(),S>>=fi,x>>=fi;return _&&(O=O.negate()),T&&(U=U.negate()),U=new d(r.mul(U.px,w.beta),U.py,U.pz),O.add(U)}multiply(v){a(v);let m=v,w,_;const{endo:S}=e;if(S){const{k1neg:T,k1:x,k2neg:O,k2:U}=S.splitScalar(m);let{p:I,f:Z}=this.wNAF(x),{p:W,f:P}=this.wNAF(U);I=f.constTimeNegate(T,I),W=f.constTimeNegate(O,W),W=new d(r.mul(W.px,S.beta),W.py,W.pz),w=I.add(W),_=Z.add(P)}else{const{p:T,f:x}=this.wNAF(m);w=T,_=x}return d.normalizeZ([w,_])[0]}multiplyAndAddUnsafe(v,m,w){const _=d.BASE,S=(x,O)=>O===$s||O===fi||!x.equals(_)?x.multiplyUnsafe(O):x.multiply(O),T=S(this,m).add(S(v,w));return T.is0()?void 0:T}toAffine(v){const{px:m,py:w,pz:_}=this,S=this.is0();v==null&&(v=S?r.ONE:r.inv(_));const T=r.mul(m,v),x=r.mul(w,v),O=r.mul(_,v);if(S)return{x:r.ZERO,y:r.ZERO};if(!r.eql(O,r.ONE))throw new Error("invZ was invalid");return{x:T,y:x}}isTorsionFree(){const{h:v,isTorsionFree:m}=e;if(v===fi)return!0;if(m)return m(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:v,clearCofactor:m}=e;return v===fi?this:m?m(d,this):this.multiplyUnsafe(e.h)}toRawBytes(v=!0){return this.assertValidity(),n(d,this,v)}toHex(v=!0){return Zl(this.toRawBytes(v))}}d.BASE=new d(e.Gx,e.Gy,r.ONE),d.ZERO=new d(r.ZERO,r.ONE,r.ZERO);const h=e.nBitLength,f=TI(d,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function OI(t){const e=r9(t);return bh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function UI(t){const e=OI(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(L){return $s<L&&L<r.ORDER}function a(L){return Mn(L,n)}function c(L){return Tv(L,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:h}=II({...e,toBytes(L,Q,Y){const re=Q.toAffine(),de=r.toBytes(re.x),ee=wh;return Y?ee(Uint8Array.from([Q.hasEvenY()?2:3]),de):ee(Uint8Array.from([4]),de,r.toBytes(re.y))},fromBytes(L){const Q=L.length,Y=L[0],re=L.subarray(1);if(Q===i&&(Y===2||Y===3)){const de=Xa(re);if(!o(de))throw new Error("Point is not on curve");const ee=d(de);let ae=r.sqrt(ee);const Se=(ae&fi)===fi;return(Y&1)===1!==Se&&(ae=r.neg(ae)),{x:de,y:ae}}else if(Q===s&&Y===4){const de=r.fromBytes(re.subarray(0,r.BYTES)),ee=r.fromBytes(re.subarray(r.BYTES,2*r.BYTES));return{x:de,y:ee}}else throw new Error(`Point of length ${Q} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),f=L=>Zl(Gl(L,e.nByteLength));function p(L){const Q=n>>fi;return L>Q}function v(L){return p(L)?a(-L):L}const m=(L,Q,Y)=>Xa(L.slice(Q,Y));class w{constructor(Q,Y,re){this.r=Q,this.s=Y,this.recovery=re,this.assertValidity()}static fromCompact(Q){const Y=e.nByteLength;return Q=Vi("compactSignature",Q,Y*2),new w(m(Q,0,Y),m(Q,Y,2*Y))}static fromDER(Q){const{r:Y,s:re}=qa.toSig(Vi("DER",Q));return new w(Y,re)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Q){return new w(this.r,this.s,Q)}recoverPublicKey(Q){const{r:Y,s:re,recovery:de}=this,ee=U(Vi("msgHash",Q));if(de==null||![0,1,2,3].includes(de))throw new Error("recovery id invalid");const ae=de===2||de===3?Y+e.n:Y;if(ae>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const Se=de&1?"03":"02",ke=l.fromHex(Se+f(ae)),Re=c(ae),_e=a(-ee*Re),we=a(re*Re),Je=l.BASE.multiplyAndAddUnsafe(ke,_e,we);if(!Je)throw new Error("point at infinify");return Je.assertValidity(),Je}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new w(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return zl(this.toDERHex())}toDERHex(){return qa.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return zl(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const _={isValidPrivateKey(L){try{return u(L),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const L=t9(e.n);return AI(e.randomBytes(L),e.n)},precompute(L=8,Q=l.BASE){return Q._setWindowSize(L),Q.multiply(BigInt(3)),Q}};function S(L,Q=!0){return l.fromPrivateKey(L).toRawBytes(Q)}function T(L){const Q=L instanceof Uint8Array,Y=typeof L=="string",re=(Q||Y)&&L.length;return Q?re===i||re===s:Y?re===2*i||re===2*s:L instanceof l}function x(L,Q,Y=!0){if(T(L))throw new Error("first arg must be private key");if(!T(Q))throw new Error("second arg must be public key");return l.fromHex(Q).multiply(u(L)).toRawBytes(Y)}const O=e.bits2int||function(L){const Q=Xa(L),Y=L.length*8-e.nBitLength;return Y>0?Q>>BigInt(Y):Q},U=e.bits2int_modN||function(L){return a(O(L))},I=Sv(e.nBitLength);function Z(L){if(typeof L!="bigint")throw new Error("bigint expected");if(!($s<=L&&L<I))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Gl(L,e.nByteLength)}function W(L,Q,Y=P){if(["recovered","canonical"].some(Ve=>Ve in Y))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:de}=e;let{lowS:ee,prehash:ae,extraEntropy:Se}=Y;ee==null&&(ee=!0),L=Vi("msgHash",L),ae&&(L=Vi("prehashed msgHash",re(L)));const ke=U(L),Re=u(Q),_e=[Z(Re),Z(ke)];if(Se!=null){const Ve=Se===!0?de(r.BYTES):Se;_e.push(Vi("extraEntropy",Ve))}const we=wh(..._e),Je=ke;function Ue(Ve){const Xe=O(Ve);if(!h(Xe))return;const rt=c(Xe),ct=l.BASE.multiply(Xe).toAffine(),ut=a(ct.x);if(ut===$s)return;const lt=a(rt*a(Je+ut*Re));if(lt===$s)return;let Ct=(ct.x===ut?0:2)|Number(ct.y&fi),Ht=lt;return ee&&p(lt)&&(Ht=v(lt),Ct^=1),new w(ut,Ht,Ct)}return{seed:we,k2sig:Ue}}const P={lowS:e.lowS,prehash:!1},D={lowS:e.lowS,prehash:!1};function G(L,Q,Y=P){const{seed:re,k2sig:de}=W(L,Q,Y),ee=e;return Y8(ee.hash.outputLen,ee.nByteLength,ee.hmac)(re,de)}l.BASE._setWindowSize(8);function q(L,Q,Y,re=D){var de;const ee=L;if(Q=Vi("msgHash",Q),Y=Vi("publicKey",Y),"strict"in re)throw new Error("options.strict was renamed to lowS");const{lowS:ae,prehash:Se}=re;let ke,Re;try{if(typeof ee=="string"||ee instanceof Uint8Array)try{ke=w.fromDER(ee)}catch(ct){if(!(ct instanceof qa.Err))throw ct;ke=w.fromCompact(ee)}else if(typeof ee=="object"&&typeof ee.r=="bigint"&&typeof ee.s=="bigint"){const{r:ct,s:ut}=ee;ke=new w(ct,ut)}else throw new Error("PARSE");Re=l.fromHex(Y)}catch(ct){if(ct.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(ae&&ke.hasHighS())return!1;Se&&(Q=e.hash(Q));const{r:_e,s:we}=ke,Je=U(Q),Ue=c(we),Ve=a(Je*Ue),Xe=a(_e*Ue),rt=(de=l.BASE.multiplyAndAddUnsafe(Re,Ve,Xe))==null?void 0:de.toAffine();return rt?a(rt.x)===_e:!1}return{CURVE:e,getPublicKey:S,getSharedSecret:x,sign:G,verify:q,ProjectivePoint:l,Signature:w,utils:_}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function MI(t){return{hash:t,hmac:(e,...r)=>Sp(t,e,cB(...r)),randomBytes:uB}}function PI(t,e){const r=n=>UI({...t,...MI(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i9=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),s9=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),VI=BigInt(1),xv=BigInt(2),o9=(t,e)=>(t+e/xv)/e;function FI(t){const e=i9,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,d=hi(u,r,e)*u%e,h=hi(d,r,e)*u%e,f=hi(h,xv,e)*l%e,p=hi(f,i,e)*f%e,v=hi(p,s,e)*p%e,m=hi(v,a,e)*v%e,w=hi(m,c,e)*m%e,_=hi(w,a,e)*v%e,S=hi(_,r,e)*u%e,T=hi(S,o,e)*p%e,x=hi(T,n,e)*l%e,O=hi(x,xv,e);if(!Bv.eql(Bv.sqr(O),t))throw new Error("Cannot find square root");return O}const Bv=SI(i9,void 0,void 0,{sqrt:FI}),Yo=PI({a:BigInt(0),b:BigInt(7),Fp:Bv,n:s9,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=s9,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-VI*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=o9(s*t,e),c=o9(-n*t,e);let l=Mn(t-a*r-c*i,e),u=Mn(-a*n-c*s,e);const d=l>o,h=u>o;if(d&&(l=e-l),h&&(u=e-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},Ll);BigInt(0),Yo.ProjectivePoint;const ec="0x0000000000000000000000000000000000000000",Bp="0x0000000000000000000000000000000000000000000000000000000000000000",a9=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),c9=BigInt("1000000000000000000"),l9=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),u9=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),d9=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),h9="Ξ",Iv=`Ethereum Signed Message:
4
4
  `,f9=BigInt(0),p9=BigInt(1),m9=BigInt(2),g9=BigInt(27),v9=BigInt(28),Ip=BigInt(35),Hl={};function y9(t){return ci(Hr(t),32)}var kh,_h,Eh,jl;const LI=class Bs{constructor(e,r,n,i){K(this,kh),K(this,_h),K(this,Eh),K(this,jl),ss(e,Hl,"Signature"),M(this,kh,r),M(this,_h,n),M(this,Eh,i),M(this,jl,null)}get r(){return A(this,kh)}set r(e){F(Vs(e)===32,"invalid r","value",e),M(this,kh,Ee(e))}get s(){return A(this,_h)}set s(e){F(Vs(e)===32,"invalid s","value",e);const r=Ee(e);F(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),M(this,_h,r)}get v(){return A(this,Eh)}set v(e){const r=qe(e,"value");F(r===27||r===28,"invalid v","v",e),M(this,Eh,r)}get networkV(){return A(this,jl)}get legacyChainId(){const e=this.networkV;return e==null?null:Bs.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Ne(this.s);return this.yParity&&(e[0]|=128),Ee(e)}get compactSerialized(){return Tt([this.r,this.yParityAndS])}get serialized(){return Tt([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Bs(Hl,this.r,this.s,this.v);return this.networkV&&M(e,jl,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=We(e,"v");return r==g9||r==v9?f9:(F(r>=Ip,"invalid EIP-155 v","v",e),(r-Ip)/m9)}static getChainIdV(e,r){return We(e)*m9+BigInt(35+r-27)}static getNormalizedV(e){const r=We(e);return r===f9||r===g9?27:r===p9||r===v9?28:(F(r>=Ip,"invalid v","v",e),r&p9?27:28)}static from(e){function r(l,u){F(l,u,"signature",e)}if(e==null)return new Bs(Hl,Bp,Bp,27);if(typeof e=="string"){const l=Ne(e,"signature");if(l.length===64){const u=Ee(l.slice(0,32)),d=l.slice(32,64),h=d[0]&128?28:27;return d[0]&=127,new Bs(Hl,u,Ee(d),h)}if(l.length===65){const u=Ee(l.slice(0,32)),d=l.slice(32,64);r((d[0]&128)===0,"non-canonical s");const h=Bs.getNormalizedV(l[64]);return new Bs(Hl,u,Ee(d),h)}r(!1,"invalid raw signature length")}if(e instanceof Bs)return e.clone();const n=e.r;r(n!=null,"missing r");const i=y9(n),s=function(l,u){if(l!=null)return y9(l);if(u!=null){r(er(u,32),"invalid yParityAndS");const d=Ne(u);return d[0]&=127,Ee(d)}r(!1,"missing s")}(e.s,e.yParityAndS);r((Ne(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(l,u,d){if(l!=null){const h=We(l);return{networkV:h>=Ip?h:void 0,v:Bs.getNormalizedV(h)}}if(u!=null)return r(er(u,32),"invalid yParityAndS"),{v:Ne(u)[0]&128?28:27};if(d!=null){switch(qe(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Bs(Hl,i,s,a);return o&&M(c,jl,o),r(e.yParity==null||qe(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};kh=new WeakMap,_h=new WeakMap,Eh=new WeakMap,jl=new WeakMap;let Fi=LI;var Xo;const DI=class Pd{constructor(e){K(this,Xo),F(Vs(e)===32,"invalid private key","privateKey","[REDACTED]"),M(this,Xo,Ee(e))}get privateKey(){return A(this,Xo)}get publicKey(){return Pd.computePublicKey(A(this,Xo))}get compressedPublicKey(){return Pd.computePublicKey(A(this,Xo),!0)}sign(e){F(Vs(e)===32,"invalid digest length","digest",e);const r=Yo.sign(Gr(e),Gr(A(this,Xo)),{lowS:!0});return Fi.from({r:li(r.r,32),s:li(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Pd.computePublicKey(e);return Ee(Yo.getSharedSecret(Gr(A(this,Xo)),Ne(r),!1))}static computePublicKey(e,r){let n=Ne(e,"key");if(n.length===32){const s=Yo.getPublicKey(n,!!r);return Ee(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=Yo.ProjectivePoint.fromHex(n);return Ee(i.toRawBytes(r))}static recoverPublicKey(e,r){F(Vs(e)===32,"invalid digest length","digest",e);const n=Fi.from(r);let i=Yo.Signature.fromCompact(Gr(Tt([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Gr(e));return F(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=Yo.ProjectivePoint.fromHex(Pd.computePublicKey(e).substring(2)),s=Yo.ProjectivePoint.fromHex(Pd.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};Xo=new WeakMap;let us=DI;function w9(){Hs.lock(),rr.lock(),Pi.lock(),Yn.lock(),js.lock(),Qs.lock(),Js.lock(),vn.lock(),Wl.lock(),Yn.lock()}const WI=BigInt(0),ZI=BigInt(36);function b9(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Ne(rr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Ov={};for(let t=0;t<10;t++)Ov[String(t)]=String(t);for(let t=0;t<26;t++)Ov[String.fromCharCode(65+t)]=String(10+t);const k9=15;function _9(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Ov[n]).join("");for(;e.length>=k9;){let n=e.substring(0,k9);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const zI=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function GI(t){t=t.toLowerCase();let e=WI;for(let r=0;r<t.length;r++)e=e*ZI+zI[t[r]];return e}function wt(t){if(F(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=b9(t);return F(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){F(t.substring(2,4)===_9(t),"bad icap checksum","address",t);let e=GI(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return b9("0x"+e)}F(!1,"invalid address","address",t)}function E9(t){let e=BigInt(wt(t)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+_9("XE00"+e)+e}function Op(t){const e=wt(t.from);let r=We(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,wt(tr(rr(zs([e,r])),12))}function C9(t,e,r){const n=wt(t),i=Ne(e,"salt"),s=Ne(r,"initCodeHash");return F(i.length===32,"salt must be 32 bytes","salt",e),F(s.length===32,"initCodeHash must be 32 bytes","initCodeHash",r),wt(tr(rr(Tt(["0xff",n,i,s])),12))}function Up(t){return t&&typeof t.getAddress=="function"}function S9(t){try{return wt(t),!0}catch{}return!1}async function Uv(t,e){const r=await e;return(r==null||r==="0x0000000000000000000000000000000000000000")&&(oe(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),F(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),wt(r)}function jr(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?wt(t):(oe(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Uv(t,e.resolveName(t)));if(Up(t))return Uv(t,t.getAddress());if(t&&typeof t.then=="function")return Uv(t,t);F(!1,"unsupported addressable value","target",t)}const Ys={};function Fe(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new yn(Ys,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function Zt(t,e){return new yn(Ys,`bytes${e||""}`,t,{size:e})}const A9=Symbol.for("_ethers_typed");var Ql;const HI=class Va{constructor(e,r,n,i){H(this,"type"),H(this,"value"),K(this,Ql),H(this,"_typedSymbol"),i==null&&(i=null),ss(Ys,e,"Typed"),Me(this,{_typedSymbol:A9,type:r,value:n}),M(this,Ql,i),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return A(this,Ql)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return A(this,Ql)===!0?-1:A(this,Ql)===!1?this.value.length:null}static from(e,r){return new Va(Ys,e,r)}static uint8(e){return Fe(e,8)}static uint16(e){return Fe(e,16)}static uint24(e){return Fe(e,24)}static uint32(e){return Fe(e,32)}static uint40(e){return Fe(e,40)}static uint48(e){return Fe(e,48)}static uint56(e){return Fe(e,56)}static uint64(e){return Fe(e,64)}static uint72(e){return Fe(e,72)}static uint80(e){return Fe(e,80)}static uint88(e){return Fe(e,88)}static uint96(e){return Fe(e,96)}static uint104(e){return Fe(e,104)}static uint112(e){return Fe(e,112)}static uint120(e){return Fe(e,120)}static uint128(e){return Fe(e,128)}static uint136(e){return Fe(e,136)}static uint144(e){return Fe(e,144)}static uint152(e){return Fe(e,152)}static uint160(e){return Fe(e,160)}static uint168(e){return Fe(e,168)}static uint176(e){return Fe(e,176)}static uint184(e){return Fe(e,184)}static uint192(e){return Fe(e,192)}static uint200(e){return Fe(e,200)}static uint208(e){return Fe(e,208)}static uint216(e){return Fe(e,216)}static uint224(e){return Fe(e,224)}static uint232(e){return Fe(e,232)}static uint240(e){return Fe(e,240)}static uint248(e){return Fe(e,248)}static uint256(e){return Fe(e,256)}static uint(e){return Fe(e,256)}static int8(e){return Fe(e,-8)}static int16(e){return Fe(e,-16)}static int24(e){return Fe(e,-24)}static int32(e){return Fe(e,-32)}static int40(e){return Fe(e,-40)}static int48(e){return Fe(e,-48)}static int56(e){return Fe(e,-56)}static int64(e){return Fe(e,-64)}static int72(e){return Fe(e,-72)}static int80(e){return Fe(e,-80)}static int88(e){return Fe(e,-88)}static int96(e){return Fe(e,-96)}static int104(e){return Fe(e,-104)}static int112(e){return Fe(e,-112)}static int120(e){return Fe(e,-120)}static int128(e){return Fe(e,-128)}static int136(e){return Fe(e,-136)}static int144(e){return Fe(e,-144)}static int152(e){return Fe(e,-152)}static int160(e){return Fe(e,-160)}static int168(e){return Fe(e,-168)}static int176(e){return Fe(e,-176)}static int184(e){return Fe(e,-184)}static int192(e){return Fe(e,-192)}static int200(e){return Fe(e,-200)}static int208(e){return Fe(e,-208)}static int216(e){return Fe(e,-216)}static int224(e){return Fe(e,-224)}static int232(e){return Fe(e,-232)}static int240(e){return Fe(e,-240)}static int248(e){return Fe(e,-248)}static int256(e){return Fe(e,-256)}static int(e){return Fe(e,-256)}static bytes1(e){return Zt(e,1)}static bytes2(e){return Zt(e,2)}static bytes3(e){return Zt(e,3)}static bytes4(e){return Zt(e,4)}static bytes5(e){return Zt(e,5)}static bytes6(e){return Zt(e,6)}static bytes7(e){return Zt(e,7)}static bytes8(e){return Zt(e,8)}static bytes9(e){return Zt(e,9)}static bytes10(e){return Zt(e,10)}static bytes11(e){return Zt(e,11)}static bytes12(e){return Zt(e,12)}static bytes13(e){return Zt(e,13)}static bytes14(e){return Zt(e,14)}static bytes15(e){return Zt(e,15)}static bytes16(e){return Zt(e,16)}static bytes17(e){return Zt(e,17)}static bytes18(e){return Zt(e,18)}static bytes19(e){return Zt(e,19)}static bytes20(e){return Zt(e,20)}static bytes21(e){return Zt(e,21)}static bytes22(e){return Zt(e,22)}static bytes23(e){return Zt(e,23)}static bytes24(e){return Zt(e,24)}static bytes25(e){return Zt(e,25)}static bytes26(e){return Zt(e,26)}static bytes27(e){return Zt(e,27)}static bytes28(e){return Zt(e,28)}static bytes29(e){return Zt(e,29)}static bytes30(e){return Zt(e,30)}static bytes31(e){return Zt(e,31)}static bytes32(e){return Zt(e,32)}static address(e){return new Va(Ys,"address",e)}static bool(e){return new Va(Ys,"bool",!!e)}static bytes(e){return new Va(Ys,"bytes",e)}static string(e){return new Va(Ys,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Va(Ys,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===A9}static dereference(e,r){if(Va.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};Ql=new WeakMap;let yn=HI;class jI extends Gs{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=yn.dereference(r,"string");try{n=wt(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return wt(li(e.readValue(),20))}}class QI extends Gs{constructor(e){super(e.name,e.type,"_",e.dynamic),H(this,"coder"),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}function R9(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return oe(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),oe(!c[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:r}),c[u]=!0,r[u]})}else F(!1,"invalid tuple value","tuple",r);F(e.length===n.length,"types/value length mismatch","tuple",r);let i=new uv,s=new uv,o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let d=s.length;c.encode(s,u);let h=i.writeUpdatableValue();o.push(f=>{h(f+d)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function T9(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),c=i.subReader(a);try{o=s.decode(c)}catch(l){if(Tr(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(Tr(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Ml.fromItems(r,n)}class JI extends Gs{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),H(this,"coder"),H(this,"length"),Me(this,{coder:e,length:r})}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(e);return r}encode(e,r){const n=yn.dereference(r,"array");Array.isArray(n)||this._throwError("expected array value",n);let i=this.length;i===-1&&(i=n.length,e.writeValue(n.length)),ap(n.length,i,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let o=0;o<n.length;o++)s.push(this.coder);return R9(e,s,n)}decode(e){let r=this.length;r===-1&&(r=e.readIndex(),oe(r*An<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:r*An,length:e.dataLength}));let n=[];for(let i=0;i<r;i++)n.push(new QI(this.coder));return T9(e,n)}}class $I extends Gs{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){const n=yn.dereference(r,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class N9 extends Gs{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=Gr(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class YI extends N9{constructor(e){super("bytes",e)}decode(e){return Ee(super.decode(e))}}class XI extends Gs{constructor(e,r){let n="bytes"+String(e);super(n,n,r,!1),H(this,"size"),Me(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let n=Gr(yn.dereference(r,this.type));return n.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(n)}decode(e){return Ee(e.readBytes(this.size))}}const KI=new Uint8Array([]);class qI extends Gs{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes(KI)}decode(e){return e.readBytes(0),null}}const eO=BigInt(0),tO=BigInt(1),rO=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class nO extends Gs{constructor(e,r,n){const i=(r?"int":"uint")+e*8;super(i,i,n,!1),H(this,"size"),H(this,"signed"),Me(this,{size:e,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,r){let n=We(yn.dereference(r,this.type)),i=Fs(rO,An*8);if(this.signed){let s=Fs(i,this.size*8-1);(n>s||n<-(s+tO))&&this._throwError("value out-of-bounds",r),n=ih(n,8*An)}else(n<eO||n>Fs(i,this.size*8))&&this._throwError("value out-of-bounds",r);return e.writeValue(n)}decode(e){let r=Fs(e.readValue(),this.size*8);return this.signed&&(r=El(r,this.size*8)),r}}class iO extends N9{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Vr(yn.dereference(r,"string")))}decode(e){return Ds(super.decode(e))}}class Mp extends Gs{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),H(this,"coders"),Me(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){const n=yn.dereference(r,"tuple");return R9(e,this.coders,n)}decode(e){return T9(e,this.coders)}}function Li(t){return rr(Vr(t))}var sO="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const x9=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),B9=4;function oO(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let x=1;x<n;x++)s.push(i+=r());let o=r(),a=e;e+=o;let c=0,l=0;function u(){return c==0&&(l=l<<8|t[e++],c=8),l>>--c&1}const d=31,h=2**d,f=h>>>1,p=f>>1,v=h-1;let m=0;for(let x=0;x<d;x++)m=m<<1|u();let w=[],_=0,S=h;for(;;){let x=Math.floor(((m-_+1)*i-1)/S),O=0,U=n;for(;U-O>1;){let W=O+U>>>1;x<s[W]?U=W:O=W}if(O==0)break;w.push(O);let I=_+Math.floor(S*s[O]/i),Z=_+Math.floor(S*s[O+1]/i)-1;for(;!((I^Z)&f);)m=m<<1&v|u(),I=I<<1&v,Z=Z<<1&v|1;for(;I&~Z&p;)m=m&f|m<<1&v>>>1|u(),I=I<<1^f,Z=(Z^f)<<1|f|1;_=I,S=1+Z-I}let T=n-4;return w.map(x=>{switch(x-T){case 3:return T+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return T+256+(t[a++]<<8|t[a++]);case 1:return T+t[a++];default:return x-1}})}function aO(t){let e=0;return()=>t[e++]}function I9(t){return aO(oO(cO(t)))}function cO(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i<r;i++)a=a<<6|e[t.charCodeAt(i)],o+=6,o>=8&&(n[s++]=a>>(o-=8));return n}function lO(t){return t&1?~t>>1:t>>1}function uO(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=lO(e());return r}function Ch(t,e=0){let r=[];for(;;){let n=t(),i=t();if(!i)break;e+=n;for(let s=0;s<i;s++)r.push(e+s);e+=i+1}return r}function O9(t){return Sh(()=>{let e=Ch(t);if(e.length)return e})}function U9(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(dO(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(hO(r,t))}return e.flat()}function Sh(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function M9(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)uO(t,r).forEach((s,o)=>n[o].push(s));return n}function dO(t,e){let r=1+e(),n=e(),i=Sh(e);return M9(i.length,1+t,e).flatMap((s,o)=>{let[a,...c]=s;return Array(i[o]).fill().map((l,u)=>{let d=u*n;return[a+u*r,c.map(h=>h+d)]})})}function hO(t,e){let r=1+e();return M9(r,1+t,e).map(n=>[n[0],n.slice(1)])}function fO(t){let e=[],r=Ch(t);return i(n([]),[]),e;function n(s){let o=t(),a=Sh(()=>{let c=Ch(t).map(l=>r[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let u of l.Q)i(l,[...a,u],c)}}}function pO(t){return t.toString(16).toUpperCase().padStart(2,"0")}function P9(t){return`{${pO(t)}}`}function mO(t){let e=[];for(let r=0,n=t.length;r<n;){let i=t.codePointAt(r);r+=i<65536?1:2,e.push(i)}return e}function Jl(t){let e=t.length;if(e<4096)return String.fromCodePoint(...t);let r=[];for(let n=0;n<e;)r.push(String.fromCodePoint(...t.slice(n,n+=4096)));return r.join("")}function gO(t,e){let r=t.length,n=r-e.length;for(let i=0;n==0&&i<r;i++)n=t[i]-e[i];return n}var vO="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const Ah=44032,Pp=4352,Vp=4449,Fp=4519,V9=19,F9=21,$l=28,Lp=F9*$l,yO=V9*Lp,wO=Ah+yO,bO=Pp+V9,kO=Vp+F9,_O=Fp+$l;function Rh(t){return t>>24&255}function L9(t){return t&16777215}let Mv,D9,Pv,Dp;function EO(){let t=I9(vO);Mv=new Map(O9(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),D9=new Set(Ch(t)),Pv=new Map,Dp=new Map;for(let[e,r]of U9(t)){if(!D9.has(e)&&r.length==2){let[n,i]=r,s=Dp.get(n);s||(s=new Map,Dp.set(n,s)),s.set(i,e)}Pv.set(e,r.reverse())}}function W9(t){return t>=Ah&&t<wO}function CO(t,e){if(t>=Pp&&t<bO&&e>=Vp&&e<kO)return Ah+(t-Pp)*Lp+(e-Vp)*$l;if(W9(t)&&e>Fp&&e<_O&&(t-Ah)%$l==0)return t+(e-Fp);{let r=Dp.get(t);return r&&(r=r.get(e),r)?r:-1}}function Z9(t){Mv||EO();let e=[],r=[],n=!1;function i(s){let o=Mv.get(s);o&&(n=!0,s|=o),e.push(s)}for(let s of t)for(;;){if(s<128)e.push(s);else if(W9(s)){let o=s-Ah,a=o/Lp|0,c=o%Lp/$l|0,l=o%$l;i(Pp+a),i(Vp+c),l>0&&i(Fp+l)}else{let o=Pv.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=Rh(e[0]);for(let o=1;o<e.length;o++){let a=Rh(e[o]);if(a==0||s<=a){s=a;continue}let c=o-1;for(;;){let l=e[c+1];if(e[c+1]=e[c],e[c]=l,!c||(s=Rh(e[--c]),s<=a))break}s=Rh(e[o])}}return e}function SO(t){let e=[],r=[],n=-1,i=0;for(let s of t){let o=Rh(s),a=L9(s);if(n==-1)o==0?n=a:e.push(a);else if(i>0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=CO(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function z9(t){return Z9(t).map(L9)}function AO(t){return SO(Z9(t))}const G9=45,H9=".",j9=65039,Q9=1,Wp=t=>Array.from(t);function Th(t,e){return t.P.has(e)||t.Q.has(e)}class RO extends Array{get is_emoji(){return!0}}let Vv,J9,tc,Fv,$9,Yl,Lv,Xl,rc,Y9,Dv;function Wv(){if(Vv)return;let t=I9(sO);const e=()=>Ch(t),r=()=>new Set(e()),n=(u,d)=>d.forEach(h=>u.add(h));Vv=new Map(U9(t)),J9=r(),tc=e(),Fv=new Set(e().map(u=>tc[u])),tc=new Set(tc),$9=r(),r();let i=O9(t),s=t();const o=()=>{let u=new Set;return e().forEach(d=>n(u,i[d])),n(u,e()),u};Yl=Sh(u=>{let d=Sh(t).map(h=>h+96);if(d.length){let h=u>=s;d[0]-=32,d=Jl(d),h&&(d=`Restricted[${d}]`);let f=o(),p=o(),v=!t();return{N:d,P:f,Q:p,M:v,R:h}}}),Lv=r(),Xl=new Map;let a=e().concat(Wp(Lv)).sort((u,d)=>u-d);a.forEach((u,d)=>{let h=t(),f=a[d]=h?a[d-h]:{V:[],M:new Map};f.V.push(u),Lv.has(u)||Xl.set(u,f)});for(let{V:u,M:d}of new Set(Xl.values())){let h=[];for(let p of u){let v=Yl.filter(w=>Th(w,p)),m=h.find(({G:w})=>v.some(_=>w.has(_)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(p),n(m.G,v)}let f=h.flatMap(p=>Wp(p.G));for(let{G:p,V:v}of h){let m=new Set(f.filter(w=>!p.has(w)));for(let w of v)d.set(w,m)}}rc=new Set;let c=new Set;const l=u=>rc.has(u)?c.add(u):rc.add(u);for(let u of Yl){for(let d of u.P)l(d);for(let d of u.Q)l(d)}for(let u of rc)!Xl.has(u)&&!c.has(u)&&Xl.set(u,Q9);n(rc,z9(rc)),Y9=fO(t).map(u=>RO.from(u)).sort(gO),Dv=new Map;for(let u of Y9){let d=[Dv];for(let h of u){let f=d.map(p=>{let v=p.get(h);return v||(v=new Map,p.set(h,v)),v});h===j9?d.push(...f):d=f}for(let h of d)h.V=u}}function Zv(t){return(X9(t)?"":`${zv(Zp([t]))} `)+P9(t)}function zv(t){return`"${t}"‎`}function TO(t){if(t.length>=4&&t[2]==G9&&t[3]==G9)throw new Error(`invalid label extension: "${Jl(t.slice(0,4))}"`)}function NO(t){for(let e=t.lastIndexOf(95);e>0;)if(t[--e]!==95)throw new Error("underscore allowed only at start")}function xO(t){let e=t[0],r=x9.get(e);if(r)throw Nh(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s<n;s++){e=t[s];let o=x9.get(e);if(o){if(i==s)throw Nh(`${r} + ${o}`);i=s+1,r=o}}if(i==n)throw Nh(`trailing ${r}`)}function Zp(t,e=1/0,r=P9){let n=[];BO(t[0])&&n.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o<s;o++){let a=t[o];X9(a)&&(n.push(Jl(t.slice(i,o))),n.push(r(a)),i=o+1)}return n.push(Jl(t.slice(i,s))),n.join("")}function BO(t){return Wv(),tc.has(t)}function X9(t){return Wv(),$9.has(t)}function IO(t){return PO(OO(t,AO,LO))}function OO(t,e,r){if(!t)return[];Wv();let n=0;return t.split(H9).map(i=>{let s=mO(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=FO(s,e,r),c=a.length,l;if(!c)throw new Error("empty label");let u=o.output=a.flat();if(NO(u),!(o.emoji=c>1||a[0].is_emoji)&&u.every(d=>d<128))TO(u),l="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)l="Emoji";else{if(tc.has(u[0]))throw Nh("leading combining mark");for(let p=1;p<c;p++){let v=a[p];if(!v.is_emoji&&tc.has(v[0]))throw Nh(`emoji + combining mark: "${Jl(a[p-1])} + ${Zp([v[0]])}"`)}xO(u);let h=Wp(new Set(d)),[f]=MO(h);VO(f,d),UO(f,h),l=f.N}}o.type=l}catch(a){o.error=a}return o})}function UO(t,e){let r,n=[];for(let i of e){let s=Xl.get(i);if(s===Q9)return;if(s){let o=s.M.get(i);if(r=r?r.filter(a=>o.has(a)):Wp(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Th(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function MO(t){let e=Yl;for(let r of t){let n=e.filter(i=>Th(i,r));if(!n.length)throw Yl.some(i=>Th(i,r))?q9(e[0],r):K9(r);if(e=n,n.length==1)break}return e}function PO(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${zv(Zp(e,63))}: ${i}`)}return Jl(n)}).join(H9)}function K9(t){return new Error(`disallowed character: ${Zv(t)}`)}function q9(t,e){let r=Zv(e),n=Yl.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Nh(t){return new Error(`illegal placement: ${t}`)}function VO(t,e){for(let r of e)if(!Th(t,r))throw q9(t,r);if(t.M){let r=z9(e);for(let n=1,i=r.length;n<i;n++)if(Fv.has(r[n])){let s=n+1;for(let o;s<i&&Fv.has(o=r[s]);s++)for(let a=n;a<s;a++)if(r[a]==o)throw new Error(`duplicate non-spacing marks: ${Zv(o)}`);if(s-n>B9)throw new Error(`excessive non-spacing marks: ${zv(Zp(r.slice(n-1,s)))} (${s-n}/${B9})`);n=s}}}function FO(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=DO(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(rc.has(o))i.push(o);else{let a=Vv.get(o);if(a)i.push(...a);else if(!J9.has(o))throw K9(o)}}}return i.length&&n.push(e(i)),n}function LO(t){return t.filter(e=>e!=j9)}function DO(t,e){let r=Dv,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}const e7=new Uint8Array(32);e7.fill(0);function t7(t){return F(t.length!==0,"invalid ENS name; empty component","comp",t),t}function Gv(t){const e=Vr(Hv(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(t7(e.slice(n,i))),n=i+1);return F(n<e.length,"invalid ENS name; empty component","name",t),r.push(t7(e.slice(n))),r}function Hv(t){try{if(t.length===0)throw new Error("empty label");return IO(t)}catch(e){F(!1,`invalid ENS name (${e.message})`,"name",t)}}function r7(t){try{return Gv(t).length!==0}catch{}return!1}function xh(t){F(typeof t=="string","invalid ENS name; not a string","name",t),F(t.length,"invalid ENS name (empty label)","name",t);let e=e7;const r=Gv(t);for(;r.length;)e=rr(Tt([e,rr(r.pop())]));return Ee(e)}function jv(t,e){const r=e??63;return F(r<=255,"DNS encoded label cannot exceed 255","length",r),Ee(Tt(Gv(t).map(n=>{F(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function Qv(t,e){return{address:wt(t),storageKeys:e.map((r,n)=>(F(er(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function ds(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(F(r.length===2,"invalid slot set",`value[${n}]`,r),Qv(r[0],r[1])):(F(r!=null&&typeof r=="object","invalid address-slot set","value",t),Qv(r.address,r.storageKeys)));F(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Qv(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function nc(t){let e;return typeof t=="string"?e=us.computePublicKey(t,!1):e=t.publicKey,wt(rr("0x"+e.substring(4)).substring(26))}function Bh(t,e){return nc(us.recoverPublicKey(t,e))}const qr=BigInt(0),WO=BigInt(2),ZO=BigInt(27),zO=BigInt(28),GO=BigInt(35),HO=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Jv=4096*32;function n7(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=vn(e).substring(4),"0x"+r}function zp(t){return t==="0x"?null:wt(t)}function $v(t,e){try{return ds(t)}catch(r){F(!1,r.message,e,t)}}function Ih(t,e){return t==="0x"?0:qe(t,e)}function xr(t,e){if(t==="0x")return qr;const r=We(t,e);return F(r<=HO,"value exceeds uint size",e,r),r}function ur(t,e){const r=We(t,"value"),n=Hr(r);return F(n.length<=32,"value too large",`tx.${e}`,r),n}function Yv(t){return ds(t).map(e=>[e.address,e.storageKeys])}function jO(t,e){F(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;r<t.length;r++)F(er(t[r],32),"invalid ${ param } hash",`value[${r}]`,t[r]);return t}function QO(t){const e=Ul(t);F(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:Ih(e[0],"nonce"),gasPrice:xr(e[1],"gasPrice"),gasLimit:xr(e[2],"gasLimit"),to:zp(e[3]),value:xr(e[4],"value"),data:Ee(e[5]),chainId:qr};if(e.length===6)return r;const n=xr(e[6],"v"),i=xr(e[7],"r"),s=xr(e[8],"s");if(i===qr&&s===qr)r.chainId=n;else{let o=(n-GO)/WO;o<qr&&(o=qr),r.chainId=o,F(o!==qr||n===ZO||n===zO,"non-canonical legacy v","v",e[6]),r.signature=Fi.from({r:ci(e[7],32),s:ci(e[8],32),v:n})}return r}function JO(t,e){const r=[ur(t.nonce,"nonce"),ur(t.gasPrice||0,"gasPrice"),ur(t.gasLimit,"gasLimit"),t.to||"0x",ur(t.value,"value"),t.data];let n=qr;if(t.chainId!=qr)n=We(t.chainId,"tx.chainId"),F(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const s=t.signature.legacyChainId;s!=null&&(n=s)}if(!e)return n!==qr&&(r.push(Hr(n)),r.push("0x"),r.push("0x")),zs(r);let i=BigInt(27+e.yParity);return n!==qr?i=Fi.getChainIdV(n,e.v):BigInt(e.v)!==i&&F(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(Hr(i)),r.push(Hr(e.r)),r.push(Hr(e.s)),zs(r)}function Xv(t,e){let r;try{if(r=Ih(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{F(!1,"invalid yParity","yParity",e[0])}const n=ci(e[1],32),i=ci(e[2],32),s=Fi.from({r:n,s:i,yParity:r});t.signature=s}function $O(t){const e=Ul(Ne(t).slice(1));F(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",Ee(t));const r={type:2,chainId:xr(e[0],"chainId"),nonce:Ih(e[1],"nonce"),maxPriorityFeePerGas:xr(e[2],"maxPriorityFeePerGas"),maxFeePerGas:xr(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:xr(e[4],"gasLimit"),to:zp(e[5]),value:xr(e[6],"value"),data:Ee(e[7]),accessList:$v(e[8],"accessList")};return e.length===9||Xv(r,e.slice(9)),r}function YO(t,e){const r=[ur(t.chainId,"chainId"),ur(t.nonce,"nonce"),ur(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ur(t.maxFeePerGas||0,"maxFeePerGas"),ur(t.gasLimit,"gasLimit"),t.to||"0x",ur(t.value,"value"),t.data,Yv(t.accessList||[])];return e&&(r.push(ur(e.yParity,"yParity")),r.push(Hr(e.r)),r.push(Hr(e.s))),Tt(["0x02",zs(r)])}function XO(t){const e=Ul(Ne(t).slice(1));F(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",Ee(t));const r={type:1,chainId:xr(e[0],"chainId"),nonce:Ih(e[1],"nonce"),gasPrice:xr(e[2],"gasPrice"),gasLimit:xr(e[3],"gasLimit"),to:zp(e[4]),value:xr(e[5],"value"),data:Ee(e[6]),accessList:$v(e[7],"accessList")};return e.length===8||Xv(r,e.slice(8)),r}function KO(t,e){const r=[ur(t.chainId,"chainId"),ur(t.nonce,"nonce"),ur(t.gasPrice||0,"gasPrice"),ur(t.gasLimit,"gasLimit"),t.to||"0x",ur(t.value,"value"),t.data,Yv(t.accessList||[])];return e&&(r.push(ur(e.yParity,"recoveryParam")),r.push(Hr(e.r)),r.push(Hr(e.s))),Tt(["0x01",zs(r)])}function qO(t){let e=Ul(Ne(t).slice(1)),r="3",n=null;if(e.length===4&&Array.isArray(e[0])){r="3 (network format)";const s=e[1],o=e[2],a=e[3];F(Array.isArray(s),"invalid network format: blobs not an array","fields[1]",s),F(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),F(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),F(s.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),F(s.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:s[c],commitment:o[c],proof:a[c]});e=e[0]}F(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${r}`,"data",Ee(t));const i={type:3,chainId:xr(e[0],"chainId"),nonce:Ih(e[1],"nonce"),maxPriorityFeePerGas:xr(e[2],"maxPriorityFeePerGas"),maxFeePerGas:xr(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:xr(e[4],"gasLimit"),to:zp(e[5]),value:xr(e[6],"value"),data:Ee(e[7]),accessList:$v(e[8],"accessList"),maxFeePerBlobGas:xr(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(i.blobs=n),F(i.to!=null,`invalid address for transaction type: ${r}`,"data",t),F(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let s=0;s<i.blobVersionedHashes.length;s++)F(er(i.blobVersionedHashes[s],32),`invalid blobVersionedHash at index ${s}: must be length 32`,"data",t);return e.length===11||Xv(i,e.slice(11)),i}function eU(t,e,r){const n=[ur(t.chainId,"chainId"),ur(t.nonce,"nonce"),ur(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ur(t.maxFeePerGas||0,"maxFeePerGas"),ur(t.gasLimit,"gasLimit"),t.to||ec,ur(t.value,"value"),t.data,Yv(t.accessList||[]),ur(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),jO(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(ur(e.yParity,"yParity")),n.push(Hr(e.r)),n.push(Hr(e.s)),r)?Tt(["0x03",zs([n,r.map(i=>i.data),r.map(i=>i.commitment),r.map(i=>i.proof)])]):Tt(["0x03",zs(n)])}var Xs,Oh,Uh,Mh,Ph,Vh,Fh,Lh,Dh,Wh,Zh,zh,Kl,ic,Ko,sc,Gh,Gp;const tU=class Fa{constructor(){K(this,Gh),K(this,Xs),K(this,Oh),K(this,Uh),K(this,Mh),K(this,Ph),K(this,Vh),K(this,Fh),K(this,Lh),K(this,Dh),K(this,Wh),K(this,Zh),K(this,zh),K(this,Kl),K(this,ic),K(this,Ko),K(this,sc),M(this,Xs,null),M(this,Oh,null),M(this,Mh,0),M(this,Ph,qr),M(this,Vh,null),M(this,Fh,null),M(this,Lh,null),M(this,Uh,"0x"),M(this,Dh,qr),M(this,Wh,qr),M(this,Zh,null),M(this,zh,null),M(this,Kl,null),M(this,ic,null),M(this,sc,null),M(this,Ko,null)}get type(){return A(this,Xs)}set type(e){switch(e){case null:M(this,Xs,null);break;case 0:case"legacy":M(this,Xs,0);break;case 1:case"berlin":case"eip-2930":M(this,Xs,1);break;case 2:case"london":case"eip-1559":M(this,Xs,2);break;case 3:case"cancun":case"eip-4844":M(this,Xs,3);break;default:F(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=A(this,Oh);return e==null&&this.type===3?ec:e}set to(e){M(this,Oh,e==null?null:wt(e))}get nonce(){return A(this,Mh)}set nonce(e){M(this,Mh,qe(e,"value"))}get gasLimit(){return A(this,Ph)}set gasLimit(e){M(this,Ph,We(e))}get gasPrice(){const e=A(this,Vh);return e==null&&(this.type===0||this.type===1)?qr:e}set gasPrice(e){M(this,Vh,e==null?null:We(e,"gasPrice"))}get maxPriorityFeePerGas(){return A(this,Fh)??(this.type===2||this.type===3?qr:null)}set maxPriorityFeePerGas(e){M(this,Fh,e==null?null:We(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){return A(this,Lh)??(this.type===2||this.type===3?qr:null)}set maxFeePerGas(e){M(this,Lh,e==null?null:We(e,"maxFeePerGas"))}get data(){return A(this,Uh)}set data(e){M(this,Uh,Ee(e))}get value(){return A(this,Dh)}set value(e){M(this,Dh,We(e,"value"))}get chainId(){return A(this,Wh)}set chainId(e){M(this,Wh,We(e))}get signature(){return A(this,Zh)||null}set signature(e){M(this,Zh,e==null?null:Fi.from(e))}get accessList(){return(A(this,zh)||null)??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){M(this,zh,e==null?null:ds(e))}get maxFeePerBlobGas(){const e=A(this,Kl);return e==null&&this.type===3?qr:e}set maxFeePerBlobGas(e){M(this,Kl,e==null?null:We(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=A(this,ic);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){F(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;r<e.length;r++)F(er(e[r],32),"invalid blobVersionedHash",`value[${r}]`,e[r])}M(this,ic,e)}get blobs(){return A(this,sc)==null?null:A(this,sc).map(e=>Object.assign({},e))}set blobs(e){if(e==null){M(this,sc,null);return}const r=[],n=[];for(let i=0;i<e.length;i++){const s=e[i];if(_l(s)){oe(A(this,Ko),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=Ne(s);if(F(o.length<=Jv,"blob is too large",`blobs[${i}]`,s),o.length!==Jv){const l=new Uint8Array(Jv);l.set(o),o=l}const a=A(this,Ko).blobToKzgCommitment(o),c=Ee(A(this,Ko).computeBlobKzgProof(o,a));r.push({data:Ee(o),commitment:Ee(a),proof:c}),n.push(n7(1,a))}else{const o=Ee(s.commitment);r.push({data:Ee(s.data),commitment:o,proof:Ee(s.proof)}),n.push(n7(1,o))}}M(this,sc,r),M(this,ic,n)}get kzg(){return A(this,Ko)}set kzg(e){M(this,Ko,e)}get hash(){return this.signature==null?null:rr(pe(this,Gh,Gp).call(this,!0,!1))}get unsignedHash(){return rr(this.unsignedSerialized)}get from(){return this.signature==null?null:Bh(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:us.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return pe(this,Gh,Gp).call(this,!0,!0)}get unsignedSerialized(){return pe(this,Gh,Gp).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=A(this,Kl)!=null||A(this,ic);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&oe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),oe(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),oe(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):r?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Fa.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Fa;if(typeof e=="string"){const n=Ne(e);if(n[0]>=127)return Fa.from(QO(n));switch(n[0]){case 1:return Fa.from(XO(n));case 2:return Fa.from($O(n));case 3:return Fa.from(qO(n))}oe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Fa;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=Fi.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(F(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),F(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(F(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),F(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};Xs=new WeakMap,Oh=new WeakMap,Uh=new WeakMap,Mh=new WeakMap,Ph=new WeakMap,Vh=new WeakMap,Fh=new WeakMap,Lh=new WeakMap,Dh=new WeakMap,Wh=new WeakMap,Zh=new WeakMap,zh=new WeakMap,Kl=new WeakMap,ic=new WeakMap,Ko=new WeakMap,sc=new WeakMap,Gh=new WeakSet,Gp=function(t,e){oe(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=t?this.signature:null;switch(this.inferType()){case 0:return JO(this,r);case 1:return KO(this,r);case 2:return YO(this,r);case 3:return eU(this,r,e?this.blobs:null)}oe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let ql=tU;function Hp(t){return typeof t=="string"&&(t=Vr(t)),rr(Tt([Vr(Iv),Vr(String(t.length)),t]))}function i7(t,e){const r=Hp(t);return Bh(r,e)}const rU=new RegExp("^bytes([0-9]+)$"),nU=new RegExp("^(u?int)([0-9]*)$"),iU=new RegExp("^(.*)\\[([0-9]*)\\]$");function s7(t,e,r){switch(t){case"address":return Ne(r?ci(e,32):wt(e));case"string":return Vr(e);case"bytes":return Ne(e);case"bool":return e=e?"0x01":"0x00",Ne(r?ci(e,32):e)}let n=t.match(nU);if(n){let i=n[1]==="int",s=parseInt(n[2]||"256");return F((!n[2]||n[2]===String(s))&&s%8===0&&s!==0&&s<=256,"invalid number type","type",t),r&&(s=256),i&&(e=ih(e,s)),Ne(ci(Hr(e),s/8))}if(n=t.match(rU),n){const i=parseInt(n[1]);return F(String(i)===n[1]&&i!==0&&i<=32,"invalid bytes type","type",t),F(Vs(e)===i,`invalid value for ${t}`,"value",e),r?Ne(nh(e,32)):e}if(n=t.match(iU),n&&Array.isArray(e)){const i=n[1],s=parseInt(n[2]||String(e.length));F(s===e.length,`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(s7(i,a,!0))}),Ne(Tt(o))}F(!1,"invalid type","type",t)}function jp(t,e){F(t.length===e.length,"wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(s7(n,e[i]))}),Ee(Tt(r))}function o7(t,e){return rr(jp(t,e))}function a7(t,e){return vn(jp(t,e))}const c7=new Uint8Array(32);c7.fill(0);const sU=BigInt(-1),l7=BigInt(0),u7=BigInt(1),oU=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function aU(t){const e=Ne(t),r=e.length%32;return r?Tt([e,c7.slice(r)]):Ee(e)}const cU=li(u7,32),lU=li(l7,32),d7={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Kv=["name","version","chainId","verifyingContract","salt"];function h7(t){return function(e){return F(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const uU={name:h7("name"),version:h7("version"),chainId:function(t){const e=We(t,"domain.chainId");return F(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Ls(e)},verifyingContract:function(t){try{return wt(t).toLowerCase()}catch{}F(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ne(t,"domain.salt");return F(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ee(e)}};function qv(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);F(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=Fs(oU,r?n-1:n),s=r?(i+u7)*sU:l7;return function(o){const a=We(o,"value");return F(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),li(r?ih(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return F(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=Ne(n);return F(i.length===r,`invalid length for ${t}`,"value",n),aU(n)}}}switch(t){case"address":return function(e){return ci(wt(e),32)};case"bool":return function(e){return e?cU:lU};case"bytes":return function(e){return rr(e)};case"string":return function(e){return Li(e)}}return null}function f7(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function Qp(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var Jp,qo,Hh,e3,p7;const dU=class qi{constructor(e){K(this,e3),H(this,"primaryType"),K(this,Jp),K(this,qo),K(this,Hh),M(this,qo,new Map),M(this,Hh,new Map);const r=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(c=>{s[c]=e[c].map(({name:l,type:u})=>{let{base:d,index:h}=Qp(u);return d==="int"&&!e.int&&(d="int256"),d==="uint"&&!e.uint&&(d="uint256"),{name:l,type:d+(h||"")}}),r.set(c,new Set),n.set(c,[]),i.set(c,new Set)}),M(this,Jp,JSON.stringify(s));for(const c in s){const l=new Set;for(const u of s[c]){F(!l.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(c)}`,"types",e),l.add(u.name);const d=Qp(u.type).base;F(d!==c,`circular type reference to ${JSON.stringify(d)}`,"types",e),!qv(d)&&(F(n.has(d),`unknown type ${JSON.stringify(d)}`,"types",e),n.get(d).push(c),r.get(c).add(d))}}const o=Array.from(n.keys()).filter(c=>n.get(c).length===0);F(o.length!==0,"missing primary type","types",e),F(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),Me(this,{primaryType:o[0]});function a(c,l){F(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(const u of r.get(c))if(n.has(u)){a(u,l);for(const d of l)i.get(d).add(u)}l.delete(c)}a(this.primaryType,new Set);for(const[c,l]of i){const u=Array.from(l);u.sort(),A(this,qo).set(c,f7(c,s[c])+u.map(d=>f7(d,s[d])).join(""))}}get types(){return JSON.parse(A(this,Jp))}getEncoder(e){let r=A(this,Hh).get(e);return r||(r=pe(this,e3,p7).call(this,e),A(this,Hh).set(e,r)),r}encodeType(e){const r=A(this,qo).get(e);return F(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return rr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(qv(e))return n(e,r);const i=Qp(e).array;if(i)return F(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(o=>this._visit(i.prefix,o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{});F(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new qi(e)}static getPrimaryType(e){return qi.from(e).primaryType}static hashStruct(e,r,n){return qi.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=d7[n];F(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Kv.indexOf(n.name)-Kv.indexOf(i.name)),qi.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Tt(["0x1901",qi.hashDomain(e),qi.from(r).hash(n)])}static hash(e,r,n){return rr(qi.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!er(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=qi.from(r);o.visit(n,(a,c)=>(a==="address"&&!er(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,r,n){qi.hashDomain(e);const i={},s=[];Kv.forEach(c=>{const l=e[c];l!=null&&(i[c]=uU[c](l),s.push({name:c,type:d7[c]}))});const o=qi.from(r);r=o.types;const a=Object.assign({},r);return F(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Ee(Ne(l));if(c.match(/^u?int/))return We(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return F(typeof l=="string","invalid string","value",l),l}F(!1,"unsupported type","type",c)})}}};Jp=new WeakMap,qo=new WeakMap,Hh=new WeakMap,e3=new WeakSet,p7=function(t){{const n=qv(t);if(n)return n}const e=Qp(t).array;if(e){const n=e.prefix,i=this.getEncoder(n);return s=>{F(e.count===-1||e.count===s.length,`array length mismatch; expected length ${e.count}`,"value",s);let o=s.map(i);return A(this,qo).has(n)&&(o=o.map(rr)),rr(Tt(o))}}const r=this.types[t];if(r){const n=Li(A(this,qo).get(t));return i=>{const s=r.map(({name:o,type:a})=>{const c=this.getEncoder(a)(i[o]);return A(this,qo).has(a)?rr(c):c});return s.unshift(n),Tt(s)}}F(!1,`unknown type: ${t}`,"type",t)};let oc=dU;function m7(t,e,r,n){return Bh(oc.hash(t,e,r),n)}function Rn(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const hU="external public payable override",fU=Rn(hU.split(" ")),g7="constant external internal payable private public pure view override",pU=Rn(g7.split(" ")),v7="constructor error event fallback function receive struct",y7=Rn(v7.split(" ")),w7="calldata memory storage payable indexed",mU=Rn(w7.split(" ")),gU="tuple returns",vU=[v7,w7,gU,g7].join(" "),yU=Rn(vU.split(" ")),wU={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},bU=new RegExp("^(\\s*)"),kU=new RegExp("^([0-9]+)"),_U=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),b7=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),k7=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var wn,hs,$p,t3;const _7=class aN{constructor(e){K(this,$p),K(this,wn),K(this,hs),M(this,wn,0),M(this,hs,e.slice())}get offset(){return A(this,wn)}get length(){return A(this,hs).length-A(this,wn)}clone(){return new aN(A(this,hs))}reset(){M(this,wn,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=pe(this,$p,t3).call(this,A(this,wn)+1,e.match+1);return M(this,wn,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;A(this,wn)<e.match-1;){const n=this.peek().linkNext;r.push(pe(this,$p,t3).call(this,A(this,wn)+1,n)),M(this,wn,n)}return M(this,wn,e.match+1),r}peek(){if(A(this,wn)>=A(this,hs).length)throw new Error("out-of-bounds");return A(this,hs)[A(this,wn)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return th(this,wn)._++,e}toString(){const e=[];for(let r=A(this,wn);r<A(this,hs).length;r++){const n=A(this,hs)[r];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};wn=new WeakMap,hs=new WeakMap,$p=new WeakSet,t3=function(t=0,e=0){return new _7(A(this,hs).slice(t,e).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))};let Ks=_7;function ea(t){const e=[],r=o=>{const a=s<t.length?JSON.stringify(t[s]):"$EOI";throw new Error(`invalid token ${a} at ${s}: ${o}`)};let n=[],i=[],s=0;for(;s<t.length;){let o=t.substring(s),a=o.match(bU);a&&(s+=a[1].length,o=t.substring(s));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};e.push(c);let l=wU[o[0]]||"";if(l){if(c.type=l,c.text=o[0],s++,l==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(l=="CLOSE_PAREN")n.length===0&&r("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if(l==="COMMA")c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let u=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const d=e.pop().text;u=d+u,e[e.length-1].value=qe(d)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(a=o.match(_U),a){if(c.text=a[1],s+=c.text.length,yU.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(k7)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(kU),a){c.text=a[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Ks(e.map(o=>Object.freeze(o)))}function E7(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function Yp(t,e){if(e.peekKeyword(y7)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function qs(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function C7(t){let e=qs(t,pU);return E7(e,Rn("constant payable nonpayable".split(" "))),E7(e,Rn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function eo(t,e){return t.popParams().map(r=>nn.from(r,e))}function S7(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return We(t.pop().text);throw new Error("invalid gas")}return null}function ac(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const EU=new RegExp(/^(.*)\[([0-9]*)\]$/);function A7(t){const e=t.match(k7);if(F(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);F(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);F(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const Cr={},Pn=Symbol.for("_ethers_internal"),R7="_ParamTypeInternal",T7="_ErrorInternal",N7="_EventInternal",x7="_ConstructorInternal",B7="_FallbackInternal",I7="_FunctionInternal",O7="_StructInternal";var jh,Xp;const CU=class es{constructor(e,r,n,i,s,o,a,c){if(K(this,jh),H(this,"name"),H(this,"type"),H(this,"baseType"),H(this,"indexed"),H(this,"components"),H(this,"arrayLength"),H(this,"arrayChildren"),ss(e,Cr,"ParamType"),Object.defineProperty(this,Pn,{value:R7}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Me(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return pe(this,jh,Xp).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(es.isParamType(e))return e;if(typeof e=="string")try{return es.from(ea(e),r)}catch{F(!1,"invalid param type","obj",e)}else if(e instanceof Ks){let a="",c="",l=null;qs(e,Rn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(p=>es.from(p)),a=`tuple(${l.map(p=>p.format()).join(",")})`):(a=A7(e.popType("TYPE")),c=a);let u=null,d=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new es(Cr,"",a,c,null,l,d,u),d=p.value,a+=p.text,c="array",l=null}let h=null;if(qs(e,mU).has("indexed")){if(!r)throw new Error("");h=!0}const f=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new es(Cr,f,a,c,h,l,d,u)}const n=e.name;F(!n||typeof n=="string"&&n.match(b7),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(F(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(EU);if(o){const a=parseInt(o[2]||"-1"),c=es.from({type:o[1],components:e.components});return new es(Cr,n||"",s,"array",i,null,a,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(c=>es.from(c)):null;return new es(Cr,n||"",s,"tuple",i,a,null,null)}return s=A7(e.type),new es(Cr,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[Pn]===R7}};jh=new WeakSet,Xp=function(t,e,r,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const s=this.arrayChildren,o=e.slice();o.forEach((a,c)=>{var l;pe(l=s,jh,Xp).call(l,t,a,r,u=>{o[c]=u})}),n(o);return}if(this.isTuple()){const s=this.components;let o;if(Array.isArray(e))o=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");o=s.map(a=>{if(!a.name)throw new Error("cannot use object value with unnamed components");if(!(a.name in e))throw new Error(`missing value for component ${a.name}`);return e[a.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((a,c)=>{var l;pe(l=s[c],jh,Xp).call(l,t,a,r,u=>{o[c]=u})}),n(o);return}const i=r(this.type,e);i.then?t.push(async function(){n(await i)}()):n(i)};let nn=CU;class to{constructor(e,r,n){H(this,"type"),H(this,"inputs"),ss(e,Cr,"Fragment"),n=Object.freeze(n.slice()),Me(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{to.from(JSON.parse(e))}catch{}return to.from(ea(e))}if(e instanceof Ks)switch(e.peekKeyword(y7)){case"constructor":return ru.from(e);case"error":return Di.from(e);case"event":return tu.from(e);case"fallback":case"receive":return Kp.from(e);case"function":return nu.from(e);case"struct":return ro.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return ru.from(e);case"error":return Di.from(e);case"event":return tu.from(e);case"fallback":case"receive":return Kp.from(e);case"function":return nu.from(e);case"struct":return ro.from(e)}oe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}F(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return ru.isFragment(e)}static isError(e){return Di.isFragment(e)}static isEvent(e){return tu.isFragment(e)}static isFunction(e){return nu.isFragment(e)}static isStruct(e){return ro.isFragment(e)}}class eu extends to{constructor(e,r,n,i){super(e,r,i),H(this,"name"),F(typeof n=="string"&&n.match(b7),"invalid identifier","name",n),i=Object.freeze(i.slice()),Me(this,{name:n})}}function Qh(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}let Di=class z0 extends eu{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,Pn,{value:T7})}get selector(){return Li(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+Qh(e,this.inputs)),r.join(" ")}static from(e){if(z0.isFragment(e))return e;if(typeof e=="string")return z0.from(ea(e));if(e instanceof Ks){const r=Yp("error",e),n=eo(e);return ac(e),new z0(Cr,r,n)}return new z0(Cr,e.name,e.inputs?e.inputs.map(nn.from):[])}static isFragment(e){return e&&e[Pn]===T7}},tu=class Vd extends eu{constructor(e,r,n,i){super(e,"event",r,n),H(this,"anonymous"),Object.defineProperty(this,Pn,{value:N7}),Me(this,{anonymous:i})}get topicHash(){return Li(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("event"),r.push(this.name+Qh(e,this.inputs)),e!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(e,r){return r=(r||[]).map(n=>nn.from(n)),new Vd(Cr,e,r,!1).topicHash}static from(e){if(Vd.isFragment(e))return e;if(typeof e=="string")try{return Vd.from(ea(e))}catch{F(!1,"invalid event fragment","obj",e)}else if(e instanceof Ks){const r=Yp("event",e),n=eo(e,!0),i=!!qs(e,Rn(["anonymous"])).has("anonymous");return ac(e),new Vd(Cr,r,n,i)}return new Vd(Cr,e.name,e.inputs?e.inputs.map(r=>nn.from(r,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[Pn]===N7}},ru=class G0 extends to{constructor(e,r,n,i,s){super(e,r,n),H(this,"payable"),H(this,"gas"),Object.defineProperty(this,Pn,{value:x7}),Me(this,{payable:i,gas:s})}format(e){if(oe(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[`constructor${Qh(e,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(e){if(G0.isFragment(e))return e;if(typeof e=="string")try{return G0.from(ea(e))}catch{F(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Ks){qs(e,Rn(["constructor"]));const r=eo(e),n=!!qs(e,fU).has("payable"),i=S7(e);return ac(e),new G0(Cr,"constructor",r,n,i)}return new G0(Cr,"constructor",e.inputs?e.inputs.map(nn.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Pn]===x7}},Kp=class il extends to{constructor(e,r,n){super(e,"fallback",r),H(this,"payable"),Object.defineProperty(this,Pn,{value:B7}),Me(this,{payable:n})}format(e){const r=this.inputs.length===0?"receive":"fallback";if(e==="json"){const n=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:n})}return`${r}()${this.payable?" payable":""}`}static from(e){if(il.isFragment(e))return e;if(typeof e=="string")try{return il.from(ea(e))}catch{F(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Ks){const r=e.toString(),n=e.peekKeyword(Rn(["fallback","receive"]));if(F(n,"type must be fallback or receive","obj",r),e.popKeyword(Rn(["fallback","receive"]))==="receive"){const o=eo(e);return F(o.length===0,"receive cannot have arguments","obj.inputs",o),qs(e,Rn(["payable"])),ac(e),new il(Cr,[],!0)}let i=eo(e);i.length?F(i.length===1&&i[0].type==="bytes","invalid fallback inputs","obj.inputs",i.map(o=>o.format("minimal")).join(", ")):i=[nn.from("bytes")];const s=C7(e);if(F(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),qs(e,Rn(["returns"])).has("returns")){const o=eo(e);F(o.length===1&&o[0].type==="bytes","invalid fallback outputs","obj.outputs",o.map(a=>a.format("minimal")).join(", "))}return ac(e),new il(Cr,i,s==="payable")}if(e.type==="receive")return new il(Cr,[],!0);if(e.type==="fallback"){const r=[nn.from("bytes")],n=e.stateMutability==="payable";return new il(Cr,r,n)}F(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[Pn]===B7}},nu=class Fd extends eu{constructor(e,r,n,i,s,o){super(e,"function",r,i),H(this,"constant"),H(this,"outputs"),H(this,"stateMutability"),H(this,"payable"),H(this,"gas"),Object.defineProperty(this,Pn,{value:I7}),s=Object.freeze(s.slice()),Me(this,{constant:n==="view"||n==="pure",gas:o,outputs:s,payable:n==="payable",stateMutability:n})}get selector(){return Li(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("function"),r.push(this.name+Qh(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(Qh(e,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(e,r){return r=(r||[]).map(n=>nn.from(n)),new Fd(Cr,e,"view",r,[],null).selector}static from(e){if(Fd.isFragment(e))return e;if(typeof e=="string")try{return Fd.from(ea(e))}catch{F(!1,"invalid function fragment","obj",e)}else if(e instanceof Ks){const n=Yp("function",e),i=eo(e),s=C7(e);let o=[];qs(e,Rn(["returns"])).has("returns")&&(o=eo(e));const a=S7(e);return ac(e),new Fd(Cr,n,s,i,o,a)}let r=e.stateMutability;return r==null&&(r="payable",typeof e.constant=="boolean"?(r="view",e.constant||(r="payable",typeof e.payable=="boolean"&&!e.payable&&(r="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(r="nonpayable")),new Fd(Cr,e.name,r,e.inputs?e.inputs.map(nn.from):[],e.outputs?e.outputs.map(nn.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[Pn]===I7}};class ro extends eu{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,Pn,{value:O7})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return ro.from(ea(e))}catch{F(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ks){const r=Yp("struct",e),n=eo(e);return ac(e),new ro(Cr,r,n)}return new ro(Cr,e.name,e.inputs?e.inputs.map(nn.from):[])}static isFragment(e){return e&&e[Pn]===O7}}const Wi=new Map;Wi.set(0,"GENERIC_PANIC"),Wi.set(1,"ASSERT_FALSE"),Wi.set(17,"OVERFLOW"),Wi.set(18,"DIVIDE_BY_ZERO"),Wi.set(33,"ENUM_RANGE_ERROR"),Wi.set(34,"BAD_STORAGE_DATA"),Wi.set(49,"STACK_UNDERFLOW"),Wi.set(50,"ARRAY_RANGE_ERROR"),Wi.set(65,"OUT_OF_MEMORY"),Wi.set(81,"UNINITIALIZED_FUNCTION_CALL");const SU=new RegExp(/^bytes([0-9]*)$/),AU=new RegExp(/^(u?int)([0-9]*)$/);let r3=null,U7=1024;function RU(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const l=Ne(r);if(r=Ee(r),l.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(l.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Ee(l.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],l.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Ee(l.slice(0,4))==="0x4e487b71")try{const u=Number(n.decode(["uint256"],l.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[u]},s=`Panic due to ${Wi.get(u)||"UNKNOWN"}(${u})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?wt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=wt(e.from)),cr(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:c,invocation:o,revert:a})}var cc,iu;const TU=class c5{constructor(){K(this,cc)}getDefaultValue(e){const r=e.map(n=>pe(this,cc,iu).call(this,nn.from(n)));return new Mp(r,"_").defaultValue()}encode(e,r){ap(r.length,e.length,"types/values length mismatch");const n=e.map(o=>pe(this,cc,iu).call(this,nn.from(o))),i=new Mp(n,"_"),s=new uv;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(s=>pe(this,cc,iu).call(this,nn.from(s)));return new Mp(i,"_").decode(new sB(r,n,U7))}static _setDefaultMaxInflation(e){F(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),U7=e}static defaultAbiCoder(){return r3==null&&(r3=new c5),r3}static getBuiltinCallException(e,r,n){return RU(e,r,n,c5.defaultAbiCoder())}};cc=new WeakSet,iu=function(t){if(t.isArray())return new JI(pe(this,cc,iu).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new Mp(t.components.map(r=>pe(this,cc,iu).call(this,r)),t.name);switch(t.baseType){case"address":return new jI(t.name);case"bool":return new $I(t.name);case"string":return new iO(t.name);case"bytes":return new YI(t.name);case"":return new qI(t.name)}let e=t.type.match(AU);if(e){let r=parseInt(e[2]||"256");return F(r!==0&&r<=256&&r%8===0,"invalid "+e[1]+" bit length","param",t),new nO(r/8,e[1]==="int",t.name)}if(e=t.type.match(SU),e){let r=parseInt(e[1]);return F(r!==0&&r<=32,"invalid bytes length","param",t),new XI(r,t.name)}F(!1,"invalid type","type",t.type)};let su=TU;function M7(t){const e=Vr(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return nh(e,32)}function P7(t){const e=Ne(t,"bytes");if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return Ds(e.slice(0,r))}class n3{constructor(e,r,n){H(this,"fragment"),H(this,"name"),H(this,"signature"),H(this,"topic"),H(this,"args");const i=e.name,s=e.format();Me(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class i3{constructor(e,r,n,i){H(this,"fragment"),H(this,"name"),H(this,"args"),H(this,"signature"),H(this,"selector"),H(this,"value");const s=e.name,o=e.format();Me(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class s3{constructor(e,r,n){H(this,"fragment"),H(this,"name"),H(this,"args"),H(this,"signature"),H(this,"selector");const i=e.name,s=e.format();Me(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class qp{constructor(e){H(this,"hash"),H(this,"_isIndexed"),Me(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const V7={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},F7={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&V7[t.toString()]&&(e=V7[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var no,io,so,Tn,ta,e1,t1;const NU=class Ld{constructor(e){K(this,ta),H(this,"fragments"),H(this,"deploy"),H(this,"fallback"),H(this,"receive"),K(this,no),K(this,io),K(this,so),K(this,Tn);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,M(this,so,new Map),M(this,no,new Map),M(this,io,new Map);const n=[];for(const o of r)try{n.push(to.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Me(this,{fragments:Object.freeze(n)});let i=null,s=!1;M(this,Tn,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Me(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(F(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":c=A(this,so);break;case"event":c=A(this,io);break;case"error":c=A(this,no);break;default:return}const l=o.format();c.has(l)||c.set(l,o)}),this.deploy||Me(this,{deploy:ru.from("constructor()")}),Me(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(n=>n.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return su.defaultAbiCoder()}getFunctionName(e){const r=pe(this,ta,e1).call(this,e,null,!1);return F(r,"no matching function","key",e),r.name}hasFunction(e){return!!pe(this,ta,e1).call(this,e,null,!1)}getFunction(e,r){return pe(this,ta,e1).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(A(this,so).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(A(this,so).get(i),n)}}getEventName(e){const r=pe(this,ta,t1).call(this,e,null,!1);return F(r,"no matching event","key",e),r.name}hasEvent(e){return!!pe(this,ta,t1).call(this,e,null,!1)}getEvent(e,r){return pe(this,ta,t1).call(this,e,r||null,!0)}forEachEvent(e){const r=Array.from(A(this,io).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(A(this,io).get(i),n)}}getError(e,r){if(er(e)){const i=e.toLowerCase();if(F7[i])return Di.from(F7[i].signature);for(const s of A(this,no).values())if(i===s.selector)return s;return null}if(e.indexOf("(")===-1){const i=[];for(const[s,o]of A(this,no))s.split("(")[0]===e&&i.push(o);if(i.length===0)return e==="Error"?Di.from("error Error(string)"):e==="Panic"?Di.from("error Panic(uint256)"):null;if(i.length>1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");F(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}return e=Di.from(e).format(),e==="Error(string)"?Di.from("error Error(string)"):e==="Panic(uint256)"?Di.from("error Panic(uint256)"):A(this,no).get(e)||null}forEachError(e){const r=Array.from(A(this,no).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(A(this,no).get(i),n)}}_decodeParams(e,r){return A(this,Tn).decode(e,r)}_encodeParams(e,r){return A(this,Tn).encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);F(n,"unknown error","fragment",e),e=n}return F(tr(r,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",r),this._decodeParams(e.inputs,tr(r,4))}encodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);F(n,"unknown error","fragment",e),e=n}return Tt([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);F(n,"unknown function","fragment",e),e=n}return F(tr(r,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",r),this._decodeParams(e.inputs,tr(r,4))}encodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);F(n,"unknown function","fragment",e),e=n}return Tt([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionResult(e,r){if(typeof e=="string"){const s=this.getFunction(e);F(s,"unknown function","fragment",e),e=s}let n="invalid length for result data";const i=Gr(r);if(i.length%32===0)try{return A(this,Tn).decode(e.outputs,i)}catch{n="could not decode result data"}oe(!1,n,"BAD_DATA",{value:Ee(i),info:{method:e.name,signature:e.format()}})}makeError(e,r){const n=Ne(e,"data"),i=su.getBuiltinCallException("call",r,n);if(i.message.startsWith("execution reverted (unknown custom error)")){const o=Ee(n.slice(0,4)),a=this.getError(o);if(a)try{const c=A(this,Tn).decode(a.inputs,n.slice(4));i.revert={name:a.name,signature:a.format(),args:c},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const s=this.parseTransaction(r);return s&&(i.invocation={method:s.name,signature:s.signature,args:s.args}),i}encodeFunctionResult(e,r){if(typeof e=="string"){const n=this.getFunction(e);F(n,"unknown function","fragment",e),e=n}return Ee(A(this,Tn).encode(e.outputs,r||[]))}encodeFilterTopics(e,r){if(typeof e=="string"){const s=this.getEvent(e);F(s,"unknown event","eventFragment",e),e=s}oe(r.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:r.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(s,o)=>s.type==="string"?Li(o):s.type==="bytes"?rr(Ee(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=li(o):s.type.match(/^bytes/)?o=nh(o,32):s.type==="address"&&A(this,Tn).encode(["address"],[o]),ci(Ee(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){F(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?F(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);F(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),F(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Li(c));else if(o.type==="bytes")n.push(rr(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(A(this,Tn).encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:A(this,Tn).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const f=this.getEvent(e);F(f,"unknown event","eventFragment",e),e=f}if(n!=null&&!e.anonymous){const f=e.topicHash;F(er(n[0],32)&&n[0].toLowerCase()===f,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((f,p)=>{f.indexed?f.type==="string"||f.type==="bytes"||f.baseType==="tuple"||f.baseType==="array"?(i.push(nn.from({type:"bytes32",name:f.name})),o.push(!0)):(i.push(f),o.push(!1)):(s.push(f),o.push(!1))});const a=n!=null?A(this,Tn).decode(i,Tt(n)):null,c=A(this,Tn).decode(s,r,!0),l=[],u=[];let d=0,h=0;return e.inputs.forEach((f,p)=>{let v=null;if(f.indexed)if(a==null)v=new qp(null);else if(o[p])v=new qp(a[h++]);else try{v=a[h++]}catch(m){v=m}else try{v=c[d++]}catch(m){v=m}l.push(v),u.push(f.name||null)}),Ml.fromItems(l,u)}parseTransaction(e){const r=Ne(e.data,"tx.data"),n=We(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Ee(r.slice(0,4)));if(!i)return null;const s=A(this,Tn).decode(i.inputs,r.slice(4));return new i3(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new n3(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=Ee(e),n=this.getError(tr(r,0,4));if(!n)return null;const i=A(this,Tn).decode(n.inputs,tr(r,4));return new s3(n,n.selector,i)}static from(e){return e instanceof Ld?e:typeof e=="string"?new Ld(JSON.parse(e)):typeof e.formatJson=="function"?new Ld(e.formatJson()):typeof e.format=="function"?new Ld(e.format("json")):new Ld(e)}};no=new WeakMap,io=new WeakMap,so=new WeakMap,Tn=new WeakMap,ta=new WeakSet,e1=function(t,e,r){if(er(t)){const i=t.toLowerCase();for(const s of A(this,so).values())if(i===s.selector)return s;return null}if(t.indexOf("(")===-1){const i=[];for(const[s,o]of A(this,so))s.split("(")[0]===t&&i.push(o);if(e){const s=e.length>0?e[e.length-1]:null;let o=e.length,a=!0;yn.isTyped(s)&&s.type==="overrides"&&(a=!1,o--);for(let c=i.length-1;c>=0;c--){const l=i[c].inputs.length;l!==o&&(!a||l!==o-1)&&i.splice(c,1)}for(let c=i.length-1;c>=0;c--){const l=i[c].inputs;for(let u=0;u<e.length;u++)if(yn.isTyped(e[u])){if(u>=l.length){if(e[u].type==="overrides")continue;i.splice(c,1);break}if(e[u].type!==l[u].baseType){i.splice(c,1);break}}}}if(i.length===1&&e&&e.length!==i[0].inputs.length){const s=e[e.length-1];(s==null||Array.isArray(s)||typeof s!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const s=i.map(o=>JSON.stringify(o.format())).join(", ");F(!1,`ambiguous function description (i.e. matches ${s})`,"key",t)}return i[0]}return A(this,so).get(nu.from(t).format())||null},t1=function(t,e,r){if(er(t)){const i=t.toLowerCase();for(const s of A(this,io).values())if(i===s.topicHash)return s;return null}if(t.indexOf("(")===-1){const i=[];for(const[s,o]of A(this,io))s.split("(")[0]===t&&i.push(o);if(e){for(let s=i.length-1;s>=0;s--)i[s].inputs.length<e.length&&i.splice(s,1);for(let s=i.length-1;s>=0;s--){const o=i[s].inputs;for(let a=0;a<e.length;a++)if(yn.isTyped(e[a])&&e[a].type!==o[a].baseType){i.splice(s,1);break}}}if(i.length===0)return null;if(i.length>1&&r){const s=i.map(o=>JSON.stringify(o.format())).join(", ");F(!1,`ambiguous event description (i.e. matches ${s})`,"key",t)}return i[0]}return A(this,io).get(tu.from(t).format())||null};let r1=NU;const L7=BigInt(0);function ou(t){return t??null}function Br(t){return t==null?null:t.toString()}class n1{constructor(e,r,n){H(this,"gasPrice"),H(this,"maxFeePerGas"),H(this,"maxPriorityFeePerGas"),Me(this,{gasPrice:ou(e),maxFeePerGas:ou(r),maxPriorityFeePerGas:ou(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Br(e),maxFeePerGas:Br(r),maxPriorityFeePerGas:Br(n)}}}function lc(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Ee(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=We(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=qe(t[i],`request.${i}`));return t.accessList&&(e.accessList=ds(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>_l(i)?Ee(i):Object.assign({},i))),e}var ra;class o3{constructor(e,r){H(this,"provider"),H(this,"number"),H(this,"hash"),H(this,"timestamp"),H(this,"parentHash"),H(this,"parentBeaconBlockRoot"),H(this,"nonce"),H(this,"difficulty"),H(this,"gasLimit"),H(this,"gasUsed"),H(this,"stateRoot"),H(this,"receiptsRoot"),H(this,"blobGasUsed"),H(this,"excessBlobGas"),H(this,"miner"),H(this,"prevRandao"),H(this,"extraData"),H(this,"baseFeePerGas"),K(this,ra),M(this,ra,e.transactions.map(n=>typeof n!="string"?new Jh(n,r):n)),Me(this,{provider:r,hash:ou(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:ou(e.prevRandao),extraData:e.extraData,baseFeePerGas:ou(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return A(this,ra).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=A(this,ra).slice();return e.length===0?[]:(oe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:c,nonce:l,number:u,parentHash:d,parentBeaconBlockRoot:h,stateRoot:f,receiptsRoot:p,timestamp:v,transactions:m}=this;return{_type:"Block",baseFeePerGas:Br(e),difficulty:Br(r),extraData:n,gasLimit:Br(i),gasUsed:Br(s),blobGasUsed:Br(this.blobGasUsed),excessBlobGas:Br(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:l,number:u,parentHash:d,timestamp:v,parentBeaconBlockRoot:h,stateRoot:f,receiptsRoot:p,transactions:m}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>e<this.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}get length(){return A(this,ra).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let r;if(typeof e=="number")r=A(this,ra)[e];else{const n=e.toLowerCase();for(const i of A(this,ra))if(typeof i=="string"){if(i!==n)continue;r=i;break}else{if(i.hash===n)continue;r=i;break}}if(r==null)throw new Error("no such tx");return typeof r=="string"?await this.provider.getTransaction(r):r}getPrefetchedTransaction(e){const r=this.prefetchedTransactions;if(typeof e=="number")return r[e];e=e.toLowerCase();for(const n of r)if(n.hash===e)return n;F(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return BU(this)}}ra=new WeakMap;class uc{constructor(e,r){H(this,"provider"),H(this,"transactionHash"),H(this,"blockHash"),H(this,"blockNumber"),H(this,"removed"),H(this,"address"),H(this,"data"),H(this,"topics"),H(this,"index"),H(this,"transactionIndex"),this.provider=r;const n=Object.freeze(e.topics.slice());Me(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:c,transactionIndex:l}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return oe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return oe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return oe(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return IU(this)}}var i1;class s1{constructor(e,r){H(this,"provider"),H(this,"to"),H(this,"from"),H(this,"contractAddress"),H(this,"hash"),H(this,"index"),H(this,"blockHash"),H(this,"blockNumber"),H(this,"logsBloom"),H(this,"gasUsed"),H(this,"blobGasUsed"),H(this,"cumulativeGasUsed"),H(this,"gasPrice"),H(this,"blobGasPrice"),H(this,"type"),H(this,"status"),H(this,"root"),K(this,i1),M(this,i1,Object.freeze(e.logs.map(i=>new uc(i,r))));let n=L7;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Me(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return A(this,i1)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:c,logs:l,status:u,root:d}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Br(this.cumulativeGasUsed),from:r,gasPrice:Br(this.gasPrice),blobGasUsed:Br(this.blobGasUsed),blobGasPrice:Br(this.blobGasPrice),gasUsed:Br(this.gasUsed),hash:i,index:s,logs:l,logsBloom:c,root:d,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return W7(this)}reorderedEvent(e){return oe(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),D7(this,e)}}i1=new WeakMap;var dc;const xU=class cN{constructor(e,r){H(this,"provider"),H(this,"blockNumber"),H(this,"blockHash"),H(this,"index"),H(this,"hash"),H(this,"type"),H(this,"to"),H(this,"from"),H(this,"nonce"),H(this,"gasLimit"),H(this,"gasPrice"),H(this,"maxPriorityFeePerGas"),H(this,"maxFeePerGas"),H(this,"maxFeePerBlobGas"),H(this,"data"),H(this,"value"),H(this,"chainId"),H(this,"signature"),H(this,"accessList"),H(this,"blobVersionedHashes"),K(this,dc),this.provider=r,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,M(this,dc,-1)}toJSON(){const{blockNumber:e,blockHash:r,index:n,hash:i,type:s,to:o,from:a,nonce:c,data:l,signature:u,accessList:d,blobVersionedHashes:h}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:e,blockHash:r,blobVersionedHashes:h,chainId:Br(this.chainId),data:l,from:a,gasLimit:Br(this.gasLimit),gasPrice:Br(this.gasPrice),hash:i,maxFeePerGas:Br(this.maxFeePerGas),maxPriorityFeePerGas:Br(this.maxPriorityFeePerGas),maxFeePerBlobGas:Br(this.maxFeePerBlobGas),nonce:c,signature:u,to:o,index:n,type:s,value:Br(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const r=this.provider.getBlock(e);if(r==null)throw new Error("TODO");return r}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:e,blockNumber:r}=await zr({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:r-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,r){const n=e??1,i=r??0;let s=A(this,dc),o=-1,a=s===-1;const c=async()=>{if(a)return null;const{blockNumber:d,nonce:h}=await zr({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){s=d;return}if(a)return null;const f=await this.getTransaction();if(!(f&&f.blockNumber!=null))for(o===-1&&(o=s-3,o<A(this,dc)&&(o=A(this,dc)));o<=d;){if(a)return null;const p=await this.provider.getBlock(o,!0);if(p==null)return;for(const v of p)if(v===this.hash)return;for(let v=0;v<p.length;v++){const m=await p.getTransaction(v);if(m.from===this.from&&m.nonce===this.nonce){if(a)return null;const w=await this.provider.getTransactionReceipt(m.hash);if(w==null||d-w.blockNumber+1<n)return;let _="replaced";m.data===this.data&&m.to===this.to&&m.value===this.value?_="repriced":m.data==="0x"&&m.from===m.to&&m.value===L7&&(_="cancelled"),oe(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:_==="replaced"||_==="cancelled",reason:_,replacement:m.replaceableTransaction(s),hash:m.hash,receipt:w})}}o++}},l=d=>{if(d==null||d.status!==0)return d;oe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},u=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(u);if(u){if(await u.confirmations()>=n)return l(u)}else if(await c(),n===0)return null;return await new Promise((d,h)=>{const f=[],p=()=>{f.forEach(m=>m())};if(f.push(()=>{a=!0}),i>0){const m=setTimeout(()=>{p(),h(cr("wait for transaction timeout","TIMEOUT"))},i);f.push(()=>{clearTimeout(m)})}const v=async m=>{if(await m.confirmations()>=n){p();try{d(l(m))}catch(w){h(w)}}};if(f.push(()=>{this.provider.off(this.hash,v)}),this.provider.on(this.hash,v),s>=0){const m=async()=>{try{await c()}catch(w){if(Tr(w,"TRANSACTION_REPLACED")){p(),h(w);return}}a||this.provider.once("block",m)};f.push(()=>{this.provider.off("block",m)}),this.provider.once("block",m)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return oe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),W7(this)}reorderedEvent(e){return oe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),oe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),D7(this,e)}replaceableTransaction(e){F(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new cN(this,this.provider);return M(r,dc,e),r}};dc=new WeakMap;let Jh=xU;function BU(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function D7(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function W7(t){return{orphan:"drop-transaction",tx:t}}function IU(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class $h extends uc{constructor(e,r,n){super(e,e.provider),H(this,"interface"),H(this,"fragment"),H(this,"args");const i=r.decodeEventLog(n,e.data,e.topics);Me(this,{args:i,fragment:n,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class o1 extends uc{constructor(e,r){super(e,e.provider),H(this,"error"),Me(this,{error:r})}}var Yh;class a3 extends s1{constructor(e,r,n){super(n,r),K(this,Yh),M(this,Yh,e)}get logs(){return super.logs.map(e=>{const r=e.topics.length?A(this,Yh).getEvent(e.topics[0]):null;if(r)try{return new $h(e,A(this,Yh),r)}catch(n){return new o1(e,n)}return e})}}Yh=new WeakMap;var a1;class Xh extends Jh{constructor(e,r,n){super(n,r),K(this,a1),M(this,a1,e)}async wait(e,r){const n=await super.wait(e,r);return n==null?null:new a3(A(this,a1),this.provider,n)}}a1=new WeakMap;class c1 extends fp{constructor(e,r,n,i){super(e,r,n),H(this,"log"),Me(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class c3 extends c1{constructor(e,r,n,i,s){super(e,r,n,new $h(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Me(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Z7=BigInt(0);function z7(t){return t&&typeof t.call=="function"}function G7(t){return t&&typeof t.estimateGas=="function"}function l1(t){return t&&typeof t.resolveName=="function"}function H7(t){return t&&typeof t.sendTransaction=="function"}function j7(t){if(t!=null){if(l1(t))return t;if(t.provider)return t.provider}}var u1;class OU{constructor(e,r,n){if(K(this,u1),H(this,"fragment"),Me(this,{fragment:r}),r.inputs.length<n.length)throw new Error("too many arguments");const i=hc(e.runner,"resolveName"),s=l1(i)?i:null;M(this,u1,async function(){const o=await Promise.all(r.inputs.map((a,c)=>n[c]==null?null:a.walkAsync(n[c],(l,u)=>l==="address"?Array.isArray(u)?Promise.all(u.map(d=>jr(d,s))):jr(u,s):u)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return A(this,u1)}}u1=new WeakMap;function hc(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function fc(t){return t==null?null:t.provider||null}async function l3(t,e){const r=yn.dereference(t,"overrides");F(typeof r=="object","invalid overrides parameter","overrides",t);const n=lc(r);return F(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),F(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function Q7(t,e,r){const n=hc(t,"resolveName"),i=l1(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,c)=>(c=yn.dereference(c,a),a==="address"?jr(c,i):c))))}function UU(t){const e=async function(o){const a=await l3(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await jr(a.from,j7(t.runner)));const c=t.interface,l=We(a.value||Z7,"overrides.value")===Z7,u=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!u&&!l&&F(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),F(c.fallback||u,"cannot send data to receive-only contract","overrides.data",a.data);const d=c.receive||c.fallback&&c.fallback.payable;return F(d||l,"cannot send value to non-payable fallback","overrides.value",a.value),F(c.fallback||u,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=hc(t.runner,"call");oe(z7(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(o);try{return await a.call(c)}catch(l){throw rh(l)&&l.data?t.interface.makeError(l.data,c):l}},n=async function(o){const a=t.runner;oe(H7(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await a.sendTransaction(await e(o)),l=fc(t.runner);return new Xh(t.interface,l,c)},i=async function(o){const a=hc(t.runner,"estimateGas");return oe(G7(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Me(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function MU(t,e){const r=function(...l){const u=t.interface.getFunction(e,l);return oe(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),u},n=async function(...l){const u=r(...l);let d={};if(u.inputs.length+1===l.length&&(d=await l3(l.pop()),d.from&&(d.from=await jr(d.from,j7(t.runner)))),u.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await Q7(t.runner,u.inputs,l);return Object.assign({},d,await zr({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...l){const u=await a(...l);return u.length===1?u[0]:u},s=async function(...l){const u=t.runner;oe(H7(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await u.sendTransaction(await n(...l)),h=fc(t.runner);return new Xh(t.interface,h,d)},o=async function(...l){const u=hc(t.runner,"estimateGas");return oe(G7(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await n(...l))},a=async function(...l){const u=hc(t.runner,"call");oe(z7(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await n(...l);let h="0x";try{h=await u.call(d)}catch(p){throw rh(p)&&p.data?t.interface.makeError(p.data,d):p}const f=r(...l);return t.interface.decodeFunctionResult(f,h)},c=async(...l)=>r(...l).constant?await i(...l):await s(...l);return Me(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=t.interface.getFunction(e);return oe(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function PU(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return oe(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new OU(t,r(...i),i)};return Me(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return oe(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const d1=Symbol.for("_ethersInternal_contract"),J7=new WeakMap;function VU(t,e){J7.set(t[d1],e)}function Xn(t){return J7.get(t[d1])}function FU(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function u3(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(er(o,32))return o;const a=t.interface.getEvent(o);return F(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?er(e,32)?r=[e]:(n=t.interface.getEvent(e),F(n,"unknown fragment","event",e),r=[n.topicHash]):FU(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):F(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function Kh(t,e){const{subs:r}=Xn(t);return r.get((await u3(t,e)).tag)||null}async function $7(t,e,r){const n=fc(t.runner);oe(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await u3(t,r),{addr:a,subs:c}=Xn(t);let l=c.get(s);if(!l){const u={address:a||t,topics:o},d=f=>{let p=i;if(p==null)try{p=t.interface.getEvent(f.topics[0])}catch{}if(p){const v=p,m=i?t.interface.decodeEventLog(i,f.data,f.topics):[];h3(t,r,m,w=>new c3(t,w,r,v,f))}else h3(t,r,[],v=>new c1(t,v,r,f))};let h=[];l={tag:s,listeners:[],start:()=>{h.length||h.push(n.on(u,d))},stop:async()=>{if(h.length==0)return;let f=h;h=[],await Promise.all(f),n.off(u,d)}},c.set(s,l)}return l}let d3=Promise.resolve();async function LU(t,e,r,n){await d3;const i=await Kh(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const c=Array.from(r);n&&c.push(n(a?null:o));try{o.call(t,...c)}catch{}return!a}),i.listeners.length===0&&(i.stop(),Xn(t).subs.delete(i.tag)),s>0}async function h3(t,e,r,n){try{await d3}catch{}const i=LU(t,e,r,n);return d3=i,await i}const h1=["then"];var Y7;Y7=d1;let qh=class og{constructor(e,r,n,i){H(this,"target"),H(this,"interface"),H(this,"runner"),H(this,"filters"),H(this,Y7),H(this,"fallback"),F(typeof e=="string"||Up(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=r1.from(r);Me(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,d1,{value:{}});let o,a=null,c=null;if(i){const d=fc(n);c=new Xh(this.interface,d,i)}let l=new Map;if(typeof e=="string")if(er(e))a=e,o=Promise.resolve(e);else{const d=hc(n,"resolveName");if(!l1(d))throw cr("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=d.resolveName(e).then(h=>{if(h==null)throw cr("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Xn(this).addr=h,h})}else o=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return Xn(this).addr=d,d});VU(this,{addrPromise:o,addr:a,deployTx:c,subs:l});const u=new Proxy({},{get:(d,h,f)=>{if(typeof h=="symbol"||h1.indexOf(h)>=0)return Reflect.get(d,h,f);try{return this.getEvent(h)}catch(p){if(!Tr(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(d,h)=>h1.indexOf(h)>=0?Reflect.has(d,h):Reflect.has(d,h)||this.interface.hasEvent(String(h))});return Me(this,{filters:u}),Me(this,{fallback:s.receive||s.fallback?UU(this):null}),new Proxy(this,{get:(d,h,f)=>{if(typeof h=="symbol"||h in d||h1.indexOf(h)>=0)return Reflect.get(d,h,f);try{return d.getFunction(h)}catch(p){if(!Tr(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(d,h)=>typeof h=="symbol"||h in d||h1.indexOf(h)>=0?Reflect.has(d,h):d.interface.hasFunction(h)})}connect(e){return new og(this.target,this.interface,e)}attach(e){return new og(e,this.interface,this.runner)}async getAddress(){return await Xn(this).addrPromise}async getDeployedCode(){const e=fc(this.runner);oe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=fc(this.runner);return oe(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((n,i)=>{const s=async()=>{try{if(await this.getDeployedCode()!=null)return n(this);r.once("block",s)}catch(o){i(o)}};s()})}deploymentTransaction(){return Xn(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),MU(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),PU(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=Xn(this),o=i||await s,{fragment:a,topics:c}=await u3(this,e),l={address:o,topics:c,fromBlock:r,toBlock:n},u=fc(this.runner);return oe(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(l)).map(d=>{let h=a;if(h==null)try{h=this.interface.getEvent(d.topics[0])}catch{}if(h)try{return new $h(d,this.interface,h)}catch(f){return new o1(d,f)}return new uc(d,u)})}async on(e,r){const n=await $7(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await $7(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await h3(this,e,r,null)}async listenerCount(e){if(e){const i=await Kh(this,e);return i?i.listeners.length:0}const{subs:r}=Xn(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Kh(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=Xn(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await Kh(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),Xn(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Kh(this,e);if(!r)return this;r.stop(),Xn(this).subs.delete(r.tag)}else{const{subs:r}=Xn(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends og{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};function DU(){return qh}class na extends DU(){}class f1{constructor(e,r,n){H(this,"interface"),H(this,"bytecode"),H(this,"runner");const i=r1.from(e);r instanceof Uint8Array||(typeof r=="object"&&(r=r.object),r.startsWith("0x")||(r="0x"+r)),r=Ee(Ne(r)),Me(this,{bytecode:r,interface:i,runner:n||null})}attach(e){return new qh(e,this.interface,this.runner)}async getDeployTransaction(...e){let r={};const n=this.interface.deploy;if(n.inputs.length+1===e.length&&(r=await l3(e.pop())),n.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await Q7(this.runner,n.inputs,e),s=Tt([this.bytecode,this.interface.encodeDeploy(i)]);return Object.assign({},r,{data:s})}async deploy(...e){const r=await this.getDeployTransaction(...e);oe(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const n=await this.runner.sendTransaction(r),i=Op(n);return new qh(i,this.interface,this.runner,n)}connect(e){return new f1(this.interface,this.bytecode,e)}static fromSolidity(e,r){F(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const n=e.abi;let i="";return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(n,i,r)}}function f3(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):F(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class p3{constructor(e){H(this,"name"),Me(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const X7=new RegExp("^(ipfs)://(.*)$","i"),K7=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),X7,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var pc,au,mc,cu,m3,q7;const g3=class l5{constructor(e,r,n){K(this,mc),H(this,"provider"),H(this,"address"),H(this,"name"),K(this,pc),K(this,au),Me(this,{provider:e,address:r,name:n}),M(this,pc,null),M(this,au,new na(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return A(this,pc)==null&&M(this,pc,(async()=>{try{return await A(this,au).supportsInterface("0x9061b923")}catch(e){if(Tr(e,"CALL_EXCEPTION"))return!1;throw M(this,pc,null),e}})()),await A(this,pc)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await pe(this,mc,cu).call(this,"addr(bytes32)");return s==null||s===ec?null:s}catch(s){if(Tr(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await pe(this,mc,cu).call(this,"addr(bytes32,uint)",[s]);if(er(o,20))return wt(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof p3&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await pe(this,mc,cu).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;oe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await pe(this,mc,cu).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await pe(this,mc,cu).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${hp("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;oe(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n<K7.length;n++){const i=r.match(K7[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":case"data":return e.push({type:"url",value:r}),{linkage:e,url:r};case"ipfs":{const o=f3(r);return e.push({type:"ipfs",value:r}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=s==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:s,value:r});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(i[2]||"").split("/");if(c.length!==2)return e.push({type:`!${s}caip`,value:i[2]||""}),{url:null,linkage:e};const l=c[1],u=new na(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(s==="erc721"){const v=await u.ownerOf(l);if(a!==v)return e.push({type:"!owner",value:v}),{url:null,linkage:e};e.push({type:"owner",value:v})}else if(s==="erc1155"){const v=await u.balanceOf(a,l);if(!v)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:v.toString()})}let d=await u[o](l);if(d==null||d==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:d}),s==="erc1155"&&(d=d.replace("{id}",li(l,32).substring(2)),e.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=f3(d)),e.push({type:"metadata-url",value:d});let h={};const f=await new gn(d).send();f.assertOk();try{h=f.bodyJson}catch{try{e.push({type:"!metadata",value:f.bodyText})}catch{const v=f.body;return v&&e.push({type:"!metadata",value:Ee(v)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!h)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(h)});let p=h.image;if(typeof p!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!p.match(/^(https:\/\/|data:)/i)){if(p.match(X7)==null)return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=f3(p)}return e.push({type:"url",value:p}),{linkage:e,url:p}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),n=r.getPlugin("org.ethers.plugins.network.Ens");return oe(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),n.address}static async fromName(e,r){var n;let i=r;for(;;){if(i===""||i==="."||r!=="eth"&&i==="eth")return null;const s=await pe(n=l5,m3,q7).call(n,e,i);if(s!=null){const o=new l5(e,s,r);return i!==r&&!await o.supportsWildcard()?null:o}i=i.split(".").slice(1).join(".")}}};pc=new WeakMap,au=new WeakMap,mc=new WeakSet,cu=async function(t,e){e=(e||[]).slice();const r=A(this,au).interface;e.unshift(xh(this.name));let n=null;await this.supportsWildcard()&&(n=r.getFunction(t),oe(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),e=[jv(this.name,255),r.encodeFunctionData(n,e)],t="resolve(bytes,bytes)"),e.push({enableCcipRead:!0});try{const i=await A(this,au)[t](...e);return n?r.decodeFunctionResult(n,i)[0]:i}catch(i){if(!Tr(i,"CALL_EXCEPTION"))throw i}return null},m3=new WeakSet,q7=async function(t,e){const r=await g3.getEnsAddress(t);try{const n=await new na(r,["function resolver(bytes32) view returns (address)"],t).resolver(xh(e),{enableCcipRead:!0});return n===ec?null:n}catch(n){throw n}return null},K(g3,m3);let p1=g3;const ek=BigInt(0);function Nt(t,e){return function(r){return r==null?e:t(r)}}function m1(t,e){return r=>{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))}}function ef(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";oe(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function WU(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}F(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function lu(t){return F(er(t,!0),"invalid data","value",t),t}function sn(t){return F(er(t,32),"invalid hash","value",t),t}const ZU=ef({address:wt,blockHash:sn,blockNumber:qe,data:lu,index:qe,removed:Nt(WU,!1),topics:m1(sn),transactionHash:sn,transactionIndex:qe},{index:["logIndex"]});function zU(t){return ZU(t)}const GU=ef({hash:Nt(sn),parentHash:sn,parentBeaconBlockRoot:Nt(sn,null),number:qe,timestamp:qe,nonce:Nt(lu),difficulty:We,gasLimit:We,gasUsed:We,stateRoot:Nt(sn,null),receiptsRoot:Nt(sn,null),blobGasUsed:Nt(We,null),excessBlobGas:Nt(We,null),miner:Nt(wt),prevRandao:Nt(sn,null),extraData:lu,baseFeePerGas:Nt(We)},{prevRandao:["mixHash"]});function HU(t){const e=GU(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:tk(r)),e}const jU=ef({transactionIndex:qe,blockNumber:qe,transactionHash:sn,address:wt,topics:m1(sn),data:lu,index:qe,blockHash:sn},{index:["logIndex"]});function QU(t){return jU(t)}const JU=ef({to:Nt(wt,null),from:Nt(wt,null),contractAddress:Nt(wt,null),index:qe,root:Nt(Ee),gasUsed:We,blobGasUsed:Nt(We,null),logsBloom:Nt(lu),blockHash:sn,hash:sn,logs:m1(QU),blockNumber:qe,cumulativeGasUsed:We,effectiveGasPrice:Nt(We),blobGasPrice:Nt(We,null),status:Nt(qe),type:Nt(qe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function $U(t){return JU(t)}function tk(t){t.to&&We(t.to)===ek&&(t.to="0x0000000000000000000000000000000000000000");const e=ef({hash:sn,index:Nt(qe,void 0),type:r=>r==="0x"||r==null?0:qe(r),accessList:Nt(ds,null),blobVersionedHashes:Nt(m1(sn,!0),null),blockHash:Nt(sn,null),blockNumber:Nt(qe,null),transactionIndex:Nt(qe,null),from:wt,gasPrice:Nt(We),maxPriorityFeePerGas:Nt(We),maxFeePerGas:Nt(We),maxFeePerBlobGas:Nt(We,null),gasLimit:We,to:Nt(wt,null),value:We,nonce:qe,data:lu,creates:Nt(wt,null),chainId:Nt(We,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=Op(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Fi.from(t.signature):e.signature=Fi.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&We(e.blockHash)===ek&&(e.blockHash=null),e}const YU="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class oo{constructor(e){H(this,"name"),Me(this,{name:e})}clone(){return new oo(this.name)}}class uu extends oo{constructor(e,r){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`),H(this,"effectiveBlock"),H(this,"txBase"),H(this,"txCreate"),H(this,"txDataZero"),H(this,"txDataNonzero"),H(this,"txAccessListStorageKey"),H(this,"txAccessListAddress");const n={effectiveBlock:e};function i(s,o){let a=(r||{})[s];a==null&&(a=o),F(typeof a=="number",`invalud value for ${s}`,"costs",r),n[s]=a}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Me(this,n)}clone(){return new uu(this.effectiveBlock,this)}}class du extends oo{constructor(e,r){super("org.ethers.plugins.network.Ens"),H(this,"address"),H(this,"targetNetwork"),Me(this,{address:e||YU,targetNetwork:r??1})}clone(){return new du(this.address,this.targetNetwork)}}var hu;const XU=class lN extends oo{constructor(e){super("org.ethers.plugins.network.FeeData"),K(this,hu),M(this,hu,e)}get feeDataFunc(){return A(this,hu)}async getFeeData(e){return await A(this,hu).call(this,e)}clone(){return new lN(A(this,hu))}};hu=new WeakMap;let rk=XU;var g1,v1;class v3 extends oo{constructor(e,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),K(this,g1),K(this,v1),M(this,g1,e),M(this,v1,r)}get url(){return A(this,g1)}get processFunc(){return A(this,v1)}clone(){return this}}g1=new WeakMap,v1=new WeakMap;const y3=new Map;var tf,rf,gc;const KU=class H0{constructor(e,r){K(this,tf),K(this,rf),K(this,gc),M(this,tf,e),M(this,rf,We(r)),M(this,gc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return A(this,tf)}set name(e){M(this,tf,e)}get chainId(){return A(this,rf)}set chainId(e){M(this,rf,We(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===We(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===We(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===We(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(A(this,gc).values())}attachPlugin(e){if(A(this,gc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return A(this,gc).set(e.name,e.clone()),this}getPlugin(e){return A(this,gc).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new H0(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new uu;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=r.txDataZero:n+=r.txDataNonzero;if(e.accessList){const i=ds(e.accessList);for(const s in i)n+=r.txAccessListAddress+r.txAccessListStorageKey*i[s].storageKeys.length}return n}static from(e){if(qU(),e==null)return H0.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const r=y3.get(e);if(r)return r();if(typeof e=="bigint")return new H0("unknown",e);F(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){F(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const r=new H0(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&r.attachPlugin(new du(e.ensAddress,e.ensNetwork)),r}F(!1,"invalid network","network",e)}static register(e,r){typeof e=="number"&&(e=BigInt(e));const n=y3.get(e);n&&F(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),y3.set(e,r)}};tf=new WeakMap,rf=new WeakMap,gc=new WeakMap;let Fr=KU;function nk(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const n=r.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function ik(t){return new v3(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:nk(a.maxFee,9),maxPriorityFeePerGas:nk(a.maxPriorityFee,9)}}catch(s){oe(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}let sk=!1;function qU(){if(sk)return;sk=!0;function t(e,r,n){const i=function(){const s=new Fr(e,r);return n.ensNetwork!=null&&s.attachPlugin(new du(null,n.ensNetwork)),s.attachPlugin(new uu),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};Fr.register(e,i),Fr.register(r,i),n.altNames&&n.altNames.forEach(s=>{Fr.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[ik("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[ik("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function w3(t){return JSON.parse(JSON.stringify(t))}var ia,Zi,vc,ao,nf,y1;class eM{constructor(e){K(this,nf),K(this,ia),K(this,Zi),K(this,vc),K(this,ao),M(this,ia,e),M(this,Zi,null),M(this,vc,4e3),M(this,ao,-2)}get pollingInterval(){return A(this,vc)}set pollingInterval(e){M(this,vc,e)}start(){A(this,Zi)||(M(this,Zi,A(this,ia)._setTimeout(pe(this,nf,y1).bind(this),A(this,vc))),pe(this,nf,y1).call(this))}stop(){A(this,Zi)&&(A(this,ia)._clearTimeout(A(this,Zi)),M(this,Zi,null))}pause(e){this.stop(),e&&M(this,ao,-2)}resume(){this.start()}}ia=new WeakMap,Zi=new WeakMap,vc=new WeakMap,ao=new WeakMap,nf=new WeakSet,y1=async function(){try{const t=await A(this,ia).getBlockNumber();if(A(this,ao)===-2){M(this,ao,t);return}if(t!==A(this,ao)){for(let e=A(this,ao)+1;e<=t;e++){if(A(this,Zi)==null)return;await A(this,ia).emit("block",e)}M(this,ao,t)}}catch{}A(this,Zi)!=null&&M(this,Zi,A(this,ia)._setTimeout(pe(this,nf,y1).bind(this),A(this,vc)))};var fu,pu,yc;class b3{constructor(e){K(this,fu),K(this,pu),K(this,yc),M(this,fu,e),M(this,yc,!1),M(this,pu,r=>{this._poll(r,A(this,fu))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){A(this,yc)||(M(this,yc,!0),A(this,pu).call(this,-2),A(this,fu).on("block",A(this,pu)))}stop(){A(this,yc)&&(M(this,yc,!1),A(this,fu).off("block",A(this,pu)))}pause(e){this.stop()}resume(){this.start()}}fu=new WeakMap,pu=new WeakMap,yc=new WeakMap;var sf,sa;class tM extends b3{constructor(e,r){super(e),K(this,sf),K(this,sa),M(this,sf,r),M(this,sa,-2)}pause(e){e&&M(this,sa,-2),super.pause(e)}async _poll(e,r){const n=await r.getBlock(A(this,sf));n!=null&&(A(this,sa)===-2?M(this,sa,n.number):n.number>A(this,sa)&&(r.emit(A(this,sf),n.number),M(this,sa,n.number)))}}sf=new WeakMap,sa=new WeakMap;var k3;class rM extends b3{constructor(e,r){super(e),K(this,k3),M(this,k3,w3(r))}async _poll(e,r){throw new Error("@TODO")}}k3=new WeakMap;var of;class nM extends b3{constructor(e,r){super(e),K(this,of),M(this,of,r)}async _poll(e,r){const n=await r.getTransactionReceipt(A(this,of));n&&r.emit(A(this,of),n)}}of=new WeakMap;var oa,af,cf,wc,zi,_3,ok;class E3{constructor(e,r){K(this,_3),K(this,oa),K(this,af),K(this,cf),K(this,wc),K(this,zi),M(this,oa,e),M(this,af,w3(r)),M(this,cf,pe(this,_3,ok).bind(this)),M(this,wc,!1),M(this,zi,-2)}start(){A(this,wc)||(M(this,wc,!0),A(this,zi)===-2&&A(this,oa).getBlockNumber().then(e=>{M(this,zi,e)}),A(this,oa).on("block",A(this,cf)))}stop(){A(this,wc)&&(M(this,wc,!1),A(this,oa).off("block",A(this,cf)))}pause(e){this.stop(),e&&M(this,zi,-2)}resume(){this.start()}}oa=new WeakMap,af=new WeakMap,cf=new WeakMap,wc=new WeakMap,zi=new WeakMap,_3=new WeakSet,ok=async function(t){if(A(this,zi)===-2)return;const e=w3(A(this,af));e.fromBlock=A(this,zi)+1,e.toBlock=t;const r=await A(this,oa).getLogs(e);if(r.length===0){A(this,zi)<t-60&&M(this,zi,t-60);return}for(const n of r)A(this,oa).emit(A(this,af),n),M(this,zi,n.blockNumber)};const iM=BigInt(2),sM=10;function w1(t){return t&&typeof t.then=="function"}function b1(t,e){return t+":"+JSON.stringify(e,(r,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class mu{constructor(e){H(this,"name"),Me(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function oM(t){return JSON.parse(JSON.stringify(t))}function C3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function S3(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(er(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:b1("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:b1("orphan",r),filter:oM(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?C3(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{er(a)?i.push(a):s.push((async()=>{i.push(await jr(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=C3(i.map(a=>a.toLowerCase()))}return{filter:n,tag:b1("event",n),type:"event"}}F(!1,"unknown ProviderEvent","event",t)}function A3(){return new Date().getTime()}const aM={cacheTimeout:250,pollingInterval:4e3};var Nn,bc,xn,lf,pi,gu,kc,aa,k1,Gi,uf,df,$t,Kn,R3,T3,hf,N3,ff,_1;class vu{constructor(e,r){if(K(this,$t),K(this,Nn),K(this,bc),K(this,xn),K(this,lf),K(this,pi),K(this,gu),K(this,kc),K(this,aa),K(this,k1),K(this,Gi),K(this,uf),K(this,df),M(this,df,Object.assign({},aM,r||{})),e==="any")M(this,gu,!0),M(this,pi,null);else if(e){const n=Fr.from(e);M(this,gu,!1),M(this,pi,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else M(this,gu,!1),M(this,pi,null);M(this,aa,-1),M(this,kc,new Map),M(this,Nn,new Map),M(this,bc,new Map),M(this,xn,null),M(this,lf,!1),M(this,k1,1),M(this,Gi,new Map),M(this,uf,!1)}get pollingInterval(){return A(this,df).pollingInterval}get provider(){return this}get plugins(){return Array.from(A(this,bc).values())}attachPlugin(e){if(A(this,bc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return A(this,bc).set(e.name,e.connect(this)),this}getPlugin(e){return A(this,bc).get(e)||null}get disableCcipRead(){return A(this,uf)}set disableCcipRead(e){M(this,uf,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a<n.length;a++){const c=n[a],l=c.replace("{sender}",i).replace("{data}",s),u=new gn(l);c.indexOf("{data}")===-1&&(u.body={data:s,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:u,index:a,urls:n});let d="unknown error",h;try{h=await u.send()}catch(f){o.push(f.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:{error:f}});continue}try{const f=h.bodyJson;if(f.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:u,result:f}),f.data;f.message&&(d=f.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:f})}catch{}oe(h.statusCode<400||h.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:d}}),o.push(d)}oe(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new o3(HU(e),this)}_wrapLog(e,r){return new uc(zU(e),this)}_wrapTransactionReceipt(e,r){return new s1($U(e),this)}_wrapTransactionResponse(e,r){return new Jh(tk(e),this)}_detectNetwork(){oe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){oe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=qe(await pe(this,$t,Kn).call(this,{method:"getBlockNumber"}),"%response");return A(this,aa)>=0&&M(this,aa,e),e}_getAddress(e){return jr(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(er(e))return er(e,32)?e:Ls(e);if(typeof e=="bigint"&&(e=qe(e,"blockTag")),typeof e=="number")return e>=0?Ls(e):A(this,aa)>=0?Ls(A(this,aa)+e):this.getBlockNumber().then(r=>Ls(r+e));F(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?C3(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,l,u)=>{let d;switch(c.length){case 0:break;case 1:d=c[0];break;default:c.sort(),d=c}if(n&&(l!=null||u!=null))throw new Error("invalid filter");const h={};return d&&(h.address=d),r.length&&(h.topics=r),l&&(h.fromBlock=l),u&&(h.toBlock=u),n&&(h.blockHash=n),h};let s=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(c=>i(c[0],c[1],c[2])):i(s,o,a)}_getTransactionRequest(e){const r=lc(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=jr(r[i],this);w1(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);w1(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(A(this,pi)==null){const i=(async()=>{try{const s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw A(this,pi)===i&&M(this,pi,null),s}})();return M(this,pi,i),(await i).clone()}const e=A(this,pi),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(A(this,gu)?(this.emit("network",n,r),A(this,pi)===e&&M(this,pi,Promise.resolve(n))):oe(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s,priorityFee:o}=await zr({_block:pe(this,$t,N3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await pe(this,$t,Kn).call(this,{method:"getGasPrice"});return We(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await pe(this,$t,Kn).call(this,{method:"getPriorityFee"});return We(u,"%response")}catch{}return null})()});let a=null,c=null;const l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(c=o??BigInt("1000000000"),a=l.baseFeePerGas*iM+c),new n1(s,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new gn(n.url),s=await n.processFunc(r,this,i);return new n1(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return w1(r)&&(r=await r),We(await pe(this,$t,Kn).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await zr({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await pe(this,$t,T3).call(this,pe(this,$t,R3).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return We(await pe(this,$t,hf).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return qe(await pe(this,$t,hf).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return Ee(await pe(this,$t,hf).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=We(r,"position");return Ee(await pe(this,$t,hf).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await zr({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=ql.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await zr({network:this.getNetwork(),params:pe(this,$t,N3).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await zr({network:this.getNetwork(),params:pe(this,$t,Kn).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await zr({network:this.getNetwork(),params:pe(this,$t,Kn).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await pe(this,$t,Kn).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await zr({network:this.getNetwork(),result:pe(this,$t,Kn).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:Ee(r)}async getLogs(e){let r=this._getFilter(e);w1(r)&&(r=await r);const{network:n,params:i}=await zr({network:this.getNetwork(),params:pe(this,$t,Kn).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){oe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await p1.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=wt(e);const r=xh(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await p1.getEnsAddress(this),i=await new na(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(i==null||i===ec)return null;const s=await new na(i,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(s)!==e?null:s}catch(n){if(Tr(n,"BAD_DATA")&&n.value==="0x"||Tr(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const c=async l=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&l-u.blockNumber+1>=i){s(u),a&&(clearTimeout(a),a=null);return}}catch(u){console.log("EEE",u)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o(cr("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){oe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=A(this,Gi).get(e);r&&(r.timer&&clearTimeout(r.timer),A(this,Gi).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=th(this,k1)._++,i=()=>{A(this,Gi).delete(n),e()};if(this.paused)A(this,Gi).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);A(this,Gi).set(n,{timer:s,func:i,time:A3()})}return n}_forEachSubscriber(e){for(const r of A(this,Nn).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new mu(e.type);case"block":{const r=new eM(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new tM(this,e.type);case"event":return new E3(this,e.filter);case"transaction":return new nM(this,e.hash);case"orphan":return new rM(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of A(this,Nn).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),A(this,xn)!=null&&r.pause(A(this,xn));break}}async on(e,r){const n=await pe(this,$t,_1).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,A(this,xn)!=null&&n.subscriber.pause(A(this,xn))),this}async once(e,r){const n=await pe(this,$t,_1).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,A(this,xn)!=null&&n.subscriber.pause(A(this,xn))),this}async emit(e,...r){const n=await pe(this,$t,ff).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new fp(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),A(this,Nn).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await pe(this,$t,ff).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of A(this,Nn).values())r+=n.length;return r}async listeners(e){if(e){const n=await pe(this,$t,ff).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of A(this,Nn).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await pe(this,$t,ff).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),A(this,Nn).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await pe(this,$t,_1).call(this,e);n&&i.stop(),A(this,Nn).delete(r)}else for(const[r,{started:n,subscriber:i}]of A(this,Nn))n&&i.stop(),A(this,Nn).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return A(this,lf)}destroy(){this.removeAllListeners();for(const e of A(this,Gi).keys())this._clearTimeout(e);M(this,lf,!0)}get paused(){return A(this,xn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(M(this,aa,-1),A(this,xn)!=null){if(A(this,xn)==!!e)return;oe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),M(this,xn,!!e);for(const r of A(this,Gi).values())r.timer&&clearTimeout(r.timer),r.time=A3()-r.time}resume(){if(A(this,xn)!=null){this._forEachSubscriber(e=>e.resume()),M(this,xn,null);for(const e of A(this,Gi).values()){let r=e.time;r<0&&(r=0),e.time=A3(),setTimeout(e.func,r)}}}}Nn=new WeakMap,bc=new WeakMap,xn=new WeakMap,lf=new WeakMap,pi=new WeakMap,gu=new WeakMap,kc=new WeakMap,aa=new WeakMap,k1=new WeakMap,Gi=new WeakMap,uf=new WeakMap,df=new WeakMap,$t=new WeakSet,Kn=async function(t){const e=A(this,df).cacheTimeout;if(e<0)return await this._perform(t);const r=b1(t.method,t);let n=A(this,kc).get(r);return n||(n=this._perform(t),A(this,kc).set(r,n),setTimeout(()=>{A(this,kc).get(r)===n&&A(this,kc).delete(r)},e)),await n},R3=async function(t,e,r){oe(r<sM,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:e,enableCcipRead:!0})});const n=lc(t);try{return Ee(await this._perform({method:"call",transaction:n,blockTag:e}))}catch(i){if(!this.disableCcipRead&&rh(i)&&i.data&&r>=0&&e==="latest"&&n.to!=null&&tr(i.data,0,4)==="0x556f1830"){const s=i.data,o=await jr(n.to,this);let a;try{a=hM(tr(i.data,4))}catch(u){oe(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:n,info:{data:s}})}oe(a.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:s,reason:"OffchainLookup",transaction:n,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:a.errorArgs}});const c=await this.ccipReadFetch(n,a.calldata,a.urls);oe(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:n,info:{data:i.data,errorArgs:a.errorArgs}});const l={to:o,data:Tt([a.selector,dM([c,a.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{const u=await pe(this,$t,R3).call(this,l,e,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:u}),u}}throw i}},T3=async function(t){const{value:e}=await zr({network:this.getNetwork(),value:t});return e},hf=async function(t,e,r){let n=this._getAddress(e),i=this._getBlockTag(r);return(typeof n!="string"||typeof i!="string")&&([n,i]=await Promise.all([n,i])),await pe(this,$t,T3).call(this,pe(this,$t,Kn).call(this,Object.assign(t,{address:n,blockTag:i})))},N3=async function(t,e){if(er(t,32))return await pe(this,$t,Kn).call(this,{method:"getBlock",blockHash:t,includeTransactions:e});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await pe(this,$t,Kn).call(this,{method:"getBlock",blockTag:r,includeTransactions:e})},ff=async function(t,e){let r=await S3(t,this);return r.type==="event"&&e&&e.length>0&&e[0].removed===!0&&(r=await S3({orphan:"drop-log",log:e[0]},this)),A(this,Nn).get(r.tag)||null},_1=async function(t){const e=await S3(t,this),r=e.tag;let n=A(this,Nn).get(r);return n||(n={subscriber:this._getSubscriber(e),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},A(this,Nn).set(r,n)),n};function cM(t,e){try{const r=x3(t,e);if(r)return Ds(r)}catch{}return null}function x3(t,e){if(t==="0x")return null;try{const r=qe(tr(t,e,e+32)),n=qe(tr(t,r,r+32));return tr(t,r+32,r+32+n)}catch{}return null}function ak(t){const e=Hr(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function lM(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const uM=new Uint8Array([]);function dM(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(uM),r+=32;for(let n=0;n<t.length;n++){const i=Ne(t[n]);e[n]=ak(r),e.push(ak(i.length)),e.push(lM(i)),r+=32+Math.ceil(i.length/32)*32}return Tt(e)}const ck="0x0000000000000000000000000000000000000000000000000000000000000000";function hM(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};oe(Vs(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=tr(t,0,32);oe(tr(r,0,12)===tr(ck,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=tr(r,12);try{const n=[],i=qe(tr(t,32,64)),s=qe(tr(t,i,i+32)),o=tr(t,i+32);for(let a=0;a<s;a++){const c=cM(o,a*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{oe(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=x3(t,64);if(n==null)throw new Error("abort");e.calldata=n}catch{oe(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}oe(tr(t,100,128)===tr(ck,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=tr(t,96,100);try{const n=x3(t,128);if(n==null)throw new Error("abort");e.extraData=n}catch{oe(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function yu(t,e){if(t.provider)return t.provider;oe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function lk(t,e){let r=lc(e);if(r.to!=null&&(r.to=jr(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),jr(n,t)]).then(([i,s])=>(F(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await zr(r)}class wu{constructor(e){H(this,"provider"),Me(this,{provider:e||null})}async getNonce(e){return yu(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await lk(this,e)}async populateTransaction(e){const r=yu(this,"populateTransaction"),n=await lk(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=We(n.chainId);F(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?F(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&F(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const o=await r.getFeeData();oe(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(oe(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):oe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await zr(n)}async estimateGas(e){return yu(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return yu(this,"call").call(await this.populateCall(e))}async resolveName(e){return await yu(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=yu(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=ql.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var pf,E1;const fM=class uN extends wu{constructor(e,r){super(r),K(this,pf),H(this,"address"),Me(this,{address:e})}async getAddress(){return this.address}connect(e){return new uN(this.address,e)}async signTransaction(e){pe(this,pf,E1).call(this,"transactions","signTransaction")}async signMessage(e){pe(this,pf,E1).call(this,"messages","signMessage")}async signTypedData(e,r,n){pe(this,pf,E1).call(this,"typed-data","signTypedData")}};pf=new WeakSet,E1=function(t,e){oe(!1,`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:e})};let C1=fM;const uk=new Set;function co(t){uk.has(t)||(uk.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}function pM(t){return JSON.parse(JSON.stringify(t))}var Vn,lo,bu,_c,ku,mf,_u,B3,I3;class dk{constructor(e){K(this,_u),K(this,Vn),K(this,lo),K(this,bu),K(this,_c),K(this,ku),K(this,mf),M(this,Vn,e),M(this,lo,null),M(this,bu,pe(this,_u,B3).bind(this)),M(this,_c,!1),M(this,ku,null),M(this,mf,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){A(this,_c)||(M(this,_c,!0),pe(this,_u,B3).call(this,-2))}stop(){A(this,_c)&&(M(this,_c,!1),M(this,mf,!0),pe(this,_u,I3).call(this),A(this,Vn).off("block",A(this,bu)))}pause(e){e&&pe(this,_u,I3).call(this),A(this,Vn).off("block",A(this,bu))}resume(){this.start()}}Vn=new WeakMap,lo=new WeakMap,bu=new WeakMap,_c=new WeakMap,ku=new WeakMap,mf=new WeakMap,_u=new WeakSet,B3=async function(t){try{A(this,lo)==null&&M(this,lo,this._subscribe(A(this,Vn)));let e=null;try{e=await A(this,lo)}catch(i){if(!Tr(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(e==null){M(this,lo,null),A(this,Vn)._recoverSubscriber(this,this._recover(A(this,Vn)));return}const r=await A(this,Vn).getNetwork();if(A(this,ku)||M(this,ku,r),A(this,ku).chainId!==r.chainId)throw new Error("chaid changed");if(A(this,mf))return;const n=await A(this,Vn).send("eth_getFilterChanges",[e]);await this._emitResults(A(this,Vn),n)}catch(e){console.log("@TODO",e)}A(this,Vn).once("block",A(this,bu))},I3=function(){const t=A(this,lo);t&&(M(this,lo,null),t.then(e=>{A(this,Vn).destroyed||A(this,Vn).send("eth_uninstallFilter",[e])}))};var Eu;class mM extends dk{constructor(e,r){super(e),K(this,Eu),M(this,Eu,pM(r))}_recover(e){return new E3(e,A(this,Eu))}async _subscribe(e){return await e.send("eth_newFilter",[A(this,Eu)])}async _emitResults(e,r){for(const n of r)e.emit(A(this,Eu),e._wrapLog(n,e._network))}}Eu=new WeakMap;class gM extends dk{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const vM="bigint,boolean,function,number,string,symbol".split(/,/g);function S1(t){if(t==null||vM.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(S1);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function yM(t){return new Promise(e=>{setTimeout(e,t)})}function Cu(t){return t&&t.toLowerCase()}function hk(t){return t&&typeof t.pollingInterval=="number"}const fk={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class gf extends wu{constructor(e,r){super(e),H(this,"address"),r=wt(r),Me(this,{address:r})}connect(e){oe(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const r=S1(e),n=[];if(r.from){const s=r.from;n.push((async()=>{const o=await jr(s,this.provider);F(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=o})())}else r.from=this.address;if(r.gasLimit==null&&n.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const s=r.to;n.push((async()=>{r.to=await jr(s,this.provider)})())}n.length&&await Promise.all(n);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(e){const r=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((i,s)=>{const o=[1e3,100];let a=0;const c=async()=>{try{const l=await this.provider.getTransaction(n);if(l!=null){i(l.replaceableTransaction(r));return}}catch(l){if(Tr(l,"CANCELLED")||Tr(l,"BAD_DATA")||Tr(l,"NETWORK_ERROR")||Tr(l,"UNSUPPORTED_OPERATION")){l.info==null&&(l.info={}),l.info.sendTransactionHash=n,s(l);return}if(Tr(l,"INVALID_ARGUMENT")&&(a++,l.info==null&&(l.info={}),l.info.sendTransactionHash=n,a>10)){s(l);return}this.provider.emit("error",cr("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:l}))}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(e){const r=S1(e);if(r.from){const i=await jr(r.from,this.provider);F(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=i}else r.from=this.address;const n=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const r=typeof e=="string"?Vr(e):e;return await this.provider.send("personal_sign",[Ee(r),this.address.toLowerCase()])}async signTypedData(e,r,n){const i=S1(n),s=await oc.resolveNames(e,r,i,async o=>{const a=await jr(o);return F(a!=null,"TypedData does not support null address","value",o),a});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(oc.getPayload(s.domain,r,s.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const r=typeof e=="string"?Vr(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Ee(r)])}}var Su,vf,ca,uo,fs,Hi,qn,A1,O3;class R1 extends vu{constructor(e,r){super(e,r),K(this,A1),K(this,Su),K(this,vf),K(this,ca),K(this,uo),K(this,fs),K(this,Hi),K(this,qn),M(this,vf,1),M(this,Su,Object.assign({},fk,r||{})),M(this,ca,[]),M(this,uo,null),M(this,Hi,null),M(this,qn,null);{let i=null;const s=new Promise(o=>{i=o});M(this,fs,{promise:s,resolve:i})}const n=this._getOption("staticNetwork");typeof n=="boolean"?(F(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",r),n&&e!=null&&M(this,Hi,Fr.from(e))):n&&(F(e==null||n.matches(e),"staticNetwork MUST match network object","options",r),M(this,Hi,n))}_getOption(e){return A(this,Su)[e]}get _network(){return oe(A(this,Hi),"network is not available yet","NETWORK_ERROR"),A(this,Hi)}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&We(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}const r=this.getRpcRequest(e);return r!=null?await this.send(r.method,r.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)if(e===!0){if(A(this,Hi))return A(this,Hi)}else return e;return A(this,qn)?await A(this,qn):this.ready?(M(this,qn,(async()=>{try{const r=Fr.from(We(await this.send("eth_chainId",[])));return M(this,qn,null),r}catch(r){throw M(this,qn,null),r}})()),await A(this,qn)):(M(this,qn,(async()=>{const r={id:th(this,vf)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let n;try{n=(await this._send(r))[0],M(this,qn,null)}catch(i){throw M(this,qn,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Fr.from(We(n.result));throw this.getRpcError(r,n)})()),await A(this,qn))}_start(){A(this,fs)==null||A(this,fs).resolve==null||(A(this,fs).resolve(),M(this,fs,null),(async()=>{for(;A(this,Hi)==null&&!this.destroyed;)try{M(this,Hi,await this._detectNetwork())}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",cr("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await yM(1e3)}pe(this,A1,O3).call(this)})())}async _waitUntilReady(){if(A(this,fs)!=null)return await A(this,fs).promise}_getSubscriber(e){return e.type==="pending"?new gM(this):e.type==="event"?this._getOption("polling")?new E3(this,e.filter):new mM(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new mu("orphan"):super._getSubscriber(e)}get ready(){return A(this,fs)==null}getRpcTransaction(e){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let i=n;n==="gasLimit"&&(i="gas"),r[i]=Ls(We(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(r[n]=Ee(e[n]))}),e.accessList&&(r.accessList=ds(e.accessList)),e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),r}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Cu(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Cu(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Cu(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Cu(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Cu):e.filter.address=Cu(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,r){const{method:n}=e,{error:i}=r;if(n==="eth_estimateGas"&&i.message){const a=i.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return cr("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}})}if(n==="eth_call"||n==="eth_estimateGas"){const a=U3(i),c=su.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],a?a.data:null);return c.info={error:i,payload:e},c}const s=JSON.stringify(wM(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return cr("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:i}});if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){const a=e.params[0];if(s.match(/insufficient funds|base fee exceeds gas limit/i))return cr("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:i}});if(s.match(/nonce/i)&&s.match(/too low/i))return cr("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:i}});if(s.match(/replacement transaction/i)&&s.match(/underpriced/i))return cr("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:i}});if(s.match(/only replay-protected/i))return cr("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:a,info:{error:i}}})}let o=!!s.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?cr("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):cr("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,r){if(this.destroyed)return Promise.reject(cr("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const n=th(this,vf)._++,i=new Promise((s,o)=>{A(this,ca).push({resolve:s,reject:o,payload:{method:e,params:r,id:n,jsonrpc:"2.0"}})});return pe(this,A1,O3).call(this),i}async getSigner(e){e==null&&(e=0);const r=this.send("eth_accounts",[]);if(typeof e=="number"){const i=await r;if(e>=i.length)throw new Error("no such account");return new gf(this,i[e])}const{accounts:n}=await zr({network:this.getNetwork(),accounts:r});e=wt(e);for(const i of n)if(wt(i)===e)return new gf(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(e=>new gf(this,e))}destroy(){A(this,uo)&&(clearTimeout(A(this,uo)),M(this,uo,null));for(const{payload:e,reject:r}of A(this,ca))r(cr("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));M(this,ca,[]),super.destroy()}}Su=new WeakMap,vf=new WeakMap,ca=new WeakMap,uo=new WeakMap,fs=new WeakMap,Hi=new WeakMap,qn=new WeakMap,A1=new WeakSet,O3=function(){if(A(this,uo))return;const t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");M(this,uo,setTimeout(()=>{M(this,uo,null);const e=A(this,ca);for(M(this,ca,[]);e.length;){const r=[e.shift()];for(;e.length&&r.length!==A(this,Su).batchMaxCount;)if(r.push(e.shift()),JSON.stringify(r.map(n=>n.payload)).length>A(this,Su).batchMaxSize){e.unshift(r.pop());break}(async()=>{const n=r.length===1?r[0].payload:r.map(i=>i.payload);this.emit("debug",{action:"sendRpcPayload",payload:n});try{const i=await this._send(n);this.emit("debug",{action:"receiveRpcResult",result:i});for(const{resolve:s,reject:o,payload:a}of r){if(this.destroyed){o(cr("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:a.method}));continue}const c=i.filter(l=>l.id===a.id)[0];if(c==null){const l=cr("missing response for request","BAD_DATA",{value:i,info:{payload:a}});this.emit("error",l),o(l);continue}if("error"in c){o(this.getRpcError(a,c));continue}s(c.result)}}catch(i){this.emit("debug",{action:"receiveRpcError",error:i});for(const{reject:s}of r)s(i)}})()}},t))};var Ec;class pk extends R1{constructor(e,r){super(e,r),K(this,Ec);let n=this._getOption("pollingInterval");n==null&&(n=fk.pollingInterval),M(this,Ec,n)}_getSubscriber(e){const r=super._getSubscriber(e);return hk(r)&&(r.pollingInterval=A(this,Ec)),r}get pollingInterval(){return A(this,Ec)}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");M(this,Ec,e),this._forEachSubscriber(r=>{hk(r)&&(r.pollingInterval=A(this,Ec))})}}Ec=new WeakMap;var yf;class ei extends pk{constructor(e,r,n){e==null&&(e="http://localhost:8545"),super(r,n),K(this,yf),typeof e=="string"?M(this,yf,new gn(e)):M(this,yf,e.clone())}_getConnection(){return A(this,yf).clone()}async send(e,r){return await this._start(),await super.send(e,r)}async _send(e){const r=this._getConnection();r.body=JSON.stringify(e),r.setHeader("content-type","application/json");const n=await r.send();n.assertOk();let i=n.bodyJson;return Array.isArray(i)||(i=[i]),i}}yf=new WeakMap;function U3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&er(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=U3(t[e]);if(r)return r}return null}if(typeof t=="string")try{return U3(JSON.parse(t))}catch{}return null}function M3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)M3(t[r],e);if(typeof t=="string")try{return M3(JSON.parse(t),e)}catch{}}}function wM(t){const e=[];return M3(t,e),e}const T1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function bM(t){switch(t){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}F(!1,"unsupported network","network",t)}class Au extends ei{constructor(e,r){e==null&&(e="mainnet");const n=Fr.from(e);r==null&&(r=T1);const i={polling:!0,staticNetwork:n},s=Au.getRequest(n,r);super(s,n,i),H(this,"apiKey"),Me(this,{apiKey:r})}_getProvider(e){try{return new Au(e,this.apiKey)}catch{}return super._getProvider(e)}static getRequest(e,r){r==null&&(r=T1);const n=new gn(`https://${bM(e.name)}/${r}`);return n.allowGzip=!0,r===T1&&(n.retryFunc=async(i,s,o)=>(co("AnkrProvider"),!0)),n}getRpcError(e,r){return e.method==="eth_sendRawTransaction"&&r&&r.error&&r.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(r.error.message="replacement transaction underpriced"),super.getRpcError(e,r)}isCommunityResource(){return this.apiKey===T1}}const N1="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function kM(t){switch(t){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}F(!1,"unsupported network","network",t)}class Ru extends ei{constructor(e,r){e==null&&(e="mainnet");const n=Fr.from(e);r==null&&(r=N1);const i=Ru.getRequest(n,r);super(i,n,{staticNetwork:n}),H(this,"apiKey"),Me(this,{apiKey:r})}_getProvider(e){try{return new Ru(e,this.apiKey)}catch{}return super._getProvider(e)}async _perform(e){if(e.method==="getTransactionResult"){const{trace:r,tx:n}=await zr({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(r==null||n==null)return null;let i,s=!1;try{i=r[0].result.output,s=r[0].error==="Reverted"}catch{}if(i)return oe(!s,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:n,invocation:null,revert:null}),i;oe(!1,"could not parse trace result","BAD_DATA",{value:r})}return await super._perform(e)}isCommunityResource(){return this.apiKey===N1}static getRequest(e,r){r==null&&(r=N1);const n=new gn(`https://${kM(e.name)}/v2/${r}`);return n.allowGzip=!0,r===N1&&(n.retryFunc=async(i,s,o)=>(co("alchemy"),!0)),n}}function x1(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}F(!1,"unsupported network","network",t)}function _M(t){switch(t){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}F(!1,"unsupported network","network",t)}class Tu extends ei{constructor(e,r){e==null&&(e="mainnet");const n=Fr.from(e);r==null&&(r=x1(n.name));const i=Tu.getRequest(n,r);super(i,n,{staticNetwork:n}),H(this,"apiKey"),Me(this,{apiKey:r})}_getProvider(e){try{return new Tu(e,this.apiKey)}catch{}return super._getProvider(e)}isCommunityResource(){return this.apiKey===x1(this._network.name)}static getRequest(e,r){r==null&&(r=x1(e.name));const n=new gn(`https://${_M(e.name)}/${r}`);return n.allowGzip=!0,r===x1(e.name)&&(n.retryFunc=async(i,s,o)=>(co("ChainstackProvider"),!0)),n}}class P3 extends ei{constructor(e){e==null&&(e="mainnet");const r=Fr.from(e);F(r.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",r,{staticNetwork:r})}}const mk=2e3;function EM(t){return t&&typeof t.then=="function"}const gk="org.ethers.plugins.provider.Etherscan";class B1 extends oo{constructor(e){super(gk),H(this,"baseUrl"),Me(this,{baseUrl:e})}clone(){return new B1(this.baseUrl)}}const CM=["enableCcipRead"];let SM=1;var wf;class V3 extends vu{constructor(e,r){const n=r??null;super(),H(this,"network"),H(this,"apiKey"),K(this,wf);const i=Fr.from(e);M(this,wf,i.getPlugin(gk)),Me(this,{apiKey:n,network:i}),this.getBaseUrl()}getBaseUrl(){if(A(this,wf))return A(this,wf).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}F(!1,"unsupported network","network",this.network)}getUrl(e,r){const n=Object.keys(r).reduce((s,o)=>{const a=r[o];return a!=null&&(s+=`&${o}=${a}`),s},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${e}${n}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}async detectNetwork(){return this.network}async fetch(e,r,n){const i=SM++,s=n?this.getPostUrl():this.getUrl(e,r),o=n?this.getPostData(e,r):null;this.emit("debug",{action:"sendRequest",id:i,url:s,payload:o});const a=new gn(s);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(u,d,h)=>(this.isCommunityResource()&&co("Etherscan"),Promise.resolve(!0)),a.processFunc=async(u,d)=>{const h=d.hasBody()?JSON.parse(Ds(d.body)):{},f=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return e==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&f&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:h}),d.throwThrottleError(h.result,mk)):f&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),d.throwThrottleError(h.result,mk)),d},o&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(o).map(u=>`${u}=${o[u]}`).join("&"));const c=await a.send();try{c.assertOk()}catch(u){this.emit("debug",{action:"receiveError",id:i,error:u,reason:"assertOk"}),oe(!1,"response error","SERVER_ERROR",{request:a,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),oe(!1,"missing response","SERVER_ERROR",{request:a,response:c}));const l=JSON.parse(Ds(c.body));return e==="proxy"?(l.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:l,reason:"invalid JSON-RPC"}),oe(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:c,info:{result:l}})),l.error&&(this.emit("debug",{action:"receiveError",id:i,result:l,reason:"JSON-RPC error"}),oe(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:l}})),this.emit("debug",{action:"receiveRequest",id:i,result:l}),l.result):l.status==0&&(l.message==="No records found"||l.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:l}),l.result):((l.status!=1||typeof l.message=="string"&&!l.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:l}),oe(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:l}})),this.emit("debug",{action:"receiveRequest",id:i,result:l}),l.result)}_getTransactionPostData(e){const r={};for(let n in e){if(CM.indexOf(n)>=0||e[n]==null)continue;let i=e[n];if(!(n==="type"&&i===0)&&!(n==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n])i=Ls(i);else if(n==="accessList")i="["+ds(i).map(s=>`{address:"${s.address}",storageKeys:["${s.storageKeys.join('","')}"]}`).join(",")+"]";else if(n==="blobVersionedHashes"){if(i.length===0)continue;oe(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else i=Ee(i);r[n]=i}}return r}_checkError(e,r,n){let i="";if(Tr(r,"SERVER_ERROR")){try{i=r.info.result.error.message}catch{}if(!i)try{i=r.info.message}catch{}}if(e.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&oe(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),(e.method==="call"||e.method==="estimateGas")&&i.match(/execution reverted/i)){let s="";try{s=r.info.result.error.data}catch{}const o=su.getBuiltinCallException(e.method,e.transaction,s);throw o.info={request:e,error:r},o}if(i&&e.method==="broadcastTransaction"){const s=ql.from(e.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&oe(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:s}),i.match(/insufficient funds/)&&oe(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:s}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&oe(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:s})}throw r}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(r=>this._checkError(e,r,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});oe(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if(e.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const r=this._getTransactionPostData(e.transaction);r.module="proxy",r.action="eth_call";try{return await this.fetch("proxy",r,!0)}catch(n){return this._checkError(e,n,e.transaction)}}case"estimateGas":{const r=this._getTransactionPostData(e.transaction);r.module="proxy",r.action="eth_estimateGas";try{return await this.fetch("proxy",r,!0)}catch(n){return this._checkError(e,n,e.transaction)}}}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let r=this._getAddress(e);EM(r)&&(r=await r);try{const n=await this.fetch("contract",{action:"getabi",address:r}),i=JSON.parse(n);return new na(r,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}}wf=new WeakMap;function AM(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}const RM=AM().WebSocket;var ho,I1,Cc,Nu,Sc;class bf{constructor(e,r){K(this,ho),K(this,I1),K(this,Cc),K(this,Nu),K(this,Sc),M(this,ho,e),M(this,I1,JSON.stringify(r)),M(this,Cc,null),M(this,Nu,null),M(this,Sc,null)}get filter(){return JSON.parse(A(this,I1))}start(){M(this,Cc,A(this,ho).send("eth_subscribe",this.filter).then(e=>(A(this,ho)._register(e,this),e)))}stop(){A(this,Cc).then(e=>{A(this,ho).destroyed||A(this,ho).send("eth_unsubscribe",[e])}),M(this,Cc,null)}pause(e){oe(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),M(this,Nu,!!e)}resume(){M(this,Nu,null)}_handleMessage(e){if(A(this,Cc)!=null&&A(this,Nu)===null){let r=A(this,Sc);r==null?r=this._emit(A(this,ho),e):r=r.then(async()=>{await this._emit(A(this,ho),e)}),M(this,Sc,r.then(()=>{A(this,Sc)===r&&M(this,Sc,null)}))}}async _emit(e,r){throw new Error("sub-classes must implemente this; _emit")}}ho=new WeakMap,I1=new WeakMap,Cc=new WeakMap,Nu=new WeakMap,Sc=new WeakMap;class F3 extends bf{constructor(e){super(e,["newHeads"])}async _emit(e,r){e.emit("block",parseInt(r.number))}}class L3 extends bf{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,r){e.emit("pending",r)}}var O1;class D3 extends bf{constructor(e,r){super(e,["logs",r]),K(this,O1),M(this,O1,JSON.stringify(r))}get logFilter(){return JSON.parse(A(this,O1))}async _emit(e,r){e.emit(this.logFilter,e._wrapLog(r,e._network))}}O1=new WeakMap;var xu,kf,Ac;class W3 extends R1{constructor(e,r){const n=Object.assign({},r??{});F(n.batchMaxCount==null||n.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",r),n.batchMaxCount=1,n.staticNetwork==null&&(n.staticNetwork=!0),super(e,n),K(this,xu),K(this,kf),K(this,Ac),M(this,xu,new Map),M(this,kf,new Map),M(this,Ac,new Map)}_getSubscriber(e){switch(e.type){case"close":return new mu("close");case"block":return new F3(this);case"pending":return new L3(this);case"event":return new D3(this,e.filter);case"orphan":if(e.filter.orphan==="drop-log")return new mu("drop-log")}return super._getSubscriber(e)}_register(e,r){A(this,kf).set(e,r);const n=A(this,Ac).get(e);if(n){for(const i of n)r._handleMessage(i);A(this,Ac).delete(e)}}async _send(e){F(!Array.isArray(e),"WebSocket does not support batch send","payload",e);const r=new Promise((n,i)=>{A(this,xu).set(e.id,{payload:e,resolve:n,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await r]}async _processMessage(e){const r=JSON.parse(e);if(r&&typeof r=="object"&&"id"in r){const n=A(this,xu).get(r.id);if(n==null){this.emit("error",cr("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:r}));return}A(this,xu).delete(r.id),n.resolve(r)}else if(r&&r.method==="eth_subscription"){const n=r.params.subscription,i=A(this,kf).get(n);if(i)i._handleMessage(r.params.result);else{let s=A(this,Ac).get(n);s==null&&(s=[],A(this,Ac).set(n,s)),s.push(r.params.result)}}else{this.emit("error",cr("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:r}));return}}async _write(e){throw new Error("sub-classes must override this")}}xu=new WeakMap,kf=new WeakMap,Ac=new WeakMap;var Bu,ps;class U1 extends W3{constructor(e,r,n){super(r,n),K(this,Bu),K(this,ps),typeof e=="string"?(M(this,Bu,()=>new RM(e)),M(this,ps,A(this,Bu).call(this))):typeof e=="function"?(M(this,Bu,e),M(this,ps,e())):(M(this,Bu,null),M(this,ps,e)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(A(this,ps)==null)throw new Error("websocket closed");return A(this,ps)}async _write(e){this.websocket.send(e)}async destroy(){A(this,ps)!=null&&(A(this,ps).close(),M(this,ps,null)),super.destroy()}}Bu=new WeakMap,ps=new WeakMap;const _f="84842078b09946638c03157f83405213";function TM(t){switch(t){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}F(!1,"unsupported network","network",t)}class Z3 extends U1{constructor(e,r){const n=new Rc(e,r),i=n._getConnection();oe(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const s=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(s,n._network),H(this,"projectId"),H(this,"projectSecret"),Me(this,{projectId:n.projectId,projectSecret:n.projectSecret})}isCommunityResource(){return this.projectId===_f}}class Rc extends ei{constructor(e,r,n){e==null&&(e="mainnet");const i=Fr.from(e);r==null&&(r=_f),n==null&&(n=null);const s=Rc.getRequest(i,r,n);super(s,i,{staticNetwork:i}),H(this,"projectId"),H(this,"projectSecret"),Me(this,{projectId:r,projectSecret:n})}_getProvider(e){try{return new Rc(e,this.projectId,this.projectSecret)}catch{}return super._getProvider(e)}isCommunityResource(){return this.projectId===_f}static getWebSocketProvider(e,r){return new Z3(e,r)}static getRequest(e,r,n){r==null&&(r=_f),n==null&&(n=null);const i=new gn(`https://${TM(e.name)}/v3/${r}`);return i.allowGzip=!0,n&&i.setCredentials("",n),r===_f&&(i.retryFunc=async(s,o,a)=>(co("InfuraProvider"),!0)),i}}const M1="919b412a057b5e9c9b6dce193c5a60242d6efadb";function NM(t){switch(t){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}F(!1,"unsupported network","network",t)}class Iu extends ei{constructor(e,r){e==null&&(e="mainnet");const n=Fr.from(e);r==null&&(r=M1);const i=Iu.getRequest(n,r);super(i,n,{staticNetwork:n}),H(this,"token"),Me(this,{token:r})}_getProvider(e){try{return new Iu(e,this.token)}catch{}return super._getProvider(e)}isCommunityResource(){return this.token===M1}static getRequest(e,r){r==null&&(r=M1);const n=new gn(`https://${NM(e.name)}/${r}`);return n.allowGzip=!0,r===M1&&(n.retryFunc=async(i,s,o)=>(co("QuickNodeProvider"),!0)),n}}const xM=BigInt("1"),BM=BigInt("2");function IM(t){for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}}function OM(t){return new Promise(e=>{setTimeout(e,t)})}function z3(){return new Date().getTime()}function G3(t){return JSON.stringify(t,(e,r)=>typeof r=="bigint"?{type:"bigint",value:r.toString()}:r)}const vk={stallTimeout:400,priority:1,weight:1},yk={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function UM(t,e){for(;(t.blockNumber<0||t.blockNumber<e)&&(t._updateNumber||(t._updateNumber=(async()=>{try{const r=await t.provider.getBlockNumber();r>t.blockNumber&&(t.blockNumber=r)}catch(r){t.blockNumber=-2,t._lastFatalError=r,t._lastFatalErrorTimestamp=z3()}t._updateNumber=null})()),await t._updateNumber,t.outOfSync++,!t._lastFatalError););}function Ef(t){if(t==null)return"null";if(Array.isArray(t))return"["+t.map(Ef).join(",")+"]";if(typeof t=="object"&&typeof t.toJSON=="function")return Ef(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":case"number":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{"+e.map(r=>`${JSON.stringify(r)}:${Ef(t[r])}`).join(",")+"}"}}throw console.log("Could not serialize",t),new Error("Hmm...")}function H3(t){if("error"in t){const r=t.error;return{tag:Ef(r),value:r}}const e=t.result;return{tag:Ef(e),value:e}}function P1(t,e){const r=new Map;for(const{value:i,tag:s,weight:o}of e){const a=r.get(s)||{value:i,weight:0};a.weight+=o,r.set(s,a)}let n=null;for(const i of r.values())i.weight>=t&&(!n||i.weight>n.weight)&&(n=i);if(n)return n.value}function j3(t,e){let r=0;const n=new Map;let i=null;const s=[];for(const{value:a,tag:c,weight:l}of e)if(a instanceof Error){const u=n.get(c)||{value:a,weight:0};u.weight+=l,n.set(c,u),(i==null||u.weight>i.weight)&&(i=u)}else s.push(BigInt(a)),r+=l;if(r<t)return i&&i.weight>=t?i.value:void 0;s.sort((a,c)=>a<c?-1:c>a?1:0);const o=Math.floor(s.length/2);return s.length%2?s[o]:(s[o-1]+s[o]+xM)/BM}function Q3(t,e){const r=P1(t,e);if(r!==void 0)return r;for(const n of e)if(n.value)return n.value}function MM(t,e){if(t===1)return qe(j3(t,e),"%internal");const r=new Map,n=(o,a)=>{const c=r.get(o)||{result:o,weight:0};c.weight+=a,r.set(o,c)};for(const{weight:o,value:a}of e){const c=qe(a);n(c-1,o),n(c,o),n(c+1,o)}let i=0,s;for(const{weight:o,result:a}of r.values())o>=t&&(o>i||s!=null&&o===i&&a>s)&&(i=o,s=a);return s}var ti,la,Cf,fo,wk,J3,bk,kk,$3;class Y3 extends vu{constructor(e,r,n){super(r,n),K(this,fo),H(this,"quorum"),H(this,"eventQuorum"),H(this,"eventWorkers"),K(this,ti),K(this,la),K(this,Cf),M(this,ti,e.map(i=>i instanceof vu?Object.assign({provider:i},vk,yk):Object.assign({},vk,i,yk))),M(this,la,-2),M(this,Cf,null),n&&n.quorum!=null?this.quorum=n.quorum:this.quorum=Math.ceil(A(this,ti).reduce((i,s)=>(i+=s.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,F(this.quorum<=A(this,ti).reduce((i,s)=>i+s.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return A(this,ti).map(e=>{const r=Object.assign({},e);for(const n in r)n[0]==="_"&&delete r[n];return r})}async _detectNetwork(){return Fr.from(We(await this._perform({method:"chainId"})))}async _translatePerform(e,r){switch(r.method){case"broadcastTransaction":return await e.broadcastTransaction(r.signedTransaction);case"call":return await e.call(Object.assign({},r.transaction,{blockTag:r.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(r.transaction);case"getBalance":return await e.getBalance(r.address,r.blockTag);case"getBlock":{const n="blockHash"in r?r.blockHash:r.blockTag;return await e.getBlock(n,r.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(r.address,r.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getPriorityFee":return(await e.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await e.getLogs(r.filter);case"getStorage":return await e.getStorage(r.address,r.position,r.blockTag);case"getTransaction":return await e.getTransaction(r.hash);case"getTransactionCount":return await e.getTransactionCount(r.address,r.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(r.hash);case"getTransactionResult":return await e.getTransactionResult(r.hash)}}async _perform(e){if(e.method==="broadcastTransaction"){const s=A(this,ti).map(c=>null),o=A(this,ti).map(async({provider:c,weight:l},u)=>{try{const d=await c._perform(e);s[u]=Object.assign(H3({result:d}),{weight:l})}catch(d){s[u]=Object.assign(H3({error:d}),{weight:l})}});for(;;){const c=s.filter(d=>d!=null);for(const{value:d}of c)if(!(d instanceof Error))return d;const l=P1(this.quorum,s.filter(d=>d!=null));if(Tr(l,"INSUFFICIENT_FUNDS"))throw l;const u=o.filter((d,h)=>s[h]==null);if(u.length===0)break;await Promise.race(u)}const a=Q3(this.quorum,s);if(oe(a!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:s.map(G3)}}),a instanceof Error)throw a;return a}await pe(this,fo,bk).call(this);const r=new Set;let n=0;for(;;){const s=pe(this,fo,J3).call(this,r,e);if(s==null||(n+=s.config.weight,n>=this.quorum))break}const i=await pe(this,fo,$3).call(this,r,e);for(const s of r)s.perform&&s.result==null&&s.config.lateResponses++;return i}async destroy(){for(const{provider:e}of A(this,ti))e.destroy();super.destroy()}}ti=new WeakMap,la=new WeakMap,Cf=new WeakMap,fo=new WeakSet,wk=function(t){const e=Array.from(t).map(n=>n.config),r=A(this,ti).slice();IM(r),r.sort((n,i)=>n.priority-i.priority);for(const n of r)if(!n._lastFatalError&&e.indexOf(n)===-1)return n;return null},J3=function(t,e){const r=pe(this,fo,wk).call(this,t);if(r==null)return null;const n={config:r,result:null,didBump:!1,perform:null,staller:null},i=z3();return n.perform=(async()=>{try{r.requests++;const o=await this._translatePerform(r.provider,e);n.result={result:o}}catch(o){r.errorResponses++,n.result={error:o}}const s=z3()-i;r._totalTime+=s,r.rollingDuration=.95*r.rollingDuration+.05*s,n.perform=null})(),n.staller=(async()=>{await OM(r.stallTimeout),n.staller=null})(),t.add(n),n},bk=async function(){let t=A(this,Cf);if(!t){const e=[];A(this,ti).forEach(r=>{e.push((async()=>{await UM(r,0),r._lastFatalError||(r._network=await r.provider.getNetwork())})())}),M(this,Cf,t=(async()=>{await Promise.all(e);let r=null;for(const n of A(this,ti)){if(n._lastFatalError)continue;const i=n._network;r==null?r=i.chainId:i.chainId!==r&&oe(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await t},kk=async function(t,e){const r=[];for(const n of t)if(n.result!=null){const{tag:i,value:s}=H3(n.result);r.push({tag:i,value:s,weight:n.config.weight})}if(!(r.reduce((n,i)=>n+i.weight,0)<this.quorum)){switch(e.method){case"getBlockNumber":{A(this,la)===-2&&M(this,la,Math.ceil(qe(j3(this.quorum,A(this,ti).filter(i=>!i._lastFatalError).map(i=>({value:i.blockNumber,tag:qe(i.blockNumber).toString(),weight:i.weight}))))));const n=MM(this.quorum,r);return n===void 0?void 0:(n>A(this,la)&&M(this,la,n),A(this,la))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return j3(this.quorum,r);case"getBlock":return"blockTag"in e&&e.blockTag==="pending"?Q3(this.quorum,r):P1(this.quorum,r);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return P1(this.quorum,r);case"broadcastTransaction":return Q3(this.quorum,r)}oe(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${G3(e.method)})`})}},$3=async function(t,e){if(t.size===0)throw new Error("no runners?!");const r=[];let n=0;for(const s of t){if(s.perform&&r.push(s.perform),s.staller){r.push(s.staller);continue}s.didBump||(s.didBump=!0,n++)}const i=await pe(this,fo,kk).call(this,t,e);if(i!==void 0){if(i instanceof Error)throw i;return i}for(let s=0;s<n;s++)pe(this,fo,J3).call(this,t,e);return oe(r.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:Array.from(t).map(s=>G3(s.result))}}),await Promise.race(r),await pe(this,fo,$3).call(this,t,e)};function PM(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const VM="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function _k(t,e){e==null&&(e={});const r=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof t=="string"&&t.match(/^https?:/))return new ei(t);if(typeof t=="string"&&t.match(/^wss?:/)||PM(t))return new U1(t);let n=null;try{n=Fr.from(t)}catch{}const i=[];if(r("publicPolygon")&&n&&(n.name==="matic"?i.push(new ei("https://polygon-rpc.com/",n,{staticNetwork:n})):n.name==="matic-amoy"&&i.push(new ei("https://rpc-amoy.polygon.technology/",n,{staticNetwork:n}))),r("alchemy"))try{i.push(new Ru(t,e.alchemy))}catch{}if(r("ankr")&&e.ankr!=null)try{i.push(new Au(t,e.ankr))}catch{}if(r("chainstack"))try{i.push(new Tu(t,e.chainstack))}catch{}if(r("cloudflare"))try{i.push(new P3(t))}catch{}if(r("etherscan"))try{i.push(new V3(t,e.etherscan))}catch{}if(r("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),i.push(new Rc(t,o,a))}catch{}if(r("quicknode"))try{let o=e.quicknode;i.push(new Iu(t,o))}catch{}if(oe(i.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),i.length===1)return i[0];let s=Math.floor(i.length/2);return s>2&&(s=2),n&&VM.indexOf(n.name)!==-1&&(s=1),e&&e.quorum&&(s=e.quorum),new Y3(i,void 0,{quorum:s})}var Tc,Ou;const FM=class dN extends wu{constructor(e){super(e.provider),H(this,"signer"),K(this,Tc),K(this,Ou),Me(this,{signer:e}),M(this,Tc,null),M(this,Ou,0)}async getAddress(){return this.signer.getAddress()}connect(e){return new dN(this.signer.connect(e))}async getNonce(e){if(e==="pending"){A(this,Tc)==null&&M(this,Tc,super.getNonce("pending"));const r=A(this,Ou);return await A(this,Tc)+r}return super.getNonce(e)}increment(){th(this,Ou)._++}reset(){M(this,Ou,0),M(this,Tc,null)}async sendTransaction(e){const r=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await r,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,r,n){return this.signer.signTypedData(e,r,n)}};Tc=new WeakMap,Ou=new WeakMap;let Ek=FM;var Sf;class X3 extends pk{constructor(e,r,n){const i=Object.assign({},n??{},{batchMaxCount:1});F(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(r,i),K(this,Sf),M(this,Sf,async(s,o)=>{const a={method:s,params:o};this.emit("debug",{action:"sendEip1193Request",payload:a});try{const c=await e.request(a);return this.emit("debug",{action:"receiveEip1193Result",result:c}),c}catch(c){const l=new Error(c.message);throw l.code=c.code,l.data=c.data,l.payload=a,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(e,r){return await this._start(),await super.send(e,r)}async _send(e){F(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const r=await A(this,Sf).call(this,e.method,e.params||[]);return[{id:e.id,result:r}]}catch(r){return[{id:e.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(e,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(e,r)}async hasSigner(e){e==null&&(e=0);const r=await this.send("eth_accounts",[]);return typeof e=="number"?r.length>e:(e=e.toLowerCase(),r.filter(n=>n.toLowerCase()===e).length!==0)}async getSigner(e){if(e==null&&(e=0),!await this.hasSigner(e))try{await A(this,Sf).call(this,"eth_requestAccounts",[])}catch(r){const n=r.payload;throw this.getRpcError(n,{id:n.id,error:r})}return await super.getSigner(e)}}Sf=new WeakMap;const V1="62e1ad51b37b8e00394bda3b";function LM(t){switch(t){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}F(!1,"unsupported network","network",t)}class Af extends ei{constructor(e,r,n){e==null&&(e="mainnet");const i=Fr.from(e);r==null&&(r=V1),n==null&&(n=null);const s={staticNetwork:i},o=Af.getRequest(i,r,n);super(o,i,s),H(this,"applicationId"),H(this,"applicationSecret"),Me(this,{applicationId:r,applicationSecret:n})}_getProvider(e){try{return new Af(e,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(e)}static getRequest(e,r,n){r==null&&(r=V1);const i=new gn(`https://${LM(e.name)}/v1/lb/${r}`);return i.allowGzip=!0,n&&i.setCredentials("",n),r===V1&&(i.retryFunc=async(s,o,a)=>(co("PocketProvider"),!0)),i}isCommunityResource(){return this.applicationId===V1}}const Ck=void 0;var Rf;const DM=class hN extends wu{constructor(e,r){super(r),H(this,"address"),K(this,Rf),F(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),M(this,Rf,e);const n=nc(this.signingKey.publicKey);Me(this,{address:n})}get signingKey(){return A(this,Rf)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new hN(A(this,Rf),e)}async signTransaction(e){e=lc(e);const{to:r,from:n}=await zr({to:e.to?jr(e.to,this.provider):void 0,from:e.from?jr(e.from,this.provider):void 0});r!=null&&(e.to=r),n!=null&&(e.from=n),e.from!=null&&(F(wt(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const i=ql.from(e);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(Hp(e)).serialized}async signTypedData(e,r,n){const i=await oc.resolveNames(e,r,n,async s=>{oe(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:s}});const o=await this.provider.resolveName(s);return oe(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:s}),o});return this.signingKey.sign(oc.hash(i.domain,r,i.value)).serialized}};Rf=new WeakMap;let F1=DM;const L1=" !#$%&'()*+,-./<=>?@[]^_`{|}~",WM=/^[a-z]*$/i;function Sk(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(WM)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function ZM(t,e){for(let i=L1.length-1;i>=0;i--)t=t.split(L1[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,s,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)r.push(";");else r.push(s.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return Sk(Sk(r,";"),":")}function Ak(t){return F(t[0]==="0","unsupported auwl data","data",t),ZM(t.substring(1+2*L1.length),t.substring(1,1+2*L1.length))}class K3{constructor(e){H(this,"locale"),Me(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var Tf,D1,Uu,W1,q3;class Z1 extends K3{constructor(e,r,n){super(e),K(this,W1),K(this,Tf),K(this,D1),K(this,Uu),M(this,Tf,r),M(this,D1,n),M(this,Uu,null)}get _data(){return A(this,Tf)}_decodeWords(){return Ak(A(this,Tf))}getWord(e){const r=pe(this,W1,q3).call(this);return F(e>=0&&e<r.length,`invalid word index: ${e}`,"index",e),r[e]}getWordIndex(e){return pe(this,W1,q3).call(this).indexOf(e)}}Tf=new WeakMap,D1=new WeakMap,Uu=new WeakMap,W1=new WeakSet,q3=function(){if(A(this,Uu)==null){const t=this._decodeWords();if(Li(t.join(`
5
5
  `)+`
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @author Feross Aboukhadijeh <https://feross.org>
10
10
  * @license MIT
11
- */(function(t){const e=s2,r=_y,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=x,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:o,SharedArrayBuffer:a}=globalThis;u.TYPED_ARRAY_SUPPORT=c(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const k=new s(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,s.prototype),Object.setPrototypeOf(k,g),k.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(k){if(k>i)throw new RangeError('The value "'+k+'" is invalid for option "size"');const g=new s(k);return Object.setPrototypeOf(g,u.prototype),g}function u(k,g,b){if(typeof k=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(k)}return d(k,g,b)}u.poolSize=8192;function d(k,g,b){if(typeof k=="string")return v(k,g);if(o.isView(k))return w(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(mt(k,o)||k&&mt(k.buffer,o)||typeof a<"u"&&(mt(k,a)||k&&mt(k.buffer,a)))return _(k,g,b);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const B=k.valueOf&&k.valueOf();if(B!=null&&B!==k)return u.from(B,g,b);const z=S(k);if(z)return z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return u.from(k[Symbol.toPrimitive]("string"),g,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}u.from=function(k,g,b){return d(k,g,b)},Object.setPrototypeOf(u.prototype,s.prototype),Object.setPrototypeOf(u,s);function h(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function f(k,g,b){return h(k),k<=0?l(k):g!==void 0?typeof b=="string"?l(k).fill(g,b):l(k).fill(g):l(k)}u.alloc=function(k,g,b){return f(k,g,b)};function p(k){return h(k),l(k<0?0:T(k)|0)}u.allocUnsafe=function(k){return p(k)},u.allocUnsafeSlow=function(k){return p(k)};function v(k,g){if((typeof g!="string"||g==="")&&(g="utf8"),!u.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const b=O(k,g)|0;let B=l(b);const z=B.write(k,g);return z!==b&&(B=B.slice(0,z)),B}function m(k){const g=k.length<0?0:T(k.length)|0,b=l(g);for(let B=0;B<g;B+=1)b[B]=k[B]&255;return b}function w(k){if(mt(k,s)){const g=new s(k);return _(g.buffer,g.byteOffset,g.byteLength)}return m(k)}function _(k,g,b){if(g<0||k.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<g+(b||0))throw new RangeError('"length" is outside of buffer bounds');let B;return g===void 0&&b===void 0?B=new s(k):b===void 0?B=new s(k,g):B=new s(k,g,b),Object.setPrototypeOf(B,u.prototype),B}function S(k){if(u.isBuffer(k)){const g=T(k.length)|0,b=l(g);return b.length===0||k.copy(b,0,0,g),b}if(k.length!==void 0)return typeof k.length!="number"||Sr(k.length)?l(0):m(k);if(k.type==="Buffer"&&Array.isArray(k.data))return m(k.data)}function T(k){if(k>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return k|0}function x(k){return+k!=k&&(k=0),u.alloc(+k)}u.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==u.prototype},u.compare=function(g,b){if(mt(g,s)&&(g=u.from(g,g.offset,g.byteLength)),mt(b,s)&&(b=u.from(b,b.offset,b.byteLength)),!u.isBuffer(g)||!u.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===b)return 0;let B=g.length,z=b.length;for(let j=0,te=Math.min(B,z);j<te;++j)if(g[j]!==b[j]){B=g[j],z=b[j];break}return B<z?-1:z<B?1:0},u.isEncoding=function(g){switch(String(g).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(g,b){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return u.alloc(0);let B;if(b===void 0)for(b=0,B=0;B<g.length;++B)b+=g[B].length;const z=u.allocUnsafe(b);let j=0;for(B=0;B<g.length;++B){let te=g[B];if(mt(te,s))j+te.length>z.length?(u.isBuffer(te)||(te=u.from(te)),te.copy(z,j)):s.prototype.set.call(z,te,j);else if(u.isBuffer(te))te.copy(z,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=te.length}return z};function O(k,g){if(u.isBuffer(k))return k.length;if(o.isView(k)||mt(k,o))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const b=k.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&b===0)return 0;let z=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return Rt(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return Ft(k).length;default:if(z)return B?-1:Rt(k).length;g=(""+g).toLowerCase(),z=!0}}u.byteLength=O;function U(k,g,b){let B=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,g>>>=0,b<=g))return"";for(k||(k="utf8");;)switch(k){case"hex":return Se(this,g,b);case"utf8":case"utf-8":return Y(this,g,b);case"ascii":return ee(this,g,b);case"latin1":case"binary":return ae(this,g,b);case"base64":return Q(this,g,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,g,b);default:if(B)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),B=!0}}u.prototype._isBuffer=!0;function I(k,g,b){const B=k[g];k[g]=k[b],k[b]=B}u.prototype.swap16=function(){const g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<g;b+=2)I(this,b,b+1);return this},u.prototype.swap32=function(){const g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<g;b+=4)I(this,b,b+3),I(this,b+1,b+2);return this},u.prototype.swap64=function(){const g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<g;b+=8)I(this,b,b+7),I(this,b+1,b+6),I(this,b+2,b+5),I(this,b+3,b+4);return this},u.prototype.toString=function(){const g=this.length;return g===0?"":arguments.length===0?Y(this,0,g):U.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(g){if(!u.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:u.compare(this,g)===0},u.prototype.inspect=function(){let g="";const b=t.INSPECT_MAX_BYTES;return g=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(g+=" ... "),"<Buffer "+g+">"},n&&(u.prototype[n]=u.prototype.inspect),u.prototype.compare=function(g,b,B,z,j){if(mt(g,s)&&(g=u.from(g,g.offset,g.byteLength)),!u.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(b===void 0&&(b=0),B===void 0&&(B=g?g.length:0),z===void 0&&(z=0),j===void 0&&(j=this.length),b<0||B>g.length||z<0||j>this.length)throw new RangeError("out of range index");if(z>=j&&b>=B)return 0;if(z>=j)return-1;if(b>=B)return 1;if(b>>>=0,B>>>=0,z>>>=0,j>>>=0,this===g)return 0;let te=j-z,he=B-b;const Ie=Math.min(te,he),Ot=this.slice(z,j),Lt=g.slice(b,B);for(let gt=0;gt<Ie;++gt)if(Ot[gt]!==Lt[gt]){te=Ot[gt],he=Lt[gt];break}return te<he?-1:he<te?1:0};function Z(k,g,b,B,z){if(k.length===0)return-1;if(typeof b=="string"?(B=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,Sr(b)&&(b=z?0:k.length-1),b<0&&(b=k.length+b),b>=k.length){if(z)return-1;b=k.length-1}else if(b<0)if(z)b=0;else return-1;if(typeof g=="string"&&(g=u.from(g,B)),u.isBuffer(g))return g.length===0?-1:W(k,g,b,B,z);if(typeof g=="number")return g=g&255,typeof s.prototype.indexOf=="function"?z?s.prototype.indexOf.call(k,g,b):s.prototype.lastIndexOf.call(k,g,b):W(k,[g],b,B,z);throw new TypeError("val must be string, number or Buffer")}function W(k,g,b,B,z){let j=1,te=k.length,he=g.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(k.length<2||g.length<2)return-1;j=2,te/=2,he/=2,b/=2}function Ie(Lt,gt){return j===1?Lt[gt]:Lt.readUInt16BE(gt*j)}let Ot;if(z){let Lt=-1;for(Ot=b;Ot<te;Ot++)if(Ie(k,Ot)===Ie(g,Lt===-1?0:Ot-Lt)){if(Lt===-1&&(Lt=Ot),Ot-Lt+1===he)return Lt*j}else Lt!==-1&&(Ot-=Ot-Lt),Lt=-1}else for(b+he>te&&(b=te-he),Ot=b;Ot>=0;Ot--){let Lt=!0;for(let gt=0;gt<he;gt++)if(Ie(k,Ot+gt)!==Ie(g,gt)){Lt=!1;break}if(Lt)return Ot}return-1}u.prototype.includes=function(g,b,B){return this.indexOf(g,b,B)!==-1},u.prototype.indexOf=function(g,b,B){return Z(this,g,b,B,!0)},u.prototype.lastIndexOf=function(g,b,B){return Z(this,g,b,B,!1)};function P(k,g,b,B){b=Number(b)||0;const z=k.length-b;B?(B=Number(B),B>z&&(B=z)):B=z;const j=g.length;B>j/2&&(B=j/2);let te;for(te=0;te<B;++te){const he=parseInt(g.substr(te*2,2),16);if(Sr(he))return te;k[b+te]=he}return te}function D(k,g,b,B){return Mr(Rt(g,k.length-b),k,b,B)}function G(k,g,b,B){return Mr(Qe(g),k,b,B)}function q(k,g,b,B){return Mr(Ft(g),k,b,B)}function L(k,g,b,B){return Mr(nt(g,k.length-b),k,b,B)}u.prototype.write=function(g,b,B,z){if(b===void 0)z="utf8",B=this.length,b=0;else if(B===void 0&&typeof b=="string")z=b,B=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(B)?(B=B>>>0,z===void 0&&(z="utf8")):(z=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-b;if((B===void 0||B>j)&&(B=j),g.length>0&&(B<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");z||(z="utf8");let te=!1;for(;;)switch(z){case"hex":return P(this,g,b,B);case"utf8":case"utf-8":return D(this,g,b,B);case"ascii":case"latin1":case"binary":return G(this,g,b,B);case"base64":return q(this,g,b,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,g,b,B);default:if(te)throw new TypeError("Unknown encoding: "+z);z=(""+z).toLowerCase(),te=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Q(k,g,b){return g===0&&b===k.length?e.fromByteArray(k):e.fromByteArray(k.slice(g,b))}function Y(k,g,b){b=Math.min(k.length,b);const B=[];let z=g;for(;z<b;){const j=k[z];let te=null,he=j>239?4:j>223?3:j>191?2:1;if(z+he<=b){let Ie,Ot,Lt,gt;switch(he){case 1:j<128&&(te=j);break;case 2:Ie=k[z+1],(Ie&192)===128&&(gt=(j&31)<<6|Ie&63,gt>127&&(te=gt));break;case 3:Ie=k[z+1],Ot=k[z+2],(Ie&192)===128&&(Ot&192)===128&&(gt=(j&15)<<12|(Ie&63)<<6|Ot&63,gt>2047&&(gt<55296||gt>57343)&&(te=gt));break;case 4:Ie=k[z+1],Ot=k[z+2],Lt=k[z+3],(Ie&192)===128&&(Ot&192)===128&&(Lt&192)===128&&(gt=(j&15)<<18|(Ie&63)<<12|(Ot&63)<<6|Lt&63,gt>65535&&gt<1114112&&(te=gt))}}te===null?(te=65533,he=1):te>65535&&(te-=65536,B.push(te>>>10&1023|55296),te=56320|te&1023),B.push(te),z+=he}return de(B)}const re=4096;function de(k){const g=k.length;if(g<=re)return String.fromCharCode.apply(String,k);let b="",B=0;for(;B<g;)b+=String.fromCharCode.apply(String,k.slice(B,B+=re));return b}function ee(k,g,b){let B="";b=Math.min(k.length,b);for(let z=g;z<b;++z)B+=String.fromCharCode(k[z]&127);return B}function ae(k,g,b){let B="";b=Math.min(k.length,b);for(let z=g;z<b;++z)B+=String.fromCharCode(k[z]);return B}function Se(k,g,b){const B=k.length;(!g||g<0)&&(g=0),(!b||b<0||b>B)&&(b=B);let z="";for(let j=g;j<b;++j)z+=y[k[j]];return z}function ke(k,g,b){const B=k.slice(g,b);let z="";for(let j=0;j<B.length-1;j+=2)z+=String.fromCharCode(B[j]+B[j+1]*256);return z}u.prototype.slice=function(g,b){const B=this.length;g=~~g,b=b===void 0?B:~~b,g<0?(g+=B,g<0&&(g=0)):g>B&&(g=B),b<0?(b+=B,b<0&&(b=0)):b>B&&(b=B),b<g&&(b=g);const z=this.subarray(g,b);return Object.setPrototypeOf(z,u.prototype),z};function Re(k,g,b){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+g>b)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=this[g],j=1,te=0;for(;++te<b&&(j*=256);)z+=this[g+te]*j;return z},u.prototype.readUintBE=u.prototype.readUIntBE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=this[g+--b],j=1;for(;b>0&&(j*=256);)z+=this[g+--b]*j;return z},u.prototype.readUint8=u.prototype.readUInt8=function(g,b){return g=g>>>0,b||Re(g,1,this.length),this[g]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(g,b){return g=g>>>0,b||Re(g,2,this.length),this[g]|this[g+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(g,b){return g=g>>>0,b||Re(g,2,this.length),this[g]<<8|this[g+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},u.prototype.readBigUInt64LE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=b+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,j=this[++g]+this[++g]*2**8+this[++g]*2**16+B*2**24;return BigInt(z)+(BigInt(j)<<BigInt(32))}),u.prototype.readBigUInt64BE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=b*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],j=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+B;return(BigInt(z)<<BigInt(32))+BigInt(j)}),u.prototype.readIntLE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=this[g],j=1,te=0;for(;++te<b&&(j*=256);)z+=this[g+te]*j;return j*=128,z>=j&&(z-=Math.pow(2,8*b)),z},u.prototype.readIntBE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=b,j=1,te=this[g+--z];for(;z>0&&(j*=256);)te+=this[g+--z]*j;return j*=128,te>=j&&(te-=Math.pow(2,8*b)),te},u.prototype.readInt8=function(g,b){return g=g>>>0,b||Re(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},u.prototype.readInt16LE=function(g,b){g=g>>>0,b||Re(g,2,this.length);const B=this[g]|this[g+1]<<8;return B&32768?B|4294901760:B},u.prototype.readInt16BE=function(g,b){g=g>>>0,b||Re(g,2,this.length);const B=this[g+1]|this[g]<<8;return B&32768?B|4294901760:B},u.prototype.readInt32LE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},u.prototype.readInt32BE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},u.prototype.readBigInt64LE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(B<<24);return(BigInt(z)<<BigInt(32))+BigInt(b+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),u.prototype.readBigInt64BE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=(b<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(z)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+B)}),u.prototype.readFloatLE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),r.read(this,g,!0,23,4)},u.prototype.readFloatBE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),r.read(this,g,!1,23,4)},u.prototype.readDoubleLE=function(g,b){return g=g>>>0,b||Re(g,8,this.length),r.read(this,g,!0,52,8)},u.prototype.readDoubleBE=function(g,b){return g=g>>>0,b||Re(g,8,this.length),r.read(this,g,!1,52,8)};function _e(k,g,b,B,z,j){if(!u.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>z||g<j)throw new RangeError('"value" argument is out of bounds');if(b+B>k.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(g,b,B,z){if(g=+g,b=b>>>0,B=B>>>0,!z){const he=Math.pow(2,8*B)-1;_e(this,g,b,B,he,0)}let j=1,te=0;for(this[b]=g&255;++te<B&&(j*=256);)this[b+te]=g/j&255;return b+B},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(g,b,B,z){if(g=+g,b=b>>>0,B=B>>>0,!z){const he=Math.pow(2,8*B)-1;_e(this,g,b,B,he,0)}let j=B-1,te=1;for(this[b+j]=g&255;--j>=0&&(te*=256);)this[b+j]=g/te&255;return b+B},u.prototype.writeUint8=u.prototype.writeUInt8=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,1,255,0),this[b]=g&255,b+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,65535,0),this[b]=g&255,this[b+1]=g>>>8,b+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,65535,0),this[b]=g>>>8,this[b+1]=g&255,b+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,4294967295,0),this[b+3]=g>>>24,this[b+2]=g>>>16,this[b+1]=g>>>8,this[b]=g&255,b+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,4294967295,0),this[b]=g>>>24,this[b+1]=g>>>16,this[b+2]=g>>>8,this[b+3]=g&255,b+4};function we(k,g,b,B,z){Ct(g,B,z,k,b,7);let j=Number(g&BigInt(4294967295));k[b++]=j,j=j>>8,k[b++]=j,j=j>>8,k[b++]=j,j=j>>8,k[b++]=j;let te=Number(g>>BigInt(32)&BigInt(4294967295));return k[b++]=te,te=te>>8,k[b++]=te,te=te>>8,k[b++]=te,te=te>>8,k[b++]=te,b}function Je(k,g,b,B,z){Ct(g,B,z,k,b,7);let j=Number(g&BigInt(4294967295));k[b+7]=j,j=j>>8,k[b+6]=j,j=j>>8,k[b+5]=j,j=j>>8,k[b+4]=j;let te=Number(g>>BigInt(32)&BigInt(4294967295));return k[b+3]=te,te=te>>8,k[b+2]=te,te=te>>8,k[b+1]=te,te=te>>8,k[b]=te,b+8}u.prototype.writeBigUInt64LE=E(function(g,b=0){return we(this,g,b,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=E(function(g,b=0){return Je(this,g,b,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(g,b,B,z){if(g=+g,b=b>>>0,!z){const Ie=Math.pow(2,8*B-1);_e(this,g,b,B,Ie-1,-Ie)}let j=0,te=1,he=0;for(this[b]=g&255;++j<B&&(te*=256);)g<0&&he===0&&this[b+j-1]!==0&&(he=1),this[b+j]=(g/te>>0)-he&255;return b+B},u.prototype.writeIntBE=function(g,b,B,z){if(g=+g,b=b>>>0,!z){const Ie=Math.pow(2,8*B-1);_e(this,g,b,B,Ie-1,-Ie)}let j=B-1,te=1,he=0;for(this[b+j]=g&255;--j>=0&&(te*=256);)g<0&&he===0&&this[b+j+1]!==0&&(he=1),this[b+j]=(g/te>>0)-he&255;return b+B},u.prototype.writeInt8=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,1,127,-128),g<0&&(g=255+g+1),this[b]=g&255,b+1},u.prototype.writeInt16LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,32767,-32768),this[b]=g&255,this[b+1]=g>>>8,b+2},u.prototype.writeInt16BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,32767,-32768),this[b]=g>>>8,this[b+1]=g&255,b+2},u.prototype.writeInt32LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,2147483647,-2147483648),this[b]=g&255,this[b+1]=g>>>8,this[b+2]=g>>>16,this[b+3]=g>>>24,b+4},u.prototype.writeInt32BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[b]=g>>>24,this[b+1]=g>>>16,this[b+2]=g>>>8,this[b+3]=g&255,b+4},u.prototype.writeBigInt64LE=E(function(g,b=0){return we(this,g,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=E(function(g,b=0){return Je(this,g,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ue(k,g,b,B,z,j){if(b+B>k.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function Ve(k,g,b,B,z){return g=+g,b=b>>>0,z||Ue(k,g,b,4),r.write(k,g,b,B,23,4),b+4}u.prototype.writeFloatLE=function(g,b,B){return Ve(this,g,b,!0,B)},u.prototype.writeFloatBE=function(g,b,B){return Ve(this,g,b,!1,B)};function Xe(k,g,b,B,z){return g=+g,b=b>>>0,z||Ue(k,g,b,8),r.write(k,g,b,B,52,8),b+8}u.prototype.writeDoubleLE=function(g,b,B){return Xe(this,g,b,!0,B)},u.prototype.writeDoubleBE=function(g,b,B){return Xe(this,g,b,!1,B)},u.prototype.copy=function(g,b,B,z){if(!u.isBuffer(g))throw new TypeError("argument should be a Buffer");if(B||(B=0),!z&&z!==0&&(z=this.length),b>=g.length&&(b=g.length),b||(b=0),z>0&&z<B&&(z=B),z===B||g.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("sourceEnd out of bounds");z>this.length&&(z=this.length),g.length-b<z-B&&(z=g.length-b+B);const j=z-B;return this===g&&typeof s.prototype.copyWithin=="function"?this.copyWithin(b,B,z):s.prototype.set.call(g,this.subarray(B,z),b),j},u.prototype.fill=function(g,b,B,z){if(typeof g=="string"){if(typeof b=="string"?(z=b,b=0,B=this.length):typeof B=="string"&&(z=B,B=this.length),z!==void 0&&typeof z!="string")throw new TypeError("encoding must be a string");if(typeof z=="string"&&!u.isEncoding(z))throw new TypeError("Unknown encoding: "+z);if(g.length===1){const te=g.charCodeAt(0);(z==="utf8"&&te<128||z==="latin1")&&(g=te)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(b<0||this.length<b||this.length<B)throw new RangeError("Out of range index");if(B<=b)return this;b=b>>>0,B=B===void 0?this.length:B>>>0,g||(g=0);let j;if(typeof g=="number")for(j=b;j<B;++j)this[j]=g;else{const te=u.isBuffer(g)?g:u.from(g,z),he=te.length;if(he===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(j=0;j<B-b;++j)this[j+b]=te[j%he]}return this};const rt={};function ct(k,g,b){rt[k]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:z,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}ct("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ct("ERR_INVALID_ARG_TYPE",function(k,g){return`The "${k}" argument must be of type number. Received type ${typeof g}`},TypeError),ct("ERR_OUT_OF_RANGE",function(k,g,b){let B=`The value of "${k}" is out of range.`,z=b;return Number.isInteger(b)&&Math.abs(b)>2**32?z=ut(String(b)):typeof b=="bigint"&&(z=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(z=ut(z)),z+="n"),B+=` It must be ${g}. Received ${z}`,B},RangeError);function ut(k){let g="",b=k.length;const B=k[0]==="-"?1:0;for(;b>=B+4;b-=3)g=`_${k.slice(b-3,b)}${g}`;return`${k.slice(0,b)}${g}`}function lt(k,g,b){Ht(g,"offset"),(k[g]===void 0||k[g+b]===void 0)&&jt(g,k.length-(b+1))}function Ct(k,g,b,B,z,j){if(k>b||k<g){const te=typeof g=="bigint"?"n":"";let he;throw g===0||g===BigInt(0)?he=`>= 0${te} and < 2${te} ** ${(j+1)*8}${te}`:he=`>= -(2${te} ** ${(j+1)*8-1}${te}) and < 2 ** ${(j+1)*8-1}${te}`,new rt.ERR_OUT_OF_RANGE("value",he,k)}lt(B,z,j)}function Ht(k,g){if(typeof k!="number")throw new rt.ERR_INVALID_ARG_TYPE(g,"number",k)}function jt(k,g,b){throw Math.floor(k)!==k?(Ht(k,b),new rt.ERR_OUT_OF_RANGE("offset","an integer",k)):g<0?new rt.ERR_BUFFER_OUT_OF_BOUNDS:new rt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,k)}const mr=/[^+/0-9A-Za-z-_]/g;function br(k){if(k=k.split("=")[0],k=k.trim().replace(mr,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function Rt(k,g){g=g||1/0;let b;const B=k.length;let z=null;const j=[];for(let te=0;te<B;++te){if(b=k.charCodeAt(te),b>55295&&b<57344){if(!z){if(b>56319){(g-=3)>-1&&j.push(239,191,189);continue}else if(te+1===B){(g-=3)>-1&&j.push(239,191,189);continue}z=b;continue}if(b<56320){(g-=3)>-1&&j.push(239,191,189),z=b;continue}b=(z-55296<<10|b-56320)+65536}else z&&(g-=3)>-1&&j.push(239,191,189);if(z=null,b<128){if((g-=1)<0)break;j.push(b)}else if(b<2048){if((g-=2)<0)break;j.push(b>>6|192,b&63|128)}else if(b<65536){if((g-=3)<0)break;j.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((g-=4)<0)break;j.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return j}function Qe(k){const g=[];for(let b=0;b<k.length;++b)g.push(k.charCodeAt(b)&255);return g}function nt(k,g){let b,B,z;const j=[];for(let te=0;te<k.length&&!((g-=2)<0);++te)b=k.charCodeAt(te),B=b>>8,z=b%256,j.push(z),j.push(B);return j}function Ft(k){return e.toByteArray(br(k))}function Mr(k,g,b,B){let z;for(z=0;z<B&&!(z+b>=g.length||z>=k.length);++z)g[z+b]=k[z];return z}function mt(k,g){return k instanceof g||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===g.name}function Sr(k){return k!==k}const y=function(){const k="0123456789abcdef",g=new Array(256);for(let b=0;b<16;++b){const B=b*16;for(let z=0;z<16;++z)g[B+z]=k[b]+k[z]}return g}();function E(k){return typeof BigInt>"u"?N:k}function N(){throw new Error("BigInt not supported")}})(jk);const pa=jk.Buffer;var o2={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_24ed46d0-df2d-4a87-806b-7078fbdbf737",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"true",npm_config_user_agent:"pnpm/10.13.1 npm/? node/v20.19.4 linux x64",CI:"true",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_24ed46d0-df2d-4a87-806b-7078fbdbf737",PIPX_HOME:"/opt/pipx",RUNNER_ENVIRONMENT:"github-hosted",npm_node_execpath:"/opt/hostedtoolcache/node/20.19.4/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",HOME:"/home/runner",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",RUNNER_TEMP:"/home/runner/work/_temp",npm_package_json:"/home/runner/work/passport/passport/packages/passport-evm/package.json",GITHUB_REPOSITORY_OWNER:"credenza-web3",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",npm_package_engines_node:">=20.10.0",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/28.2.13676358",GITHUB_RETENTION_DAYS:"90",GRADLE_HOME:"/usr/share/gradle-8.14.3",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",GITHUB_REPOSITORY_OWNER_ID:"93208388",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",npm_config__credenza3_registry:"https://registry.npmjs.org/",npm_config_userconfig:"/home/runner/work/_temp/.npmrc",SYSTEMD_EXEC_PID:"1744",npm_config_engine_strict:"true",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",ImageVersion:"20250720.1.0",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.12/x64",LOGNAME:"runner",RUNNER_OS:"Linux",SWIFT_PATH:"/usr/share/swift/usr/bin",pnpm_config_verify_deps_before_run:"false",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GITHUB_WORKFLOW:"Publish @credenza3/passport-evm",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.11/x64",JOURNAL_STREAM:"9:13429",_:"/home/runner/setup-pnpm/node_modules/.bin/pnpm",GOROOT_1_24_X64:"/opt/hostedtoolcache/go/1.24.5/x64",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/hosted-compute-agent.service/memory.pressure",npm_config_registry:"https://registry.npmjs.org/",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",GITHUB_RUN_ID:"16619942643",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_BASE_REF:"",GITHUB_REF_TYPE:"branch",GITHUB_WORKFLOW_SHA:"0d84f7a91046b65109cef163814531faba56b2c5",ImageOS:"ubuntu24",ENABLE_RUNNER_TRACING:"true",GITHUB_ACTION_REPOSITORY:"",GITHUB_WORKFLOW_REF:"credenza-web3/passport/.github/workflows/publish-evm.yml@refs/heads/main",npm_config_node_gyp:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/passport/passport/packages/passport-evm/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/20.19.4/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",INVOCATION_ID:"925ac0fcd0244d09b84f83fdea935c4a",NODE:"/opt/hostedtoolcache/node/20.19.4/x64/bin/node",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",RUNNER_TRACKING_ID:"github_c36ff440-817a-42ac-9665-e6477e7532b3",TURBO_HASH:"531aead7c955cd98",npm_package_name:"@credenza3/passport-evm",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",GITHUB_ACTION:"__run_2",GITHUB_RUN_NUMBER:"65",GITHUB_TRIGGERING_ACTOR:"mikeavvad",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",npm_config_frozen_lockfile:"",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"credenza-web3/passport",RUNNER_NAME:"GitHub Actions 1000000428",XDG_CONFIG_HOME:"/home/runner/.config",npm_lifecycle_script:"vite build",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.3.13750724",DEBIAN_FRONTEND:"noninteractive",GITHUB_ACTION_REF:"",GITHUB_ACTIONS:"true",GITHUB_REPOSITORY_ID:"493155814",NODE_PATH:"/home/runner/work/passport/passport/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.3_jiti@2.4.2_lightningcss@1.29.1_sass@1.89.2_yaml@2.8.0/node_modules/vite/bin/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.3_jiti@2.4.2_lightningcss@1.29.1_sass@1.89.2_yaml@2.8.0/node_modules/vite/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.3_jiti@2.4.2_lightningcss@1.29.1_sass@1.89.2_yaml@2.8.0/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/turbo@1.13.3/node_modules/turbo/bin/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/turbo@1.13.3/node_modules/turbo/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/turbo@1.13.3/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules",SHELL:"/bin/bash",npm_package_version:"0.2.14",npm_config_verify_deps_before_run:"false",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",ACCEPT_EULA:"Y",GITHUB_JOB:"publish-gpr",GITHUB_WORKSPACE:"/home/runner/work/passport/passport",TURBO_INVOCATION_DIR:"/home/runner/work/passport/passport",npm_package_engines_pnpm:">=9",GITHUB_RUN_ATTEMPT:"1",GITHUB_SHA:"0d84f7a91046b65109cef163814531faba56b2c5",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",GITHUB_ACTOR:"mikeavvad",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR_ID:"87299315",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_24ed46d0-df2d-4a87-806b-7078fbdbf737",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/passport/passport/packages/passport-evm",RUNNER_WORKSPACE:"/home/runner/work/passport",npm_execpath:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/bin/pnpm.cjs",ANDROID_HOME:"/usr/local/lib/android/sdk",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_EVENT_NAME:"push",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_24ed46d0-df2d-4a87-806b-7078fbdbf737",GITHUB_SERVER_URL:"https://github.com",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",HOMEBREW_NO_AUTO_UPDATE:"1",EDGEWEBDRIVER:"/usr/local/share/edge_driver",PNPM_SCRIPT_SRC_DIR:"/home/runner/work/passport/passport/packages/passport-evm",npm_config__jsr_registry:"https://npm.jsr.io/",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.3.13750724",CHROME_BIN:"/usr/bin/google-chrome",SGX_AESM_ADDR:"1",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",PNPM_HOME:"/home/runner/setup-pnpm/node_modules/.bin",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.3.13750724",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_24ed46d0-df2d-4a87-806b-7078fbdbf737",INIT_CWD:"/home/runner/work/passport/passport/packages/passport-evm",NODE_ENV:"production"},Pe;if(typeof window>"u"){var Jk={hostname:""};Pe={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:Jk,referrer:""},screen:{width:0,height:0},location:Jk,addEventListener:function(){},removeEventListener:function(){}}}else Pe=window;function $k(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Yk(t,e,r,n,i,s,o){try{var a=t[s](o),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function Ey(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(c){Yk(s,n,i,o,a,"next",c)}function a(c){Yk(s,n,i,o,a,"throw",c)}o(void 0)})}}function a2(t,e,r){return Xk()?a2=Reflect.construct:a2=function(i,s,o){var a=[null];a.push.apply(a,s);var c=Function.bind.apply(i,a),l=new c;return o&&Ff(l,o.prototype),l},a2.apply(null,arguments)}function BP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function an(t,e,r){return e&&BP(t.prototype,e),t}function Pt(){return Pt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Pt.apply(this,arguments)}function Cy(t){return Cy=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Cy(t)}function kn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ff(t,e)}function ft(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function IP(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Vf(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Ff(t,e){return Ff=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ff(t,e)}function _t(t){"@swc/helpers - typeof";return t&&typeof Symbol<"u"&&t.constructor===Symbol?"symbol":typeof t}function OP(t,e){if(t){if(typeof t=="string")return $k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $k(t,e)}}function c2(t){var e=typeof Map=="function"?new Map:void 0;return c2=function(n){if(n===null||!IP(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return a2(n,arguments,Cy(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ff(i,n)},c2(t)}function Xk(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xk=function(){return!!t})()}function He(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=OP(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Lf(t,e){var r,n,i,s,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=l[0]&2?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=e.call(t,o)}catch(u){l=[6,u],n=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Kk(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var UP=Object.defineProperty,MP=function(t,e,r){return e in t?UP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Oe=function(t,e,r){return MP(t,(typeof e>"u"?"undefined":_t(e))!=="symbol"?e+"":e,r)},qk,PP=Object.defineProperty,VP=function(t,e,r){return e in t?PP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},e_=function(t,e,r){return VP(t,(typeof e>"u"?"undefined":_t(e))!=="symbol"?e+"":e,r)},Qr=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}(Qr||{}),t_={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},r_={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l2={},FP=function(){return!!globalThis.Zone};function Sy(t){if(l2[t])return l2[t];var e=globalThis[t],r=e.prototype,n=t in t_?t_[t]:void 0,i=!!(n&&n.every(function(u){var d,h;return!!((h=(d=Object.getOwnPropertyDescriptor(r,u))==null?void 0:d.get)!=null&&h.toString().includes("[native code]"))})),s=t in r_?r_[t]:void 0,o=!!(s&&s.every(function(u){var d;return typeof r[u]=="function"&&((d=r[u])==null?void 0:d.toString().includes("[native code]"))}));if(i&&o&&!FP())return l2[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return e.prototype;var l=c[t].prototype;return document.body.removeChild(a),l?l2[t]=l:r}catch{return r}}var Ay={};function ma(t,e,r){var n,i=t+"."+String(r);if(Ay[i])return Ay[i].call(e);var s=Sy(t),o=(n=Object.getOwnPropertyDescriptor(s,r))==null?void 0:n.get;return o?(Ay[i]=o,o.call(e)):e[r]}var Ry={};function n_(t,e,r){var n=t+"."+String(r);if(Ry[n])return Ry[n].bind(e);var i=Sy(t),s=i[r];return typeof s!="function"?e[r]:(Ry[n]=s,s.bind(e))}function LP(t){return ma("Node",t,"childNodes")}function DP(t){return ma("Node",t,"parentNode")}function WP(t){return ma("Node",t,"parentElement")}function ZP(t){return ma("Node",t,"textContent")}function zP(t,e){return n_("Node",t,"contains")(e)}function GP(t){return n_("Node",t,"getRootNode")()}function HP(t){return!t||!("host"in t)?null:ma("ShadowRoot",t,"host")}function jP(t){return t.styleSheets}function QP(t){return!t||!("shadowRoot"in t)?null:ma("Element",t,"shadowRoot")}function JP(t,e){return ma("Element",t,"querySelector")(e)}function $P(t,e){return ma("Element",t,"querySelectorAll")(e)}function YP(){return Sy("MutationObserver").constructor}var _n={childNodes:LP,parentNode:DP,parentElement:WP,textContent:ZP,contains:zP,getRootNode:GP,host:HP,styleSheets:jP,shadowRoot:QP,querySelector:JP,querySelectorAll:$P,mutationObserver:YP};function i_(t){return t.nodeType===t.ELEMENT_NODE}function Df(t){var e=t&&"host"in t&&"mode"in t&&_n.host(t)||null;return!!(e&&"shadowRoot"in e&&_n.shadowRoot(e)===t)}function Wf(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function XP(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function KP(t){var e=t.cssText;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return t.layerName===""?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}function Ty(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;!r&&t.ownerNode&&t.ownerNode.ownerDocument&&(r=t.ownerNode.ownerDocument.location.href);var n=Array.from(e,function(i){return s_(i,r)}).join("");return XP(n)}catch{return null}}function s_(t,e){if(eV(t)){var r;try{r=Ty(t.styleSheet)||KP(t)}catch{r=t.cssText}return t.styleSheet.href?u2(r,t.styleSheet.href):r}else{var n=t.cssText;return tV(t)&&t.selectorText.includes(":")&&(n=qP(n)),e?u2(n,e):n}}function qP(t){var e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function eV(t){return"styleSheet"in t}function tV(t){return"selectorText"in t}var o_=function(){function t(){e_(this,"idNodeMap",new Map),e_(this,"nodeMetaMap",new WeakMap)}var e=t.prototype;return e.getId=function(n){var i;if(!n)return-1;var s=(i=this.getMeta(n))==null?void 0:i.id;return s??-1},e.getNode=function(n){return this.idNodeMap.get(n)||null},e.getIds=function(){return Array.from(this.idNodeMap.keys())},e.getMeta=function(n){return this.nodeMetaMap.get(n)||null},e.removeNodeFromMap=function(n){var i=this,s=this.getId(n);this.idNodeMap.delete(s),n.childNodes&&n.childNodes.forEach(function(o){return i.removeNodeFromMap(o)})},e.has=function(n){return this.idNodeMap.has(n)},e.hasNode=function(n){return this.nodeMetaMap.has(n)},e.add=function(n,i){var s=i.id;this.idNodeMap.set(s,n),this.nodeMetaMap.set(n,i)},e.replace=function(n,i){var s=this.getNode(n);if(s){var o=this.nodeMetaMap.get(s);o&&this.nodeMetaMap.set(i,o)}this.idNodeMap.set(n,i)},e.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t}();function rV(){return new o_}function Ny(t){var e=t.element,r=t.maskInputOptions,n=t.tagName,i=t.type,s=t.value,o=t.maskInputFn,a=s||"",c=i&&Pc(i);return(r[n.toLowerCase()]||c&&r[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function Pc(t){return t.toLowerCase()}var a_="__rrweb_original__";function nV(t){var e=t.getContext("2d");if(!e)return!0;for(var r=50,n=0;n<t.width;n+=r)for(var i=0;i<t.height;i+=r){var s=e.getImageData,o=a_ in s?s[a_]:s,a=new Uint32Array(o.call(e,n,i,Math.min(r,t.width-n),Math.min(r,t.height-i)).data.buffer);if(a.some(function(c){return c!==0}))return!1}return!0}function xy(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Pc(e):null}function c_(t,e){var r;try{r=new URL(t,e??window.location.href)}catch{return null}var n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n),s;return(s=i==null?void 0:i[1])!=null?s:null}function iV(t){var e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var sV=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oV=/^(?:[a-z+]+:)?\/\//i,aV=/^www\..*/i,cV=/^(data:)([^,]*),(.*)/i;function u2(t,e){return(t||"").replace(sV,function(r,n,i,s,o,a){var c=i||o||a,l=n||s||"";if(!c)return r;if(oV.test(c)||aV.test(c)||cV.test(c))return"url("+l+c+l+")";if(c[0]==="/")return"url("+l+(iV(e)+c)+l+")";var u=e.split("/"),d=c.split("/");u.pop();for(var h=He(d),f;!(f=h()).done;){var p=f.value;p!=="."&&(p===".."?u.pop():u.push(p))}return"url("+l+u.join("/")+l+")"})}function By(t){return t.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function lV(t,e){var r=Array.from(e.childNodes),n=[];if(r.length>1&&t&&typeof t=="string"){for(var i=By(t),s=1;s<r.length;s++)if(r[s].textContent&&typeof r[s].textContent=="string")for(var o=By(r[s].textContent),a=3;a<o.length;a++){var c=o.substring(0,a);if(i.split(c).length===2){for(var l=i.indexOf(c),u=l;u<t.length;u++)if(By(t.substring(0,u)).length===l){n.push(t.substring(0,u)),t=t.substring(u);break}break}}}return n.push(t),n}function uV(t,e){return lV(t,e).join("/* rr_split */")}var dV=1,hV=new RegExp("[^a-z0-9-_:]"),Zf=-2;function l_(){return dV++}function fV(t){if(ft(t,HTMLFormElement))return"form";var e=Pc(t.tagName);return hV.test(e)?"div":e}var Zu,u_,pV=/^[^ \t\n\r\u000c]+/,mV=/^[, \t\n\r\u000c]+/;function gV(t,e){if(e.trim()==="")return e;var r=0;function n(l){var u,d=l.exec(e.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var i=[];n(mV),!(r>=e.length);){var s=n(pV);if(s.slice(-1)===",")s=zu(t,s.substring(0,s.length-1)),i.push(s);else{var o="";s=zu(t,s);for(var a=!1;;){var c=e.charAt(r);if(c===""){i.push((s+o).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){r+=1,i.push((s+o).trim());break}else c==="("&&(a=!0);o+=c,r+=1}}}return i.join(", ")}var d_=new WeakMap;function zu(t,e){return!e||e.trim()===""?e:Iy(t,e)}function vV(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function Iy(t,e){var r=d_.get(t);if(r||(r=t.createElement("a"),d_.set(t,r)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return r.setAttribute("href",e),r.href}function h_(t,e,r,n){return n&&(r==="src"||r==="href"&&!(e==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(e==="table"||e==="td"||e==="th")?zu(t,n):r==="srcset"?gV(t,n):r==="style"?u2(n,Iy(t)):e==="object"&&r==="data"?zu(t,n):n)}function f_(t,e,r){return(t==="video"||t==="audio")&&e==="autoplay"}function yV(t,e,r){try{if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch{}return!1}function d2(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return r?d2(_n.parentNode(t),e,r):!1;for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return r?d2(_n.parentNode(t),e,r):!1}function p_(t,e,r,n){var i;if(i_(t)){if(i=t,!_n.childNodes(i).length)return!1}else{if(_n.parentElement(t)===null)return!1;i=_n.parentElement(t)}try{if(typeof e=="string"){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(d2(i,e,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function wV(t,e,r){var n=t.contentWindow;if(n){var i=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var o=setTimeout(function(){i||(e(),i=!0)},r);t.addEventListener("load",function(){clearTimeout(o),i=!0,e()});return}var a="about:blank";if(n.location.href!==a||t.src===a||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}}function bV(t,e,r){var n=!1,i;try{i=t.sheet}catch{return}if(!i){var s=setTimeout(function(){n||(e(),n=!0)},r);t.addEventListener("load",function(){clearTimeout(s),n=!0,e()})}}function kV(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.needsMask,a=e.inlineStylesheet,c=e.maskInputOptions,l=c===void 0?{}:c,u=e.maskTextFn,d=e.maskInputFn,h=e.dataURLOptions,f=h===void 0?{}:h,p=e.inlineImages,v=e.recordCanvas,m=e.keepIframeSrcFn,w=e.newlyAddedElement,_=w===void 0?!1:w,S=e.cssCaptured,T=S===void 0?!1:S,x=_V(r,n);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Qr.Document,childNodes:[],compatMode:t.compatMode}:{type:Qr.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Qr.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:x};case t.ELEMENT_NODE:return CV(t,{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:f,inlineImages:p,recordCanvas:v,keepIframeSrcFn:m,newlyAddedElement:_,rootId:x});case t.TEXT_NODE:return EV(t,{doc:r,needsMask:o,maskTextFn:u,rootId:x,cssCaptured:T});case t.CDATA_SECTION_NODE:return{type:Qr.CDATA,textContent:"",rootId:x};case t.COMMENT_NODE:return{type:Qr.Comment,textContent:_n.textContent(t)||"",rootId:x};default:return!1}}function _V(t,e){if(e.hasNode(t)){var r=e.getId(t);return r===1?void 0:r}}function EV(t,e){var r=e.needsMask,n=e.maskTextFn,i=e.rootId,s=e.cssCaptured,o=_n.parentNode(t),a=o&&o.tagName,c="",l=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?c="SCRIPT_PLACEHOLDER":s||(c=_n.textContent(t),l&&c&&(c=u2(c,Iy(e.doc)))),!l&&!u&&c&&r&&(c=n?n(c,_n.parentElement(t)):c.replace(/[\S]/g,"*")),{type:Qr.Text,textContent:c||"",rootId:i}}function CV(t,e){for(var r=e.doc,n=e.blockClass,i=e.blockSelector,s=e.inlineStylesheet,o=e.maskInputOptions,a=o===void 0?{}:o,c=e.maskInputFn,l=e.dataURLOptions,u=l===void 0?{}:l,d=e.inlineImages,h=e.recordCanvas,f=e.keepIframeSrcFn,p=e.newlyAddedElement,v=p===void 0?!1:p,m=e.rootId,w=yV(t,n,i),_=fV(t),S={},T=t.attributes.length,x=0;x<T;x++){var O=t.attributes[x];f_(_,O.name,O.value)||(S[O.name]=h_(r,_,Pc(O.name),O.value))}if(_==="link"&&s){var U=Array.from(r.styleSheets).find(function(Re){return Re.href===t.href}),I=null;U&&(I=Ty(U)),I&&(delete S.rel,delete S.href,S._cssText=I)}if(_==="style"&&t.sheet){var Z=Ty(t.sheet);Z&&(t.childNodes.length>1&&(Z=uV(Z,t)),S._cssText=Z)}if(_==="input"||_==="textarea"||_==="select"){var W=t.value,P=t.checked;S.type!=="radio"&&S.type!=="checkbox"&&S.type!=="submit"&&S.type!=="button"&&W?S.value=Ny({element:t,type:xy(t),tagName:_,value:W,maskInputOptions:a,maskInputFn:c}):P&&(S.checked=P)}if(_==="option"&&(t.selected&&!a.select?S.selected=!0:delete S.selected),_==="dialog"&&t.open&&(S.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"),_==="canvas"&&h){if(t.__context==="2d")nV(t)||(S.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var D=t.toDataURL(u.type,u.quality),G=r.createElement("canvas");G.width=t.width,G.height=t.height;var q=G.toDataURL(u.type,u.quality);D!==q&&(S.rr_dataURL=D)}}if(_==="img"&&d){Zu||(Zu=r.createElement("canvas"),u_=Zu.getContext("2d"));var L=t,Q=L.currentSrc||L.getAttribute("src")||"<unknown-src>",Y=L.crossOrigin,re=function(){L.removeEventListener("load",re);try{Zu.width=L.naturalWidth,Zu.height=L.naturalHeight,u_.drawImage(L,0,0),S.rr_dataURL=Zu.toDataURL(u.type,u.quality)}catch(Re){if(L.crossOrigin!=="anonymous"){L.crossOrigin="anonymous",L.complete&&L.naturalWidth!==0?re():L.addEventListener("load",re);return}else console.warn("Cannot inline img src="+Q+"! Error: "+Re)}L.crossOrigin==="anonymous"&&(Y?S.crossOrigin=Y:L.removeAttribute("crossorigin"))};L.complete&&L.naturalWidth!==0?re():L.addEventListener("load",re)}if(_==="audio"||_==="video"){var de=S;de.rr_mediaState=t.paused?"paused":"played",de.rr_mediaCurrentTime=t.currentTime,de.rr_mediaPlaybackRate=t.playbackRate,de.rr_mediaMuted=t.muted,de.rr_mediaLoop=t.loop,de.rr_mediaVolume=t.volume}if(v||(t.scrollLeft&&(S.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(S.rr_scrollTop=t.scrollTop)),w){var ee=t.getBoundingClientRect(),ae=ee.width,Se=ee.height;S={class:S.class,rr_width:""+ae+"px",rr_height:""+Se+"px"}}_==="iframe"&&!f(S.src)&&(t.contentDocument||(S.rr_src=S.src),delete S.src);var ke;try{customElements.get(_)&&(ke=!0)}catch{}return{type:Qr.Element,tagName:_,attributes:S,childNodes:[],isSVG:vV(t)||void 0,needBlock:w,rootId:m,isCustom:ke}}function lr(t){return t==null?"":t.toLowerCase()}function SV(t,e){if(e.comment&&t.type===Qr.Comment)return!0;if(t.type===Qr.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&c_(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(lr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||lr(t.attributes.name)==="application-name"||lr(t.attributes.rel)==="icon"||lr(t.attributes.rel)==="apple-touch-icon"||lr(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&lr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(lr(t.attributes.property).match(/^(og|twitter|fb):/)||lr(t.attributes.name).match(/^(og|twitter):/)||lr(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(lr(t.attributes.name)==="robots"||lr(t.attributes.name)==="googlebot"||lr(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(lr(t.attributes.name)==="author"||lr(t.attributes.name)==="generator"||lr(t.attributes.name)==="framework"||lr(t.attributes.name)==="publisher"||lr(t.attributes.name)==="progid"||lr(t.attributes.property).match(/^article:/)||lr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(lr(t.attributes.name)==="google-site-verification"||lr(t.attributes.name)==="yandex-verification"||lr(t.attributes.name)==="csrf-token"||lr(t.attributes.name)==="p:domain_verify"||lr(t.attributes.name)==="verify-v1"||lr(t.attributes.name)==="verification"||lr(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Gu(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,c=e.skipChild,l=c===void 0?!1:c,u=e.inlineStylesheet,d=u===void 0?!0:u,h=e.maskInputOptions,f=h===void 0?{}:h,p=e.maskTextFn,v=e.maskInputFn,m=e.slimDOMOptions,w=e.dataURLOptions,_=w===void 0?{}:w,S=e.inlineImages,T=S===void 0?!1:S,x=e.recordCanvas,O=x===void 0?!1:x,U=e.onSerialize,I=e.onIframeLoad,Z=e.iframeLoadTimeout,W=Z===void 0?5e3:Z,P=e.onStylesheetLoad,D=e.stylesheetLoadTimeout,G=D===void 0?5e3:D,q=e.keepIframeSrcFn,L=q===void 0?function(){return!1}:q,Q=e.newlyAddedElement,Y=Q===void 0?!1:Q,re=e.cssCaptured,de=re===void 0?!1:re,ee=e.needsMask,ae=e.preserveWhiteSpace,Se=ae===void 0?!0:ae;if(!ee){var ke=ee===void 0;ee=p_(t,o,a,ke)}var Re=kV(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,dataURLOptions:_,inlineImages:T,recordCanvas:O,keepIframeSrcFn:L,newlyAddedElement:Y,cssCaptured:de});if(!Re)return console.warn(t,"not serialized"),null;var _e;n.hasNode(t)?_e=n.getId(t):SV(Re,m)||!Se&&Re.type===Qr.Text&&!Re.textContent.replace(/^\s+|\s+$/gm,"").length?_e=Zf:_e=l_();var we=Object.assign(Re,{id:_e});if(n.add(t,we),_e===Zf)return null;U&&U(t);var Je=!l;if(we.type===Qr.Element){Je=Je&&!we.needBlock,delete we.needBlock;var Ue=_n.shadowRoot(t);Ue&&Wf(Ue)&&(we.isShadowHost=!0)}if((we.type===Qr.Document||we.type===Qr.Element)&&Je){m.headWhitespace&&we.type===Qr.Element&&we.tagName==="head"&&(Se=!1);var Ve={doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,slimDOMOptions:m,dataURLOptions:_,inlineImages:T,recordCanvas:O,preserveWhiteSpace:Se,onSerialize:U,onIframeLoad:I,iframeLoadTimeout:W,onStylesheetLoad:P,stylesheetLoadTimeout:G,keepIframeSrcFn:L,cssCaptured:!1};if(!(we.type===Qr.Element&&we.tagName==="textarea"&&we.attributes.value!==void 0)){we.type===Qr.Element&&we.attributes._cssText!==void 0&&typeof we.attributes._cssText=="string"&&(Ve.cssCaptured=!0);for(var Xe=He(Array.from(_n.childNodes(t))),rt;!(rt=Xe()).done;){var ct=rt.value,ut=Gu(ct,Ve);ut&&we.childNodes.push(ut)}}var lt=null;if(i_(t)&&(lt=_n.shadowRoot(t)))for(var Ct=He(Array.from(_n.childNodes(lt))),Ht;!(Ht=Ct()).done;){var jt=Ht.value,mr=Gu(jt,Ve);mr&&(Wf(lt)&&(mr.isShadow=!0),we.childNodes.push(mr))}}var br=_n.parentNode(t);return br&&Df(br)&&Wf(br)&&(we.isShadow=!0),we.type===Qr.Element&&we.tagName==="iframe"&&wV(t,function(){var Rt=t.contentDocument;if(Rt&&I){var Qe=Gu(Rt,{doc:Rt,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,slimDOMOptions:m,dataURLOptions:_,inlineImages:T,recordCanvas:O,preserveWhiteSpace:Se,onSerialize:U,onIframeLoad:I,iframeLoadTimeout:W,onStylesheetLoad:P,stylesheetLoadTimeout:G,keepIframeSrcFn:L});Qe&&I(t,Qe)}},W),we.type===Qr.Element&&we.tagName==="link"&&typeof we.attributes.rel=="string"&&(we.attributes.rel==="stylesheet"||we.attributes.rel==="preload"&&typeof we.attributes.href=="string"&&c_(we.attributes.href)==="css")&&bV(t,function(){if(P){var Rt=Gu(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,slimDOMOptions:m,dataURLOptions:_,inlineImages:T,recordCanvas:O,preserveWhiteSpace:Se,onSerialize:U,onIframeLoad:I,iframeLoadTimeout:W,onStylesheetLoad:P,stylesheetLoadTimeout:G,keepIframeSrcFn:L});Rt&&P(t,Rt)}},G),we}function AV(t,e){var r=e||{},n=r.mirror,i=n===void 0?new o_:n,s=r.blockClass,o=s===void 0?"rr-block":s,a=r.blockSelector,c=a===void 0?null:a,l=r.maskTextClass,u=l===void 0?"rr-mask":l,d=r.maskTextSelector,h=d===void 0?null:d,f=r.inlineStylesheet,p=f===void 0?!0:f,v=r.inlineImages,m=v===void 0?!1:v,w=r.recordCanvas,_=w===void 0?!1:w,S=r.maskAllInputs,T=S===void 0?!1:S,x=r.maskTextFn,O=r.maskInputFn,U=r.slimDOM,I=U===void 0?!1:U,Z=r.dataURLOptions,W=r.preserveWhiteSpace,P=r.onSerialize,D=r.onIframeLoad,G=r.iframeLoadTimeout,q=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,Q=r.keepIframeSrcFn,Y=Q===void 0?function(){return!1}:Q,re=T===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:T===!1?{password:!0}:T,de=I===!0||I==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:I==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:I===!1?{}:I;return Gu(t,{doc:t,mirror:i,blockClass:o,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:re,maskTextFn:x,maskInputFn:O,slimDOMOptions:de,dataURLOptions:Z,inlineImages:m,recordCanvas:_,preserveWhiteSpace:W,onSerialize:P,onIframeLoad:D,iframeLoadTimeout:G,onStylesheetLoad:q,stylesheetLoadTimeout:L,keepIframeSrcFn:Y,newlyAddedElement:!1})}function RV(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function TV(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return ft(this,n)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Oy={exports:{}},dr=String,m_=function(){return{isColorSupported:!1,reset:dr,bold:dr,dim:dr,italic:dr,underline:dr,inverse:dr,hidden:dr,strikethrough:dr,black:dr,red:dr,green:dr,yellow:dr,blue:dr,magenta:dr,cyan:dr,white:dr,gray:dr,bgBlack:dr,bgRed:dr,bgGreen:dr,bgYellow:dr,bgBlue:dr,bgMagenta:dr,bgCyan:dr,bgWhite:dr}};Oy.exports=m_(),Oy.exports.createColors=m_;var NV=Oy.exports,xV={},BV=Object.freeze(Object.defineProperty({__proto__:null,default:xV},Symbol.toStringTag,{value:"Module"})),Or=TV(BV),g_=NV,v_=Or,Uy=function(t){kn(e,t);function e(n,i,s,o,a,c){var l;return l=t.call(this,n)||this,l.name="CssSyntaxError",l.reason=n,a&&(l.file=a),o&&(l.source=o),c&&(l.plugin=c),typeof i<"u"&&typeof s<"u"&&(typeof i=="number"?(l.line=i,l.column=s):(l.line=i.line,l.column=i.column,l.endLine=s.line,l.endColumn=s.column)),l.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(l,e),l}var r=e.prototype;return r.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},r.showSourceCode=function(i){var s=this;if(!this.source)return"";var o=this.source;i==null&&(i=g_.isColorSupported),v_&&i&&(o=v_(o));var a=o.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),u=String(l).length,d,h;if(i){var f=g_.createColors(!0),p=f.bold,v=f.gray,m=f.red;d=function(w){return p(m(w))},h=function(w){return v(w)}}else d=h=function(w){return w};return a.slice(c,l).map(function(w,_){var S=c+1+_,T=" "+(" "+S).slice(-u)+" | ";if(S===s.line){var x=h(T.replace(/\d/g," "))+w.slice(0,s.column-1).replace(/[^\t]/g," ");return d(">")+h(T)+w+`
11
+ */(function(t){const e=s2,r=_y,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=x,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:o,SharedArrayBuffer:a}=globalThis;u.TYPED_ARRAY_SUPPORT=c(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const k=new s(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,s.prototype),Object.setPrototypeOf(k,g),k.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(k){if(k>i)throw new RangeError('The value "'+k+'" is invalid for option "size"');const g=new s(k);return Object.setPrototypeOf(g,u.prototype),g}function u(k,g,b){if(typeof k=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(k)}return d(k,g,b)}u.poolSize=8192;function d(k,g,b){if(typeof k=="string")return v(k,g);if(o.isView(k))return w(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(mt(k,o)||k&&mt(k.buffer,o)||typeof a<"u"&&(mt(k,a)||k&&mt(k.buffer,a)))return _(k,g,b);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const B=k.valueOf&&k.valueOf();if(B!=null&&B!==k)return u.from(B,g,b);const z=S(k);if(z)return z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return u.from(k[Symbol.toPrimitive]("string"),g,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}u.from=function(k,g,b){return d(k,g,b)},Object.setPrototypeOf(u.prototype,s.prototype),Object.setPrototypeOf(u,s);function h(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function f(k,g,b){return h(k),k<=0?l(k):g!==void 0?typeof b=="string"?l(k).fill(g,b):l(k).fill(g):l(k)}u.alloc=function(k,g,b){return f(k,g,b)};function p(k){return h(k),l(k<0?0:T(k)|0)}u.allocUnsafe=function(k){return p(k)},u.allocUnsafeSlow=function(k){return p(k)};function v(k,g){if((typeof g!="string"||g==="")&&(g="utf8"),!u.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const b=O(k,g)|0;let B=l(b);const z=B.write(k,g);return z!==b&&(B=B.slice(0,z)),B}function m(k){const g=k.length<0?0:T(k.length)|0,b=l(g);for(let B=0;B<g;B+=1)b[B]=k[B]&255;return b}function w(k){if(mt(k,s)){const g=new s(k);return _(g.buffer,g.byteOffset,g.byteLength)}return m(k)}function _(k,g,b){if(g<0||k.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<g+(b||0))throw new RangeError('"length" is outside of buffer bounds');let B;return g===void 0&&b===void 0?B=new s(k):b===void 0?B=new s(k,g):B=new s(k,g,b),Object.setPrototypeOf(B,u.prototype),B}function S(k){if(u.isBuffer(k)){const g=T(k.length)|0,b=l(g);return b.length===0||k.copy(b,0,0,g),b}if(k.length!==void 0)return typeof k.length!="number"||Sr(k.length)?l(0):m(k);if(k.type==="Buffer"&&Array.isArray(k.data))return m(k.data)}function T(k){if(k>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return k|0}function x(k){return+k!=k&&(k=0),u.alloc(+k)}u.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==u.prototype},u.compare=function(g,b){if(mt(g,s)&&(g=u.from(g,g.offset,g.byteLength)),mt(b,s)&&(b=u.from(b,b.offset,b.byteLength)),!u.isBuffer(g)||!u.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===b)return 0;let B=g.length,z=b.length;for(let j=0,te=Math.min(B,z);j<te;++j)if(g[j]!==b[j]){B=g[j],z=b[j];break}return B<z?-1:z<B?1:0},u.isEncoding=function(g){switch(String(g).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(g,b){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return u.alloc(0);let B;if(b===void 0)for(b=0,B=0;B<g.length;++B)b+=g[B].length;const z=u.allocUnsafe(b);let j=0;for(B=0;B<g.length;++B){let te=g[B];if(mt(te,s))j+te.length>z.length?(u.isBuffer(te)||(te=u.from(te)),te.copy(z,j)):s.prototype.set.call(z,te,j);else if(u.isBuffer(te))te.copy(z,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=te.length}return z};function O(k,g){if(u.isBuffer(k))return k.length;if(o.isView(k)||mt(k,o))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const b=k.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&b===0)return 0;let z=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return Rt(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return Ft(k).length;default:if(z)return B?-1:Rt(k).length;g=(""+g).toLowerCase(),z=!0}}u.byteLength=O;function U(k,g,b){let B=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,g>>>=0,b<=g))return"";for(k||(k="utf8");;)switch(k){case"hex":return Se(this,g,b);case"utf8":case"utf-8":return Y(this,g,b);case"ascii":return ee(this,g,b);case"latin1":case"binary":return ae(this,g,b);case"base64":return Q(this,g,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,g,b);default:if(B)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),B=!0}}u.prototype._isBuffer=!0;function I(k,g,b){const B=k[g];k[g]=k[b],k[b]=B}u.prototype.swap16=function(){const g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<g;b+=2)I(this,b,b+1);return this},u.prototype.swap32=function(){const g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<g;b+=4)I(this,b,b+3),I(this,b+1,b+2);return this},u.prototype.swap64=function(){const g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<g;b+=8)I(this,b,b+7),I(this,b+1,b+6),I(this,b+2,b+5),I(this,b+3,b+4);return this},u.prototype.toString=function(){const g=this.length;return g===0?"":arguments.length===0?Y(this,0,g):U.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(g){if(!u.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:u.compare(this,g)===0},u.prototype.inspect=function(){let g="";const b=t.INSPECT_MAX_BYTES;return g=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(g+=" ... "),"<Buffer "+g+">"},n&&(u.prototype[n]=u.prototype.inspect),u.prototype.compare=function(g,b,B,z,j){if(mt(g,s)&&(g=u.from(g,g.offset,g.byteLength)),!u.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(b===void 0&&(b=0),B===void 0&&(B=g?g.length:0),z===void 0&&(z=0),j===void 0&&(j=this.length),b<0||B>g.length||z<0||j>this.length)throw new RangeError("out of range index");if(z>=j&&b>=B)return 0;if(z>=j)return-1;if(b>=B)return 1;if(b>>>=0,B>>>=0,z>>>=0,j>>>=0,this===g)return 0;let te=j-z,he=B-b;const Ie=Math.min(te,he),Ot=this.slice(z,j),Lt=g.slice(b,B);for(let gt=0;gt<Ie;++gt)if(Ot[gt]!==Lt[gt]){te=Ot[gt],he=Lt[gt];break}return te<he?-1:he<te?1:0};function Z(k,g,b,B,z){if(k.length===0)return-1;if(typeof b=="string"?(B=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,Sr(b)&&(b=z?0:k.length-1),b<0&&(b=k.length+b),b>=k.length){if(z)return-1;b=k.length-1}else if(b<0)if(z)b=0;else return-1;if(typeof g=="string"&&(g=u.from(g,B)),u.isBuffer(g))return g.length===0?-1:W(k,g,b,B,z);if(typeof g=="number")return g=g&255,typeof s.prototype.indexOf=="function"?z?s.prototype.indexOf.call(k,g,b):s.prototype.lastIndexOf.call(k,g,b):W(k,[g],b,B,z);throw new TypeError("val must be string, number or Buffer")}function W(k,g,b,B,z){let j=1,te=k.length,he=g.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(k.length<2||g.length<2)return-1;j=2,te/=2,he/=2,b/=2}function Ie(Lt,gt){return j===1?Lt[gt]:Lt.readUInt16BE(gt*j)}let Ot;if(z){let Lt=-1;for(Ot=b;Ot<te;Ot++)if(Ie(k,Ot)===Ie(g,Lt===-1?0:Ot-Lt)){if(Lt===-1&&(Lt=Ot),Ot-Lt+1===he)return Lt*j}else Lt!==-1&&(Ot-=Ot-Lt),Lt=-1}else for(b+he>te&&(b=te-he),Ot=b;Ot>=0;Ot--){let Lt=!0;for(let gt=0;gt<he;gt++)if(Ie(k,Ot+gt)!==Ie(g,gt)){Lt=!1;break}if(Lt)return Ot}return-1}u.prototype.includes=function(g,b,B){return this.indexOf(g,b,B)!==-1},u.prototype.indexOf=function(g,b,B){return Z(this,g,b,B,!0)},u.prototype.lastIndexOf=function(g,b,B){return Z(this,g,b,B,!1)};function P(k,g,b,B){b=Number(b)||0;const z=k.length-b;B?(B=Number(B),B>z&&(B=z)):B=z;const j=g.length;B>j/2&&(B=j/2);let te;for(te=0;te<B;++te){const he=parseInt(g.substr(te*2,2),16);if(Sr(he))return te;k[b+te]=he}return te}function D(k,g,b,B){return Mr(Rt(g,k.length-b),k,b,B)}function G(k,g,b,B){return Mr(Qe(g),k,b,B)}function q(k,g,b,B){return Mr(Ft(g),k,b,B)}function L(k,g,b,B){return Mr(nt(g,k.length-b),k,b,B)}u.prototype.write=function(g,b,B,z){if(b===void 0)z="utf8",B=this.length,b=0;else if(B===void 0&&typeof b=="string")z=b,B=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(B)?(B=B>>>0,z===void 0&&(z="utf8")):(z=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-b;if((B===void 0||B>j)&&(B=j),g.length>0&&(B<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");z||(z="utf8");let te=!1;for(;;)switch(z){case"hex":return P(this,g,b,B);case"utf8":case"utf-8":return D(this,g,b,B);case"ascii":case"latin1":case"binary":return G(this,g,b,B);case"base64":return q(this,g,b,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,g,b,B);default:if(te)throw new TypeError("Unknown encoding: "+z);z=(""+z).toLowerCase(),te=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Q(k,g,b){return g===0&&b===k.length?e.fromByteArray(k):e.fromByteArray(k.slice(g,b))}function Y(k,g,b){b=Math.min(k.length,b);const B=[];let z=g;for(;z<b;){const j=k[z];let te=null,he=j>239?4:j>223?3:j>191?2:1;if(z+he<=b){let Ie,Ot,Lt,gt;switch(he){case 1:j<128&&(te=j);break;case 2:Ie=k[z+1],(Ie&192)===128&&(gt=(j&31)<<6|Ie&63,gt>127&&(te=gt));break;case 3:Ie=k[z+1],Ot=k[z+2],(Ie&192)===128&&(Ot&192)===128&&(gt=(j&15)<<12|(Ie&63)<<6|Ot&63,gt>2047&&(gt<55296||gt>57343)&&(te=gt));break;case 4:Ie=k[z+1],Ot=k[z+2],Lt=k[z+3],(Ie&192)===128&&(Ot&192)===128&&(Lt&192)===128&&(gt=(j&15)<<18|(Ie&63)<<12|(Ot&63)<<6|Lt&63,gt>65535&&gt<1114112&&(te=gt))}}te===null?(te=65533,he=1):te>65535&&(te-=65536,B.push(te>>>10&1023|55296),te=56320|te&1023),B.push(te),z+=he}return de(B)}const re=4096;function de(k){const g=k.length;if(g<=re)return String.fromCharCode.apply(String,k);let b="",B=0;for(;B<g;)b+=String.fromCharCode.apply(String,k.slice(B,B+=re));return b}function ee(k,g,b){let B="";b=Math.min(k.length,b);for(let z=g;z<b;++z)B+=String.fromCharCode(k[z]&127);return B}function ae(k,g,b){let B="";b=Math.min(k.length,b);for(let z=g;z<b;++z)B+=String.fromCharCode(k[z]);return B}function Se(k,g,b){const B=k.length;(!g||g<0)&&(g=0),(!b||b<0||b>B)&&(b=B);let z="";for(let j=g;j<b;++j)z+=y[k[j]];return z}function ke(k,g,b){const B=k.slice(g,b);let z="";for(let j=0;j<B.length-1;j+=2)z+=String.fromCharCode(B[j]+B[j+1]*256);return z}u.prototype.slice=function(g,b){const B=this.length;g=~~g,b=b===void 0?B:~~b,g<0?(g+=B,g<0&&(g=0)):g>B&&(g=B),b<0?(b+=B,b<0&&(b=0)):b>B&&(b=B),b<g&&(b=g);const z=this.subarray(g,b);return Object.setPrototypeOf(z,u.prototype),z};function Re(k,g,b){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+g>b)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=this[g],j=1,te=0;for(;++te<b&&(j*=256);)z+=this[g+te]*j;return z},u.prototype.readUintBE=u.prototype.readUIntBE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=this[g+--b],j=1;for(;b>0&&(j*=256);)z+=this[g+--b]*j;return z},u.prototype.readUint8=u.prototype.readUInt8=function(g,b){return g=g>>>0,b||Re(g,1,this.length),this[g]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(g,b){return g=g>>>0,b||Re(g,2,this.length),this[g]|this[g+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(g,b){return g=g>>>0,b||Re(g,2,this.length),this[g]<<8|this[g+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},u.prototype.readBigUInt64LE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=b+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,j=this[++g]+this[++g]*2**8+this[++g]*2**16+B*2**24;return BigInt(z)+(BigInt(j)<<BigInt(32))}),u.prototype.readBigUInt64BE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=b*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],j=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+B;return(BigInt(z)<<BigInt(32))+BigInt(j)}),u.prototype.readIntLE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=this[g],j=1,te=0;for(;++te<b&&(j*=256);)z+=this[g+te]*j;return j*=128,z>=j&&(z-=Math.pow(2,8*b)),z},u.prototype.readIntBE=function(g,b,B){g=g>>>0,b=b>>>0,B||Re(g,b,this.length);let z=b,j=1,te=this[g+--z];for(;z>0&&(j*=256);)te+=this[g+--z]*j;return j*=128,te>=j&&(te-=Math.pow(2,8*b)),te},u.prototype.readInt8=function(g,b){return g=g>>>0,b||Re(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},u.prototype.readInt16LE=function(g,b){g=g>>>0,b||Re(g,2,this.length);const B=this[g]|this[g+1]<<8;return B&32768?B|4294901760:B},u.prototype.readInt16BE=function(g,b){g=g>>>0,b||Re(g,2,this.length);const B=this[g+1]|this[g]<<8;return B&32768?B|4294901760:B},u.prototype.readInt32LE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},u.prototype.readInt32BE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},u.prototype.readBigInt64LE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(B<<24);return(BigInt(z)<<BigInt(32))+BigInt(b+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),u.prototype.readBigInt64BE=E(function(g){g=g>>>0,Ht(g,"offset");const b=this[g],B=this[g+7];(b===void 0||B===void 0)&&jt(g,this.length-8);const z=(b<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(z)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+B)}),u.prototype.readFloatLE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),r.read(this,g,!0,23,4)},u.prototype.readFloatBE=function(g,b){return g=g>>>0,b||Re(g,4,this.length),r.read(this,g,!1,23,4)},u.prototype.readDoubleLE=function(g,b){return g=g>>>0,b||Re(g,8,this.length),r.read(this,g,!0,52,8)},u.prototype.readDoubleBE=function(g,b){return g=g>>>0,b||Re(g,8,this.length),r.read(this,g,!1,52,8)};function _e(k,g,b,B,z,j){if(!u.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>z||g<j)throw new RangeError('"value" argument is out of bounds');if(b+B>k.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(g,b,B,z){if(g=+g,b=b>>>0,B=B>>>0,!z){const he=Math.pow(2,8*B)-1;_e(this,g,b,B,he,0)}let j=1,te=0;for(this[b]=g&255;++te<B&&(j*=256);)this[b+te]=g/j&255;return b+B},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(g,b,B,z){if(g=+g,b=b>>>0,B=B>>>0,!z){const he=Math.pow(2,8*B)-1;_e(this,g,b,B,he,0)}let j=B-1,te=1;for(this[b+j]=g&255;--j>=0&&(te*=256);)this[b+j]=g/te&255;return b+B},u.prototype.writeUint8=u.prototype.writeUInt8=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,1,255,0),this[b]=g&255,b+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,65535,0),this[b]=g&255,this[b+1]=g>>>8,b+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,65535,0),this[b]=g>>>8,this[b+1]=g&255,b+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,4294967295,0),this[b+3]=g>>>24,this[b+2]=g>>>16,this[b+1]=g>>>8,this[b]=g&255,b+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,4294967295,0),this[b]=g>>>24,this[b+1]=g>>>16,this[b+2]=g>>>8,this[b+3]=g&255,b+4};function we(k,g,b,B,z){Ct(g,B,z,k,b,7);let j=Number(g&BigInt(4294967295));k[b++]=j,j=j>>8,k[b++]=j,j=j>>8,k[b++]=j,j=j>>8,k[b++]=j;let te=Number(g>>BigInt(32)&BigInt(4294967295));return k[b++]=te,te=te>>8,k[b++]=te,te=te>>8,k[b++]=te,te=te>>8,k[b++]=te,b}function Je(k,g,b,B,z){Ct(g,B,z,k,b,7);let j=Number(g&BigInt(4294967295));k[b+7]=j,j=j>>8,k[b+6]=j,j=j>>8,k[b+5]=j,j=j>>8,k[b+4]=j;let te=Number(g>>BigInt(32)&BigInt(4294967295));return k[b+3]=te,te=te>>8,k[b+2]=te,te=te>>8,k[b+1]=te,te=te>>8,k[b]=te,b+8}u.prototype.writeBigUInt64LE=E(function(g,b=0){return we(this,g,b,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=E(function(g,b=0){return Je(this,g,b,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(g,b,B,z){if(g=+g,b=b>>>0,!z){const Ie=Math.pow(2,8*B-1);_e(this,g,b,B,Ie-1,-Ie)}let j=0,te=1,he=0;for(this[b]=g&255;++j<B&&(te*=256);)g<0&&he===0&&this[b+j-1]!==0&&(he=1),this[b+j]=(g/te>>0)-he&255;return b+B},u.prototype.writeIntBE=function(g,b,B,z){if(g=+g,b=b>>>0,!z){const Ie=Math.pow(2,8*B-1);_e(this,g,b,B,Ie-1,-Ie)}let j=B-1,te=1,he=0;for(this[b+j]=g&255;--j>=0&&(te*=256);)g<0&&he===0&&this[b+j+1]!==0&&(he=1),this[b+j]=(g/te>>0)-he&255;return b+B},u.prototype.writeInt8=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,1,127,-128),g<0&&(g=255+g+1),this[b]=g&255,b+1},u.prototype.writeInt16LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,32767,-32768),this[b]=g&255,this[b+1]=g>>>8,b+2},u.prototype.writeInt16BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,2,32767,-32768),this[b]=g>>>8,this[b+1]=g&255,b+2},u.prototype.writeInt32LE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,2147483647,-2147483648),this[b]=g&255,this[b+1]=g>>>8,this[b+2]=g>>>16,this[b+3]=g>>>24,b+4},u.prototype.writeInt32BE=function(g,b,B){return g=+g,b=b>>>0,B||_e(this,g,b,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[b]=g>>>24,this[b+1]=g>>>16,this[b+2]=g>>>8,this[b+3]=g&255,b+4},u.prototype.writeBigInt64LE=E(function(g,b=0){return we(this,g,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=E(function(g,b=0){return Je(this,g,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ue(k,g,b,B,z,j){if(b+B>k.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function Ve(k,g,b,B,z){return g=+g,b=b>>>0,z||Ue(k,g,b,4),r.write(k,g,b,B,23,4),b+4}u.prototype.writeFloatLE=function(g,b,B){return Ve(this,g,b,!0,B)},u.prototype.writeFloatBE=function(g,b,B){return Ve(this,g,b,!1,B)};function Xe(k,g,b,B,z){return g=+g,b=b>>>0,z||Ue(k,g,b,8),r.write(k,g,b,B,52,8),b+8}u.prototype.writeDoubleLE=function(g,b,B){return Xe(this,g,b,!0,B)},u.prototype.writeDoubleBE=function(g,b,B){return Xe(this,g,b,!1,B)},u.prototype.copy=function(g,b,B,z){if(!u.isBuffer(g))throw new TypeError("argument should be a Buffer");if(B||(B=0),!z&&z!==0&&(z=this.length),b>=g.length&&(b=g.length),b||(b=0),z>0&&z<B&&(z=B),z===B||g.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(B<0||B>=this.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("sourceEnd out of bounds");z>this.length&&(z=this.length),g.length-b<z-B&&(z=g.length-b+B);const j=z-B;return this===g&&typeof s.prototype.copyWithin=="function"?this.copyWithin(b,B,z):s.prototype.set.call(g,this.subarray(B,z),b),j},u.prototype.fill=function(g,b,B,z){if(typeof g=="string"){if(typeof b=="string"?(z=b,b=0,B=this.length):typeof B=="string"&&(z=B,B=this.length),z!==void 0&&typeof z!="string")throw new TypeError("encoding must be a string");if(typeof z=="string"&&!u.isEncoding(z))throw new TypeError("Unknown encoding: "+z);if(g.length===1){const te=g.charCodeAt(0);(z==="utf8"&&te<128||z==="latin1")&&(g=te)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(b<0||this.length<b||this.length<B)throw new RangeError("Out of range index");if(B<=b)return this;b=b>>>0,B=B===void 0?this.length:B>>>0,g||(g=0);let j;if(typeof g=="number")for(j=b;j<B;++j)this[j]=g;else{const te=u.isBuffer(g)?g:u.from(g,z),he=te.length;if(he===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(j=0;j<B-b;++j)this[j+b]=te[j%he]}return this};const rt={};function ct(k,g,b){rt[k]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:z,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}ct("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ct("ERR_INVALID_ARG_TYPE",function(k,g){return`The "${k}" argument must be of type number. Received type ${typeof g}`},TypeError),ct("ERR_OUT_OF_RANGE",function(k,g,b){let B=`The value of "${k}" is out of range.`,z=b;return Number.isInteger(b)&&Math.abs(b)>2**32?z=ut(String(b)):typeof b=="bigint"&&(z=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(z=ut(z)),z+="n"),B+=` It must be ${g}. Received ${z}`,B},RangeError);function ut(k){let g="",b=k.length;const B=k[0]==="-"?1:0;for(;b>=B+4;b-=3)g=`_${k.slice(b-3,b)}${g}`;return`${k.slice(0,b)}${g}`}function lt(k,g,b){Ht(g,"offset"),(k[g]===void 0||k[g+b]===void 0)&&jt(g,k.length-(b+1))}function Ct(k,g,b,B,z,j){if(k>b||k<g){const te=typeof g=="bigint"?"n":"";let he;throw g===0||g===BigInt(0)?he=`>= 0${te} and < 2${te} ** ${(j+1)*8}${te}`:he=`>= -(2${te} ** ${(j+1)*8-1}${te}) and < 2 ** ${(j+1)*8-1}${te}`,new rt.ERR_OUT_OF_RANGE("value",he,k)}lt(B,z,j)}function Ht(k,g){if(typeof k!="number")throw new rt.ERR_INVALID_ARG_TYPE(g,"number",k)}function jt(k,g,b){throw Math.floor(k)!==k?(Ht(k,b),new rt.ERR_OUT_OF_RANGE("offset","an integer",k)):g<0?new rt.ERR_BUFFER_OUT_OF_BOUNDS:new rt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${g}`,k)}const mr=/[^+/0-9A-Za-z-_]/g;function br(k){if(k=k.split("=")[0],k=k.trim().replace(mr,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function Rt(k,g){g=g||1/0;let b;const B=k.length;let z=null;const j=[];for(let te=0;te<B;++te){if(b=k.charCodeAt(te),b>55295&&b<57344){if(!z){if(b>56319){(g-=3)>-1&&j.push(239,191,189);continue}else if(te+1===B){(g-=3)>-1&&j.push(239,191,189);continue}z=b;continue}if(b<56320){(g-=3)>-1&&j.push(239,191,189),z=b;continue}b=(z-55296<<10|b-56320)+65536}else z&&(g-=3)>-1&&j.push(239,191,189);if(z=null,b<128){if((g-=1)<0)break;j.push(b)}else if(b<2048){if((g-=2)<0)break;j.push(b>>6|192,b&63|128)}else if(b<65536){if((g-=3)<0)break;j.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((g-=4)<0)break;j.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return j}function Qe(k){const g=[];for(let b=0;b<k.length;++b)g.push(k.charCodeAt(b)&255);return g}function nt(k,g){let b,B,z;const j=[];for(let te=0;te<k.length&&!((g-=2)<0);++te)b=k.charCodeAt(te),B=b>>8,z=b%256,j.push(z),j.push(B);return j}function Ft(k){return e.toByteArray(br(k))}function Mr(k,g,b,B){let z;for(z=0;z<B&&!(z+b>=g.length||z>=k.length);++z)g[z+b]=k[z];return z}function mt(k,g){return k instanceof g||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===g.name}function Sr(k){return k!==k}const y=function(){const k="0123456789abcdef",g=new Array(256);for(let b=0;b<16;++b){const B=b*16;for(let z=0;z<16;++z)g[B+z]=k[b]+k[z]}return g}();function E(k){return typeof BigInt>"u"?N:k}function N(){throw new Error("BigInt not supported")}})(jk);const pa=jk.Buffer;var o2={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_2aa324d8-57b6-450a-89e1-435458f28459",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"true",npm_config_user_agent:"pnpm/10.13.1 npm/? node/v20.19.4 linux x64",CI:"true",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_2aa324d8-57b6-450a-89e1-435458f28459",PIPX_HOME:"/opt/pipx",RUNNER_ENVIRONMENT:"github-hosted",npm_node_execpath:"/opt/hostedtoolcache/node/20.19.4/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",HOME:"/home/runner",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",RUNNER_TEMP:"/home/runner/work/_temp",npm_package_json:"/home/runner/work/passport/passport/packages/passport-evm/package.json",GITHUB_REPOSITORY_OWNER:"credenza-web3",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",npm_package_engines_node:">=20.10.0",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/28.2.13676358",GITHUB_RETENTION_DAYS:"90",GRADLE_HOME:"/usr/share/gradle-8.14.3",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",GITHUB_REPOSITORY_OWNER_ID:"93208388",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",npm_config__credenza3_registry:"https://registry.npmjs.org/",npm_config_userconfig:"/home/runner/work/_temp/.npmrc",SYSTEMD_EXEC_PID:"1804",npm_config_engine_strict:"true",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",ImageVersion:"20250728.1.0",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.12/x64",LOGNAME:"runner",RUNNER_OS:"Linux",SWIFT_PATH:"/usr/share/swift/usr/bin",pnpm_config_verify_deps_before_run:"false",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GITHUB_WORKFLOW:"Publish @credenza3/passport-evm",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.11/x64",JOURNAL_STREAM:"9:13560",_:"/home/runner/setup-pnpm/node_modules/.bin/pnpm",GOROOT_1_24_X64:"/opt/hostedtoolcache/go/1.24.5/x64",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/hosted-compute-agent.service/memory.pressure",npm_config_registry:"https://registry.npmjs.org/",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",GITHUB_RUN_ID:"16650570979",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_BASE_REF:"",GITHUB_REF_TYPE:"branch",GITHUB_WORKFLOW_SHA:"b9cc2921cf6ad8e6cc1d9a6f423b92b42aec0dce",ImageOS:"ubuntu24",ENABLE_RUNNER_TRACING:"true",GITHUB_ACTION_REPOSITORY:"",GITHUB_WORKFLOW_REF:"credenza-web3/passport/.github/workflows/publish-evm.yml@refs/heads/main",npm_config_node_gyp:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/passport/passport/packages/passport-evm/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/20.19.4/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",INVOCATION_ID:"cc9dfed8a6e749d487df4015913d54c7",NODE:"/opt/hostedtoolcache/node/20.19.4/x64/bin/node",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",RUNNER_TRACKING_ID:"github_63ab66e5-2856-44f7-8cd4-56af06d322ce",TURBO_HASH:"fe0e6bc1bec42fe2",npm_package_name:"@credenza3/passport-evm",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",GITHUB_ACTION:"__run_2",GITHUB_RUN_NUMBER:"66",GITHUB_TRIGGERING_ACTOR:"mikeavvad",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",npm_config_frozen_lockfile:"",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"credenza-web3/passport",RUNNER_NAME:"GitHub Actions 1000000439",XDG_CONFIG_HOME:"/home/runner/.config",npm_lifecycle_script:"vite build",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.3.13750724",DEBIAN_FRONTEND:"noninteractive",GITHUB_ACTION_REF:"",GITHUB_ACTIONS:"true",GITHUB_REPOSITORY_ID:"493155814",NODE_PATH:"/home/runner/work/passport/passport/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.3_jiti@2.4.2_lightningcss@1.29.1_sass@1.89.2_yaml@2.8.0/node_modules/vite/bin/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.3_jiti@2.4.2_lightningcss@1.29.1_sass@1.89.2_yaml@2.8.0/node_modules/vite/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.3_jiti@2.4.2_lightningcss@1.29.1_sass@1.89.2_yaml@2.8.0/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/turbo@1.13.3/node_modules/turbo/bin/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/turbo@1.13.3/node_modules/turbo/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/turbo@1.13.3/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules",SHELL:"/bin/bash",npm_package_version:"0.2.15",npm_config_verify_deps_before_run:"false",npm_lifecycle_event:"build",GITHUB_REF_PROTECTED:"false",ACCEPT_EULA:"Y",GITHUB_JOB:"publish-gpr",GITHUB_WORKSPACE:"/home/runner/work/passport/passport",TURBO_INVOCATION_DIR:"/home/runner/work/passport/passport",npm_package_engines_pnpm:">=9",GITHUB_RUN_ATTEMPT:"1",GITHUB_SHA:"b9cc2921cf6ad8e6cc1d9a6f423b92b42aec0dce",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",GITHUB_ACTOR:"mikeavvad",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR_ID:"87299315",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_2aa324d8-57b6-450a-89e1-435458f28459",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/passport/passport/packages/passport-evm",RUNNER_WORKSPACE:"/home/runner/work/passport",npm_execpath:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.13.1/node_modules/pnpm/bin/pnpm.cjs",ANDROID_HOME:"/usr/local/lib/android/sdk",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_EVENT_NAME:"push",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_2aa324d8-57b6-450a-89e1-435458f28459",GITHUB_SERVER_URL:"https://github.com",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",HOMEBREW_NO_AUTO_UPDATE:"1",EDGEWEBDRIVER:"/usr/local/share/edge_driver",PNPM_SCRIPT_SRC_DIR:"/home/runner/work/passport/passport/packages/passport-evm",npm_config__jsr_registry:"https://npm.jsr.io/",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.3.13750724",CHROME_BIN:"/usr/bin/google-chrome",SGX_AESM_ADDR:"1",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",PNPM_HOME:"/home/runner/setup-pnpm/node_modules/.bin",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.3.13750724",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_2aa324d8-57b6-450a-89e1-435458f28459",INIT_CWD:"/home/runner/work/passport/passport/packages/passport-evm",NODE_ENV:"production"},Pe;if(typeof window>"u"){var Jk={hostname:""};Pe={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:Jk,referrer:""},screen:{width:0,height:0},location:Jk,addEventListener:function(){},removeEventListener:function(){}}}else Pe=window;function $k(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Yk(t,e,r,n,i,s,o){try{var a=t[s](o),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function Ey(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(c){Yk(s,n,i,o,a,"next",c)}function a(c){Yk(s,n,i,o,a,"throw",c)}o(void 0)})}}function a2(t,e,r){return Xk()?a2=Reflect.construct:a2=function(i,s,o){var a=[null];a.push.apply(a,s);var c=Function.bind.apply(i,a),l=new c;return o&&Ff(l,o.prototype),l},a2.apply(null,arguments)}function BP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function an(t,e,r){return e&&BP(t.prototype,e),t}function Pt(){return Pt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Pt.apply(this,arguments)}function Cy(t){return Cy=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Cy(t)}function kn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ff(t,e)}function ft(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function IP(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Vf(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Ff(t,e){return Ff=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ff(t,e)}function _t(t){"@swc/helpers - typeof";return t&&typeof Symbol<"u"&&t.constructor===Symbol?"symbol":typeof t}function OP(t,e){if(t){if(typeof t=="string")return $k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $k(t,e)}}function c2(t){var e=typeof Map=="function"?new Map:void 0;return c2=function(n){if(n===null||!IP(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return a2(n,arguments,Cy(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ff(i,n)},c2(t)}function Xk(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xk=function(){return!!t})()}function He(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=OP(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Lf(t,e){var r,n,i,s,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=l[0]&2?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=e.call(t,o)}catch(u){l=[6,u],n=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Kk(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var UP=Object.defineProperty,MP=function(t,e,r){return e in t?UP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Oe=function(t,e,r){return MP(t,(typeof e>"u"?"undefined":_t(e))!=="symbol"?e+"":e,r)},qk,PP=Object.defineProperty,VP=function(t,e,r){return e in t?PP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},e_=function(t,e,r){return VP(t,(typeof e>"u"?"undefined":_t(e))!=="symbol"?e+"":e,r)},Qr=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}(Qr||{}),t_={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},r_={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l2={},FP=function(){return!!globalThis.Zone};function Sy(t){if(l2[t])return l2[t];var e=globalThis[t],r=e.prototype,n=t in t_?t_[t]:void 0,i=!!(n&&n.every(function(u){var d,h;return!!((h=(d=Object.getOwnPropertyDescriptor(r,u))==null?void 0:d.get)!=null&&h.toString().includes("[native code]"))})),s=t in r_?r_[t]:void 0,o=!!(s&&s.every(function(u){var d;return typeof r[u]=="function"&&((d=r[u])==null?void 0:d.toString().includes("[native code]"))}));if(i&&o&&!FP())return l2[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return e.prototype;var l=c[t].prototype;return document.body.removeChild(a),l?l2[t]=l:r}catch{return r}}var Ay={};function ma(t,e,r){var n,i=t+"."+String(r);if(Ay[i])return Ay[i].call(e);var s=Sy(t),o=(n=Object.getOwnPropertyDescriptor(s,r))==null?void 0:n.get;return o?(Ay[i]=o,o.call(e)):e[r]}var Ry={};function n_(t,e,r){var n=t+"."+String(r);if(Ry[n])return Ry[n].bind(e);var i=Sy(t),s=i[r];return typeof s!="function"?e[r]:(Ry[n]=s,s.bind(e))}function LP(t){return ma("Node",t,"childNodes")}function DP(t){return ma("Node",t,"parentNode")}function WP(t){return ma("Node",t,"parentElement")}function ZP(t){return ma("Node",t,"textContent")}function zP(t,e){return n_("Node",t,"contains")(e)}function GP(t){return n_("Node",t,"getRootNode")()}function HP(t){return!t||!("host"in t)?null:ma("ShadowRoot",t,"host")}function jP(t){return t.styleSheets}function QP(t){return!t||!("shadowRoot"in t)?null:ma("Element",t,"shadowRoot")}function JP(t,e){return ma("Element",t,"querySelector")(e)}function $P(t,e){return ma("Element",t,"querySelectorAll")(e)}function YP(){return Sy("MutationObserver").constructor}var _n={childNodes:LP,parentNode:DP,parentElement:WP,textContent:ZP,contains:zP,getRootNode:GP,host:HP,styleSheets:jP,shadowRoot:QP,querySelector:JP,querySelectorAll:$P,mutationObserver:YP};function i_(t){return t.nodeType===t.ELEMENT_NODE}function Df(t){var e=t&&"host"in t&&"mode"in t&&_n.host(t)||null;return!!(e&&"shadowRoot"in e&&_n.shadowRoot(e)===t)}function Wf(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function XP(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function KP(t){var e=t.cssText;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return t.layerName===""?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}function Ty(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;!r&&t.ownerNode&&t.ownerNode.ownerDocument&&(r=t.ownerNode.ownerDocument.location.href);var n=Array.from(e,function(i){return s_(i,r)}).join("");return XP(n)}catch{return null}}function s_(t,e){if(eV(t)){var r;try{r=Ty(t.styleSheet)||KP(t)}catch{r=t.cssText}return t.styleSheet.href?u2(r,t.styleSheet.href):r}else{var n=t.cssText;return tV(t)&&t.selectorText.includes(":")&&(n=qP(n)),e?u2(n,e):n}}function qP(t){var e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function eV(t){return"styleSheet"in t}function tV(t){return"selectorText"in t}var o_=function(){function t(){e_(this,"idNodeMap",new Map),e_(this,"nodeMetaMap",new WeakMap)}var e=t.prototype;return e.getId=function(n){var i;if(!n)return-1;var s=(i=this.getMeta(n))==null?void 0:i.id;return s??-1},e.getNode=function(n){return this.idNodeMap.get(n)||null},e.getIds=function(){return Array.from(this.idNodeMap.keys())},e.getMeta=function(n){return this.nodeMetaMap.get(n)||null},e.removeNodeFromMap=function(n){var i=this,s=this.getId(n);this.idNodeMap.delete(s),n.childNodes&&n.childNodes.forEach(function(o){return i.removeNodeFromMap(o)})},e.has=function(n){return this.idNodeMap.has(n)},e.hasNode=function(n){return this.nodeMetaMap.has(n)},e.add=function(n,i){var s=i.id;this.idNodeMap.set(s,n),this.nodeMetaMap.set(n,i)},e.replace=function(n,i){var s=this.getNode(n);if(s){var o=this.nodeMetaMap.get(s);o&&this.nodeMetaMap.set(i,o)}this.idNodeMap.set(n,i)},e.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t}();function rV(){return new o_}function Ny(t){var e=t.element,r=t.maskInputOptions,n=t.tagName,i=t.type,s=t.value,o=t.maskInputFn,a=s||"",c=i&&Pc(i);return(r[n.toLowerCase()]||c&&r[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function Pc(t){return t.toLowerCase()}var a_="__rrweb_original__";function nV(t){var e=t.getContext("2d");if(!e)return!0;for(var r=50,n=0;n<t.width;n+=r)for(var i=0;i<t.height;i+=r){var s=e.getImageData,o=a_ in s?s[a_]:s,a=new Uint32Array(o.call(e,n,i,Math.min(r,t.width-n),Math.min(r,t.height-i)).data.buffer);if(a.some(function(c){return c!==0}))return!1}return!0}function xy(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Pc(e):null}function c_(t,e){var r;try{r=new URL(t,e??window.location.href)}catch{return null}var n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n),s;return(s=i==null?void 0:i[1])!=null?s:null}function iV(t){var e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var sV=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oV=/^(?:[a-z+]+:)?\/\//i,aV=/^www\..*/i,cV=/^(data:)([^,]*),(.*)/i;function u2(t,e){return(t||"").replace(sV,function(r,n,i,s,o,a){var c=i||o||a,l=n||s||"";if(!c)return r;if(oV.test(c)||aV.test(c)||cV.test(c))return"url("+l+c+l+")";if(c[0]==="/")return"url("+l+(iV(e)+c)+l+")";var u=e.split("/"),d=c.split("/");u.pop();for(var h=He(d),f;!(f=h()).done;){var p=f.value;p!=="."&&(p===".."?u.pop():u.push(p))}return"url("+l+u.join("/")+l+")"})}function By(t){return t.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function lV(t,e){var r=Array.from(e.childNodes),n=[];if(r.length>1&&t&&typeof t=="string"){for(var i=By(t),s=1;s<r.length;s++)if(r[s].textContent&&typeof r[s].textContent=="string")for(var o=By(r[s].textContent),a=3;a<o.length;a++){var c=o.substring(0,a);if(i.split(c).length===2){for(var l=i.indexOf(c),u=l;u<t.length;u++)if(By(t.substring(0,u)).length===l){n.push(t.substring(0,u)),t=t.substring(u);break}break}}}return n.push(t),n}function uV(t,e){return lV(t,e).join("/* rr_split */")}var dV=1,hV=new RegExp("[^a-z0-9-_:]"),Zf=-2;function l_(){return dV++}function fV(t){if(ft(t,HTMLFormElement))return"form";var e=Pc(t.tagName);return hV.test(e)?"div":e}var Zu,u_,pV=/^[^ \t\n\r\u000c]+/,mV=/^[, \t\n\r\u000c]+/;function gV(t,e){if(e.trim()==="")return e;var r=0;function n(l){var u,d=l.exec(e.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var i=[];n(mV),!(r>=e.length);){var s=n(pV);if(s.slice(-1)===",")s=zu(t,s.substring(0,s.length-1)),i.push(s);else{var o="";s=zu(t,s);for(var a=!1;;){var c=e.charAt(r);if(c===""){i.push((s+o).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){r+=1,i.push((s+o).trim());break}else c==="("&&(a=!0);o+=c,r+=1}}}return i.join(", ")}var d_=new WeakMap;function zu(t,e){return!e||e.trim()===""?e:Iy(t,e)}function vV(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function Iy(t,e){var r=d_.get(t);if(r||(r=t.createElement("a"),d_.set(t,r)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return r.setAttribute("href",e),r.href}function h_(t,e,r,n){return n&&(r==="src"||r==="href"&&!(e==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(e==="table"||e==="td"||e==="th")?zu(t,n):r==="srcset"?gV(t,n):r==="style"?u2(n,Iy(t)):e==="object"&&r==="data"?zu(t,n):n)}function f_(t,e,r){return(t==="video"||t==="audio")&&e==="autoplay"}function yV(t,e,r){try{if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch{}return!1}function d2(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return r?d2(_n.parentNode(t),e,r):!1;for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return r?d2(_n.parentNode(t),e,r):!1}function p_(t,e,r,n){var i;if(i_(t)){if(i=t,!_n.childNodes(i).length)return!1}else{if(_n.parentElement(t)===null)return!1;i=_n.parentElement(t)}try{if(typeof e=="string"){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(d2(i,e,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function wV(t,e,r){var n=t.contentWindow;if(n){var i=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var o=setTimeout(function(){i||(e(),i=!0)},r);t.addEventListener("load",function(){clearTimeout(o),i=!0,e()});return}var a="about:blank";if(n.location.href!==a||t.src===a||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}}function bV(t,e,r){var n=!1,i;try{i=t.sheet}catch{return}if(!i){var s=setTimeout(function(){n||(e(),n=!0)},r);t.addEventListener("load",function(){clearTimeout(s),n=!0,e()})}}function kV(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.needsMask,a=e.inlineStylesheet,c=e.maskInputOptions,l=c===void 0?{}:c,u=e.maskTextFn,d=e.maskInputFn,h=e.dataURLOptions,f=h===void 0?{}:h,p=e.inlineImages,v=e.recordCanvas,m=e.keepIframeSrcFn,w=e.newlyAddedElement,_=w===void 0?!1:w,S=e.cssCaptured,T=S===void 0?!1:S,x=_V(r,n);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Qr.Document,childNodes:[],compatMode:t.compatMode}:{type:Qr.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Qr.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:x};case t.ELEMENT_NODE:return CV(t,{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:f,inlineImages:p,recordCanvas:v,keepIframeSrcFn:m,newlyAddedElement:_,rootId:x});case t.TEXT_NODE:return EV(t,{doc:r,needsMask:o,maskTextFn:u,rootId:x,cssCaptured:T});case t.CDATA_SECTION_NODE:return{type:Qr.CDATA,textContent:"",rootId:x};case t.COMMENT_NODE:return{type:Qr.Comment,textContent:_n.textContent(t)||"",rootId:x};default:return!1}}function _V(t,e){if(e.hasNode(t)){var r=e.getId(t);return r===1?void 0:r}}function EV(t,e){var r=e.needsMask,n=e.maskTextFn,i=e.rootId,s=e.cssCaptured,o=_n.parentNode(t),a=o&&o.tagName,c="",l=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?c="SCRIPT_PLACEHOLDER":s||(c=_n.textContent(t),l&&c&&(c=u2(c,Iy(e.doc)))),!l&&!u&&c&&r&&(c=n?n(c,_n.parentElement(t)):c.replace(/[\S]/g,"*")),{type:Qr.Text,textContent:c||"",rootId:i}}function CV(t,e){for(var r=e.doc,n=e.blockClass,i=e.blockSelector,s=e.inlineStylesheet,o=e.maskInputOptions,a=o===void 0?{}:o,c=e.maskInputFn,l=e.dataURLOptions,u=l===void 0?{}:l,d=e.inlineImages,h=e.recordCanvas,f=e.keepIframeSrcFn,p=e.newlyAddedElement,v=p===void 0?!1:p,m=e.rootId,w=yV(t,n,i),_=fV(t),S={},T=t.attributes.length,x=0;x<T;x++){var O=t.attributes[x];f_(_,O.name,O.value)||(S[O.name]=h_(r,_,Pc(O.name),O.value))}if(_==="link"&&s){var U=Array.from(r.styleSheets).find(function(Re){return Re.href===t.href}),I=null;U&&(I=Ty(U)),I&&(delete S.rel,delete S.href,S._cssText=I)}if(_==="style"&&t.sheet){var Z=Ty(t.sheet);Z&&(t.childNodes.length>1&&(Z=uV(Z,t)),S._cssText=Z)}if(_==="input"||_==="textarea"||_==="select"){var W=t.value,P=t.checked;S.type!=="radio"&&S.type!=="checkbox"&&S.type!=="submit"&&S.type!=="button"&&W?S.value=Ny({element:t,type:xy(t),tagName:_,value:W,maskInputOptions:a,maskInputFn:c}):P&&(S.checked=P)}if(_==="option"&&(t.selected&&!a.select?S.selected=!0:delete S.selected),_==="dialog"&&t.open&&(S.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"),_==="canvas"&&h){if(t.__context==="2d")nV(t)||(S.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var D=t.toDataURL(u.type,u.quality),G=r.createElement("canvas");G.width=t.width,G.height=t.height;var q=G.toDataURL(u.type,u.quality);D!==q&&(S.rr_dataURL=D)}}if(_==="img"&&d){Zu||(Zu=r.createElement("canvas"),u_=Zu.getContext("2d"));var L=t,Q=L.currentSrc||L.getAttribute("src")||"<unknown-src>",Y=L.crossOrigin,re=function(){L.removeEventListener("load",re);try{Zu.width=L.naturalWidth,Zu.height=L.naturalHeight,u_.drawImage(L,0,0),S.rr_dataURL=Zu.toDataURL(u.type,u.quality)}catch(Re){if(L.crossOrigin!=="anonymous"){L.crossOrigin="anonymous",L.complete&&L.naturalWidth!==0?re():L.addEventListener("load",re);return}else console.warn("Cannot inline img src="+Q+"! Error: "+Re)}L.crossOrigin==="anonymous"&&(Y?S.crossOrigin=Y:L.removeAttribute("crossorigin"))};L.complete&&L.naturalWidth!==0?re():L.addEventListener("load",re)}if(_==="audio"||_==="video"){var de=S;de.rr_mediaState=t.paused?"paused":"played",de.rr_mediaCurrentTime=t.currentTime,de.rr_mediaPlaybackRate=t.playbackRate,de.rr_mediaMuted=t.muted,de.rr_mediaLoop=t.loop,de.rr_mediaVolume=t.volume}if(v||(t.scrollLeft&&(S.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(S.rr_scrollTop=t.scrollTop)),w){var ee=t.getBoundingClientRect(),ae=ee.width,Se=ee.height;S={class:S.class,rr_width:""+ae+"px",rr_height:""+Se+"px"}}_==="iframe"&&!f(S.src)&&(t.contentDocument||(S.rr_src=S.src),delete S.src);var ke;try{customElements.get(_)&&(ke=!0)}catch{}return{type:Qr.Element,tagName:_,attributes:S,childNodes:[],isSVG:vV(t)||void 0,needBlock:w,rootId:m,isCustom:ke}}function lr(t){return t==null?"":t.toLowerCase()}function SV(t,e){if(e.comment&&t.type===Qr.Comment)return!0;if(t.type===Qr.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&c_(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(lr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||lr(t.attributes.name)==="application-name"||lr(t.attributes.rel)==="icon"||lr(t.attributes.rel)==="apple-touch-icon"||lr(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&lr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(lr(t.attributes.property).match(/^(og|twitter|fb):/)||lr(t.attributes.name).match(/^(og|twitter):/)||lr(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(lr(t.attributes.name)==="robots"||lr(t.attributes.name)==="googlebot"||lr(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(lr(t.attributes.name)==="author"||lr(t.attributes.name)==="generator"||lr(t.attributes.name)==="framework"||lr(t.attributes.name)==="publisher"||lr(t.attributes.name)==="progid"||lr(t.attributes.property).match(/^article:/)||lr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(lr(t.attributes.name)==="google-site-verification"||lr(t.attributes.name)==="yandex-verification"||lr(t.attributes.name)==="csrf-token"||lr(t.attributes.name)==="p:domain_verify"||lr(t.attributes.name)==="verify-v1"||lr(t.attributes.name)==="verification"||lr(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Gu(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,c=e.skipChild,l=c===void 0?!1:c,u=e.inlineStylesheet,d=u===void 0?!0:u,h=e.maskInputOptions,f=h===void 0?{}:h,p=e.maskTextFn,v=e.maskInputFn,m=e.slimDOMOptions,w=e.dataURLOptions,_=w===void 0?{}:w,S=e.inlineImages,T=S===void 0?!1:S,x=e.recordCanvas,O=x===void 0?!1:x,U=e.onSerialize,I=e.onIframeLoad,Z=e.iframeLoadTimeout,W=Z===void 0?5e3:Z,P=e.onStylesheetLoad,D=e.stylesheetLoadTimeout,G=D===void 0?5e3:D,q=e.keepIframeSrcFn,L=q===void 0?function(){return!1}:q,Q=e.newlyAddedElement,Y=Q===void 0?!1:Q,re=e.cssCaptured,de=re===void 0?!1:re,ee=e.needsMask,ae=e.preserveWhiteSpace,Se=ae===void 0?!0:ae;if(!ee){var ke=ee===void 0;ee=p_(t,o,a,ke)}var Re=kV(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,dataURLOptions:_,inlineImages:T,recordCanvas:O,keepIframeSrcFn:L,newlyAddedElement:Y,cssCaptured:de});if(!Re)return console.warn(t,"not serialized"),null;var _e;n.hasNode(t)?_e=n.getId(t):SV(Re,m)||!Se&&Re.type===Qr.Text&&!Re.textContent.replace(/^\s+|\s+$/gm,"").length?_e=Zf:_e=l_();var we=Object.assign(Re,{id:_e});if(n.add(t,we),_e===Zf)return null;U&&U(t);var Je=!l;if(we.type===Qr.Element){Je=Je&&!we.needBlock,delete we.needBlock;var Ue=_n.shadowRoot(t);Ue&&Wf(Ue)&&(we.isShadowHost=!0)}if((we.type===Qr.Document||we.type===Qr.Element)&&Je){m.headWhitespace&&we.type===Qr.Element&&we.tagName==="head"&&(Se=!1);var Ve={doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,slimDOMOptions:m,dataURLOptions:_,inlineImages:T,recordCanvas:O,preserveWhiteSpace:Se,onSerialize:U,onIframeLoad:I,iframeLoadTimeout:W,onStylesheetLoad:P,stylesheetLoadTimeout:G,keepIframeSrcFn:L,cssCaptured:!1};if(!(we.type===Qr.Element&&we.tagName==="textarea"&&we.attributes.value!==void 0)){we.type===Qr.Element&&we.attributes._cssText!==void 0&&typeof we.attributes._cssText=="string"&&(Ve.cssCaptured=!0);for(var Xe=He(Array.from(_n.childNodes(t))),rt;!(rt=Xe()).done;){var ct=rt.value,ut=Gu(ct,Ve);ut&&we.childNodes.push(ut)}}var lt=null;if(i_(t)&&(lt=_n.shadowRoot(t)))for(var Ct=He(Array.from(_n.childNodes(lt))),Ht;!(Ht=Ct()).done;){var jt=Ht.value,mr=Gu(jt,Ve);mr&&(Wf(lt)&&(mr.isShadow=!0),we.childNodes.push(mr))}}var br=_n.parentNode(t);return br&&Df(br)&&Wf(br)&&(we.isShadow=!0),we.type===Qr.Element&&we.tagName==="iframe"&&wV(t,function(){var Rt=t.contentDocument;if(Rt&&I){var Qe=Gu(Rt,{doc:Rt,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,slimDOMOptions:m,dataURLOptions:_,inlineImages:T,recordCanvas:O,preserveWhiteSpace:Se,onSerialize:U,onIframeLoad:I,iframeLoadTimeout:W,onStylesheetLoad:P,stylesheetLoadTimeout:G,keepIframeSrcFn:L});Qe&&I(t,Qe)}},W),we.type===Qr.Element&&we.tagName==="link"&&typeof we.attributes.rel=="string"&&(we.attributes.rel==="stylesheet"||we.attributes.rel==="preload"&&typeof we.attributes.href=="string"&&c_(we.attributes.href)==="css")&&bV(t,function(){if(P){var Rt=Gu(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:ee,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:v,slimDOMOptions:m,dataURLOptions:_,inlineImages:T,recordCanvas:O,preserveWhiteSpace:Se,onSerialize:U,onIframeLoad:I,iframeLoadTimeout:W,onStylesheetLoad:P,stylesheetLoadTimeout:G,keepIframeSrcFn:L});Rt&&P(t,Rt)}},G),we}function AV(t,e){var r=e||{},n=r.mirror,i=n===void 0?new o_:n,s=r.blockClass,o=s===void 0?"rr-block":s,a=r.blockSelector,c=a===void 0?null:a,l=r.maskTextClass,u=l===void 0?"rr-mask":l,d=r.maskTextSelector,h=d===void 0?null:d,f=r.inlineStylesheet,p=f===void 0?!0:f,v=r.inlineImages,m=v===void 0?!1:v,w=r.recordCanvas,_=w===void 0?!1:w,S=r.maskAllInputs,T=S===void 0?!1:S,x=r.maskTextFn,O=r.maskInputFn,U=r.slimDOM,I=U===void 0?!1:U,Z=r.dataURLOptions,W=r.preserveWhiteSpace,P=r.onSerialize,D=r.onIframeLoad,G=r.iframeLoadTimeout,q=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,Q=r.keepIframeSrcFn,Y=Q===void 0?function(){return!1}:Q,re=T===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:T===!1?{password:!0}:T,de=I===!0||I==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:I==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:I===!1?{}:I;return Gu(t,{doc:t,mirror:i,blockClass:o,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:re,maskTextFn:x,maskInputFn:O,slimDOMOptions:de,dataURLOptions:Z,inlineImages:m,recordCanvas:_,preserveWhiteSpace:W,onSerialize:P,onIframeLoad:D,iframeLoadTimeout:G,onStylesheetLoad:q,stylesheetLoadTimeout:L,keepIframeSrcFn:Y,newlyAddedElement:!1})}function RV(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function TV(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return ft(this,n)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Oy={exports:{}},dr=String,m_=function(){return{isColorSupported:!1,reset:dr,bold:dr,dim:dr,italic:dr,underline:dr,inverse:dr,hidden:dr,strikethrough:dr,black:dr,red:dr,green:dr,yellow:dr,blue:dr,magenta:dr,cyan:dr,white:dr,gray:dr,bgBlack:dr,bgRed:dr,bgGreen:dr,bgYellow:dr,bgBlue:dr,bgMagenta:dr,bgCyan:dr,bgWhite:dr}};Oy.exports=m_(),Oy.exports.createColors=m_;var NV=Oy.exports,xV={},BV=Object.freeze(Object.defineProperty({__proto__:null,default:xV},Symbol.toStringTag,{value:"Module"})),Or=TV(BV),g_=NV,v_=Or,Uy=function(t){kn(e,t);function e(n,i,s,o,a,c){var l;return l=t.call(this,n)||this,l.name="CssSyntaxError",l.reason=n,a&&(l.file=a),o&&(l.source=o),c&&(l.plugin=c),typeof i<"u"&&typeof s<"u"&&(typeof i=="number"?(l.line=i,l.column=s):(l.line=i.line,l.column=i.column,l.endLine=s.line,l.endColumn=s.column)),l.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(l,e),l}var r=e.prototype;return r.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},r.showSourceCode=function(i){var s=this;if(!this.source)return"";var o=this.source;i==null&&(i=g_.isColorSupported),v_&&i&&(o=v_(o));var a=o.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),u=String(l).length,d,h;if(i){var f=g_.createColors(!0),p=f.bold,v=f.gray,m=f.red;d=function(w){return p(m(w))},h=function(w){return v(w)}}else d=h=function(w){return w};return a.slice(c,l).map(function(w,_){var S=c+1+_,T=" "+(" "+S).slice(-u)+" | ";if(S===s.line){var x=h(T.replace(/\d/g," "))+w.slice(0,s.column-1).replace(/[^\t]/g," ");return d(">")+h(T)+w+`
12
12
  `+x+d("^")}return" "+h(T)+w}).join(`
13
13
  `)},r.toString=function(){var i=this.showSourceCode();return i&&(i=`
14
14
 
@@ -66,7 +66,7 @@ or you can use record.mirror to access the mirror instance during recording.`,lC
66
66
  `+h+"]":"["+f.join(",")+"]",o=h,u}for(l in p)um.call(p,l)&&(u=n(l,p),u&&f.push(r(l)+(o?": ":":")+u));return u=f.length===0?"{}":o?"{"+f.join(",")+h+"}":"{"+f.join(",")+"}",o=h,u}};return n("",{"":e})}}(),R.JSONDecode=function(){var t,e,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
67
67
  `,r:"\r",t:" "},n,i=function(f){var p=new SyntaxError(f);throw p.at=t,p.text=n,p},s=function(f){return f&&f!==e&&i("Expected '"+f+"' instead of '"+e+"'"),e=n.charAt(t),t+=1,e},o=function(){var f,p="";for(e==="-"&&(p="-",s("-"));e>="0"&&e<="9";)p+=e,s();if(e===".")for(p+=".";s()&&e>="0"&&e<="9";)p+=e;if(e==="e"||e==="E")for(p+=e,s(),(e==="-"||e==="+")&&(p+=e,s());e>="0"&&e<="9";)p+=e,s();if(f=+p,!isFinite(f))i("Bad number");else return f},a=function(){var f,p,v="",m;if(e==='"')for(;s();){if(e==='"')return s(),v;if(e==="\\")if(s(),e==="u"){for(m=0,p=0;p<4&&(f=parseInt(s(),16),!!isFinite(f));p+=1)m=m*16+f;v+=String.fromCharCode(m)}else if(typeof r[e]=="string")v+=r[e];else break;else v+=e}i("Bad string")},c=function(){for(;e&&e<=" ";)s()},l=function(){switch(e){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}i('Unexpected "'+e+'"')},u,d=function(){var f=[];if(e==="["){if(s("["),c(),e==="]")return s("]"),f;for(;e;){if(f.push(u()),c(),e==="]")return s("]"),f;s(","),c()}}i("Bad array")},h=function(){var f,p={};if(e==="{"){if(s("{"),c(),e==="}")return s("}"),p;for(;e;){if(f=a(),c(),s(":"),Object.hasOwnProperty.call(p,f)&&i('Duplicate key "'+f+'"'),p[f]=u(),c(),e==="}")return s("}"),p;s(","),c()}}i("Bad object")};return u=function(){switch(c(),e){case"{":return h();case"[":return d();case'"':return a();case"-":return o();default:return e>="0"&&e<="9"?o():l()}},function(f){var p;return n=f,t=0,e=" ",p=u(),c(),e&&i("Syntax error"),p}}(),R.base64Encode=function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,i,s,o,a,c,l,u=0,d=0,h="",f=[];if(!t)return t;t=R.utf8Encode(t);do r=t.charCodeAt(u++),n=t.charCodeAt(u++),i=t.charCodeAt(u++),l=r<<16|n<<8|i,s=l>>18&63,o=l>>12&63,a=l>>6&63,c=l&63,f[d++]=e.charAt(s)+e.charAt(o)+e.charAt(a)+e.charAt(c);while(u<t.length);switch(h=f.join(""),t.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"=";break}return h},R.utf8Encode=function(t){t=(t+"").replace(/\r\n/g,`
68
68
  `).replace(/\r/g,`
69
- `);var e="",r,n,i=0,s;for(r=n=0,i=t.length,s=0;s<i;s++){var o=t.charCodeAt(s),a=null;o<128?n++:o>127&&o<2048?a=String.fromCharCode(o>>6|192,o&63|128):a=String.fromCharCode(o>>12|224,o>>6&63|128,o&63|128),a!==null&&(n>r&&(e+=t.substring(r,n)),e+=a,r=n=s+1)}return n>r&&(e+=t.substring(r,t.length)),e},R.UUID=function(){try{return Pe.crypto.randomUUID()}catch{for(var t=new Array(36),e=0;e<36;e++)t[e]=Math.floor(Math.random()*16);return t[14]=4,t[19]=t[19]&=-5,t[19]=t[19]|=8,t[8]=t[13]=t[18]=t[23]="-",R.map(t,function(n){return n.toString(16)}).join("")}};var KC=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];R.isBlockedUA=function(t){var e;for(t=t.toLowerCase(),e=0;e<KC.length;e++)if(t.indexOf(KC[e])!==-1)return!0;return!1},R.HTTPBuildQuery=function(t,e){var r,n,i=[];return R.isUndefined(e)&&(e="&"),R.each(t,function(s,o){r=encodeURIComponent(s.toString()),n=encodeURIComponent(o),i[i.length]=n+"="+r}),i.join(e)},R.getQueryParam=function(t,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r="[\\?&]"+e+"=([^&#]*)",n=new RegExp(r),i=n.exec(t);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var s=i[1];try{s=decodeURIComponent(s)}catch{Gt.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},R.cookie={get:function(t){for(var e=t+"=",r=zt.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}return null},parse:function(t){var e;try{e=R.JSONDecode(R.cookie.get(t))||{}}catch{}return e},set_seconds:function(t,e,r,n,i,s,o){var a="",c="",l="";if(o)a="; domain="+o;else if(n){var u=tS(zt.location.hostname);a=u?"; domain=."+u:""}if(r){var d=new Date;d.setTime(d.getTime()+r*1e3),c="; expires="+d.toGMTString()}s&&(i=!0,l="; SameSite=None"),i&&(l+="; secure"),zt.cookie=t+"="+encodeURIComponent(e)+c+"; path=/"+a+l},set:function(t,e,r,n,i,s,o){var a="",c="",l="";if(o)a="; domain="+o;else if(n){var u=tS(zt.location.hostname);a=u?"; domain=."+u:""}if(r){var d=new Date;d.setTime(d.getTime()+r*24*60*60*1e3),c="; expires="+d.toGMTString()}s&&(i=!0,l="; SameSite=None"),i&&(l+="; secure");var h=t+"="+encodeURIComponent(e)+c+"; path=/"+a+l;return zt.cookie=h,h},remove:function(t,e,r){R.cookie.set(t,"",-1,e,!1,!1,r)}};var qC=function(t){var e=!0;try{var r="__mplss_"+r4(8),n="xyz";t.setItem(r,n),t.getItem(r)!==n&&(e=!1),t.removeItem(r)}catch{e=!1}return e},e4=null,l0=function(t,e){return e4!==null&&!e?e4:e4=qC(t||Pe.localStorage)},t4=null,oZ=function(t,e){return t4!==null&&!e?t4:t4=qC(t||Pe.sessionStorage)};function eS(t,e,r){var n=function(i){Gt.error(e+" error: "+i)};return{is_supported:function(i){var s=r(t,i);return s||Gt.error(e+" unsupported"),s},error:n,get:function(i){try{return t.getItem(i)}catch(s){n(s)}return null},parse:function(i){try{return R.JSONDecode(t.getItem(i))||{}}catch{}return null},set:function(i,s){try{t.setItem(i,s)}catch(o){n(o)}},remove:function(i){try{t.removeItem(i)}catch(s){n(s)}}}}R.localStorage=eS(Pe.localStorage,"localStorage",l0),R.sessionStorage=eS(Pe.sessionStorage,"sessionStorage",oZ),R.register_event=function(){var t=function(n,i,s,o,a){if(!n){Gt.error("No valid element provided to register_event");return}if(n.addEventListener&&!o)n.addEventListener(i,s,!!a);else{var c="on"+i,l=n[c];n[c]=e(n,s,l)}};function e(n,i,s){var o=function(a){if(a=a||r(Pe.event),!!a){var c=!0,l,u;return R.isFunction(s)&&(l=s(a)),u=i.call(n,a),(l===!1||u===!1)&&(c=!1),c}};return o}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},t}();var aZ=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');R.dom_query=function(){function t(i){return i.all?i.all:i.getElementsByTagName("*")}var e=/[\t\r\n]/g;function r(i,s){var o=" "+s+" ";return(" "+i.className+" ").replace(e," ").indexOf(o)>=0}function n(i){if(!zt.getElementsByTagName)return[];var s=i.split(" "),o,a,c,l,u,d,h,f,p,v,m=[zt];for(d=0;d<s.length;d++){if(o=s[d].replace(/^\s+/,"").replace(/\s+$/,""),o.indexOf("#")>-1){a=o.split("#"),c=a[0];var w=a[1],_=zt.getElementById(w);if(!_||c&&_.nodeName.toLowerCase()!=c)return[];m=[_];continue}if(o.indexOf(".")>-1){a=o.split("."),c=a[0];var S=a[1];for(c||(c="*"),l=[],u=0,h=0;h<m.length;h++)for(c=="*"?p=t(m[h]):p=m[h].getElementsByTagName(c),f=0;f<p.length;f++)l[u++]=p[f];for(m=[],v=0,h=0;h<l.length;h++)l[h].className&&R.isString(l[h].className)&&r(l[h],S)&&(m[v++]=l[h]);continue}var T=o.match(aZ);if(T){c=T[1];var x=T[2],O=T[3],U=T[4];for(c||(c="*"),l=[],u=0,h=0;h<m.length;h++)for(c=="*"?p=t(m[h]):p=m[h].getElementsByTagName(c),f=0;f<p.length;f++)l[u++]=p[f];m=[],v=0;var I;switch(O){case"=":I=function(Z){return Z.getAttribute(x)==U};break;case"~":I=function(Z){return Z.getAttribute(x).match(new RegExp("\\b"+U+"\\b"))};break;case"|":I=function(Z){return Z.getAttribute(x).match(new RegExp("^"+U+"-?"))};break;case"^":I=function(Z){return Z.getAttribute(x).indexOf(U)===0};break;case"$":I=function(Z){return Z.getAttribute(x).lastIndexOf(U)==Z.getAttribute(x).length-U.length};break;case"*":I=function(Z){return Z.getAttribute(x).indexOf(U)>-1};break;default:I=function(Z){return Z.getAttribute(x)}}for(m=[],v=0,h=0;h<l.length;h++)I(l[h])&&(m[v++]=l[h]);continue}for(c=o,l=[],u=0,h=0;h<m.length;h++)for(p=m[h].getElementsByTagName(c),f=0;f<p.length;f++)l[u++]=p[f];m=l}return m}return function(i){return R.isElement(i)?[i]:R.isObject(i)&&!R.isUndefined(i.length)?i:n.call(this,i)}}();var cZ=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],lZ=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];R.info={campaignParams:function(t){var e="",r={};return R.each(cZ,function(n){e=R.getQueryParam(zt.URL,n),e.length?r[n]=e:t!==void 0&&(r[n]=t)}),r},clickParams:function(){var t="",e={};return R.each(lZ,function(r){t=R.getQueryParam(zt.URL,r),t.length&&(e[r]=t)}),e},marketingParams:function(){return R.extend(R.info.campaignParams(),R.info.clickParams())},searchEngine:function(t){return t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(t){var e=R.info.searchEngine(t),r=e!="yahoo"?"q":"p",n={};if(e!==null){n.$search_engine=e;var i=R.getQueryParam(t,r);i.length&&(n.mp_keyword=i)}return n},browser:function(t,e,r){return e=e||"",r||R.includes(t," OPR/")?R.includes(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":R.includes(t,"IEMobile")||R.includes(t,"WPDesktop")?"Internet Explorer Mobile":R.includes(t,"SamsungBrowser/")?"Samsung Internet":R.includes(t,"Edge")||R.includes(t,"Edg/")?"Microsoft Edge":R.includes(t,"FBIOS")?"Facebook Mobile":R.includes(t,"Whale/")?"Whale Browser":R.includes(t,"Chrome")?"Chrome":R.includes(t,"CriOS")?"Chrome iOS":R.includes(t,"UCWEB")||R.includes(t,"UCBrowser")?"UC Browser":R.includes(t,"FxiOS")?"Firefox iOS":R.includes(e,"Apple")?R.includes(t,"Mobile")?"Mobile Safari":"Safari":R.includes(t,"Android")?"Android Mobile":R.includes(t,"Konqueror")?"Konqueror":R.includes(t,"Firefox")?"Firefox":R.includes(t,"MSIE")||R.includes(t,"Trident/")?"Internet Explorer":R.includes(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,r){var n=R.info.browser(t,e,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/},s=i[n];if(s===void 0)return null;var o=t.match(s);return o?parseFloat(o[o.length-2]):null},os:function(){var t=wo;return/Windows/i.test(t)?/Phone/.test(t)||/WPDesktop/.test(t)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(t)?"iOS":/Android/.test(t)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Mac/i.test(t)?"Mac OS X":/Linux/.test(t)?"Linux":/CrOS/.test(t)?"Chrome OS":""},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)?"Android":""},referringDomain:function(t){var e=t.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return Pe.location.href},properties:function(t){return typeof t!="object"&&(t={}),R.extend(R.strip_empty_properties({$os:R.info.os(),$browser:R.info.browser(wo,Ca.vendor,dm),$referrer:zt.referrer,$referring_domain:R.info.referringDomain(zt.referrer),$device:R.info.device(wo)}),{$current_url:R.info.currentUrl(),$browser_version:R.info.browserVersion(wo,Ca.vendor,dm),$screen_height:QC.height,$screen_width:QC.width,mp_lib:"web",$lib_version:Qi.LIB_VERSION,$insert_id:r4(),time:R.timestamp()/1e3},R.strip_empty_properties(t))},people_properties:function(){return R.extend(R.strip_empty_properties({$os:R.info.os(),$browser:R.info.browser(wo,Ca.vendor,dm)}),{$browser_version:R.info.browserVersion(wo,Ca.vendor,dm)})},mpPageViewProperties:function(){return R.strip_empty_properties({current_page_title:zt.title,current_domain:Pe.location.hostname,current_url_path:Pe.location.pathname,current_url_protocol:Pe.location.protocol,current_url_search:Pe.location.search})}};var uZ=function(t,e){var r=null,n=[];return function(i){var s=this;return n.push(i),r||(r=new Yt(function(o){setTimeout(function(){var a=t.apply(s,[n]);r=null,n=[],o(a)},e)})),r}},r4=function(t){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return t?e.substring(0,t):e},dZ=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,hZ=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,tS=function(t){var e=hZ,r=t.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(e=dZ);var i=t.match(e);return i?i[0]:""},fZ=function(){var t=Pe.navigator.onLine;return R.isUndefined(t)||t},Sa=function(){},rd=null,hm=null;typeof JSON<"u"&&(rd=JSON.stringify,hm=JSON.parse),rd=rd||R.JSONEncode,hm=hm||R.JSONDecode,R.info=R.info,R.info.browser=R.info.browser,R.info.browserVersion=R.info.browserVersion,R.info.device=R.info.device,R.info.properties=R.info.properties,R.isBlockedUA=R.isBlockedUA,R.isEmptyObject=R.isEmptyObject,R.isObject=R.isObject,R.JSONDecode=R.JSONDecode,R.JSONEncode=R.JSONEncode,R.toArray=R.toArray,R.NPO=_a;var pZ="mixpanelBrowserDb",rS="mixpanelRecordingEvents",n4="mixpanelRecordingRegistry",mZ=1,gZ=[rS,n4],Es=function(t){this.dbPromise=null,this.storeName=t};Es.prototype._openDb=function(){return new Yt(function(t,e){var r=Pe.indexedDB.open(pZ,mZ);r.onerror=function(){e(r.error)},r.onsuccess=function(){t(r.result)},r.onupgradeneeded=function(n){var i=n.target.result;gZ.forEach(function(s){i.createObjectStore(s)})}})},Es.prototype.init=function(){return Pe.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(t){return t instanceof Pe.IDBDatabase?Yt.resolve():Yt.reject(t)})):Yt.reject("indexedDB is not supported in this browser")},Es.prototype.makeTransaction=function(t,e){var r=this.storeName,n=function(i){return new Yt(function(s,o){var a=i.transaction(r,t);a.oncomplete=function(){s(a)},a.onabort=a.onerror=function(){o(a.error)},e(a.objectStore(r))})};return this.dbPromise.then(n).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(n)):Yt.reject(i)}).bind(this))},Es.prototype.setItem=function(t,e){return this.makeTransaction("readwrite",function(r){r.put(e,t)})},Es.prototype.getItem=function(t){var e;return this.makeTransaction("readonly",function(r){e=r.get(t)}).then(function(){return e.result})},Es.prototype.removeItem=function(t){return this.makeTransaction("readwrite",function(e){e.delete(t)})},Es.prototype.getAll=function(){var t;return this.makeTransaction("readonly",function(e){t=e.getAll()}).then(function(){return t.result})};var vZ="__mp_opt_in_out_";function yZ(t,e){sS(!0,t,e)}function wZ(t,e){sS(!1,t,e)}function bZ(t,e){return iS(t,e)==="1"}function nS(t,e){if(_Z(e))return Gt.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=iS(t,e)==="0";return r&&Gt.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Aa(t){return o4(t,function(e){return this.get_config(e)})}function Ra(t){return o4(t,function(e){return this._get_config(e)})}function nd(t){return o4(t,function(e){return this._get_config(e)})}function kZ(t,e){e=e||{},i4(e).remove(s4(t,e),!!e.crossSubdomainCookie,e.cookieDomain)}function i4(t){return t=t||{},t.persistenceType==="localStorage"?R.localStorage:R.cookie}function s4(t,e){return e=e||{},(e.persistencePrefix||vZ)+t}function iS(t,e){return i4(e).get(s4(t,e))}function _Z(t){if(t&&t.ignoreDnt)return!1;var e=t&&t.window||Pe,r=e.navigator||{},n=!1;return R.each([r.doNotTrack,r.msDoNotTrack,e.doNotTrack],function(i){R.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function sS(t,e,r){if(!R.isString(e)||!e.length){Gt.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token");return}r=r||{},i4(r).set(s4(e,r),t?1:0,R.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&t&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})}function o4(t,e){return function(){var r=!1;try{var n=e.call(this,"token"),i=e.call(this,"ignore_dnt"),s=e.call(this,"opt_out_tracking_persistence_type"),o=e.call(this,"opt_out_tracking_cookie_prefix"),a=e.call(this,"window");n&&(r=nS(n,{ignoreDnt:i,persistenceType:s,persistencePrefix:o,window:a}))}catch(l){Gt.error("Unexpected error when checking tracking opt-out status: "+l)}if(!r)return t.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var EZ=Dc("lock"),oS=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||Pe.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3,this.promiseImpl=e.promiseImpl||Yt};oS.prototype.withLock=function(t,e){var r=this.promiseImpl;return new r(R.bind(function(n,i){var s=e||new Date().getTime()+"|"+Math.random(),o=new Date().getTime(),a=this.storageKey,c=this.pollIntervalMS,l=this.timeoutMS,u=this.storage,d=a+":X",h=a+":Y",f=a+":Z",p=function(S){if(new Date().getTime()-o>l){EZ.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+s+"]"),u.removeItem(f),u.removeItem(h),w();return}setTimeout(function(){try{S()}catch(T){i(T)}},c*(Math.random()+.1))},v=function(S,T){S()?T():p(function(){v(S,T)})},m=function(){var S=u.getItem(h);return S&&S!==s?!1:(u.setItem(h,s),u.getItem(h)===s?!0:(l0(u,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},w=function(){u.setItem(d,s),v(m,function(){if(u.getItem(d)===s){_();return}p(function(){if(u.getItem(h)!==s){w();return}v(function(){return!u.getItem(f)},_)})})},_=function(){u.setItem(f,"1");var S=function(){u.removeItem(f),u.getItem(h)===s&&u.removeItem(h),u.getItem(d)===s&&u.removeItem(d)};t().then(function(T){S(),n(T)}).catch(function(T){S(),i(T)})};try{if(l0(u,!0))w();else throw new Error("localStorage support check failed")}catch(S){i(S)}},this))};var u0=function(t){this.storage=t||Pe.localStorage};u0.prototype.init=function(){return Yt.resolve()},u0.prototype.setItem=function(t,e){return new Yt(R.bind(function(r,n){try{this.storage.setItem(t,rd(e))}catch(i){n(i)}r()},this))},u0.prototype.getItem=function(t){return new Yt(R.bind(function(e,r){var n;try{n=hm(this.storage.getItem(t))}catch(i){r(i)}e(n)},this))},u0.prototype.removeItem=function(t){return new Yt(R.bind(function(e,r){try{this.storage.removeItem(t)}catch(n){r(n)}e()},this))};var aS=Dc("batch"),Cs=function(t,e){e=e||{},this.storageKey=t,this.usePersistence=e.usePersistence,this.usePersistence&&(this.queueStorage=e.queueStorage||new u0,this.lock=new oS(t,{storage:e.sharedLockStorage||Pe.localStorage,timeoutMS:e.sharedLockTimeoutMS})),this.reportError=e.errorReporter||R.bind(aS.error,aS),this.pid=e.pid||null,this.memQueue=[],this.initialized=!1,e.enqueueThrottleMs?this.enqueuePersisted=uZ(R.bind(this._enqueuePersisted,this),e.enqueueThrottleMs):this.enqueuePersisted=R.bind(function(r){return this._enqueuePersisted([r])},this)};Cs.prototype.ensureInit=function(){return this.initialized?Yt.resolve():this.queueStorage.init().then(R.bind(function(){this.initialized=!0},this)).catch(R.bind(function(t){this.reportError("Error initializing queue persistence. Disabling persistence",t),this.initialized=!0,this.usePersistence=!1},this))},Cs.prototype.enqueue=function(t,e){var r={id:r4(),flushAfter:new Date().getTime()+e*2,payload:t};return this.usePersistence?this.enqueuePersisted(r):(this.memQueue.push(r),Yt.resolve(!0))},Cs.prototype._enqueuePersisted=function(t){var e=R.bind(function(){return this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(r){return this.saveToStorage(r.concat(t))},this)).then(R.bind(function(r){return r&&(this.memQueue=this.memQueue.concat(t)),r},this)).catch(R.bind(function(r){return this.reportError("Error enqueueing items",r,t),!1},this))},this);return this.lock.withLock(e,this.pid).catch(R.bind(function(r){return this.reportError("Error acquiring storage lock",r),!1},this))},Cs.prototype.fillBatch=function(t){var e=this.memQueue.slice(0,t);return this.usePersistence&&e.length<t?this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(r){if(r.length){var n={};R.each(e,function(o){n[o.id]=!0});for(var i=0;i<r.length;i++){var s=r[i];if(new Date().getTime()>s.flushAfter&&!n[s.id]&&(s.orphaned=!0,e.push(s),e.length>=t))break}}return e},this)):Yt.resolve(e)};var cS=function(t,e){var r=[];return R.each(t,function(n){n.id&&!e[n.id]&&r.push(n)}),r};Cs.prototype.removeItemsByID=function(t){var e={};if(R.each(t,function(n){e[n]=!0}),this.memQueue=cS(this.memQueue,e),this.usePersistence){var r=R.bind(function(){return this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(n){return n=cS(n,e),this.saveToStorage(n)},this)).then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(n){for(var i=0;i<n.length;i++){var s=n[i];if(s.id&&e[s.id])throw new Error("Item not removed from storage")}return!0},this)).catch(R.bind(function(n){return this.reportError("Error removing items",n,t),!1},this))},this);return this.lock.withLock(r,this.pid).catch(R.bind(function(n){return this.reportError("Error acquiring storage lock",n),l0(this.lock.storage,!0)?!1:r().then(R.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(R.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return Yt.resolve(!0)};var lS=function(t,e){var r=[];return R.each(t,function(n){var i=n.id;if(i in e){var s=e[i];s!==null&&(n.payload=s,r.push(n))}else r.push(n)}),r};Cs.prototype.updatePayloads=function(t){return this.memQueue=lS(this.memQueue,t),this.usePersistence?this.lock.withLock(R.bind(function(){return this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(r){return r=lS(r,t),this.saveToStorage(r)},this)).catch(R.bind(function(r){return this.reportError("Error updating items",t,r),!1},this))},this),this.pid).catch(R.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):Yt.resolve(!0)},Cs.prototype.readFromStorage=function(){return this.ensureInit().then(R.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(R.bind(function(t){return t&&(R.isArray(t)||(this.reportError("Invalid storage entry:",t),t=null)),t||[]},this)).catch(R.bind(function(t){return this.reportError("Error retrieving queue",t),[]},this))},Cs.prototype.saveToStorage=function(t){return this.ensureInit().then(R.bind(function(){return this.queueStorage.setItem(this.storageKey,t)},this)).then(function(){return!0}).catch(R.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},Cs.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(R.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):Yt.resolve()};var CZ=10*60*1e3,d0=Dc("batch"),_i=function(t,e){this.errorReporter=e.errorReporter,this.queue=new Cs(t,{errorReporter:R.bind(this.reportError,this),queueStorage:e.queueStorage,sharedLockStorage:e.sharedLockStorage,sharedLockTimeoutMS:e.sharedLockTimeoutMS,usePersistence:e.usePersistence,enqueueThrottleMs:e.enqueueThrottleMs}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1,this._flushPromise=null};_i.prototype.enqueue=function(t){return this.queue.enqueue(t,this.flushInterval)},_i.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},_i.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},_i.prototype.clear=function(){return this.queue.clear()},_i.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},_i.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},_i.prototype.scheduleFlush=function(t){this.flushInterval=t,this.stopped||(this.timeoutID=setTimeout(R.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},_i.prototype.sendRequestPromise=function(t,e){return new Yt(R.bind(function(r){this.sendRequest(t,e,r)},this))},_i.prototype.flush=function(t){if(this.requestInProgress)return d0.log("Flush: Request already in progress"),Yt.resolve();this.requestInProgress=!0,t=t||{};var e=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize;return this.queue.fillBatch(n).then(R.bind(function(i){var s=i.length===n,o=[],a={};if(R.each(i,function(d){var h=d.payload;if(this.beforeSendHook&&!d.orphaned&&(h=this.beforeSendHook(h)),h){h.event&&h.properties&&(h.properties=R.extend({},h.properties,{mp_sent_by_lib_version:Qi.LIB_VERSION}));var f=!0,p=d.id;p?(this.itemIdsSentSuccessfully[p]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:d,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[p]}),f=!1):this.reportError("[dupe] found item with no ID",{item:d}),f&&o.push(h)}a[d.id]=h},this),o.length<1)return this.requestInProgress=!1,this.resetFlush(),Yt.resolve();var c=R.bind(function(){return this.queue.removeItemsByID(R.map(i,function(d){return d.id})).then(R.bind(function(d){return R.each(i,R.bind(function(h){var f=h.id;f?(this.itemIdsSentSuccessfully[f]=this.itemIdsSentSuccessfully[f]||0,this.itemIdsSentSuccessfully[f]++,this.itemIdsSentSuccessfully[f]>5&&this.reportError("[dupe] item ID sent too many times",{item:h,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[f]})):this.reportError("[dupe] found item with no ID while removing",{item:h})},this)),d?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!s?(this.resetFlush(),Yt.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),Yt.resolve())},this))},this),l=R.bind(function(d){this.requestInProgress=!1;try{if(t.unloading)return this.queue.updatePayloads(a);if(R.isObject(d)&&d.error==="timeout"&&new Date().getTime()-r>=e)return this.reportError("Network timeout; retrying"),this.flush();if(R.isObject(d)&&(d.httpStatusCode>=500||d.httpStatusCode===429||d.httpStatusCode<=0&&!fZ()||d.error==="timeout")){var h=this.flushInterval*2;return d.retryAfter&&(h=parseInt(d.retryAfter,10)*1e3||h),h=Math.min(CZ,h),this.reportError("Error; retry in "+h+" ms"),this.scheduleFlush(h),Yt.resolve()}else if(R.isObject(d)&&d.httpStatusCode===413)if(i.length>1){var f=Math.max(1,Math.floor(n/2));return this.batchSize=Math.min(this.batchSize,f,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),Yt.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),c();else return c()}catch(p){this.reportError("Error handling API response",p),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};return t.unloading&&(u.transport="sendBeacon"),d0.log("MIXPANEL REQUEST:",o),this.sendRequestPromise(o,u).then(l)},this)).catch(R.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},_i.prototype.reportError=function(t,e){if(d0.error.apply(d0.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(t)),this.errorReporter(t,e)}catch(r){d0.error(r)}};var a4=function(t){var e=Date.now();return!t||e>t.maxExpires||e>t.idleExpires},SZ=250,id=Dc("recorder"),uS=Pe.CompressionStream,AZ={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},RZ=new Set([ot.MouseMove,ot.MouseInteraction,ot.Scroll,ot.ViewportResize,ot.Input,ot.TouchMove,ot.MediaInteraction,ot.Drag,ot.Selection]);function TZ(t){return t.type===St.IncrementalSnapshot&&RZ.has(t.data.source)}var cn=function(t){this._mixpanel=t.mixpanelInstance,this._onIdleTimeout=t.onIdleTimeout||Sa,this._onMaxLengthReached=t.onMaxLengthReached||Sa,this._onBatchSent=t.onBatchSent||Sa,this._rrwebRecord=t.rrwebRecord||null,this._stopRecording=null,this.replayId=t.replayId,this.batchStartUrl=t.batchStartUrl||null,this.replayStartUrl=t.replayStartUrl||null,this.idleExpires=t.idleExpires||null,this.maxExpires=t.maxExpires||null,this.replayStartTime=t.replayStartTime||null,this.seqNo=t.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=a0,this.recordMinMs=0;var e=l0(t.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new Es(rS),this.batcher=new _i(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:AZ,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:t.sharedLockStorage,usePersistence:e,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:SZ,sharedLockTimeoutMS:10*1e3})};cn.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var t={distinct_id:String(this._mixpanel.get_distinct_id())},e=this._mixpanel.get_property("$device_id");e&&(t.$device_id=e);var r=this._mixpanel.get_property("$user_id");return r&&(t.$user_id=r),t},cn.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},cn.prototype.getConfig=function(t){return this._mixpanel.get_config(t)},cn.prototype.get_config=function(t){return this.getConfig(t)},cn.prototype.startRecording=function(t){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){id.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>a0&&(this.recordMaxMs=a0,id.critical("record_max_ms cannot be greater than "+a0+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>$w&&(this.recordMinMs=$w,id.critical("record_min_ms cannot be greater than "+$w+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=R.info.currentUrl(),this.replayStartUrl=R.info.currentUrl()),t||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);e();var r=this.getConfig("record_block_selector");(r===""||r===null)&&(r=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}TZ(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var n=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),n)},cn.prototype.stopRecording=function(t){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(r){this.reportError("Error with rrweb stopRecording",r)}this._stopRecording=null}var e;return this.batcher.stopped?e=this.batcher.clear():t||(e=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),e},cn.prototype.isRrwebStopped=function(){return this._stopRecording===null},cn.prototype.flushEventsWithOptOut=function(t,e,r){var n=(function(i){i===0&&(this.stopRecording(),r({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(t,e,r,n)},cn.prototype.serialize=function(){var t;try{t=this._mixpanel.get_tab_id()}catch(e){this.reportError("Error getting tab ID for serialization ",e),t=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:t}},cn.deserialize=function(t,e){var r=new cn(R.extend({},e,{replayId:t.replayId,batchStartUrl:t.batchStartUrl,replayStartUrl:t.replayStartUrl,idleExpires:t.idleExpires,maxExpires:t.maxExpires,replayStartTime:t.replayStartTime,seqNo:t.seqNo,sharedLockStorage:e.sharedLockStorage}));return r},cn.prototype._sendRequest=function(t,e,r,n){var i=(function(o,a){o.status===200&&this.replayId===t&&(this.seqNo++,this.batchStartUrl=R.info.currentUrl()),this._onBatchSent(),n({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})}).bind(this),s=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");Pe.fetch(s+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:r}).then(function(o){o.json().then(function(a){i(o,a)}).catch(function(a){n({error:a})})}).catch(function(o){n({error:o,httpStatusCode:0})})},cn.prototype._flushEvents=Aa(function(t,e,r){var n=t.length;if(n>0){for(var i=this.replayId,s=1/0,o=-1/0,a=!1,c=0;c<n;c++)s=Math.min(s,t[c].timestamp),o=Math.max(o,t[c].timestamp),t[c].type===St.FullSnapshot&&(a=!0);if(this.seqNo===0){if(!a){r({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=s}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=s);var l=o-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:Qi.LIB_VERSION,batch_start_time:s/1e3,mp_lib:"web",replay_id:i,replay_length_ms:l,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},d=JSON.stringify(t);if(Object.assign(u,this.getUserIdInfo()),uS){var h=new Blob([d],{type:"application/json"}).stream(),f=h.pipeThrough(new uS("gzip"));new Response(f).blob().then((function(p){u.format="gzip",this._sendRequest(i,u,p,r)}).bind(this))}else u.format="body",this._sendRequest(i,u,d,r)}}),cn.prototype.reportError=function(t,e){id.error.apply(id.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.getConfig("error_reporter")(t,e)}catch(r){id.error(r)}};var sd=function(t){this.idb=new Es(n4),this.errorReporter=t.errorReporter,this.mixpanelInstance=t.mixpanelInstance,this.sharedLockStorage=t.sharedLockStorage};sd.prototype.handleError=function(t){this.errorReporter("IndexedDB error: ",t)},sd.prototype.setActiveRecording=function(t){var e=t.tabId;return e?this.idb.init().then((function(){return this.idb.setItem(e,t)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),Yt.resolve())},sd.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(t){return a4(t)?null:t}).bind(this)).catch(this.handleError.bind(this))},sd.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(t){if(t)return t.maxExpires=0,this.setActiveRecording(t)}).bind(this)).catch(this.handleError.bind(this))},sd.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(t){var e=t.filter(function(r){return a4(r)}).map((function(r){var n=cn.deserialize(r,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return n.unloadPersistedData().then((function(){return this.idb.removeItem(r.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return Yt.all(e)}).bind(this)).catch(this.handleError.bind(this))};var h0=Dc("recorder"),bo=function(t,e,r){this.mixpanelInstance=t,this.rrwebRecord=e||ba,this.sharedLockStorage=r,this.recordingRegistry=new sd({mixpanelInstance:this.mixpanelInstance,errorReporter:h0.error,sharedLockStorage:r}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};bo.prototype.startRecording=function(t){if(t=t||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){h0.log("Recording already in progress, skipping startRecording.");return}var e=(function(){h0.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),r=(function(){h0.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),n=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:n,onIdleTimeout:e,onMaxLengthReached:r,replayId:R.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return t.activeSerializedRecording?this.activeRecording=cn.deserialize(t.activeSerializedRecording,i):this.activeRecording=new cn(i),this.activeRecording.startRecording(t.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},bo.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then((function(){return this.recordingRegistry.clearActiveRecording()}).bind(this)).then((function(){this.stopRecordingInProgress=!1}).bind(this))},bo.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},bo.prototype._stopCurrentRecording=function(t,e){if(this.activeRecording){var r=this.activeRecording.stopRecording(t);return e&&(this.activeRecording=null),r}return Yt.resolve()},bo.prototype.resumeRecording=function(t){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),Yt.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(e){return e&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:e}):t?this.startRecording({shouldStopBatcher:!1}):(h0.log("No resumable recording found."),null)}).bind(this))},bo.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},bo.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(bo.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),Pe.__mp_recorder=bo;var fm="change",f0="click",dS="hashchange",od="mp_locationchange",hS="popstate",fS="scrollend",c4="submit",NZ=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],pS=["mp-include"],l4=["mp-no-track"],mS=l4.concat(["mp-sensitive"]),xZ=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],Dn=Dc("autocapture");function u4(t){for(var e={},r=gS(t).split(" "),n=0;n<r.length;n++){var i=r[n];i&&(e[i]=!0)}return e}function gS(t){switch(typeof t.className){case"string":return t.className;case"object":return t.className.baseVal||t.getAttribute("class")||"";default:return""}}function BZ(t){if(t.previousElementSibling)return t.previousElementSibling;do t=t.previousSibling;while(t&&!wS(t));return t}function vS(t,e,r,n,i,s){var o={$classes:gS(t).split(" "),$tag_name:t.tagName.toLowerCase()},a=t.id;a&&(o.$id=a),f4(t,e,i,s)&&R.each(xZ.concat(n),function(d){if(t.hasAttribute(d)&&!r[d]){var h=t.getAttribute(d);pm(h)&&(o["$attr-"+d]=h)}});for(var c=1,l=1,u=t;u=BZ(u);)c++,u.tagName===t.tagName&&l++;return o.$nth_child=c,o.$nth_of_type=l,o}function IZ(t,e){var r=e.allowElementCallback,n=e.allowSelectors||[],i=e.blockAttrs||[],s=e.blockElementCallback,o=e.blockSelectors||[],a=e.captureTextContent||!1,c=e.captureExtraAttrs||[],l=e.capturedForHeatMap||!1,u={};R.each(i,function(x){u[x]=!0});var d=null,h=typeof t.target>"u"?t.srcElement:t.target;if(bS(h)&&(h=h.parentNode),MZ(h,t)&&d4(h,t,r,n)&&!h4(h,t,s,o)){for(var f=[h],p=h;p.parentNode&&!Ss(p,"body");)f.push(p.parentNode),p=p.parentNode;var v=[],m,w=!1;if(R.each(f,function(x){var O=f4(x,t,r,n);!u.href&&x.tagName.toLowerCase()==="a"&&(m=x.getAttribute("href"),m=O&&pm(m)&&m),h4(x,t,s,o)&&(w=!0),v.push(vS(x,t,u,c,r,n))},this),!w){var _=zt.documentElement;if(d={$event_type:t.type,$host:Pe.location.host,$pathname:Pe.location.pathname,$elements:v,$el_attr__href:m,$viewportHeight:Math.max(_.clientHeight,Pe.innerHeight||0),$viewportWidth:Math.max(_.clientWidth,Pe.innerWidth||0),$pageHeight:zt.body.offsetHeight||0,$pageWidth:zt.body.offsetWidth||0},R.each(c,function(x){if(!u[x]&&h.hasAttribute(x)){var O=h.getAttribute(x);pm(O)&&(d["$el_attr__"+x]=O)}}),a&&(S=yS(h,t,r,n),S&&S.length&&(d.$el_text=S)),t.type===f0&&(R.each(NZ,function(x){x in t&&(d["$"+x]=t[x])}),l&&(d.$captured_for_heatmap=!0),h=OZ(t)),a){var S=yS(h,t,r,n);S&&S.length&&(d.$el_text=S)}if(h){if(!d4(h,t,r,n)||h4(h,t,s,o))return null;var T=vS(h,t,u,c,r,n);d.$target=T,d.$el_classes=T.$classes,R.extend(d,R.strip_empty_properties({$el_id:T.$id,$el_tag_name:T.$tag_name}))}}}return d}function yS(t,e,r,n){var i="";return f4(t,e,r,n)&&t.childNodes&&t.childNodes.length&&R.each(t.childNodes,function(s){bS(s)&&s.textContent&&(i+=R.trim(s.textContent).split(/(\s+)/).filter(pm).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),R.trim(i)}function OZ(t){for(var e=t.target,r=t.composedPath(),n=0;n<r.length;n++){var i=r[n];if(Ss(i,"a")||Ss(i,"button")||Ss(i,"input")||Ss(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){e=i;break}if(i===e)break}return e}function d4(t,e,r,n){if(r)try{if(!r(t,e))return!1}catch(o){return Dn.critical("Error while checking element in allowElementCallback",o),!1}if(!n.length)return!0;for(var i=0;i<n.length;i++){var s=n[i];try{if(t.matches(s))return!0}catch(o){Dn.critical("Error while checking selector: "+s,o)}}return!1}function h4(t,e,r,n){var i;if(r)try{if(r(t,e))return!0}catch(a){return Dn.critical("Error while checking element in blockElementCallback",a),!0}if(n&&n.length)for(i=0;i<n.length;i++){var s=n[i];try{if(t.matches(s))return!0}catch(a){Dn.critical("Error while checking selector: "+s,a)}}var o=u4(t);for(i=0;i<l4.length;i++)if(o[l4[i]])return!0;return!1}function wS(t){return t&&t.nodeType===1}function Ss(t,e){return t&&t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function bS(t){return t&&t.nodeType===3}function UZ(){try{var t=zt.createElement("div");return!!t.matches}catch{return!1}}function MZ(t,e){if(!t||Ss(t,"html")||!wS(t))return!1;var r=t.tagName.toLowerCase();switch(r){case"form":return e.type===c4;case"input":return["button","submit"].indexOf(t.getAttribute("type"))===-1?e.type===fm:e.type===f0;case"select":case"textarea":return e.type===fm;default:return e.type===f0}}function f4(t,e,r,n){var i;if(!d4(t,e,r,n))return!1;for(var s=t;s.parentNode&&!Ss(s,"body");s=s.parentNode){var o=u4(s);for(i=0;i<mS.length;i++)if(o[mS[i]])return!1}var a=u4(t);for(i=0;i<pS.length;i++)if(a[pS[i]])return!0;if(Ss(t,"input")||Ss(t,"select")||Ss(t,"textarea")||t.getAttribute("contenteditable")==="true")return!1;var c=t.type||"";if(typeof c=="string")switch(c.toLowerCase()){case"hidden":return!1;case"password":return!1}var l=t.name||t.id||"";if(typeof l=="string"){var u=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(u.test(l.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function pm(t){if(t===null||R.isUndefined(t))return!1;if(typeof t=="string"){t=R.trim(t);var e=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(e.test((t||"").replace(/[- ]/g,"")))return!1;var r=/(^\d{3}-?\d{2}-?\d{4}$)/;if(r.test(t))return!1}return!0}var kS="autocapture",PZ="track_pageview",_S="full-url",VZ="url-with-path-and-query-string",FZ="url-with-path",LZ="allow_element_callback",ES="allow_selectors",CS="allow_url_regexes",SS="block_attrs",AS="block_element_callback",RS="block_selectors",TS="block_url_regexes",NS="capture_extra_attrs",xS="capture_text_content",BS="scroll_capture_all",IS="scroll_depth_percent_checkpoints",mm="click",p4="input",OS="pageview",m4="scroll",g4="submit",ln={};ln[ES]=[],ln[CS]=[],ln[SS]=[],ln[AS]=null,ln[RS]=[],ln[TS]=[],ln[NS]=[],ln[xS]=!1,ln[BS]=!1,ln[IS]=[25,50,75,100],ln[mm]=!0,ln[p4]=!0,ln[OS]=_S,ln[m4]=!0,ln[g4]=!0;var gm={$mp_autocapture:!0},US="$mp_click",DZ="$mp_input_change",WZ="$mp_scroll",ZZ="$mp_submit",ni=function(t){this.mp=t};ni.prototype.init=function(){if(!UZ()){Dn.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking()},ni.prototype.getFullConfig=function(){var t=this.mp.get_config(kS);return t?R.isObject(t)?R.extend({},ln,t):ln:{}},ni.prototype.getConfig=function(t){return this.getFullConfig()[t]},ni.prototype.currentUrlBlocked=function(){var t,e=R.info.currentUrl(),r=this.getConfig(CS)||[];if(r.length){var n=!1;for(t=0;t<r.length;t++){var i=r[t];try{if(e.match(i)){n=!0;break}}catch(o){return Dn.critical("Error while checking block URL regex: "+i,o),!0}}if(!n)return!0}var s=this.getConfig(TS)||[];if(!s||!s.length)return!1;for(t=0;t<s.length;t++)try{if(e.match(s[t]))return!0}catch(o){return Dn.critical("Error while checking block URL regex: "+s[t],o),!0}return!1},ni.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(kS)?this.getConfig(OS):this.mp.get_config(PZ)},ni.prototype.trackDomEvent=function(t,e){if(!this.currentUrlBlocked()){var r=IZ(t,{allowElementCallback:this.getConfig(LZ),allowSelectors:this.getConfig(ES),blockAttrs:this.getConfig(SS),blockElementCallback:this.getConfig(AS),blockSelectors:this.getConfig(RS),captureExtraAttrs:this.getConfig(NS),captureTextContent:this.getConfig(xS),capturedForHeatMap:e===US&&!this.getConfig(mm)&&this.mp.is_recording_heatmap_data()});r&&(R.extend(r,gm),this.mp.track(e,r))}},ni.prototype.initClickTracking=function(){Pe.removeEventListener(f0,this.listenerClick),!(!this.getConfig(mm)&&!this.mp.get_config("record_heatmap_data"))&&(Dn.log("Initializing click tracking"),this.listenerClick=Pe.addEventListener(f0,(function(t){!this.getConfig(mm)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(t,US)}).bind(this)))},ni.prototype.initInputTracking=function(){Pe.removeEventListener(fm,this.listenerChange),this.getConfig(p4)&&(Dn.log("Initializing input tracking"),this.listenerChange=Pe.addEventListener(fm,(function(t){this.getConfig(p4)&&this.trackDomEvent(t,DZ)}).bind(this)))},ni.prototype.initPageviewTracking=function(){if(Pe.removeEventListener(hS,this.listenerPopstate),Pe.removeEventListener(dS,this.listenerHashchange),Pe.removeEventListener(od,this.listenerLocationchange),!!this.pageviewTrackingConfig()){Dn.log("Initializing pageview tracking");var t="",e=!1;this.currentUrlBlocked()||(e=this.mp.track_pageview(gm)),e&&(t=R.info.currentUrl()),this.listenerPopstate=Pe.addEventListener(hS,function(){Pe.dispatchEvent(new Event(od))}),this.listenerHashchange=Pe.addEventListener(dS,function(){Pe.dispatchEvent(new Event(od))});var r=Pe.history.pushState;typeof r=="function"&&(Pe.history.pushState=function(i,s,o){r.call(Pe.history,i,s,o),Pe.dispatchEvent(new Event(od))});var n=Pe.history.replaceState;typeof n=="function"&&(Pe.history.replaceState=function(i,s,o){n.call(Pe.history,i,s,o),Pe.dispatchEvent(new Event(od))}),this.listenerLocationchange=Pe.addEventListener(od,qw((function(){if(!this.currentUrlBlocked()){var i=R.info.currentUrl(),s=!1,o=i.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0],a=this.pageviewTrackingConfig();if(a===_S?s=i!==t:a===VZ?s=i.split("#")[0]!==t.split("#")[0]:a===FZ&&(s=o),s){var c=this.mp.track_pageview(gm);c&&(t=i),o&&(this.lastScrollCheckpoint=0,Dn.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},ni.prototype.initScrollTracking=function(){Pe.removeEventListener(fS,this.listenerScroll),this.getConfig(m4)&&(Dn.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=Pe.addEventListener(fS,qw((function(){if(this.getConfig(m4)&&!this.currentUrlBlocked()){var t=this.getConfig(BS),e=(this.getConfig(IS)||[]).slice().sort(function(c,l){return c-l}),r=Pe.scrollY,n=R.extend({$scroll_top:r},gm);try{var i=zt.body.scrollHeight,s=Math.round(r/(i-Pe.innerHeight)*100);if(n.$scroll_height=i,n.$scroll_percentage=s,s>this.lastScrollCheckpoint)for(var o=0;o<e.length;o++){var a=e[o];s>=a&&this.lastScrollCheckpoint<a&&(n.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,t=!0)}}catch(c){Dn.critical("Error while calculating scroll percentage",c)}t&&this.mp.track(WZ,n)}}).bind(this))))},ni.prototype.initSubmitTracking=function(){Pe.removeEventListener(c4,this.listenerSubmit),this.getConfig(g4)&&(Dn.log("Initializing submit tracking"),this.listenerSubmit=Pe.addEventListener(c4,(function(t){this.getConfig(g4)&&this.trackDomEvent(t,ZZ)}).bind(this)))},XC(ni);var zZ=Pe.fetch,Wn=Dc("flags"),MS="flags",PS="context",v4={};v4[PS]={};var Vt=function(t){this.getFullApiRoute=t.getFullApiRoute,this.getMpConfig=t.getConfigFunc,this.getMpProperty=t.getPropertyFunc,this.track=t.trackingFunc};Vt.prototype.init=function(){if(!GZ()){Wn.critical("Feature Flags unavailable: missing minimum required APIs");return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set},Vt.prototype.getFullConfig=function(){var t=this.getMpConfig(MS);return t?R.isObject(t)?R.extend({},v4,t):v4:{}},Vt.prototype.getConfig=function(t){return this.getFullConfig()[t]},Vt.prototype.isSystemEnabled=function(){return!!this.getMpConfig(MS)},Vt.prototype.areFlagsReady=function(){return this.isSystemEnabled()||Wn.error("Feature Flags not enabled"),!!this.flags},Vt.prototype.fetchFlags=function(){if(this.isSystemEnabled()){var t=this.getMpProperty("distinct_id"),e=this.getMpProperty("$device_id");Wn.log("Fetching flags for distinct ID: "+t);var r={context:R.extend({distinct_id:t,device_id:e},this.getConfig(PS))};this._fetchInProgressStartTime=Date.now(),this.fetchPromise=Pe.fetch(this.getFullApiRoute(),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),"Content-Type":"application/octet-stream"},body:JSON.stringify(r)}).then((function(n){return this.markFetchComplete(),n.json().then((function(i){var s=i.flags;if(!s)throw new Error("No flags in API response");var o=new Map;R.each(s,function(a,c){o.set(c,{key:a.variant_key,value:a.variant_value})}),this.flags=o}).bind(this)).catch((function(i){this.markFetchComplete(),Wn.error(i)}).bind(this))}).bind(this)).catch((function(n){this.markFetchComplete(),Wn.error(n)}).bind(this))}},Vt.prototype.markFetchComplete=function(){if(!this._fetchInProgressStartTime){Wn.error("Fetch in progress started time not set, cannot mark fetch complete");return}this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null},Vt.prototype.getVariant=function(t,e){return this.fetchPromise?this.fetchPromise.then((function(){return this.getVariantSync(t,e)}).bind(this)).catch(function(r){return Wn.error(r),e}):new Promise(function(r){Wn.critical("Feature Flags not initialized"),r(e)})},Vt.prototype.getVariantSync=function(t,e){if(!this.areFlagsReady())return Wn.log("Flags not loaded yet"),e;var r=this.flags.get(t);return r?(this.trackFeatureCheck(t,r),r):(Wn.log('No flag found: "'+t+'"'),e)},Vt.prototype.getVariantValue=function(t,e){return this.getVariant(t,{value:e}).then(function(r){return r.value}).catch(function(r){return Wn.error(r),e})},Vt.prototype.getFeatureData=function(t,e){return Wn.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(t,e)},Vt.prototype.getVariantValueSync=function(t,e){return this.getVariantSync(t,{value:e}).value},Vt.prototype.isEnabled=function(t,e){return this.getVariantValue(t).then((function(){return this.isEnabledSync(t,e)}).bind(this)).catch(function(r){return Wn.error(r),e})},Vt.prototype.isEnabledSync=function(t,e){e=e||!1;var r=this.getVariantValueSync(t,e);return r!==!0&&r!==!1&&(Wn.error('Feature flag "'+t+'" value: '+r+" is not a boolean; returning fallback value: "+e),r=e),r},Vt.prototype.trackFeatureCheck=function(t,e){this.trackedFeatures.has(t)||(this.trackedFeatures.add(t),this.track("$experiment_started",{"Experiment name":t,"Variant name":e.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency}))};function GZ(){return!!zZ&&typeof Promise<"u"&&typeof Map<"u"&&typeof Set<"u"}XC(Vt),Vt.prototype.are_flags_ready=Vt.prototype.areFlagsReady,Vt.prototype.get_variant=Vt.prototype.getVariant,Vt.prototype.get_variant_sync=Vt.prototype.getVariantSync,Vt.prototype.get_variant_value=Vt.prototype.getVariantValue,Vt.prototype.get_variant_value_sync=Vt.prototype.getVariantValueSync,Vt.prototype.is_enabled=Vt.prototype.isEnabled,Vt.prototype.is_enabled_sync=Vt.prototype.isEnabledSync,Vt.prototype.get_feature_data=Vt.prototype.getFeatureData;var ko=function(){};ko.prototype.create_properties=function(){},ko.prototype.event_handler=function(){},ko.prototype.after_track_handler=function(){},ko.prototype.init=function(t){return this.mp=t,this},ko.prototype.track=function(t,e,r,n){var i=this,s=R.dom_query(t);if(s.length===0){Gt.error("The DOM query ("+t+") returned 0 elements");return}return R.each(s,function(o){R.register_event(o,this.override_event,function(a){var c={},l=i.create_properties(r,this),u=i.mp.get_config("track_links_timeout");i.event_handler(a,this,c),window.setTimeout(i.track_callback(n,l,c,!0),u),i.mp.track(e,l,i.track_callback(n,l,c))})},this),!0},ko.prototype.track_callback=function(t,e,r,n){n=n||!1;var i=this;return function(){r.callback_fired||(r.callback_fired=!0,!(t&&t(n,e)===!1)&&i.after_track_handler(e,r,n))}},ko.prototype.create_properties=function(t,e){var r;return typeof t=="function"?r=t(e):r=R.extend({},t),r};var ad=function(){this.override_event="click"};R.inherit(ad,ko),ad.prototype.create_properties=function(t,e){var r=ad.superclass.create_properties.apply(this,arguments);return e.href&&(r.url=e.href),r},ad.prototype.event_handler=function(t,e,r){r.new_tab=t.which===2||t.metaKey||t.ctrlKey||e.target==="_blank",r.href=e.href,r.new_tab||t.preventDefault()},ad.prototype.after_track_handler=function(t,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var vm=function(){this.override_event="submit"};R.inherit(vm,ko),vm.prototype.event_handler=function(t,e,r){r.element=e,t.preventDefault()},vm.prototype.after_track_handler=function(t,e){setTimeout(function(){e.element.submit()},0)};var Ta="$set",cd="$set_once",Ji="$unset",Wc="$add",As="$append",Zc="$union",_o="$remove",HZ="$delete",VS={set_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[Ta]=n,r},unset_action:function(t){var e={},r=[];return R.isArray(t)||(t=[t]),R.each(t,function(n){this._is_reserved_property(n)||r.push(n)},this),e[Ji]=r,e},set_once_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[cd]=n,r},union_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=R.isArray(i)?i:[i])},this):n[t]=R.isArray(e)?e:[e],r[Zc]=n,r},append_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[As]=n,r},remove_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[_o]=n,r},delete_action:function(){var t={};return t[HZ]="",t}},fr=function(){};R.extend(fr.prototype,VS),fr.prototype._init=function(t,e,r){this._mixpanel=t,this._group_key=e,this._group_id=r},fr.prototype.set=nd(function(t,e,r){var n=this.set_action(t,e);return R.isObject(t)&&(r=e),this._send_request(n,r)}),fr.prototype.set_once=nd(function(t,e,r){var n=this.set_once_action(t,e);return R.isObject(t)&&(r=e),this._send_request(n,r)}),fr.prototype.unset=nd(function(t,e){var r=this.unset_action(t);return this._send_request(r,e)}),fr.prototype.union=nd(function(t,e,r){R.isObject(t)&&(r=e);var n=this.union_action(t,e);return this._send_request(n,r)}),fr.prototype.delete=nd(function(t){var e=this.delete_action();return this._send_request(e,t)}),fr.prototype.remove=nd(function(t,e,r){var n=this.remove_action(t,e);return this._send_request(n,r)}),fr.prototype._send_request=function(t,e){t.$group_key=this._group_key,t.$group_id=this._group_id,t.$token=this._get_config("token");var r=R.encodeDates(t);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},fr.prototype._is_reserved_property=function(t){return t==="$group_key"||t==="$group_id"},fr.prototype._get_config=function(t){return this._mixpanel.get_config(t)},fr.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},fr.prototype.remove=fr.prototype.remove,fr.prototype.set=fr.prototype.set,fr.prototype.set_once=fr.prototype.set_once,fr.prototype.union=fr.prototype.union,fr.prototype.unset=fr.prototype.unset,fr.prototype.toString=fr.prototype.toString;var at=function(){};R.extend(at.prototype,VS),at.prototype._init=function(t){this._mixpanel=t},at.prototype.set=Ra(function(t,e,r){var n=this.set_action(t,e);return R.isObject(t)&&(r=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),n[Ta]=R.extend({},R.info.people_properties(),n[Ta]),this._send_request(n,r)}),at.prototype.set_once=Ra(function(t,e,r){var n=this.set_once_action(t,e);return R.isObject(t)&&(r=e),this._send_request(n,r)}),at.prototype.unset=Ra(function(t,e){var r=this.unset_action(t);return this._send_request(r,e)}),at.prototype.increment=Ra(function(t,e,r){var n={},i={};return R.isObject(t)?(R.each(t,function(s,o){if(!this._is_reserved_property(o))if(isNaN(parseFloat(s))){Gt.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[o]=s},this),r=e):(R.isUndefined(e)&&(e=1),i[t]=e),n[Wc]=i,this._send_request(n,r)}),at.prototype.append=Ra(function(t,e,r){R.isObject(t)&&(r=e);var n=this.append_action(t,e);return this._send_request(n,r)}),at.prototype.remove=Ra(function(t,e,r){R.isObject(t)&&(r=e);var n=this.remove_action(t,e);return this._send_request(n,r)}),at.prototype.union=Ra(function(t,e,r){R.isObject(t)&&(r=e);var n=this.union_action(t,e);return this._send_request(n,r)}),at.prototype.track_charge=Ra(function(){Gt.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),at.prototype.clear_charges=function(t){return this.set("$transactions",[],t)},at.prototype.delete_user=function(){if(!this._identify_called()){Gt.error("mixpanel.people.delete_user() requires you to call identify() first");return}var t={$delete:this._mixpanel.get_distinct_id()};return this._send_request(t)},at.prototype.toString=function(){return this._mixpanel.toString()+".people"},at.prototype._send_request=function(t,e){t.$token=this._get_config("token"),t.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),n=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(t.$device_id=r),n&&(t.$user_id=n),i&&(t.$had_persisted_distinct_id=i);var s=R.encodeDates(t);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:s,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(t),R.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),R.truncate(s,255))},at.prototype._get_config=function(t){return this._mixpanel.get_config(t)},at.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},at.prototype._enqueue=function(t){Ta in t?this._mixpanel.persistence._add_to_people_queue(Ta,t):cd in t?this._mixpanel.persistence._add_to_people_queue(cd,t):Ji in t?this._mixpanel.persistence._add_to_people_queue(Ji,t):Wc in t?this._mixpanel.persistence._add_to_people_queue(Wc,t):As in t?this._mixpanel.persistence._add_to_people_queue(As,t):_o in t?this._mixpanel.persistence._add_to_people_queue(_o,t):Zc in t?this._mixpanel.persistence._add_to_people_queue(Zc,t):Gt.error("Invalid call to _enqueue():",t)},at.prototype._flush_one_queue=function(t,e,r,n){var i=this,s=R.extend({},this._mixpanel.persistence.load_queue(t)),o=s;!R.isUndefined(s)&&R.isObject(s)&&!R.isEmptyObject(s)&&(i._mixpanel.persistence._pop_from_people_queue(t,s),i._mixpanel.persistence.save(),n&&(o=n(s)),e.call(i,o,function(a,c){a===0&&i._mixpanel.persistence._add_to_people_queue(t,s),R.isUndefined(r)||r(a,c)}))},at.prototype._flush=function(t,e,r,n,i,s,o){var a=this;this._flush_one_queue(Ta,this.set,t),this._flush_one_queue(cd,this.set_once,n),this._flush_one_queue(Ji,this.unset,s,function(m){return R.keys(m)}),this._flush_one_queue(Wc,this.increment,e),this._flush_one_queue(Zc,this.union,i);var c=this._mixpanel.persistence.load_queue(As);if(!R.isUndefined(c)&&R.isArray(c)&&c.length)for(var l,u=function(m,w){m===0&&a._mixpanel.persistence._add_to_people_queue(As,l),R.isUndefined(r)||r(m,w)},d=c.length-1;d>=0;d--)c=this._mixpanel.persistence.load_queue(As),l=c.pop(),a._mixpanel.persistence.save(),R.isEmptyObject(l)||a.append(l,u);var h=this._mixpanel.persistence.load_queue(_o);if(!R.isUndefined(h)&&R.isArray(h)&&h.length)for(var f,p=function(m,w){m===0&&a._mixpanel.persistence._add_to_people_queue(_o,f),R.isUndefined(o)||o(m,w)},v=h.length-1;v>=0;v--)h=this._mixpanel.persistence.load_queue(_o),f=h.pop(),a._mixpanel.persistence.save(),R.isEmptyObject(f)||a.remove(f,p)},at.prototype._is_reserved_property=function(t){return t==="$distinct_id"||t==="$token"||t==="$device_id"||t==="$user_id"||t==="$had_persisted_distinct_id"},at.prototype.set=at.prototype.set,at.prototype.set_once=at.prototype.set_once,at.prototype.unset=at.prototype.unset,at.prototype.increment=at.prototype.increment,at.prototype.append=at.prototype.append,at.prototype.remove=at.prototype.remove,at.prototype.union=at.prototype.union,at.prototype.track_charge=at.prototype.track_charge,at.prototype.clear_charges=at.prototype.clear_charges,at.prototype.delete_user=at.prototype.delete_user,at.prototype.toString=at.prototype.toString;var y4="__mps",w4="__mpso",b4="__mpus",k4="__mpa",_4="__mpap",E4="__mpr",C4="__mpu",FS="$people_distinct_id",ym="__alias",p0="__timers",jZ=[y4,w4,b4,k4,_4,E4,C4,FS,ym,p0],kt=function(t){this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="mp_"+t.persistence_name:this.name="mp_"+t.token+"_mixpanel";var e=t.persistence;e!=="cookie"&&e!=="localStorage"&&(Gt.critical("Unknown persistence type "+e+"; falling back to cookie"),e=t.persistence="cookie"),e==="localStorage"&&R.localStorage.is_supported()?this.storage=R.localStorage:this.storage=R.cookie,this.load(),this.update_config(t),this.upgrade(),this.save()};kt.prototype.properties=function(){var t={};return this.load(),R.each(this.props,function(e,r){R.include(jZ,r)||(t[r]=e)}),t},kt.prototype.load=function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=R.extend({},t))}},kt.prototype.upgrade=function(){var t,e;this.storage===R.localStorage?(t=R.cookie.parse(this.name),R.cookie.remove(this.name),R.cookie.remove(this.name,!0),t&&this.register_once(t)):this.storage===R.cookie&&(e=R.localStorage.parse(this.name),R.localStorage.remove(this.name),e&&this.register_once(e))},kt.prototype.save=function(){this.disabled||this.storage.set(this.name,rd(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},kt.prototype.load_prop=function(t){return this.load(),this.props[t]},kt.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},kt.prototype.clear=function(){this.remove(),this.props={}},kt.prototype.register_once=function(t,e,r){return R.isObject(t)?(typeof e>"u"&&(e="None"),this.expire_days=typeof r>"u"?this.default_expiry:r,this.load(),R.each(t,function(n,i){(!this.props.hasOwnProperty(i)||this.props[i]===e)&&(this.props[i]=n)},this),this.save(),!0):!1},kt.prototype.register=function(t,e){return R.isObject(t)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),R.extend(this.props,t),this.save(),!0):!1},kt.prototype.unregister=function(t){this.load(),t in this.props&&(delete this.props[t],this.save())},kt.prototype.update_search_keyword=function(t){this.register(R.info.searchInfo(t))},kt.prototype.update_referrer_info=function(t){this.register_once({$initial_referrer:t||"$direct",$initial_referring_domain:R.info.referringDomain(t)||"$direct"},"")},kt.prototype.get_referrer_info=function(){return R.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},kt.prototype.update_config=function(t){this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cookie_domain(t.cookie_domain),this.set_cross_site(t.cross_site_cookie),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie)},kt.prototype.set_disabled=function(t){this.disabled=t,this.disabled?this.remove():this.save()},kt.prototype.set_cookie_domain=function(t){t!==this.cookie_domain&&(this.remove(),this.cookie_domain=t,this.save())},kt.prototype.set_cross_site=function(t){t!==this.cross_site&&(this.cross_site=t,this.remove(),this.save())},kt.prototype.set_cross_subdomain=function(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())},kt.prototype.get_cross_subdomain=function(){return this.cross_subdomain},kt.prototype.set_secure=function(t){t!==this.secure&&(this.secure=!!t,this.remove(),this.save())},kt.prototype._add_to_people_queue=function(t,e){var r=this._get_queue_key(t),n=e[t],i=this._get_or_create_queue(Ta),s=this._get_or_create_queue(cd),o=this._get_or_create_queue(Ji),a=this._get_or_create_queue(Wc),c=this._get_or_create_queue(Zc),l=this._get_or_create_queue(_o,[]),u=this._get_or_create_queue(As,[]);r===y4?(R.extend(i,n),this._pop_from_people_queue(Wc,n),this._pop_from_people_queue(Zc,n),this._pop_from_people_queue(Ji,n)):r===w4?(R.each(n,function(d,h){h in s||(s[h]=d)}),this._pop_from_people_queue(Ji,n)):r===b4?R.each(n,function(d){R.each([i,s,a,c],function(h){d in h&&delete h[d]}),R.each(u,function(h){d in h&&delete h[d]}),o[d]=!0}):r===k4?(R.each(n,function(d,h){h in i?i[h]+=d:(h in a||(a[h]=0),a[h]+=d)},this),this._pop_from_people_queue(Ji,n)):r===C4?(R.each(n,function(d,h){R.isArray(d)&&(h in c||(c[h]=[]),R.each(d,function(f){R.include(c[h],f)||c[h].push(f)}))}),this._pop_from_people_queue(Ji,n)):r===E4?(l.push(n),this._pop_from_people_queue(As,n)):r===_4&&(u.push(n),this._pop_from_people_queue(Ji,n)),Gt.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Gt.log(e),this.save()},kt.prototype._pop_from_people_queue=function(t,e){var r=this.props[this._get_queue_key(t)];R.isUndefined(r)||R.each(e,function(n,i){t===As||t===_o?R.each(r,function(s){s[i]===n&&delete s[i]}):delete r[i]},this)},kt.prototype.load_queue=function(t){return this.load_prop(this._get_queue_key(t))},kt.prototype._get_queue_key=function(t){if(t===Ta)return y4;if(t===cd)return w4;if(t===Ji)return b4;if(t===Wc)return k4;if(t===As)return _4;if(t===_o)return E4;if(t===Zc)return C4;Gt.error("Invalid queue:",t)},kt.prototype._get_or_create_queue=function(t,e){var r=this._get_queue_key(t);return e=R.isUndefined(e)?{}:e,this.props[r]||(this.props[r]=e)},kt.prototype.set_event_timer=function(t,e){var r=this.load_prop(p0)||{};r[t]=e,this.props[p0]=r,this.save()},kt.prototype.remove_event_timer=function(t){var e=this.load_prop(p0)||{},r=e[t];return R.isUndefined(r)||(delete this.props[p0][t],this.save()),r};var S4,LS=function(t,e){throw new Error(t+" not available in this build.")},En,DS=0,QZ=1,JZ=function(t){return t},Ei="mixpanel",WS="base64",$Z="json",A4="$device:",ld=Pe.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ZS=!ld&&wo.indexOf("MSIE")===-1&&wo.indexOf("Mozilla")===-1,wm=null;Ca.sendBeacon&&(wm=function(){return Ca.sendBeacon.apply(Ca,arguments)});var zS={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},GS={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:zS,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:WS,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Sa,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Sa,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:a0,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},HS=!1,ne=function(){},R4=function(t,e,r){var n,i=r===Ei?En:En[r];if(i&&S4===DS)n=i;else{if(i&&!R.isArray(i)){Gt.error("You have already initialized "+r);return}n=new ne}if(n._cached_groups={},n._init(t,e,r),n.people=new at,n.people._init(n),!n.get_config("skip_first_touch_marketing")){var s=R.info.campaignParams(null),o={},a=!1;R.each(s,function(c,l){o["initial_"+l]=c,c&&(a=!0)}),a&&n.people.set_once(o)}return Qi.DEBUG=Qi.DEBUG||n.get_config("debug"),!R.isUndefined(i)&&R.isArray(i)&&(n._execute_array.call(n.people,i.people),n._execute_array(i)),n};ne.prototype.init=function(t,e,r){if(R.isUndefined(r)){this.report_error("You must name your new library: init(token, config, name)");return}if(r===Ei){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var n=R4(t,e,r);return En[r]=n,n._loaded(),n},ne.prototype._init=function(t,e,r){e=e||{},this.__loaded=!0,this.config={};var n={};if(!("api_payload_format"in e)){var i=e.api_host||GS.api_host;i.match(/\.mixpanel\.com/)&&(n.api_payload_format=$Z)}if(this.set_config(R.extend({},GS,n,e,{name:r,token:t,callback_fn:(r===Ei?r:Ei+"."+r)+"._jsc"})),this._jsc=Sa,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!R.localStorage.is_supported(!0)||!ld)this._batch_requests=!1,Gt.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),R.each(this.get_batcher_configs(),function(a){Gt.log("Clearing batch queue "+a.queue_key),R.localStorage.remove(a.queue_key)});else if(this.init_batchers(),wm&&Pe.addEventListener){var s=R.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);Pe.addEventListener("pagehide",function(a){a.persisted&&s()}),Pe.addEventListener("visibilitychange",function(){zt.visibilityState==="hidden"&&s()})}}this.persistence=this.cookie=new kt(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=R.UUID();this.get_distinct_id()||this.register_once({distinct_id:A4+o,$device_id:o},""),this.flags=new Vt({getFullApiRoute:R.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:R.bind(this.get_config,this),getPropertyFunc:R.bind(this.get_property,this),trackingFunc:R.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new ni(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},ne.prototype._init_tab_id=function(){if(R.sessionStorage.is_supported())try{var t=this.get_config("name")+"_"+this.get_config("token"),e="mp_tab_id_"+t,r="mp_gen_new_tab_id_"+t;(R.sessionStorage.get(r)||!R.sessionStorage.get(e))&&R.sessionStorage.set(e,"$tab-"+R.UUID()),R.sessionStorage.set(r,"1"),this.tab_id=R.sessionStorage.get(e),Pe.addEventListener("beforeunload",function(){R.sessionStorage.remove(r)})}catch(n){this.report_error("Error initializing tab id",n)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},ne.prototype.get_tab_id=function(){return this.tab_id||null},ne.prototype._should_load_recorder=function(){var t=new Es(n4),e=this.get_tab_id();return t.init().then(function(){return t.getAll()}).then(function(r){for(var n=0;n<r.length;n++)if(a4(r[n])||r[n].tabId===e)return!0;return!1}).catch(R.bind(function(r){this.report_error("Error checking recording registry",r)},this))},ne.prototype._check_and_start_session_recording=Aa(function(t){if(!Pe.MutationObserver){Gt.critical("Browser does not support MutationObserver; skipping session recording");return}var e=R.bind(function(n){var i=R.bind(function(){this._recorder=this._recorder||new Pe.__mp_recorder(this),this._recorder.resumeRecording(n)},this);R.isUndefined(Pe.__mp_recorder)?LS(this.get_config("recorder_src"),i):i()},this),r=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");t||r?e(!0):this._should_load_recorder().then(function(n){n&&e(!1)})}),ne.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},ne.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},ne.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},ne.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},ne.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},ne.prototype.get_session_recording_properties=function(){var t={},e=this._get_session_replay_id();return e&&(t.$mp_replay_id=e),t},ne.prototype.get_session_replay_url=function(){var t=null,e=this._get_session_replay_id();if(e){var r=R.HTTPBuildQuery({replay_id:e,distinct_id:this.get_distinct_id(),token:this.get_config("token")});t="https://mixpanel.com/projects/replay-redirect?"+r}return t},ne.prototype._get_session_replay_id=function(){var t=null;return this._recorder&&(t=this._recorder.replayId),t||null},ne.prototype.__get_recorder=function(){return this._recorder},ne.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var t=R.info.campaignParams(null);R.each(t,(function(e,r){this.unregister(r)}).bind(this))}},ne.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(zt.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(R.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(zt.referrer)},ne.prototype._dom_loaded=function(){R.each(this.__dom_loaded_queue,function(t){this._track_dom.apply(this,t)},this),this.has_opted_out_tracking()||R.each(this.__request_queue,function(t){this._send_request.apply(this,t)},this),delete this.__dom_loaded_queue,delete this.__request_queue},ne.prototype._track_dom=function(t,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!HS)return this.__dom_loaded_queue.push([t,e]),!1;var r=new t().init(this);return r.track.apply(r,e)},ne.prototype._prepare_callback=function(t,e){if(R.isUndefined(t))return null;if(ld){var r=function(o){t(o,e)};return r}else{var n=this._jsc,i=""+Math.floor(Math.random()*1e8),s=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(o){delete n[i],t(o,e)},s}},ne.prototype._send_request=function(t,e,r,n){var i=!0;if(ZS)return this.__request_queue.push(arguments),i;var s={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},o=null;!n&&(R.isFunction(r)||typeof r=="string")&&(n=r,r=null),r=R.extend(s,r||{}),ld||(r.method="GET");var a=r.method==="POST",c=wm&&a&&r.transport.toLowerCase()==="sendbeacon",l=r.verbose;e.verbose&&(l=!0),this.get_config("test")&&(e.test=1),l&&(e.verbose=1),this.get_config("img")&&(e.img=1),ld||(n?e.callback=n:(l||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),a&&(o="data="+encodeURIComponent(e.data),delete e.data),R.extend(e,this.get_config("api_extra_query_params")),t+="?"+R.HTTPBuildQuery(e);var u=this;if("img"in e){var d=zt.createElement("img");d.src=t,zt.body.appendChild(d)}else if(c){try{i=wm(t,o)}catch(w){u.report_error(w),i=!1}try{n&&n(i?1:0)}catch(w){u.report_error(w)}}else if(ld)try{var h=new XMLHttpRequest;h.open(r.method,t,!0);var f=this.get_config("xhr_headers");if(a&&(f["Content-Type"]="application/x-www-form-urlencoded"),R.each(f,function(w,_){h.setRequestHeader(_,w)}),r.timeout_ms&&typeof h.timeout<"u"){h.timeout=r.timeout_ms;var p=new Date().getTime()}h.withCredentials=!0,h.onreadystatechange=function(){if(h.readyState===4)if(h.status===200){if(n)if(l){var w;try{w=R.JSONDecode(h.responseText)}catch(T){if(u.report_error(T),r.ignore_json_errors)w=h.responseText;else return}n(w)}else n(Number(h.responseText))}else{var _;if(h.timeout&&!h.status&&new Date().getTime()-p>=h.timeout?_="timeout":_="Bad HTTP status: "+h.status+" "+h.statusText,u.report_error(_),n)if(l){var S=h.responseHeaders||{};n({status:0,httpStatusCode:h.status,error:_,retryAfter:S["Retry-After"]})}else n(0)}},h.send(o)}catch(w){u.report_error(w),i=!1}else{var v=zt.createElement("script");v.type="text/javascript",v.async=!0,v.defer=!0,v.src=t;var m=zt.getElementsByTagName("script")[0];m.parentNode.insertBefore(v,m)}return i},ne.prototype._execute_array=function(t){var e,r=[],n=[],i=[];R.each(t,function(o){o&&(e=o[0],R.isArray(e)?i.push(o):typeof o=="function"?o.call(this):R.isArray(o)&&e==="alias"?r.push(o):R.isArray(o)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?i.push(o):n.push(o))},this);var s=function(o,a){R.each(o,function(c){if(R.isArray(c[0])){var l=a;R.each(c,function(u){l=l[u[0]].apply(l,u.slice(1))})}else this[c[0]].apply(this,c.slice(1))},a)};s(r,this),s(n,this),s(i,this)},ne.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},ne.prototype.get_batcher_configs=function(){var t="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:t+"_ev"},people:{type:"people",api_name:"engage",queue_key:t+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:t+"_gr"}},this._batcher_configs},ne.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var t=R.bind(function(r){return new _i(r.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:R.bind(function(n,i,s){var o=this.get_config("api_routes");this._send_request(this.get_api_host(r.api_name)+"/"+o[r.api_name],this._encode_data_for_request(n),i,this._prepare_callback(s,n))},this),beforeSendHook:R.bind(function(n){return this._run_hook("before_send_"+r.type,n)},this),stopAllBatchingFunc:R.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:t(e.events),people:t(e.people),groups:t(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},ne.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,R.each(this.request_batchers,function(t){t.start()}))},ne.prototype.stop_batch_senders=function(){this._batch_requests=!1,R.each(this.request_batchers,function(t){t.stop(),t.clear()})},ne.prototype.push=function(t){this._execute_array([t])},ne.prototype.disable=function(t){typeof t>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(t)},ne.prototype._encode_data_for_request=function(t){var e=rd(t);return this.get_config("api_payload_format")===WS&&(e=R.base64Encode(e)),{data:e}},ne.prototype._track_or_batch=function(t,e){var r=R.truncate(t.data,255),n=t.endpoint,i=t.batcher,s=t.should_send_immediately,o=t.send_request_options||{};e=e||Sa;var a=!0,c=R.bind(function(){return o.skip_hooks||(r=this._run_hook("before_send_"+t.type,r)),r?(Gt.log("MIXPANEL REQUEST:"),Gt.log(r),this._send_request(n,this._encode_data_for_request(r),o,this._prepare_callback(e,r))):null},this);return this._batch_requests&&!s?i.enqueue(r).then(function(l){l?e(1,r):c()}):a=c(),a&&r},ne.prototype.track=Aa(function(t,e,r,n){!n&&typeof r=="function"&&(n=r,r=null),r=r||{};var i=r.transport;i&&(r.transport=i);var s=r.send_immediately;if(typeof n!="function"&&(n=Sa),R.isUndefined(t)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(t)){n(0);return}e=R.extend({},e),e.token=this.get_config("token");var o=this.persistence.remove_event_timer(t);if(!R.isUndefined(o)){var a=new Date().getTime()-o;e.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?R.info.marketingParams():{};e=R.extend({},R.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var l=this.get_config("property_blacklist");R.isArray(l)?R.each(l,function(h){delete e[h]}):this.report_error("Invalid value for property_blacklist config: "+l);var u={event:t,properties:e},d=this._track_or_batch({type:"events",data:u,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:r},n);return d}),ne.prototype.set_group=Aa(function(t,e,r){R.isArray(e)||(e=[e]);var n={};return n[t]=e,this.register(n),this.people.set(t,e,r)}),ne.prototype.add_group=Aa(function(t,e,r){var n=this.get_property(t),i={};return n===void 0?(i[t]=[e],this.register(i)):n.indexOf(e)===-1&&(n.push(e),i[t]=n,this.register(i)),this.people.union(t,e,r)}),ne.prototype.remove_group=Aa(function(t,e,r){var n=this.get_property(t);if(n!==void 0){var i=n.indexOf(e);i>-1&&(n.splice(i,1),this.register({group_key:n})),n.length===0&&this.unregister(t)}return this.people.remove(t,e,r)}),ne.prototype.track_with_groups=Aa(function(t,e,r,n){var i=R.extend({},e||{});return R.each(r,function(s,o){s!=null&&(i[o]=s)}),this.track(t,i,n)}),ne.prototype._create_map_key=function(t,e){return t+"_"+JSON.stringify(e)},ne.prototype._remove_group_from_cache=function(t,e){delete this._cached_groups[this._create_map_key(t,e)]},ne.prototype.get_group=function(t,e){var r=this._create_map_key(t,e),n=this._cached_groups[r];return(n===void 0||n._group_key!==t||n._group_id!==e)&&(n=new fr,n._init(this,t,e),this._cached_groups[r]=n),n},ne.prototype.track_pageview=Aa(function(t,e){typeof t!="object"&&(t={}),e=e||{};var r=e.event_name||"$mp_web_page_view",n=R.extend(R.info.mpPageViewProperties(),R.info.campaignParams(),R.info.clickParams()),i=R.extend({},n,t);return this.track(r,i)}),ne.prototype.track_links=function(){return this._track_dom.call(this,ad,arguments)},ne.prototype.track_forms=function(){return this._track_dom.call(this,vm,arguments)},ne.prototype.time_event=function(t){if(R.isUndefined(t)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(t)||this.persistence.set_event_timer(t,new Date().getTime())};var YZ={persistent:!0},T4=function(t){var e;return R.isObject(t)?e=t:R.isUndefined(t)?e={}:e={days:t},R.extend({},YZ,e)};ne.prototype.register=function(t,e){var r=T4(e);r.persistent?this.persistence.register(t,r.days):R.extend(this.unpersisted_superprops,t)},ne.prototype.register_once=function(t,e,r){var n=T4(r);n.persistent?this.persistence.register_once(t,e,n.days):(typeof e>"u"&&(e="None"),R.each(t,function(i,s){(!this.unpersisted_superprops.hasOwnProperty(s)||this.unpersisted_superprops[s]===e)&&(this.unpersisted_superprops[s]=i)},this))},ne.prototype.unregister=function(t,e){e=T4(e),e.persistent?this.persistence.unregister(t):delete this.unpersisted_superprops[t]},ne.prototype._register_single=function(t,e){var r={};r[t]=e,this.register(r)},ne.prototype.identify=function(t,e,r,n,i,s,o,a){var c=this.get_distinct_id();if(t&&c!==t){if(typeof t=="string"&&t.indexOf(A4)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:t})}if(!this.get_property("$device_id")){var l=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:l},"")}t!==c&&t!==this.get_property(ym)&&(this.unregister(ym),this.register({distinct_id:t})),this._flags.identify_called=!0,this.people._flush(e,r,n,i,s,o,a),t!==c&&this.track("$identify",{distinct_id:t,$anon_distinct_id:c},{skip_hooks:!0}),t!==c&&this.flags.fetchFlags()},ne.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var t=R.UUID();this.register_once({distinct_id:A4+t,$device_id:t},""),this._check_and_start_session_recording()},ne.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},ne.prototype.alias=function(t,e){if(t===this.get_property(FS))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return R.isUndefined(e)&&(e=this.get_distinct_id()),t!==e?(this._register_single(ym,t),this.track("$create_alias",{alias:t,distinct_id:e},{skip_hooks:!0},function(){r.identify(t)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(t),-1)},ne.prototype.name_tag=function(t){this._register_single("mp_name_tag",t)},ne.prototype.set_config=function(t){if(R.isObject(t)){R.extend(this.config,t);var e=t.batch_size;e&&R.each(this.request_batchers,function(r){r.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Qi.DEBUG=Qi.DEBUG||this.get_config("debug"),("autocapture"in t||"record_heatmap_data"in t)&&this.autocapture&&this.autocapture.init()}},ne.prototype.get_config=function(t){return this.config[t]},ne.prototype._run_hook=function(t){var e=(this.config.hooks[t]||JZ).apply(this,Ea.call(arguments,1));return typeof e>"u"&&(this.report_error(t+" hook did not return a value"),e=null),e},ne.prototype.get_property=function(t){return this.persistence.load_prop([t])},ne.prototype.get_api_host=function(t){return this.get_config("api_hosts")[t]||this.get_config("api_host")},ne.prototype.toString=function(){var t=this.get_config("name");return t!==Ei&&(t=Ei+"."+t),t},ne.prototype._event_is_disabled=function(t){return R.isBlockedUA(wo)||this._flags.disable_all_events||R.include(this.__disabled_events,t)},ne.prototype._gdpr_init=function(){var t=this.get_config("opt_out_tracking_persistence_type")==="localStorage";t&&R.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||R.cookie.get("mp_optout"))&&(R.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},ne.prototype._gdpr_update_persistence=function(t){var e;if(t&&t.clear_persistence)e=!0;else if(t&&t.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},ne.prototype._gdpr_call_func=function(t,e){return e=R.extend({track:R.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),R.localStorage.is_supported()||(e.persistence_type="cookie"),t(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},ne.prototype.opt_in_tracking=function(t){t=R.extend({enable_persistence:!0},t),this._gdpr_call_func(yZ,t),this._gdpr_update_persistence(t)},ne.prototype.opt_out_tracking=function(t){t=R.extend({clear_persistence:!0,delete_user:!0},t),t.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(wZ,t),this._gdpr_update_persistence(t)},ne.prototype.has_opted_in_tracking=function(t){return this._gdpr_call_func(bZ,t)},ne.prototype.has_opted_out_tracking=function(t){return this._gdpr_call_func(nS,t)},ne.prototype.clear_opt_in_out_tracking=function(t){t=R.extend({enable_persistence:!0},t),this._gdpr_call_func(kZ,t),this._gdpr_update_persistence(t)},ne.prototype.report_error=function(t,e){Gt.error.apply(Gt.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.get_config("error_reporter")(t,e)}catch(r){Gt.error(r)}},ne.prototype.init=ne.prototype.init,ne.prototype.reset=ne.prototype.reset,ne.prototype.disable=ne.prototype.disable,ne.prototype.time_event=ne.prototype.time_event,ne.prototype.track=ne.prototype.track,ne.prototype.track_links=ne.prototype.track_links,ne.prototype.track_forms=ne.prototype.track_forms,ne.prototype.track_pageview=ne.prototype.track_pageview,ne.prototype.register=ne.prototype.register,ne.prototype.register_once=ne.prototype.register_once,ne.prototype.unregister=ne.prototype.unregister,ne.prototype.identify=ne.prototype.identify,ne.prototype.alias=ne.prototype.alias,ne.prototype.name_tag=ne.prototype.name_tag,ne.prototype.set_config=ne.prototype.set_config,ne.prototype.get_config=ne.prototype.get_config,ne.prototype.get_api_host=ne.prototype.get_api_host,ne.prototype.get_property=ne.prototype.get_property,ne.prototype.get_distinct_id=ne.prototype.get_distinct_id,ne.prototype.toString=ne.prototype.toString,ne.prototype.opt_out_tracking=ne.prototype.opt_out_tracking,ne.prototype.opt_in_tracking=ne.prototype.opt_in_tracking,ne.prototype.has_opted_out_tracking=ne.prototype.has_opted_out_tracking,ne.prototype.has_opted_in_tracking=ne.prototype.has_opted_in_tracking,ne.prototype.clear_opt_in_out_tracking=ne.prototype.clear_opt_in_out_tracking,ne.prototype.get_group=ne.prototype.get_group,ne.prototype.set_group=ne.prototype.set_group,ne.prototype.add_group=ne.prototype.add_group,ne.prototype.remove_group=ne.prototype.remove_group,ne.prototype.track_with_groups=ne.prototype.track_with_groups,ne.prototype.start_batch_senders=ne.prototype.start_batch_senders,ne.prototype.stop_batch_senders=ne.prototype.stop_batch_senders,ne.prototype.start_session_recording=ne.prototype.start_session_recording,ne.prototype.stop_session_recording=ne.prototype.stop_session_recording,ne.prototype.pause_session_recording=ne.prototype.pause_session_recording,ne.prototype.resume_session_recording=ne.prototype.resume_session_recording,ne.prototype.get_session_recording_properties=ne.prototype.get_session_recording_properties,ne.prototype.get_session_replay_url=ne.prototype.get_session_replay_url,ne.prototype.get_tab_id=ne.prototype.get_tab_id,ne.prototype.DEFAULT_API_ROUTES=zS,ne.prototype.__get_recorder=ne.prototype.__get_recorder,kt.prototype.properties=kt.prototype.properties,kt.prototype.update_search_keyword=kt.prototype.update_search_keyword,kt.prototype.update_referrer_info=kt.prototype.update_referrer_info,kt.prototype.get_cross_subdomain=kt.prototype.get_cross_subdomain,kt.prototype.clear=kt.prototype.clear;var ud={},XZ=function(){R.each(ud,function(t,e){e!==Ei&&(En[e]=t)}),En._=R},KZ=function(){En.init=function(t,e,r){if(r)return En[r]||(En[r]=ud[r]=R4(t,e,r),En[r]._loaded()),En[r];var n=En;ud[Ei]?n=ud[Ei]:t&&(n=R4(t,e,Ei),n._loaded(),ud[Ei]=n),En=n,S4===QZ&&(Pe[Ei]=En),XZ()}},qZ=function(){function t(){t.done||(t.done=!0,HS=!0,ZS=!1,R.each(ud,function(n){n._dom_loaded()}))}function e(){try{zt.documentElement.doScroll("left")}catch{setTimeout(e,1);return}t()}if(zt.addEventListener)zt.readyState==="complete"?t():zt.addEventListener("DOMContentLoaded",t,!1);else if(zt.attachEvent){zt.attachEvent("onreadystatechange",t);var r=!1;try{r=Pe.frameElement===null}catch{}zt.documentElement.doScroll&&r&&e()}R.register_event(Pe,"load",t,!0)};function ez(t){return LS=t,S4=DS,En=new ne,KZ(),En.init(),qZ(),En}function tz(t,e){e()}var jS=ez(tz);let un=jS;const rz=t=>{const e=t===Oc.MAINNET?"99f02568157d7aa8d54f0843d18e7d91":"874af62961206fdd0dab0d95ae71dcf7";jS.init(e,{debug:!1,loaded:r=>un=r},t)},nz=()=>{const t=new URL(window.location.href);t.search="",history.pushState({},"",t.toString())},N4=0,iz="0xAebF6188EA36F166A15D9003a7F761122b695a70".toLowerCase(),x4={src:"https://customer-bmztknkgqgwr6a86.cloudflarestream.com/b6057185863fe1c1ca2875dbf11ea447/watch",embedded:!0},QS="We are processing your order..",sz=()=>{bt.set({...ve(bt),isProgressFinished:!1,isVideoEnded:!0})},B4=async()=>(bt.set({...ve(bt),isProgressFinished:!0,isVideoEnded:!1}),new Promise(t=>{const e=bt.subscribe(r=>{r.isVideoEnded&&(bt.set({...ve(bt),isProgressFinished:!1,isVideoEnded:!1}),e(),t(null))});setTimeout(()=>{try{e()}catch{}t(null)},60*1e3)})),oz=[{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"addOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"clearOwners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getDescription",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"target",type:"address"}],name:"getDropAvailableAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDropAvailableTotalAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDropPerAddressLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDropTotalLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"target",type:"address"}],name:"getDroppedAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDroppedTotalAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getOwners",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTrustedForwarder",outputs:[{internalType:"address",name:"forwarder",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"isOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"forwarder",type:"address"}],name:"isTrustedForwarder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"removeOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"target",type:"address"}],name:"requestToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"description",type:"string"}],name:"setDescription",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"setDropPerAddressLimit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"setDropTotalLimit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_forwarder",type:"address"}],name:"setTrustedForwarder",outputs:[],stateMutability:"nonpayable",type:"function"}],tt=mn(),I4=Gg([ys,tt,bn,wi],([t,e,r,n])=>{var i,s,o,a,c;if(t)return t;if(n){if((i=e.auth)!=null&&i.extendedRegistration&&(!(r!=null&&r.name)||!(r!=null&&r.email)&&!((s=r==null?void 0:r.pending)!=null&&s.email)&&!(r!=null&&r.phone)&&!((o=r==null?void 0:r.pending)!=null&&o.phone)))return Be.UPDATE_PROFILE;if((a=r==null?void 0:r.pending)!=null&&a.email||(c=r==null?void 0:r.pending)!=null&&c.phone)return Be.CONFIRM_ACCOUNT}else return Be.LOGIN;return null}),O4=Gg([tt,wi],([t,e])=>{var r;return!e&&!!((r=t.content)!=null&&r.cloak)}),Dr=mn(),dd=mn(),az=Gg(Dr,async t=>{try{return t?(await(await t.getSigner()).getAddress()).toLowerCase():""}catch{return""}}),Bt={[Ae.POLYGON]:{name:"Polygon",rpcUrl:"https://polygon-rpc.com",scanUrl:"https://polygonscan.com"},[Ae.POLYGON_AMOY]:{name:"Amoy",rpcUrl:"https://rpc-amoy.polygon.technology",scanUrl:"https://www.oklink.com/amoy"},[Ae.CHILIZ]:{name:"Chiliz",rpcUrl:"https://rpc.chiliz.com",scanUrl:"https://scan.chiliz.com/"},[Ae.CHILIZ_SPICY]:{name:"Spicy",rpcUrl:"https://spicy-rpc.chiliz.com",scanUrl:"https://spicy-explorer.chiliz.com/"},[Ae.AVALANCHE_FUJI]:{name:"Fuji",rpcUrl:"https://api.avax-test.network/ext/bc/C/rpc",scanUrl:"https://testnet.snowscan.xyz/"},[Ae.AVALANCHE]:{name:"Avalanche",rpcUrl:"https://api.avax.network/ext/bc/C/rpc",scanUrl:"https://snowtrace.io/"},[Ae.BASE]:{name:"Base",rpcUrl:"https://mainnet.base.org",scanUrl:"https://basescan.org"},[Ae.BASE_SEPOLIA]:{name:"Base Sepolia",rpcUrl:"https://sepolia.base.org",scanUrl:"https://sepolia.basescan.org"}},JS=t=>{switch(t){case Ae.POLYGON:case Ae.CHILIZ:case Ae.AVALANCHE:case Ae.BASE:return Oc.MAINNET;default:return Oc.TESTNET}},Rs=Object.create(null);Rs.open="0",Rs.close="1",Rs.ping="2",Rs.pong="3",Rs.message="4",Rs.upgrade="5",Rs.noop="6";const bm=Object.create(null);Object.keys(Rs).forEach(t=>{bm[Rs[t]]=t});const U4={type:"error",data:"parser error"},$S=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",YS=typeof ArrayBuffer=="function",XS=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,M4=({type:t,data:e},r,n)=>$S&&e instanceof Blob?r?n(e):KS(e,n):YS&&(e instanceof ArrayBuffer||XS(e))?r?n(e):KS(new Blob([e]),n):n(Rs[t]+(e||"")),KS=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function qS(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let P4;function cz(t,e){if($S&&t.data instanceof Blob)return t.data.arrayBuffer().then(qS).then(e);if(YS&&(t.data instanceof ArrayBuffer||XS(t.data)))return e(qS(t.data));M4(t,!1,r=>{P4||(P4=new TextEncoder),e(P4.encode(r))})}const eA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m0=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<eA.length;t++)m0[eA.charCodeAt(t)]=t;const lz=t=>{let e=t.length*.75,r=t.length,n,i=0,s,o,a,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const l=new ArrayBuffer(e),u=new Uint8Array(l);for(n=0;n<r;n+=4)s=m0[t.charCodeAt(n)],o=m0[t.charCodeAt(n+1)],a=m0[t.charCodeAt(n+2)],c=m0[t.charCodeAt(n+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|c&63;return l},uz=typeof ArrayBuffer=="function",V4=(t,e)=>{if(typeof t!="string")return{type:"message",data:tA(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:dz(t.substring(1),e)}:bm[r]?t.length>1?{type:bm[r],data:t.substring(1)}:{type:bm[r]}:U4},dz=(t,e)=>{if(uz){const r=lz(t);return tA(r,e)}else return{base64:!0,data:t}},tA=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},rA="",hz=(t,e)=>{const r=t.length,n=new Array(r);let i=0;t.forEach((s,o)=>{M4(s,!1,a=>{n[o]=a,++i===r&&e(n.join(rA))})})},fz=(t,e)=>{const r=t.split(rA),n=[];for(let i=0;i<r.length;i++){const s=V4(r[i],e);if(n.push(s),s.type==="error")break}return n};function pz(){return new TransformStream({transform(t,e){cz(t,r=>{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(r)})}})}let F4;function km(t){return t.reduce((e,r)=>e+r.length,0)}function _m(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)r[i]=t[0][n++],n===t[0].length&&(t.shift(),n=0);return t.length&&n<t[0].length&&(t[0]=t[0].slice(n)),r}function mz(t,e){F4||(F4=new TextDecoder);const r=[];let n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(r.push(o);;){if(n===0){if(km(r)<1)break;const c=_m(r,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(km(r)<2)break;const c=_m(r,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(km(r)<8)break;const c=_m(r,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(U4);break}i=u*Math.pow(2,32)+l.getUint32(4),n=3}else{if(km(r)<i)break;const c=_m(r,i);a.enqueue(V4(s?c:F4.decode(c),e)),n=0}if(i===0||i>t){a.enqueue(U4);break}}}})}const nA=4;function Wr(t){if(t)return gz(t)}function gz(t){for(var e in Wr.prototype)t[e]=Wr.prototype[e];return t}Wr.prototype.on=Wr.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Wr.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},Wr.prototype.off=Wr.prototype.removeListener=Wr.prototype.removeAllListeners=Wr.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,i=0;i<r.length;i++)if(n=r[i],n===e||n.fn===e){r.splice(i,1);break}return r.length===0&&delete this._callbacks["$"+t],this},Wr.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n)r[n].apply(this,e)}return this},Wr.prototype.emitReserved=Wr.prototype.emit,Wr.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Wr.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Em=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Ci=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),vz="arraybuffer";function iK(){}function iA(t,...e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const yz=Ci.setTimeout,wz=Ci.clearTimeout;function Cm(t,e){e.useNativeTimers?(t.setTimeoutFn=yz.bind(Ci),t.clearTimeoutFn=wz.bind(Ci)):(t.setTimeoutFn=Ci.setTimeout.bind(Ci),t.clearTimeoutFn=Ci.clearTimeout.bind(Ci))}const bz=1.33;function kz(t){return typeof t=="string"?_z(t):Math.ceil((t.byteLength||t.size)*bz)}function _z(t){let e=0,r=0;for(let n=0,i=t.length;n<i;n++)e=t.charCodeAt(n),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}function sA(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ez(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function Cz(t){let e={},r=t.split("&");for(let n=0,i=r.length;n<i;n++){let s=r[n].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class Sz extends Error{constructor(e,r,n){super(e),this.description=r,this.context=n,this.type="TransportError"}}class L4 extends Wr{constructor(e){super(),this.writable=!1,Cm(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,r,n){return super.emitReserved("error",new Sz(e,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const r=V4(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const r=Ez(e);return r.length?"?"+r:""}}class Az extends L4{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};fz(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,hz(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=sA()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}}let oA=!1;try{oA=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Rz=oA;function Tz(){}class Nz extends Az{constructor(e){if(super(e),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class Ts extends Wr{constructor(e,r,n){super(),this.createRequest=e,Cm(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const r=iA(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ts.requestsCount++,Ts.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Tz,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ts.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Ts.requestsCount=0,Ts.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",aA);else if(typeof addEventListener=="function"){const t="onpagehide"in Ci?"pagehide":"unload";addEventListener(t,aA,!1)}}function aA(){for(let t in Ts.requests)Ts.requests.hasOwnProperty(t)&&Ts.requests[t].abort()}const xz=function(){const t=cA({xdomain:!1});return t&&t.responseType!==null}();class Bz extends Nz{constructor(e){super(e);const r=e&&e.forceBase64;this.supportsBinary=xz&&!r}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Ts(cA,this.uri(),e)}}function cA(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Rz))return new XMLHttpRequest}catch{}if(!e)try{return new Ci[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const lA=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Iz extends L4{get name(){return"websocket"}doOpen(){const e=this.uri(),r=this.opts.protocols,n=lA?{}:iA(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],i=r===e.length-1;M4(n,this.supportsBinary,s=>{try{this.doWrite(n,s)}catch{}i&&Em(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=sA()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}}const D4=Ci.WebSocket||Ci.MozWebSocket;class Oz extends Iz{createSocket(e,r,n){return lA?new D4(e,r,n):r?new D4(e,r):new D4(e)}doWrite(e,r){this.ws.send(r)}}class Uz extends L4{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const r=mz(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),i=pz();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{n.read().then(({done:a,value:c})=>{a||(this.onPacket(c),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],i=r===e.length-1;this._writer.write(n).then(()=>{i&&Em(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Mz={websocket:Oz,webtransport:Uz,polling:Bz},Pz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function W4(t){if(t.length>8e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let i=Pz.exec(t||""),s={},o=14;for(;o--;)s[Vz[o]]=i[o]||"";return r!=-1&&n!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Fz(s,s.path),s.queryKey=Lz(s,s.query),s}function Fz(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Lz(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,s){i&&(r[i]=s)}),r}const Z4=typeof addEventListener=="function"&&typeof removeEventListener=="function",Sm=[];Z4&&addEventListener("offline",()=>{Sm.forEach(t=>t())},!1);class Na extends Wr{constructor(e,r){if(super(),this.binaryType=vz,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(r=e,e=null),e){const n=W4(e);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=W4(r.host).host);Cm(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Cz(this.opts.query)),Z4&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Sm.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=nA,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Na.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(e);r.open(),this.setTransport(r)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Na.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=e.data,this._onError(r);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(r+=kz(i)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Em(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,r,n){return this._sendPacket("message",e,r,n),this}send(e,r,n){return this._sendPacket("message",e,r,n),this}_sendPacket(e,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const s={type:e,data:r,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Na.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Z4&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Sm.indexOf(this._offlineEventListener);n!==-1&&Sm.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this._prevBufferLen=0}}}Na.protocol=nA;class Dz extends Na{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let r=this.createTransport(e),n=!1;Na.priorWebsocketSuccess=!1;const i=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Na.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(u(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=r.name,this.emitReserved("upgradeError",h)}}))};function s(){n||(n=!0,u(),r.close(),r=null)}const o=d=>{const h=new Error("probe error: "+d);h.transport=r.name,s(),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function c(){o("socket closed")}function l(d){r&&d.name!==r.name&&s()}const u=()=>{r.removeListener("open",i),r.removeListener("error",o),r.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};r.once("open",i),r.once("error",o),r.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const r=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&r.push(e[n]);return r}}let Wz=class extends Dz{constructor(e,r={}){const n=typeof e=="object"?e:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>Mz[i]).filter(i=>!!i)),super(e,n)}};function Zz(t,e="",r){let n=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),n=W4(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+e,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}const zz=typeof ArrayBuffer=="function",Gz=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,uA=Object.prototype.toString,Hz=typeof Blob=="function"||typeof Blob<"u"&&uA.call(Blob)==="[object BlobConstructor]",jz=typeof File=="function"||typeof File<"u"&&uA.call(File)==="[object FileConstructor]";function z4(t){return zz&&(t instanceof ArrayBuffer||Gz(t))||Hz&&t instanceof Blob||jz&&t instanceof File}function Am(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(Am(t[r]))return!0;return!1}if(z4(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Am(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&Am(t[r]))return!0;return!1}function Qz(t){const e=[],r=t.data,n=t;return n.data=G4(r,e),n.attachments=e.length,{packet:n,buffers:e}}function G4(t,e){if(!t)return t;if(z4(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=G4(t[n],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=G4(t[n],e));return r}return t}function Jz(t,e){return t.data=H4(t.data,e),delete t.attachments,t}function H4(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=H4(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=H4(t[r],e));return t}const $z=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Yz=5;var At;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(At||(At={}));class Xz{constructor(e){this.replacer=e}encode(e){return(e.type===At.EVENT||e.type===At.ACK)&&Am(e)?this.encodeAsBinary({type:e.type===At.EVENT?At.BINARY_EVENT:At.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===At.BINARY_EVENT||e.type===At.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=Qz(e),n=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(n),i}}function dA(t){return Object.prototype.toString.call(t)==="[object Object]"}class j4 extends Wr{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);const n=r.type===At.BINARY_EVENT;n||r.type===At.BINARY_ACK?(r.type=n?At.EVENT:At.ACK,this.reconstructor=new Kz(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(z4(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const n={type:Number(e.charAt(0))};if(At[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===At.BINARY_EVENT||n.type===At.BINARY_ACK){const s=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const o=e.substring(s,r);if(o!=Number(o)||e.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(r+1)==="/"){const s=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););n.nsp=e.substring(s,r)}else n.nsp="/";const i=e.charAt(r+1);if(i!==""&&Number(i)==i){const s=r+1;for(;++r;){const o=e.charAt(r);if(o==null||Number(o)!=o){--r;break}if(r===e.length)break}n.id=Number(e.substring(s,r+1))}if(e.charAt(++r)){const s=this.tryParse(e.substr(r));if(j4.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case At.CONNECT:return dA(r);case At.DISCONNECT:return r===void 0;case At.CONNECT_ERROR:return typeof r=="string"||dA(r);case At.EVENT:case At.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&$z.indexOf(r[0])===-1);case At.ACK:case At.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Kz{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=Jz(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const qz=Object.freeze(Object.defineProperty({__proto__:null,Decoder:j4,Encoder:Xz,get PacketType(){return At},protocol:Yz},Symbol.toStringTag,{value:"Module"}));function $i(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const eG=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class hA extends Wr{constructor(e,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[$i(e,"open",this.onopen.bind(this)),$i(e,"packet",this.onpacket.bind(this)),$i(e,"error",this.onerror.bind(this)),$i(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...r){var n,i,s;if(eG.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const o={type:At.EVENT,data:r};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const u=this.ids++,d=r.pop();this._registerAckCallback(u,d),o.id=u}const a=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,r){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=r;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);r.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),r.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...r){return new Promise((n,i)=>{const s=(o,a)=>o?i(o):n(a);s.withError=!0,r.push(s),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>n!==this._queue[0]?void 0:(i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...s)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:At.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case At.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case At.EVENT:case At.BINARY_EVENT:this.onevent(e);break;case At.ACK:case At.BINARY_ACK:this.onack(e);break;case At.DISCONNECT:this.ondisconnect();break;case At.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:At.ACK,id:e,data:i}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:At.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,e.data)}}}function hd(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}hd.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0},hd.prototype.reset=function(){this.attempts=0},hd.prototype.setMin=function(t){this.ms=t},hd.prototype.setMax=function(t){this.max=t},hd.prototype.setJitter=function(t){this.jitter=t};class Q4 extends Wr{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,Cm(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new hd({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const i=r.parser||qz;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Wz(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=$i(r,"open",function(){n.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=$i(r,"error",s);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),r.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push($i(e,"ping",this.onping.bind(this)),$i(e,"data",this.ondata.bind(this)),$i(e,"error",this.onerror.bind(this)),$i(e,"close",this.onclose.bind(this)),$i(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){Em(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new hA(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;n<r.length;n++)this.engine.write(r[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const g0={};function Rm(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=Zz(t,e.path||"/socket.io"),n=r.source,i=r.id,s=r.path,o=g0[i]&&s in g0[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let c;return a?c=new Q4(n,e):(g0[i]||(g0[i]=new Q4(n,e)),c=g0[i]),r.query&&!e.query&&(e.query=r.queryKey),c.socket(r.path,e)}Object.assign(Rm,{Manager:Q4,Socket:hA,io:Rm,connect:Rm});const zc=new Map,tG=async t=>{const e=zc.get(t);e==null||e.disconnect(),zc.delete(t)},fA=async t=>{if(zc.has(t))return zc.get(t);const e=Rm(t,{auth:{bearer_token:ve(Fn)}});return await new Promise((r,n)=>{e.once("connect_error",i=>n(i)),e.once("connect",()=>r(e)),setTimeout(()=>n(new Error("Cannot connect to websocket server")),5e3)}),zc.set(t,e),e},rG=async t=>{(await fA(t)).on("passport_id/sign",sG)},nG=async(t,e)=>{const r=await fA(t);return new Promise((n,i)=>{r.emit("contracts/forward_transaction",{payload:{unsigned_serialized_meta_tx:e}},s=>{if(tG(t),s.error)return console.error(s.error),i(new Error("Transaction failed"));n(s.payload)})})},iG=async(t,e,r)=>{var n;try{if(!zc.has(t))throw new Error("Socket client not connected");(n=zc.get(t))==null||n.emit(r.emit_event,{headers:r.emit_event_headers,payload:{signature:e}})}catch(i){console.error(i)}},sG=async t=>{const{openUI:e}=ve(vr);e(Be.SIGN,{message:t.payload.message,socketEventDataHeaders:t.headers})},pA={connectSocketForSignatures:rG,signDataAndEmitEvent:iG},oG=async t=>{try{return(await t.getTrustedForwarder()).toLowerCase()===iz}catch(e){return console.warn("Gasless tx are not available for this contract",(e==null?void 0:e.message)||e),!1}},v0=async(t,e)=>{if(!await oG(e))return await(await ve(Dr).getSigner()).sendTransaction(t);const{credenza:r,chainId:n}=ve(tt);t.chainId=BigInt(n);const i=ir.Transaction.from(t).unsignedSerialized;return await nG(r.evmApiUrl,i)},mA=t=>{const{chainId:e}=ve(tt);return Bt[e].scanUrl+"/tx/"+t};var pt=(t=>(t.ERROR="ERROR",t.INIT="INIT",t.LOGIN="LOGIN",t.LOGOUT="LOGOUT",t.PAYMENT="PAYMENT",t.SEND_TOKENS="SEND_TOKENS",t.SEND_NFT="SEND_NFT",t.RECHECK_BALANCE="RECHECK_BALANCE",t.UPDATE_PROFILE="UPDATE_PROFILE",t.ACCOUNT_CONFIRMED="ACCOUNT_CONFIRMED",t.TRANSACTION="TRANSACTION",t.RECEIPT="RECEIPT",t.UI_CLOSED="UI_CLOSED",t.REQUEST_AIRDROP="REQUEST_AIRDROP",t.REQUEST_LOYALTY_POINTS="REQUEST_LOYALTY_POINTS",t))(pt||{});const Gc=new Map;let xa=0;function J4(t,e){const r=Gc.get(t);if(r!=null&&r.length){for(let n=r.length-1;n>=0;n--)if(r[n].id===e){r.splice(n,1),Gc.set(t,r);return}}}function $4(t,e){const r=Gc.get(t)??[];return xa=xa+1,r.push({callback:e,id:xa,once:!0}),Gc.set(t,r),()=>J4(t,xa)}function Y4(t,e){const r=Gc.get(t)??[];return xa=xa+1,r.push({callback:e,id:xa}),Gc.set(t,r),()=>J4(t,xa)}function It(t,e){const r=Gc.get(t);if(r!=null&&r.length)for(const n of r)n.callback(e),n.once&&J4(t,n.id)}var aG=Object.defineProperty,cG=(t,e,r)=>e in t?aG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dn=(t,e,r)=>cG(t,typeof e!="symbol"?e+"":e,r);let y0=class extends Error{};y0.prototype.name="InvalidTokenError";function lG(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function uG(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return lG(e)}catch{return atob(e)}}function dG(t,e){if(typeof t!="string")throw new y0("Invalid token specified: must be a string");e||(e={});const r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new y0(`Invalid token specified: missing part #${r+1}`);let i;try{i=uG(n)}catch(s){throw new y0(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new y0(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}const X4="credenza_web_sdk:";function K4(t,e){return localStorage.setItem(`${X4}${t}`,e)}function q4(t){return localStorage.getItem(`${X4}${t}`)}function gA(t){return localStorage.removeItem(`${X4}${t}`)}const vA={LOCAL:"local",STAGING:"staging",PROD:"prod"},eb="access_token",tb="refresh_token",yA="login_provider",Tm={ERROR:"ERROR",INIT:"INIT",LOGIN:"LOGIN",LOGOUT:"LOGOUT"},Hc=new Map;let Ba=0;function rb(t,e){const r=Hc.get(t);if(r!=null&&r.length){for(let n=r.length-1;n>=0;n--)if(r[n].id===e){r.splice(n,1),Hc.set(t,r);return}}}function hG(t,e){const r=Hc.get(t)??[];return Ba=Ba+1,r.push({callback:e,id:Ba,once:!0}),Hc.set(t,r),()=>rb(t,Ba)}function fG(t,e){const r=Hc.get(t)??[];return Ba=Ba+1,r.push({callback:e,id:Ba}),Hc.set(t,r),()=>rb(t,Ba)}function Nm(t,e){const r=Hc.get(t);if(r!=null&&r.length)for(const n of r)n.callback(e),n.once&&rb(t,n.id)}let w0=class{constructor(e){dn(this,"clientId"),dn(this,"env"),dn(this,"extensions",[]),dn(this,"oauth"),dn(this,"account"),dn(this,"metamask"),dn(this,"evm"),dn(this,"sui"),dn(this,"zklogin"),dn(this,"accessToken"),dn(this,"refreshToken"),dn(this,"loginProvider"),dn(this,"once",hG),dn(this,"on",fG),dn(this,"_emit",Nm),this.clientId=e.clientId,this.env=e.env||vA.PROD;for(const r of e.extensions||[])Object.assign(this,{[r.name]:r}),this.extensions.push(r.name)}async initialize(){var e;if(this.accessToken=q4(eb),this.refreshToken=q4(tb),this.loginProvider=q4(yA),this.accessToken){const r=dG(this.accessToken);(!r.exp||r.aud!==this.clientId||r.exp*1e3<new Date().getTime())&&this.logout()}for(const r of this.extensions)await((e=this[r])==null?void 0:e._initialize(this));Nm(Tm.INIT)}async _setAccessToken(e,r,n=!0){K4(yA,r),n&&K4(eb,e),this.accessToken=e,this.loginProvider=r,Nm(Tm.LOGIN)}_setRefreshToken(e){K4(tb,e),this.refreshToken=e}getRefreshToken(){return this.refreshToken}getAccessToken(){return this.accessToken}getLoginProvider(){return this.loginProvider}isLoggedIn(){return!!this.accessToken&&!!this.loginProvider}logout(){gA(eb),gA(tb),this.accessToken=null,this.refreshToken=null,this.loginProvider=null,Nm(Tm.LOGOUT)}};dn(w0,"SDK_ENV",vA),dn(w0,"SDK_EVENT",Tm);var pG=Object.defineProperty,mG=(t,e,r)=>e in t?pG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wA=(t,e,r)=>mG(t,typeof e!="symbol"?e+"":e,r);const fd={LOCAL:"local",STAGING:"staging",PROD:"prod"},nb={PROD:"https://accounts.credenza3.com",STAGING:"https://accounts.staging.credenza3.com",LOCAL:"http://localhost:8081"},ib={PROD:"https://auth.credenza3.com",STAGING:"https://auth.staging.credenza3.com",LOCAL:"https://auth.staging.credenza3.com"};function sb(t){switch(t.env){case fd.LOCAL:return nb.LOCAL;case fd.STAGING:return nb.STAGING;case fd.PROD:return nb.PROD;default:throw new Error("Invalid sdk env")}}function gG(t){switch(t.env){case fd.LOCAL:return ib.LOCAL;case fd.STAGING:return ib.STAGING;case fd.PROD:return ib.PROD;default:throw new Error("Invalid sdk env")}}const bA="credenza_web_sdk:";function ob(t,e){return localStorage.setItem(`${bA}${t}`,e)}function pd(t){return localStorage.getItem(`${bA}${t}`)}const vG={OAUTH:"oauth"};let b0=class extends Error{};b0.prototype.name="InvalidTokenError";function yG(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function wG(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return yG(e)}catch{return atob(e)}}function bG(t,e){if(typeof t!="string")throw new b0("Invalid token specified: must be a string");e||(e={});const r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new b0(`Invalid token specified: missing part #${r+1}`);let i;try{i=wG(n)}catch(s){throw new b0(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new b0(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}const kA="oauth:nonce",ab="oauth:state",xm="oauth:client_server_uri";function cb(t=64){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=new Uint8Array(t);return crypto.getRandomValues(r),Array.from(r,n=>e[n%e.length]).join("")}const _A="credenza_web_sdk:";function kG(t,e){return sessionStorage.setItem(`${_A}${t}`,e)}function _G(t){return sessionStorage.getItem(`${_A}${t}`)}const EA="oauth:client_code_verifier";async function EG(t,e,r){if(e.searchParams.append("response_type",r.responseType||"token"),r.responseType==="code"){const n=cb();kG(EA,n);const{codeChallenge:i,codeChallengeMethod:s}=await t.oauth.buildS256CodeChallenge(n);e.searchParams.append("code_challenge",i),e.searchParams.append("code_challenge_method",s)}}async function CA(t,e,r=!1){const n=r?sb:gG,i=new URL(n(t)+"/oauth2/authorize"+(r?"/jwt":""));return i.searchParams.append("client_id",t.clientId),i.searchParams.append("scope",e.scope),i.searchParams.append("nonce",e.nonce||cb(32)),i.searchParams.append("state",e.state||cb(32)),i.searchParams.append("credenza_session_length_seconds",String(e.sessionLengthSeconds??60*60)),await EG(t,i,e),i}function SA(t,e){t.searchParams.append("redirect_uri",e.redirectUrl)}function CG(t,e){e.clientServerUri&&t.searchParams.append("client_server_uri",e.clientServerUri)}function SG(t,e){e.forceEmail?t.searchParams.append("force_email",e.forceEmail):e.forcePhone&&t.searchParams.append("force_phone",e.forcePhone)}async function AG(t){try{const e=await fetch(`${sb(t)}/oauth2/revoke-session`,{method:"DELETE",headers:{Authorization:`Bearer ${t.getAccessToken()}`}});if(!e.ok)throw new Error(e.statusText)}catch(e){throw new Error(`Error revoking session: ${e.message}`)}}async function RG(t,e){try{const r=await fetch(e.clientServerUri.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e.code,client_id:t.clientId,grant_type:"authorization_code",code_verifier:_G(EA)})});if(!r.ok)throw new Error(r.statusText);return await r.json()}catch(r){throw new Error(`Code exchange failed: ${r.message}`)}}async function TG(t,e){try{const r=await fetch(e.clientServerUri.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e.refreshToken,client_id:t.clientId,grant_type:"refresh_token"})});if(!r.ok)throw new Error(r.statusText);return await r.json()}catch(r){throw new Error(`Code refresh failed: ${r.message}`)}}async function NG(t,e){try{const r=await CA(t,e,!0);SA(r,{redirectUrl:"none"});const n=await fetch(r.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({validator_id:e.validatorId,..."idToken"in e?{id_token:e.idToken}:{},..."accessToken"in e?{access_token:e.accessToken}:{}})});if(!n.ok)throw new Error(n.statusText);return await n.json()}catch(r){throw new Error(`Jwt login failed: ${r.message}`)}}const k0=t=>Array.isArray(t)?t.map(e=>k0(e)):typeof t=="function"||t!==Object(t)?t:Object.fromEntries(Object.entries(t).map(([e,r])=>[e.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,"")),k0(r)]));let xG=class{constructor(){wA(this,"name","oauth"),wA(this,"sdk")}async _initialize(e){this.sdk=e,await this._handleRedirectResult(),!this.sdk.getAccessToken()&&this.sdk.getRefreshToken()&&await this.refreshAccessToken()}async revokeSession(){if(!this.sdk.isLoggedIn())throw new Error("Revoke failed: User is not logged in");return await AG(this.sdk)}revokeBrowserSessionWithRedirect(e){const r=new URL(sb(this.sdk)+"/oauth2/logout");return r.searchParams.append("redirect_uri",e),window.location.href=r.toString()}login(e){return console.warn('login is deprecated and will be removed soon. Use "loginWithRedirect" instead.'),this.loginWithRedirect(e)}async loginWithRedirect(e){const r=await CA(this.sdk,e);SA(r,e),SG(r,e),CG(r,e),ob(kA,r.searchParams.get("nonce")),ob(ab,r.searchParams.get("state")),r.searchParams.has("client_server_uri")&&ob(xm,r.searchParams.get("client_server_uri")),window.location.href=r.toString()}async loginWithJwt(e){const r=await NG(this.sdk,e);return r.access_token&&await this.setAccessToken(r.access_token),k0(r)}async checkAndHandleHashRedirectResult(){const e=window.location.hash;if(!e)return!1;const r=e.replace("#","").split("&").reduce((s,o)=>{const[a,c]=o.split("=");return s[a]=c,s},{}),n=pd(ab);if(r.state!==n)throw new Error("Invalid state");if(!r.access_token)throw new Error("Invalid access token");const i=bG(r.access_token);if(pd(kA)!==i.nonce)throw new Error("Invalid nonce");return await this.setAccessToken(r.access_token),history&&window.location.hash?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash="",!0}async checkAndHandleSearchRedirectResult(){const e=new URLSearchParams(window.location.search);if(!e.has("state")||!e.has("code"))return;const r=pd(ab),n=pd(xm);if(e.get("state")!==r)throw new Error("Invalid state");if(!n)throw new Error("Invalid client server uri");if(!e.has("code"))throw new Error("Invalid code");await this._exchangeCodeForToken(e.get("code")),history&&window.location.search&&(e.delete("code"),e.delete("state"),history.replaceState(null,document.title,window.location.pathname+e.toString()))}async refreshAccessToken(){const e=this.sdk.getRefreshToken();if(!e)throw new Error("Invalid refresh token");const r=pd(xm);if(!r)throw new Error("Invalid client server uri");const n=await TG(this.sdk,{clientServerUri:r,refreshToken:e});return n.access_token&&await this.setAccessToken(n.access_token),n.refresh_token&&this.setRefreshToken(n.refresh_token),k0(n)}async _exchangeCodeForToken(e){const r=pd(xm);if(!r)throw new Error("Invalid client server uri");const n=await RG(this.sdk,{code:e,clientServerUri:r});return n.access_token&&await this.setAccessToken(n.access_token,!1),n.refresh_token&&this.setRefreshToken(n.refresh_token),k0(n)}async _handleRedirectResult(){await this.checkAndHandleHashRedirectResult()||await this.checkAndHandleSearchRedirectResult()}async buildS256CodeChallenge(e){const r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return{codeChallenge:btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(n)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),codeChallengeMethod:"S256"}}async setAccessToken(e,r=!0){await this.sdk._setAccessToken(e,vG.OAUTH,r)}setRefreshToken(e){this.sdk._setRefreshToken(e)}};var BG=Object.defineProperty,IG=(t,e,r)=>e in t?BG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AA=(t,e,r)=>IG(t,typeof e!="symbol"?e+"":e,r);const lb={LOCAL:"local",STAGING:"staging",PROD:"prod"},ub={PROD:"https://accounts.credenza3.com",STAGING:"https://accounts.staging.credenza3.com",LOCAL:"http://localhost:8081"};function _0(t){switch(t.env){case lb.LOCAL:return ub.LOCAL;case lb.STAGING:return ub.STAGING;case lb.PROD:return ub.PROD;default:throw new Error("Invalid sdk env")}}let OG=class{constructor(){AA(this,"name","account"),AA(this,"sdk")}async _initialize(e){this.sdk=e}async _updateAccountContact(e){const r=`${_0(this.sdk)}/accounts/me/change-contact`,n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sdk.getAccessToken()}`},body:JSON.stringify({..."email"in e?{email:e.email.trim()}:{},..."phone"in e?{phone:e.phone.trim()}:{},..."code"in e?{code:e.code.trim()}:{}})});if(!n.ok)throw new Error(`Request failed: ${n.statusText}`);return await n.json()}async changeEmail(e){return await this._updateAccountContact({email:e})}async changePhone(e){return await this._updateAccountContact({phone:e})}async verifyCode(e){return await this._updateAccountContact({code:e})}async pendingVerificationContacts(){const e=`${_0(this.sdk)}/accounts/me/change-contact`,r=await fetch(e,{headers:{Authorization:`Bearer ${this.sdk.getAccessToken()}`}});if(!r.ok)throw new Error(`Request failed: ${r.statusText}`);return await r.json()}async info(){const e=`${_0(this.sdk)}/oauth2/userinfo`,r=await fetch(e,{headers:{Authorization:`Bearer ${this.sdk.getAccessToken()}`}});if(!r.ok)throw new Error(`Cannot get userInfo: ${r.statusText}`);return await r.json()}async updateProfile(e){if(!e.name&&!e.picture)throw new Error("Nothing to update");const r=`${_0(this.sdk)}/accounts/me`,n=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sdk.getAccessToken()}`},body:JSON.stringify({...e.name?{name:e.name.trim()}:{},...e.picture?{image:e.picture.trim()}:{}})});if(!n.ok)throw new Error(`Cannot update user: ${n.statusText}`);return await n.json()}async changePassword(e){if(!e.oldPassword||!e.newPassword)throw new Error("Invalid parameters");if(e.newPassword!==e.confirmPassword)throw new Error("Passwords do not match");const r=`${_0(this.sdk)}/accounts/me/password`,n=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sdk.getAccessToken()}`},body:JSON.stringify({old_password:e.oldPassword.trim(),new_password:e.newPassword.trim(),confirm_password:e.confirmPassword.trim()})});if(!n.ok)throw new Error(`Cannot change password: ${n.statusText}`);return await n.json()}},pr;const UG=async(t,e,r=Oc.MAINNET)=>pr?void 0:(pr=new w0({env:r===Oc.MAINNET?w0.SDK_ENV.PROD:w0.SDK_ENV.STAGING,clientId:t,extensions:[...e,new xG,new OG]}),pr.initialize()),Ia=t=>`0x${Number(t).toString(16)}`,MG={chainId:Ia(Ae.POLYGON_AMOY),rpcUrl:Bt[Ae.POLYGON_AMOY].rpcUrl,displayName:Bt[Ae.POLYGON_AMOY].name,blockExplorer:Bt[Ae.POLYGON_AMOY].scanUrl,nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18}},PG={chainId:Ia(Ae.POLYGON),rpcUrl:Bt[Ae.POLYGON].rpcUrl,displayName:Bt[Ae.POLYGON].name,blockExplorer:Bt[Ae.POLYGON].scanUrl,nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18}},VG={chainId:Ia(Ae.CHILIZ_SPICY),rpcUrl:Bt[Ae.CHILIZ_SPICY].rpcUrl,displayName:Bt[Ae.CHILIZ_SPICY].name,blockExplorer:Bt[Ae.CHILIZ_SPICY].scanUrl,nativeCurrency:{name:"CHZ",symbol:"CHZ",decimals:18}},FG={chainId:Ia(Ae.CHILIZ),rpcUrl:Bt[Ae.CHILIZ].rpcUrl,displayName:Bt[Ae.CHILIZ].name,blockExplorer:Bt[Ae.CHILIZ].scanUrl,nativeCurrency:{name:"CHZ",symbol:"CHZ",decimals:18}},LG={chainId:Ia(Ae.AVALANCHE_FUJI),rpcUrl:Bt[Ae.AVALANCHE_FUJI].rpcUrl,displayName:Bt[Ae.AVALANCHE_FUJI].name,blockExplorer:Bt[Ae.AVALANCHE_FUJI].scanUrl,nativeCurrency:{name:"AVAX",symbol:"AVAX",decimals:18}},DG={chainId:Ia(Ae.AVALANCHE),rpcUrl:Bt[Ae.AVALANCHE].rpcUrl,displayName:Bt[Ae.AVALANCHE].name,blockExplorer:Bt[Ae.AVALANCHE].scanUrl,nativeCurrency:{name:"AVAX",symbol:"AVAX",decimals:18}},WG={chainId:Ia(Ae.BASE),rpcUrl:Bt[Ae.BASE].rpcUrl,displayName:Bt[Ae.BASE].name,blockExplorer:Bt[Ae.BASE].scanUrl,nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},ZG={chainId:Ia(Ae.BASE_SEPOLIA),rpcUrl:Bt[Ae.BASE_SEPOLIA].rpcUrl,displayName:Bt[Ae.BASE_SEPOLIA].name,blockExplorer:Bt[Ae.BASE_SEPOLIA].scanUrl,nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},RA=t=>{switch(t){case Ae.POLYGON_AMOY:return MG;case Ae.CHILIZ_SPICY:return VG;case Ae.CHILIZ:return FG;case Ae.POLYGON:return PG;case Ae.AVALANCHE_FUJI:return LG;case Ae.AVALANCHE:return DG;case Ae.BASE_SEPOLIA:return ZG;case Ae.BASE:return WG;default:throw new Error("Unsupported Chain Id: "+t)}};function zG(){return ve(Dr)}async function Zr(){return await ve(az)??null}async function GG({chainId:t}){if(this.networkType!==JS(t))throw new Error(`Passport is initialized in '${this.networkType}' environment.`);const e=RA(t);await pr.evm.switchChain(e),Dr.set(await pr.evm.getEthersProvider()),this.configurePassport({chainId:t,config:this.config,clientId:this.config.clientId})}async function TA(){const{address:t,decimals:e}=ve(dd).erc20Cred;if(!t||!e)throw new Error("not available for this chainId");const r=ve(Dr),{erc20MinAbi:n}=await Promise.resolve().then(()=>Pa);return{contract:new ir.Contract(t,n,r),decimals:e,address:t}}async function HG(t,e=ve(dd).membership.address){try{if(!e)throw new Error("Membership is not available for this chainId");const r=ve(Dr),{membershipMinAbi:n}=await Promise.resolve().then(()=>Pa),i=new ir.Contract(e,n,r),s=await i.confirmMembership(t);if(!s)return{isMember:s,meta:{}};const o=await i.getMembershipMetadata(t);return{isMember:s,meta:o&&JSON.parse(o)}}catch{return{isMember:!1,meta:{}}}}async function jG({contractAddress:t,tokenId:e,amount:r,targetAddress:n}){try{const i=ve(Dr),s=new ir.Contract(t,oz,i),o=await s["requestToken(uint256,uint256,address)"].populateTransaction(e||0,r||1,n),a=await v0(o,s);It(pt.REQUEST_AIRDROP,a),It(pt.RECHECK_BALANCE);const{chainId:c,clientId:l}=ve(tt);un.track("cp_airdrop",{chain:c,clientId:l,contract:t,tokenId:e,to:n,amount:r})}catch(i){throw It(pt.ERROR,{error:{message:i.statusText,title:"Air drop failed",code:i.status}}),i}}async function QG({contract:t,recipient:e,tokenId:r,amount:n}){const i=await t["safeTransferFrom(address,address,uint256,uint256,bytes)"].populateTransaction(await Zr(),e,r,n,ir.ZeroHash),s=await v0(i,t),{clientId:o,chainId:a}=ve(tt),c={chain:a,clientId:o,contract:await(t==null?void 0:t.getAddress())??null,tokenId:r,from:await Zr(),to:e,amount:n};return It(pt.SEND_NFT,{...s,...c}),un.track("cp_transfer_nft",c),s}async function JG({address:t,amount:e,instance:r}){try{const n=ve(dd).erc20Cred.decimals,i=await ve(Dr).getSigner(),s=r?await v0(await r.transfer.populateTransaction(t,e),r):await i.sendTransaction({to:t,value:e}),{chainId:o,clientId:a}=ve(tt);return It(pt.SEND_TOKENS,s),un.track("cp_transfer_tokens",{chain:o,clientId:a,contract:await(r==null?void 0:r.getAddress())??null,from:await Zr(),to:t,amount:ir.formatUnits(e,n)}),s}catch(n){throw It(pt.ERROR,{error:n}),n}}const $G=async()=>{try{const{contract:t}=await TA();return await t.balanceOf(await Zr())}catch(t){throw It(pt.ERROR,{error:t}),t}},YG=async t=>{const r=await(await pr.evm.getEthersProvider()).getSigner(),{erc1155MinAbi:n}=await Promise.resolve().then(()=>Pa);for(const i of t){if(i.directive.type!=="erc1155")continue;const s=i.directive.value.token_id,o=i.directive.resource_id,c=await new ir.Contract(o,n,r).uri(s.toString()),u=await(await fetch(c)).json();i.metadata=u}};async function XG(t,e){const n=await(await pr.evm.getEthersProvider()).getSigner(),{erc1155MinAbi:i}=await Promise.resolve().then(()=>Pa),o=await new ir.Contract(t,i,n).uri(Number(e)),a=await fetch(o);if(!a.ok)throw new Error(`Failed to fetch metadata: ${a.status} ${a.statusText}`);return await a.json()}const KG=t=>["contractAddress","amount","title"].every(r=>Object.prototype.hasOwnProperty.call(t,r))&&(t.tokenId||t.typeId),NA=({title:t,typeId:e,amount:r,tokenId:n,contractAddress:i,progressVideos:s})=>{bt.set({subtitle:t,...e?{memberships:[{contractAddress:i,typeId:e}]}:{},...n?{tokens:[{contractAddress:i,tokenId:n,amount:r}]}:{},loaderText:QS,progressVideos:s}),Mt.set(Be.PAYMENT)},qG=({userAddress:t,amount:e})=>{bt.set({to:t,amount:e}),Mt.set(Be.SEND_TOKENS)},eH=async t=>{const e=ve(tt).chainId;if(t.chainId!==e)throw new Error("Chain ID mismatch. Expected: "+e+", got: "+t.chainId);const r=await XG(t.contractAddress,String(t.tokenId));let n=r.image||"";const{requestAirDrop:i}=ve(Gk);try{bt.set({loaderText:`AirDropping Token: ${r.name}`||"...",progressVideos:t.progressVideos}),Mt.set(Be.LOADER);const s=await Zr();await i({...t,targetAddress:s}),await B4(),bt.set({subtitle:`Your account has a new token: ${r.name}`,receipt:!1,tokenImage:n}),Mt.set(Be.PAYMENT_RESULT)}catch(s){bt.set({errorMessage:s.statusText}),Mt.set(Be.ERROR)}},tH=async({eventId:t,contractAddress:e})=>{const{requestLoyaltyPoints:r}=ve(vr);try{bt.set({loaderText:"Issuing Loyalty points..",progressVideos:[]}),Mt.set(Be.LOADER),r&&await r(t,e),bt.set({subtitle:"The request for loyalty points was successful!",description:"",receipt:!1}),Mt.set(Be.PAYMENT_RESULT)}catch(n){bt.set({description:n.message,title:"The request failed"}),Mt.set(Be.ERROR)}};async function rH(t={}){var e;try{if(!Object.keys(t).length)return;const r=[];t.name&&r.push(pr.account.updateProfile({name:t.name})),t.email&&r.push(pr.account.changeEmail(t.email)),t.phone&&r.push(pr.account.changePhone(t.phone));const n=await Promise.all(r);for(const s of n)if((e=s.errors)!=null&&e.length)throw new Error(s.errors[0].error);const i=await Bm();return bn.set(i),It(pt.UPDATE_PROFILE,i),i}catch(r){throw It(pt.ERROR,{error:r}),r}}async function nH(t){try{const e=[];t.phoneCode&&e.push(pr.account.verifyCode(t.phoneCode)),t.emailCode&&e.push(pr.account.verifyCode(t.emailCode)),await Promise.all(e);const r=await Bm();return bn.set(r),It(pt.ACCOUNT_CONFIRMED,{...r!=null&&r.name?{name:r.name}:{},...r!=null&&r.email?{email:r.email}:{},...r!=null&&r.phone?{phone:r.phone}:{}}),r}catch(e){throw It(pt.ERROR,{error:e}),e}}const iH=async()=>(await pr.account.pendingVerificationContacts()).reduce((e,r)=>(r.phone&&(e.phone=r.phone),r.email&&(e.email=r.email),e),{}),Bm=async()=>({...await pr.account.info(),pending:{...await iH()}}),sH=async({address:t,tokenType:e})=>{const r=ve(Fn);if(!r)throw new Error("Passport access token doesn't exist.");const n=ve(tt),i=await fetch(n.credenza.apiUrl+`/users/${e}/${n.chainId}/${t}`,{headers:{Authorization:`Bearer ${r}`}});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return await i.json()},oH=async()=>{const{chainId:t,credenza:e}=ve(tt),r=ve(Fn);if(!r)throw new Error("Passport access token doesn't exist.");const n=await fetch(e.apiUrl+`/auth/gitbookToken/${t}`,{headers:{Authorization:`Bearer ${r}`}});if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return(await n.json()).gitbookToken},aH=t=>{const e=localStorage.getItem(Mc.QR_CODE);if(e)try{const{date:r,sig:n}=JSON.parse(e);if(ir.verifyMessage(r,n).toLowerCase()!==t.toLowerCase())throw new Error("Address mismatch")}catch{localStorage.removeItem(Mc.QR_CODE)}},cH=async()=>{try{Du.set(!0);const t=ve(tt),e=await pr.evm.getEthersProvider();Dr.set(e);const r=await(await e.getSigner()).getAddress(),n=pr.getAccessToken();Fn.set(n),aH(r);const i=await Bm();bn.set(i),wi.set(!0),Du.set(!1),un.identify(i.sub),un.people.set({$email:i.email,$phone:i.phone,$name:i.name,chain:t.chainId,clientId:t.clientId,provider:e,address:r,location:window.location.href}),un.track("cp_init",{$email:i.email,$phone:i.phone,chain:t.chainId,provider:e,address:r,location:window.location.href,clientId:t.clientId})}catch(t){localStorage.removeItem(Mc.ACCESS_TOKEN),wi.set(!1),Du.set(!1),bn.set(null),Fn.set(null),console.error("Cannot init credenza user",t)}},lH=(t,e)=>{const r=Object.fromEntries(new URLSearchParams(location.search));if(KG(r)){if(!t)return void e();NA({title:r.title,typeId:+r.typeId,amount:+r.amount,tokenId:r.tokenId,contractAddress:r.contractAddress}),e(),nz()}},xA=async t=>{if(!ve(Fn))throw new Error("Passport access token doesn't exist.");const r=ve(tt),n=await fetch(`${r.credenza.evmApiUrl}/accounts/${t}/assigned-address`,{method:"get",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ve(Fn)}`}}),i=await n.json();if(!n.ok)throw new Error(i.error);return i};var uH=Object.defineProperty,dH=(t,e,r)=>e in t?uH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jc=(t,e,r)=>dH(t,typeof e!="symbol"?e+"":e,r);function hn(){}const md=t=>t;function Im(t,e){for(const r in e)t[r]=e[r];return t}function BA(t){return t()}function IA(){return Object.create(null)}function Eo(t){t.forEach(BA)}function E0(t){return typeof t=="function"}function db(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function hH(t){return Object.keys(t).length===0}function fH(t,...e){if(t==null){for(const n of e)n(void 0);return hn}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function OA(t,e,r){t.$$.on_destroy.push(fH(e,r))}function UA(t){return t??""}function MA(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const PA=typeof window<"u";let Om=PA?()=>window.performance.now():()=>Date.now(),hb=PA?t=>requestAnimationFrame(t):hn;const gd=new Set;function VA(t){gd.forEach(e=>{e.c(t)||(gd.delete(e),e.f())}),gd.size!==0&&hb(VA)}function Um(t){let e;return gd.size===0&&hb(VA),{promise:new Promise(r=>{gd.add(e={c:t,f:r})}),abort(){gd.delete(e)}}}function vd(t,e){t.appendChild(e)}function FA(t,e,r){const n=fb(t);if(!n.getElementById(e)){const i=So("style");i.id=e,i.textContent=r,LA(n,i)}}function fb(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function pH(t){const e=So("style");return e.textContent="/* empty */",LA(fb(t),e),e.sheet}function LA(t,e){return vd(t.head||t,e),e.sheet}function Qc(t,e,r){t.insertBefore(e,r||null)}function Co(t){t.parentNode&&t.parentNode.removeChild(t)}function So(t){return document.createElement(t)}function mH(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function DA(t){return document.createTextNode(t)}function pb(){return DA(" ")}function WA(){return DA("")}function Mm(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function Si(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}function gH(t){return Array.from(t.childNodes)}function Pm(t,e,r){t.classList.toggle(e,!!r)}function vH(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}class yH{constructor(e=!1){jc(this,"is_svg",!1),jc(this,"e"),jc(this,"n"),jc(this,"t"),jc(this,"a"),this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,r,n=null){this.e||(this.is_svg?this.e=mH(r.nodeName):this.e=So(r.nodeType===11?"TEMPLATE":r.nodeName),this.t=r.tagName!=="TEMPLATE"?r:r.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let r=0;r<this.n.length;r+=1)Qc(this.t,this.n[r],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Co)}}function ZA(t,e){return new t(e)}const Vm=new Map;let Fm=0;function wH(t){let e=5381,r=t.length;for(;r--;)e=(e<<5)-e^t.charCodeAt(r);return e>>>0}function bH(t,e){const r={stylesheet:pH(e),rules:{}};return Vm.set(t,r),r}function mb(t,e,r,n,i,s,o,a=0){const c=16.666/n;let l=`{
69
+ `);var e="",r,n,i=0,s;for(r=n=0,i=t.length,s=0;s<i;s++){var o=t.charCodeAt(s),a=null;o<128?n++:o>127&&o<2048?a=String.fromCharCode(o>>6|192,o&63|128):a=String.fromCharCode(o>>12|224,o>>6&63|128,o&63|128),a!==null&&(n>r&&(e+=t.substring(r,n)),e+=a,r=n=s+1)}return n>r&&(e+=t.substring(r,t.length)),e},R.UUID=function(){try{return Pe.crypto.randomUUID()}catch{for(var t=new Array(36),e=0;e<36;e++)t[e]=Math.floor(Math.random()*16);return t[14]=4,t[19]=t[19]&=-5,t[19]=t[19]|=8,t[8]=t[13]=t[18]=t[23]="-",R.map(t,function(n){return n.toString(16)}).join("")}};var KC=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];R.isBlockedUA=function(t){var e;for(t=t.toLowerCase(),e=0;e<KC.length;e++)if(t.indexOf(KC[e])!==-1)return!0;return!1},R.HTTPBuildQuery=function(t,e){var r,n,i=[];return R.isUndefined(e)&&(e="&"),R.each(t,function(s,o){r=encodeURIComponent(s.toString()),n=encodeURIComponent(o),i[i.length]=n+"="+r}),i.join(e)},R.getQueryParam=function(t,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r="[\\?&]"+e+"=([^&#]*)",n=new RegExp(r),i=n.exec(t);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var s=i[1];try{s=decodeURIComponent(s)}catch{Gt.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},R.cookie={get:function(t){for(var e=t+"=",r=zt.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}return null},parse:function(t){var e;try{e=R.JSONDecode(R.cookie.get(t))||{}}catch{}return e},set_seconds:function(t,e,r,n,i,s,o){var a="",c="",l="";if(o)a="; domain="+o;else if(n){var u=tS(zt.location.hostname);a=u?"; domain=."+u:""}if(r){var d=new Date;d.setTime(d.getTime()+r*1e3),c="; expires="+d.toGMTString()}s&&(i=!0,l="; SameSite=None"),i&&(l+="; secure"),zt.cookie=t+"="+encodeURIComponent(e)+c+"; path=/"+a+l},set:function(t,e,r,n,i,s,o){var a="",c="",l="";if(o)a="; domain="+o;else if(n){var u=tS(zt.location.hostname);a=u?"; domain=."+u:""}if(r){var d=new Date;d.setTime(d.getTime()+r*24*60*60*1e3),c="; expires="+d.toGMTString()}s&&(i=!0,l="; SameSite=None"),i&&(l+="; secure");var h=t+"="+encodeURIComponent(e)+c+"; path=/"+a+l;return zt.cookie=h,h},remove:function(t,e,r){R.cookie.set(t,"",-1,e,!1,!1,r)}};var qC=function(t){var e=!0;try{var r="__mplss_"+r4(8),n="xyz";t.setItem(r,n),t.getItem(r)!==n&&(e=!1),t.removeItem(r)}catch{e=!1}return e},e4=null,l0=function(t,e){return e4!==null&&!e?e4:e4=qC(t||Pe.localStorage)},t4=null,oZ=function(t,e){return t4!==null&&!e?t4:t4=qC(t||Pe.sessionStorage)};function eS(t,e,r){var n=function(i){Gt.error(e+" error: "+i)};return{is_supported:function(i){var s=r(t,i);return s||Gt.error(e+" unsupported"),s},error:n,get:function(i){try{return t.getItem(i)}catch(s){n(s)}return null},parse:function(i){try{return R.JSONDecode(t.getItem(i))||{}}catch{}return null},set:function(i,s){try{t.setItem(i,s)}catch(o){n(o)}},remove:function(i){try{t.removeItem(i)}catch(s){n(s)}}}}R.localStorage=eS(Pe.localStorage,"localStorage",l0),R.sessionStorage=eS(Pe.sessionStorage,"sessionStorage",oZ),R.register_event=function(){var t=function(n,i,s,o,a){if(!n){Gt.error("No valid element provided to register_event");return}if(n.addEventListener&&!o)n.addEventListener(i,s,!!a);else{var c="on"+i,l=n[c];n[c]=e(n,s,l)}};function e(n,i,s){var o=function(a){if(a=a||r(Pe.event),!!a){var c=!0,l,u;return R.isFunction(s)&&(l=s(a)),u=i.call(n,a),(l===!1||u===!1)&&(c=!1),c}};return o}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},t}();var aZ=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');R.dom_query=function(){function t(i){return i.all?i.all:i.getElementsByTagName("*")}var e=/[\t\r\n]/g;function r(i,s){var o=" "+s+" ";return(" "+i.className+" ").replace(e," ").indexOf(o)>=0}function n(i){if(!zt.getElementsByTagName)return[];var s=i.split(" "),o,a,c,l,u,d,h,f,p,v,m=[zt];for(d=0;d<s.length;d++){if(o=s[d].replace(/^\s+/,"").replace(/\s+$/,""),o.indexOf("#")>-1){a=o.split("#"),c=a[0];var w=a[1],_=zt.getElementById(w);if(!_||c&&_.nodeName.toLowerCase()!=c)return[];m=[_];continue}if(o.indexOf(".")>-1){a=o.split("."),c=a[0];var S=a[1];for(c||(c="*"),l=[],u=0,h=0;h<m.length;h++)for(c=="*"?p=t(m[h]):p=m[h].getElementsByTagName(c),f=0;f<p.length;f++)l[u++]=p[f];for(m=[],v=0,h=0;h<l.length;h++)l[h].className&&R.isString(l[h].className)&&r(l[h],S)&&(m[v++]=l[h]);continue}var T=o.match(aZ);if(T){c=T[1];var x=T[2],O=T[3],U=T[4];for(c||(c="*"),l=[],u=0,h=0;h<m.length;h++)for(c=="*"?p=t(m[h]):p=m[h].getElementsByTagName(c),f=0;f<p.length;f++)l[u++]=p[f];m=[],v=0;var I;switch(O){case"=":I=function(Z){return Z.getAttribute(x)==U};break;case"~":I=function(Z){return Z.getAttribute(x).match(new RegExp("\\b"+U+"\\b"))};break;case"|":I=function(Z){return Z.getAttribute(x).match(new RegExp("^"+U+"-?"))};break;case"^":I=function(Z){return Z.getAttribute(x).indexOf(U)===0};break;case"$":I=function(Z){return Z.getAttribute(x).lastIndexOf(U)==Z.getAttribute(x).length-U.length};break;case"*":I=function(Z){return Z.getAttribute(x).indexOf(U)>-1};break;default:I=function(Z){return Z.getAttribute(x)}}for(m=[],v=0,h=0;h<l.length;h++)I(l[h])&&(m[v++]=l[h]);continue}for(c=o,l=[],u=0,h=0;h<m.length;h++)for(p=m[h].getElementsByTagName(c),f=0;f<p.length;f++)l[u++]=p[f];m=l}return m}return function(i){return R.isElement(i)?[i]:R.isObject(i)&&!R.isUndefined(i.length)?i:n.call(this,i)}}();var cZ=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],lZ=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];R.info={campaignParams:function(t){var e="",r={};return R.each(cZ,function(n){e=R.getQueryParam(zt.URL,n),e.length?r[n]=e:t!==void 0&&(r[n]=t)}),r},clickParams:function(){var t="",e={};return R.each(lZ,function(r){t=R.getQueryParam(zt.URL,r),t.length&&(e[r]=t)}),e},marketingParams:function(){return R.extend(R.info.campaignParams(),R.info.clickParams())},searchEngine:function(t){return t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(t){var e=R.info.searchEngine(t),r=e!="yahoo"?"q":"p",n={};if(e!==null){n.$search_engine=e;var i=R.getQueryParam(t,r);i.length&&(n.mp_keyword=i)}return n},browser:function(t,e,r){return e=e||"",r||R.includes(t," OPR/")?R.includes(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":R.includes(t,"IEMobile")||R.includes(t,"WPDesktop")?"Internet Explorer Mobile":R.includes(t,"SamsungBrowser/")?"Samsung Internet":R.includes(t,"Edge")||R.includes(t,"Edg/")?"Microsoft Edge":R.includes(t,"FBIOS")?"Facebook Mobile":R.includes(t,"Whale/")?"Whale Browser":R.includes(t,"Chrome")?"Chrome":R.includes(t,"CriOS")?"Chrome iOS":R.includes(t,"UCWEB")||R.includes(t,"UCBrowser")?"UC Browser":R.includes(t,"FxiOS")?"Firefox iOS":R.includes(e,"Apple")?R.includes(t,"Mobile")?"Mobile Safari":"Safari":R.includes(t,"Android")?"Android Mobile":R.includes(t,"Konqueror")?"Konqueror":R.includes(t,"Firefox")?"Firefox":R.includes(t,"MSIE")||R.includes(t,"Trident/")?"Internet Explorer":R.includes(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,r){var n=R.info.browser(t,e,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/},s=i[n];if(s===void 0)return null;var o=t.match(s);return o?parseFloat(o[o.length-2]):null},os:function(){var t=wo;return/Windows/i.test(t)?/Phone/.test(t)||/WPDesktop/.test(t)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(t)?"iOS":/Android/.test(t)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Mac/i.test(t)?"Mac OS X":/Linux/.test(t)?"Linux":/CrOS/.test(t)?"Chrome OS":""},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)?"Android":""},referringDomain:function(t){var e=t.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return Pe.location.href},properties:function(t){return typeof t!="object"&&(t={}),R.extend(R.strip_empty_properties({$os:R.info.os(),$browser:R.info.browser(wo,Ca.vendor,dm),$referrer:zt.referrer,$referring_domain:R.info.referringDomain(zt.referrer),$device:R.info.device(wo)}),{$current_url:R.info.currentUrl(),$browser_version:R.info.browserVersion(wo,Ca.vendor,dm),$screen_height:QC.height,$screen_width:QC.width,mp_lib:"web",$lib_version:Qi.LIB_VERSION,$insert_id:r4(),time:R.timestamp()/1e3},R.strip_empty_properties(t))},people_properties:function(){return R.extend(R.strip_empty_properties({$os:R.info.os(),$browser:R.info.browser(wo,Ca.vendor,dm)}),{$browser_version:R.info.browserVersion(wo,Ca.vendor,dm)})},mpPageViewProperties:function(){return R.strip_empty_properties({current_page_title:zt.title,current_domain:Pe.location.hostname,current_url_path:Pe.location.pathname,current_url_protocol:Pe.location.protocol,current_url_search:Pe.location.search})}};var uZ=function(t,e){var r=null,n=[];return function(i){var s=this;return n.push(i),r||(r=new Yt(function(o){setTimeout(function(){var a=t.apply(s,[n]);r=null,n=[],o(a)},e)})),r}},r4=function(t){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return t?e.substring(0,t):e},dZ=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,hZ=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,tS=function(t){var e=hZ,r=t.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(e=dZ);var i=t.match(e);return i?i[0]:""},fZ=function(){var t=Pe.navigator.onLine;return R.isUndefined(t)||t},Sa=function(){},rd=null,hm=null;typeof JSON<"u"&&(rd=JSON.stringify,hm=JSON.parse),rd=rd||R.JSONEncode,hm=hm||R.JSONDecode,R.info=R.info,R.info.browser=R.info.browser,R.info.browserVersion=R.info.browserVersion,R.info.device=R.info.device,R.info.properties=R.info.properties,R.isBlockedUA=R.isBlockedUA,R.isEmptyObject=R.isEmptyObject,R.isObject=R.isObject,R.JSONDecode=R.JSONDecode,R.JSONEncode=R.JSONEncode,R.toArray=R.toArray,R.NPO=_a;var pZ="mixpanelBrowserDb",rS="mixpanelRecordingEvents",n4="mixpanelRecordingRegistry",mZ=1,gZ=[rS,n4],Es=function(t){this.dbPromise=null,this.storeName=t};Es.prototype._openDb=function(){return new Yt(function(t,e){var r=Pe.indexedDB.open(pZ,mZ);r.onerror=function(){e(r.error)},r.onsuccess=function(){t(r.result)},r.onupgradeneeded=function(n){var i=n.target.result;gZ.forEach(function(s){i.createObjectStore(s)})}})},Es.prototype.init=function(){return Pe.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(t){return t instanceof Pe.IDBDatabase?Yt.resolve():Yt.reject(t)})):Yt.reject("indexedDB is not supported in this browser")},Es.prototype.makeTransaction=function(t,e){var r=this.storeName,n=function(i){return new Yt(function(s,o){var a=i.transaction(r,t);a.oncomplete=function(){s(a)},a.onabort=a.onerror=function(){o(a.error)},e(a.objectStore(r))})};return this.dbPromise.then(n).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(n)):Yt.reject(i)}).bind(this))},Es.prototype.setItem=function(t,e){return this.makeTransaction("readwrite",function(r){r.put(e,t)})},Es.prototype.getItem=function(t){var e;return this.makeTransaction("readonly",function(r){e=r.get(t)}).then(function(){return e.result})},Es.prototype.removeItem=function(t){return this.makeTransaction("readwrite",function(e){e.delete(t)})},Es.prototype.getAll=function(){var t;return this.makeTransaction("readonly",function(e){t=e.getAll()}).then(function(){return t.result})};var vZ="__mp_opt_in_out_";function yZ(t,e){sS(!0,t,e)}function wZ(t,e){sS(!1,t,e)}function bZ(t,e){return iS(t,e)==="1"}function nS(t,e){if(_Z(e))return Gt.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=iS(t,e)==="0";return r&&Gt.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Aa(t){return o4(t,function(e){return this.get_config(e)})}function Ra(t){return o4(t,function(e){return this._get_config(e)})}function nd(t){return o4(t,function(e){return this._get_config(e)})}function kZ(t,e){e=e||{},i4(e).remove(s4(t,e),!!e.crossSubdomainCookie,e.cookieDomain)}function i4(t){return t=t||{},t.persistenceType==="localStorage"?R.localStorage:R.cookie}function s4(t,e){return e=e||{},(e.persistencePrefix||vZ)+t}function iS(t,e){return i4(e).get(s4(t,e))}function _Z(t){if(t&&t.ignoreDnt)return!1;var e=t&&t.window||Pe,r=e.navigator||{},n=!1;return R.each([r.doNotTrack,r.msDoNotTrack,e.doNotTrack],function(i){R.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function sS(t,e,r){if(!R.isString(e)||!e.length){Gt.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token");return}r=r||{},i4(r).set(s4(e,r),t?1:0,R.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&t&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})}function o4(t,e){return function(){var r=!1;try{var n=e.call(this,"token"),i=e.call(this,"ignore_dnt"),s=e.call(this,"opt_out_tracking_persistence_type"),o=e.call(this,"opt_out_tracking_cookie_prefix"),a=e.call(this,"window");n&&(r=nS(n,{ignoreDnt:i,persistenceType:s,persistencePrefix:o,window:a}))}catch(l){Gt.error("Unexpected error when checking tracking opt-out status: "+l)}if(!r)return t.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var EZ=Dc("lock"),oS=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||Pe.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3,this.promiseImpl=e.promiseImpl||Yt};oS.prototype.withLock=function(t,e){var r=this.promiseImpl;return new r(R.bind(function(n,i){var s=e||new Date().getTime()+"|"+Math.random(),o=new Date().getTime(),a=this.storageKey,c=this.pollIntervalMS,l=this.timeoutMS,u=this.storage,d=a+":X",h=a+":Y",f=a+":Z",p=function(S){if(new Date().getTime()-o>l){EZ.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+s+"]"),u.removeItem(f),u.removeItem(h),w();return}setTimeout(function(){try{S()}catch(T){i(T)}},c*(Math.random()+.1))},v=function(S,T){S()?T():p(function(){v(S,T)})},m=function(){var S=u.getItem(h);return S&&S!==s?!1:(u.setItem(h,s),u.getItem(h)===s?!0:(l0(u,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},w=function(){u.setItem(d,s),v(m,function(){if(u.getItem(d)===s){_();return}p(function(){if(u.getItem(h)!==s){w();return}v(function(){return!u.getItem(f)},_)})})},_=function(){u.setItem(f,"1");var S=function(){u.removeItem(f),u.getItem(h)===s&&u.removeItem(h),u.getItem(d)===s&&u.removeItem(d)};t().then(function(T){S(),n(T)}).catch(function(T){S(),i(T)})};try{if(l0(u,!0))w();else throw new Error("localStorage support check failed")}catch(S){i(S)}},this))};var u0=function(t){this.storage=t||Pe.localStorage};u0.prototype.init=function(){return Yt.resolve()},u0.prototype.setItem=function(t,e){return new Yt(R.bind(function(r,n){try{this.storage.setItem(t,rd(e))}catch(i){n(i)}r()},this))},u0.prototype.getItem=function(t){return new Yt(R.bind(function(e,r){var n;try{n=hm(this.storage.getItem(t))}catch(i){r(i)}e(n)},this))},u0.prototype.removeItem=function(t){return new Yt(R.bind(function(e,r){try{this.storage.removeItem(t)}catch(n){r(n)}e()},this))};var aS=Dc("batch"),Cs=function(t,e){e=e||{},this.storageKey=t,this.usePersistence=e.usePersistence,this.usePersistence&&(this.queueStorage=e.queueStorage||new u0,this.lock=new oS(t,{storage:e.sharedLockStorage||Pe.localStorage,timeoutMS:e.sharedLockTimeoutMS})),this.reportError=e.errorReporter||R.bind(aS.error,aS),this.pid=e.pid||null,this.memQueue=[],this.initialized=!1,e.enqueueThrottleMs?this.enqueuePersisted=uZ(R.bind(this._enqueuePersisted,this),e.enqueueThrottleMs):this.enqueuePersisted=R.bind(function(r){return this._enqueuePersisted([r])},this)};Cs.prototype.ensureInit=function(){return this.initialized?Yt.resolve():this.queueStorage.init().then(R.bind(function(){this.initialized=!0},this)).catch(R.bind(function(t){this.reportError("Error initializing queue persistence. Disabling persistence",t),this.initialized=!0,this.usePersistence=!1},this))},Cs.prototype.enqueue=function(t,e){var r={id:r4(),flushAfter:new Date().getTime()+e*2,payload:t};return this.usePersistence?this.enqueuePersisted(r):(this.memQueue.push(r),Yt.resolve(!0))},Cs.prototype._enqueuePersisted=function(t){var e=R.bind(function(){return this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(r){return this.saveToStorage(r.concat(t))},this)).then(R.bind(function(r){return r&&(this.memQueue=this.memQueue.concat(t)),r},this)).catch(R.bind(function(r){return this.reportError("Error enqueueing items",r,t),!1},this))},this);return this.lock.withLock(e,this.pid).catch(R.bind(function(r){return this.reportError("Error acquiring storage lock",r),!1},this))},Cs.prototype.fillBatch=function(t){var e=this.memQueue.slice(0,t);return this.usePersistence&&e.length<t?this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(r){if(r.length){var n={};R.each(e,function(o){n[o.id]=!0});for(var i=0;i<r.length;i++){var s=r[i];if(new Date().getTime()>s.flushAfter&&!n[s.id]&&(s.orphaned=!0,e.push(s),e.length>=t))break}}return e},this)):Yt.resolve(e)};var cS=function(t,e){var r=[];return R.each(t,function(n){n.id&&!e[n.id]&&r.push(n)}),r};Cs.prototype.removeItemsByID=function(t){var e={};if(R.each(t,function(n){e[n]=!0}),this.memQueue=cS(this.memQueue,e),this.usePersistence){var r=R.bind(function(){return this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(n){return n=cS(n,e),this.saveToStorage(n)},this)).then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(n){for(var i=0;i<n.length;i++){var s=n[i];if(s.id&&e[s.id])throw new Error("Item not removed from storage")}return!0},this)).catch(R.bind(function(n){return this.reportError("Error removing items",n,t),!1},this))},this);return this.lock.withLock(r,this.pid).catch(R.bind(function(n){return this.reportError("Error acquiring storage lock",n),l0(this.lock.storage,!0)?!1:r().then(R.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(R.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return Yt.resolve(!0)};var lS=function(t,e){var r=[];return R.each(t,function(n){var i=n.id;if(i in e){var s=e[i];s!==null&&(n.payload=s,r.push(n))}else r.push(n)}),r};Cs.prototype.updatePayloads=function(t){return this.memQueue=lS(this.memQueue,t),this.usePersistence?this.lock.withLock(R.bind(function(){return this.ensureInit().then(R.bind(function(){return this.readFromStorage()},this)).then(R.bind(function(r){return r=lS(r,t),this.saveToStorage(r)},this)).catch(R.bind(function(r){return this.reportError("Error updating items",t,r),!1},this))},this),this.pid).catch(R.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):Yt.resolve(!0)},Cs.prototype.readFromStorage=function(){return this.ensureInit().then(R.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(R.bind(function(t){return t&&(R.isArray(t)||(this.reportError("Invalid storage entry:",t),t=null)),t||[]},this)).catch(R.bind(function(t){return this.reportError("Error retrieving queue",t),[]},this))},Cs.prototype.saveToStorage=function(t){return this.ensureInit().then(R.bind(function(){return this.queueStorage.setItem(this.storageKey,t)},this)).then(function(){return!0}).catch(R.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},Cs.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(R.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):Yt.resolve()};var CZ=10*60*1e3,d0=Dc("batch"),_i=function(t,e){this.errorReporter=e.errorReporter,this.queue=new Cs(t,{errorReporter:R.bind(this.reportError,this),queueStorage:e.queueStorage,sharedLockStorage:e.sharedLockStorage,sharedLockTimeoutMS:e.sharedLockTimeoutMS,usePersistence:e.usePersistence,enqueueThrottleMs:e.enqueueThrottleMs}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1,this._flushPromise=null};_i.prototype.enqueue=function(t){return this.queue.enqueue(t,this.flushInterval)},_i.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},_i.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},_i.prototype.clear=function(){return this.queue.clear()},_i.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},_i.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},_i.prototype.scheduleFlush=function(t){this.flushInterval=t,this.stopped||(this.timeoutID=setTimeout(R.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},_i.prototype.sendRequestPromise=function(t,e){return new Yt(R.bind(function(r){this.sendRequest(t,e,r)},this))},_i.prototype.flush=function(t){if(this.requestInProgress)return d0.log("Flush: Request already in progress"),Yt.resolve();this.requestInProgress=!0,t=t||{};var e=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize;return this.queue.fillBatch(n).then(R.bind(function(i){var s=i.length===n,o=[],a={};if(R.each(i,function(d){var h=d.payload;if(this.beforeSendHook&&!d.orphaned&&(h=this.beforeSendHook(h)),h){h.event&&h.properties&&(h.properties=R.extend({},h.properties,{mp_sent_by_lib_version:Qi.LIB_VERSION}));var f=!0,p=d.id;p?(this.itemIdsSentSuccessfully[p]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:d,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[p]}),f=!1):this.reportError("[dupe] found item with no ID",{item:d}),f&&o.push(h)}a[d.id]=h},this),o.length<1)return this.requestInProgress=!1,this.resetFlush(),Yt.resolve();var c=R.bind(function(){return this.queue.removeItemsByID(R.map(i,function(d){return d.id})).then(R.bind(function(d){return R.each(i,R.bind(function(h){var f=h.id;f?(this.itemIdsSentSuccessfully[f]=this.itemIdsSentSuccessfully[f]||0,this.itemIdsSentSuccessfully[f]++,this.itemIdsSentSuccessfully[f]>5&&this.reportError("[dupe] item ID sent too many times",{item:h,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[f]})):this.reportError("[dupe] found item with no ID while removing",{item:h})},this)),d?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!s?(this.resetFlush(),Yt.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),Yt.resolve())},this))},this),l=R.bind(function(d){this.requestInProgress=!1;try{if(t.unloading)return this.queue.updatePayloads(a);if(R.isObject(d)&&d.error==="timeout"&&new Date().getTime()-r>=e)return this.reportError("Network timeout; retrying"),this.flush();if(R.isObject(d)&&(d.httpStatusCode>=500||d.httpStatusCode===429||d.httpStatusCode<=0&&!fZ()||d.error==="timeout")){var h=this.flushInterval*2;return d.retryAfter&&(h=parseInt(d.retryAfter,10)*1e3||h),h=Math.min(CZ,h),this.reportError("Error; retry in "+h+" ms"),this.scheduleFlush(h),Yt.resolve()}else if(R.isObject(d)&&d.httpStatusCode===413)if(i.length>1){var f=Math.max(1,Math.floor(n/2));return this.batchSize=Math.min(this.batchSize,f,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),Yt.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),c();else return c()}catch(p){this.reportError("Error handling API response",p),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};return t.unloading&&(u.transport="sendBeacon"),d0.log("MIXPANEL REQUEST:",o),this.sendRequestPromise(o,u).then(l)},this)).catch(R.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},_i.prototype.reportError=function(t,e){if(d0.error.apply(d0.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(t)),this.errorReporter(t,e)}catch(r){d0.error(r)}};var a4=function(t){var e=Date.now();return!t||e>t.maxExpires||e>t.idleExpires},SZ=250,id=Dc("recorder"),uS=Pe.CompressionStream,AZ={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},RZ=new Set([ot.MouseMove,ot.MouseInteraction,ot.Scroll,ot.ViewportResize,ot.Input,ot.TouchMove,ot.MediaInteraction,ot.Drag,ot.Selection]);function TZ(t){return t.type===St.IncrementalSnapshot&&RZ.has(t.data.source)}var cn=function(t){this._mixpanel=t.mixpanelInstance,this._onIdleTimeout=t.onIdleTimeout||Sa,this._onMaxLengthReached=t.onMaxLengthReached||Sa,this._onBatchSent=t.onBatchSent||Sa,this._rrwebRecord=t.rrwebRecord||null,this._stopRecording=null,this.replayId=t.replayId,this.batchStartUrl=t.batchStartUrl||null,this.replayStartUrl=t.replayStartUrl||null,this.idleExpires=t.idleExpires||null,this.maxExpires=t.maxExpires||null,this.replayStartTime=t.replayStartTime||null,this.seqNo=t.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=a0,this.recordMinMs=0;var e=l0(t.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new Es(rS),this.batcher=new _i(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:AZ,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:t.sharedLockStorage,usePersistence:e,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:SZ,sharedLockTimeoutMS:10*1e3})};cn.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var t={distinct_id:String(this._mixpanel.get_distinct_id())},e=this._mixpanel.get_property("$device_id");e&&(t.$device_id=e);var r=this._mixpanel.get_property("$user_id");return r&&(t.$user_id=r),t},cn.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},cn.prototype.getConfig=function(t){return this._mixpanel.get_config(t)},cn.prototype.get_config=function(t){return this.getConfig(t)},cn.prototype.startRecording=function(t){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){id.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>a0&&(this.recordMaxMs=a0,id.critical("record_max_ms cannot be greater than "+a0+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>$w&&(this.recordMinMs=$w,id.critical("record_min_ms cannot be greater than "+$w+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=R.info.currentUrl(),this.replayStartUrl=R.info.currentUrl()),t||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);e();var r=this.getConfig("record_block_selector");(r===""||r===null)&&(r=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}TZ(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var n=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),n)},cn.prototype.stopRecording=function(t){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(r){this.reportError("Error with rrweb stopRecording",r)}this._stopRecording=null}var e;return this.batcher.stopped?e=this.batcher.clear():t||(e=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),e},cn.prototype.isRrwebStopped=function(){return this._stopRecording===null},cn.prototype.flushEventsWithOptOut=function(t,e,r){var n=(function(i){i===0&&(this.stopRecording(),r({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(t,e,r,n)},cn.prototype.serialize=function(){var t;try{t=this._mixpanel.get_tab_id()}catch(e){this.reportError("Error getting tab ID for serialization ",e),t=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:t}},cn.deserialize=function(t,e){var r=new cn(R.extend({},e,{replayId:t.replayId,batchStartUrl:t.batchStartUrl,replayStartUrl:t.replayStartUrl,idleExpires:t.idleExpires,maxExpires:t.maxExpires,replayStartTime:t.replayStartTime,seqNo:t.seqNo,sharedLockStorage:e.sharedLockStorage}));return r},cn.prototype._sendRequest=function(t,e,r,n){var i=(function(o,a){o.status===200&&this.replayId===t&&(this.seqNo++,this.batchStartUrl=R.info.currentUrl()),this._onBatchSent(),n({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})}).bind(this),s=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");Pe.fetch(s+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:r}).then(function(o){o.json().then(function(a){i(o,a)}).catch(function(a){n({error:a})})}).catch(function(o){n({error:o,httpStatusCode:0})})},cn.prototype._flushEvents=Aa(function(t,e,r){var n=t.length;if(n>0){for(var i=this.replayId,s=1/0,o=-1/0,a=!1,c=0;c<n;c++)s=Math.min(s,t[c].timestamp),o=Math.max(o,t[c].timestamp),t[c].type===St.FullSnapshot&&(a=!0);if(this.seqNo===0){if(!a){r({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=s}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=s);var l=o-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:Qi.LIB_VERSION,batch_start_time:s/1e3,mp_lib:"web",replay_id:i,replay_length_ms:l,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},d=JSON.stringify(t);if(Object.assign(u,this.getUserIdInfo()),uS){var h=new Blob([d],{type:"application/json"}).stream(),f=h.pipeThrough(new uS("gzip"));new Response(f).blob().then((function(p){u.format="gzip",this._sendRequest(i,u,p,r)}).bind(this))}else u.format="body",this._sendRequest(i,u,d,r)}}),cn.prototype.reportError=function(t,e){id.error.apply(id.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.getConfig("error_reporter")(t,e)}catch(r){id.error(r)}};var sd=function(t){this.idb=new Es(n4),this.errorReporter=t.errorReporter,this.mixpanelInstance=t.mixpanelInstance,this.sharedLockStorage=t.sharedLockStorage};sd.prototype.handleError=function(t){this.errorReporter("IndexedDB error: ",t)},sd.prototype.setActiveRecording=function(t){var e=t.tabId;return e?this.idb.init().then((function(){return this.idb.setItem(e,t)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),Yt.resolve())},sd.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(t){return a4(t)?null:t}).bind(this)).catch(this.handleError.bind(this))},sd.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(t){if(t)return t.maxExpires=0,this.setActiveRecording(t)}).bind(this)).catch(this.handleError.bind(this))},sd.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(t){var e=t.filter(function(r){return a4(r)}).map((function(r){var n=cn.deserialize(r,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return n.unloadPersistedData().then((function(){return this.idb.removeItem(r.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return Yt.all(e)}).bind(this)).catch(this.handleError.bind(this))};var h0=Dc("recorder"),bo=function(t,e,r){this.mixpanelInstance=t,this.rrwebRecord=e||ba,this.sharedLockStorage=r,this.recordingRegistry=new sd({mixpanelInstance:this.mixpanelInstance,errorReporter:h0.error,sharedLockStorage:r}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};bo.prototype.startRecording=function(t){if(t=t||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){h0.log("Recording already in progress, skipping startRecording.");return}var e=(function(){h0.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),r=(function(){h0.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),n=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:n,onIdleTimeout:e,onMaxLengthReached:r,replayId:R.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return t.activeSerializedRecording?this.activeRecording=cn.deserialize(t.activeSerializedRecording,i):this.activeRecording=new cn(i),this.activeRecording.startRecording(t.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},bo.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then((function(){return this.recordingRegistry.clearActiveRecording()}).bind(this)).then((function(){this.stopRecordingInProgress=!1}).bind(this))},bo.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},bo.prototype._stopCurrentRecording=function(t,e){if(this.activeRecording){var r=this.activeRecording.stopRecording(t);return e&&(this.activeRecording=null),r}return Yt.resolve()},bo.prototype.resumeRecording=function(t){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),Yt.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(e){return e&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:e}):t?this.startRecording({shouldStopBatcher:!1}):(h0.log("No resumable recording found."),null)}).bind(this))},bo.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},bo.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(bo.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),Pe.__mp_recorder=bo;var fm="change",f0="click",dS="hashchange",od="mp_locationchange",hS="popstate",fS="scrollend",c4="submit",NZ=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],pS=["mp-include"],l4=["mp-no-track"],mS=l4.concat(["mp-sensitive"]),xZ=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],Dn=Dc("autocapture");function u4(t){for(var e={},r=gS(t).split(" "),n=0;n<r.length;n++){var i=r[n];i&&(e[i]=!0)}return e}function gS(t){switch(typeof t.className){case"string":return t.className;case"object":return t.className.baseVal||t.getAttribute("class")||"";default:return""}}function BZ(t){if(t.previousElementSibling)return t.previousElementSibling;do t=t.previousSibling;while(t&&!wS(t));return t}function vS(t,e,r,n,i,s){var o={$classes:gS(t).split(" "),$tag_name:t.tagName.toLowerCase()},a=t.id;a&&(o.$id=a),f4(t,e,i,s)&&R.each(xZ.concat(n),function(d){if(t.hasAttribute(d)&&!r[d]){var h=t.getAttribute(d);pm(h)&&(o["$attr-"+d]=h)}});for(var c=1,l=1,u=t;u=BZ(u);)c++,u.tagName===t.tagName&&l++;return o.$nth_child=c,o.$nth_of_type=l,o}function IZ(t,e){var r=e.allowElementCallback,n=e.allowSelectors||[],i=e.blockAttrs||[],s=e.blockElementCallback,o=e.blockSelectors||[],a=e.captureTextContent||!1,c=e.captureExtraAttrs||[],l=e.capturedForHeatMap||!1,u={};R.each(i,function(x){u[x]=!0});var d=null,h=typeof t.target>"u"?t.srcElement:t.target;if(bS(h)&&(h=h.parentNode),MZ(h,t)&&d4(h,t,r,n)&&!h4(h,t,s,o)){for(var f=[h],p=h;p.parentNode&&!Ss(p,"body");)f.push(p.parentNode),p=p.parentNode;var v=[],m,w=!1;if(R.each(f,function(x){var O=f4(x,t,r,n);!u.href&&x.tagName.toLowerCase()==="a"&&(m=x.getAttribute("href"),m=O&&pm(m)&&m),h4(x,t,s,o)&&(w=!0),v.push(vS(x,t,u,c,r,n))},this),!w){var _=zt.documentElement;if(d={$event_type:t.type,$host:Pe.location.host,$pathname:Pe.location.pathname,$elements:v,$el_attr__href:m,$viewportHeight:Math.max(_.clientHeight,Pe.innerHeight||0),$viewportWidth:Math.max(_.clientWidth,Pe.innerWidth||0),$pageHeight:zt.body.offsetHeight||0,$pageWidth:zt.body.offsetWidth||0},R.each(c,function(x){if(!u[x]&&h.hasAttribute(x)){var O=h.getAttribute(x);pm(O)&&(d["$el_attr__"+x]=O)}}),a&&(S=yS(h,t,r,n),S&&S.length&&(d.$el_text=S)),t.type===f0&&(R.each(NZ,function(x){x in t&&(d["$"+x]=t[x])}),l&&(d.$captured_for_heatmap=!0),h=OZ(t)),a){var S=yS(h,t,r,n);S&&S.length&&(d.$el_text=S)}if(h){if(!d4(h,t,r,n)||h4(h,t,s,o))return null;var T=vS(h,t,u,c,r,n);d.$target=T,d.$el_classes=T.$classes,R.extend(d,R.strip_empty_properties({$el_id:T.$id,$el_tag_name:T.$tag_name}))}}}return d}function yS(t,e,r,n){var i="";return f4(t,e,r,n)&&t.childNodes&&t.childNodes.length&&R.each(t.childNodes,function(s){bS(s)&&s.textContent&&(i+=R.trim(s.textContent).split(/(\s+)/).filter(pm).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),R.trim(i)}function OZ(t){for(var e=t.target,r=t.composedPath(),n=0;n<r.length;n++){var i=r[n];if(Ss(i,"a")||Ss(i,"button")||Ss(i,"input")||Ss(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){e=i;break}if(i===e)break}return e}function d4(t,e,r,n){if(r)try{if(!r(t,e))return!1}catch(o){return Dn.critical("Error while checking element in allowElementCallback",o),!1}if(!n.length)return!0;for(var i=0;i<n.length;i++){var s=n[i];try{if(t.matches(s))return!0}catch(o){Dn.critical("Error while checking selector: "+s,o)}}return!1}function h4(t,e,r,n){var i;if(r)try{if(r(t,e))return!0}catch(a){return Dn.critical("Error while checking element in blockElementCallback",a),!0}if(n&&n.length)for(i=0;i<n.length;i++){var s=n[i];try{if(t.matches(s))return!0}catch(a){Dn.critical("Error while checking selector: "+s,a)}}var o=u4(t);for(i=0;i<l4.length;i++)if(o[l4[i]])return!0;return!1}function wS(t){return t&&t.nodeType===1}function Ss(t,e){return t&&t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function bS(t){return t&&t.nodeType===3}function UZ(){try{var t=zt.createElement("div");return!!t.matches}catch{return!1}}function MZ(t,e){if(!t||Ss(t,"html")||!wS(t))return!1;var r=t.tagName.toLowerCase();switch(r){case"form":return e.type===c4;case"input":return["button","submit"].indexOf(t.getAttribute("type"))===-1?e.type===fm:e.type===f0;case"select":case"textarea":return e.type===fm;default:return e.type===f0}}function f4(t,e,r,n){var i;if(!d4(t,e,r,n))return!1;for(var s=t;s.parentNode&&!Ss(s,"body");s=s.parentNode){var o=u4(s);for(i=0;i<mS.length;i++)if(o[mS[i]])return!1}var a=u4(t);for(i=0;i<pS.length;i++)if(a[pS[i]])return!0;if(Ss(t,"input")||Ss(t,"select")||Ss(t,"textarea")||t.getAttribute("contenteditable")==="true")return!1;var c=t.type||"";if(typeof c=="string")switch(c.toLowerCase()){case"hidden":return!1;case"password":return!1}var l=t.name||t.id||"";if(typeof l=="string"){var u=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(u.test(l.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function pm(t){if(t===null||R.isUndefined(t))return!1;if(typeof t=="string"){t=R.trim(t);var e=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(e.test((t||"").replace(/[- ]/g,"")))return!1;var r=/(^\d{3}-?\d{2}-?\d{4}$)/;if(r.test(t))return!1}return!0}var kS="autocapture",PZ="track_pageview",_S="full-url",VZ="url-with-path-and-query-string",FZ="url-with-path",LZ="allow_element_callback",ES="allow_selectors",CS="allow_url_regexes",SS="block_attrs",AS="block_element_callback",RS="block_selectors",TS="block_url_regexes",NS="capture_extra_attrs",xS="capture_text_content",BS="scroll_capture_all",IS="scroll_depth_percent_checkpoints",mm="click",p4="input",OS="pageview",m4="scroll",g4="submit",ln={};ln[ES]=[],ln[CS]=[],ln[SS]=[],ln[AS]=null,ln[RS]=[],ln[TS]=[],ln[NS]=[],ln[xS]=!1,ln[BS]=!1,ln[IS]=[25,50,75,100],ln[mm]=!0,ln[p4]=!0,ln[OS]=_S,ln[m4]=!0,ln[g4]=!0;var gm={$mp_autocapture:!0},US="$mp_click",DZ="$mp_input_change",WZ="$mp_scroll",ZZ="$mp_submit",ni=function(t){this.mp=t};ni.prototype.init=function(){if(!UZ()){Dn.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking()},ni.prototype.getFullConfig=function(){var t=this.mp.get_config(kS);return t?R.isObject(t)?R.extend({},ln,t):ln:{}},ni.prototype.getConfig=function(t){return this.getFullConfig()[t]},ni.prototype.currentUrlBlocked=function(){var t,e=R.info.currentUrl(),r=this.getConfig(CS)||[];if(r.length){var n=!1;for(t=0;t<r.length;t++){var i=r[t];try{if(e.match(i)){n=!0;break}}catch(o){return Dn.critical("Error while checking block URL regex: "+i,o),!0}}if(!n)return!0}var s=this.getConfig(TS)||[];if(!s||!s.length)return!1;for(t=0;t<s.length;t++)try{if(e.match(s[t]))return!0}catch(o){return Dn.critical("Error while checking block URL regex: "+s[t],o),!0}return!1},ni.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(kS)?this.getConfig(OS):this.mp.get_config(PZ)},ni.prototype.trackDomEvent=function(t,e){if(!this.currentUrlBlocked()){var r=IZ(t,{allowElementCallback:this.getConfig(LZ),allowSelectors:this.getConfig(ES),blockAttrs:this.getConfig(SS),blockElementCallback:this.getConfig(AS),blockSelectors:this.getConfig(RS),captureExtraAttrs:this.getConfig(NS),captureTextContent:this.getConfig(xS),capturedForHeatMap:e===US&&!this.getConfig(mm)&&this.mp.is_recording_heatmap_data()});r&&(R.extend(r,gm),this.mp.track(e,r))}},ni.prototype.initClickTracking=function(){Pe.removeEventListener(f0,this.listenerClick),!(!this.getConfig(mm)&&!this.mp.get_config("record_heatmap_data"))&&(Dn.log("Initializing click tracking"),this.listenerClick=Pe.addEventListener(f0,(function(t){!this.getConfig(mm)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(t,US)}).bind(this)))},ni.prototype.initInputTracking=function(){Pe.removeEventListener(fm,this.listenerChange),this.getConfig(p4)&&(Dn.log("Initializing input tracking"),this.listenerChange=Pe.addEventListener(fm,(function(t){this.getConfig(p4)&&this.trackDomEvent(t,DZ)}).bind(this)))},ni.prototype.initPageviewTracking=function(){if(Pe.removeEventListener(hS,this.listenerPopstate),Pe.removeEventListener(dS,this.listenerHashchange),Pe.removeEventListener(od,this.listenerLocationchange),!!this.pageviewTrackingConfig()){Dn.log("Initializing pageview tracking");var t="",e=!1;this.currentUrlBlocked()||(e=this.mp.track_pageview(gm)),e&&(t=R.info.currentUrl()),this.listenerPopstate=Pe.addEventListener(hS,function(){Pe.dispatchEvent(new Event(od))}),this.listenerHashchange=Pe.addEventListener(dS,function(){Pe.dispatchEvent(new Event(od))});var r=Pe.history.pushState;typeof r=="function"&&(Pe.history.pushState=function(i,s,o){r.call(Pe.history,i,s,o),Pe.dispatchEvent(new Event(od))});var n=Pe.history.replaceState;typeof n=="function"&&(Pe.history.replaceState=function(i,s,o){n.call(Pe.history,i,s,o),Pe.dispatchEvent(new Event(od))}),this.listenerLocationchange=Pe.addEventListener(od,qw((function(){if(!this.currentUrlBlocked()){var i=R.info.currentUrl(),s=!1,o=i.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0],a=this.pageviewTrackingConfig();if(a===_S?s=i!==t:a===VZ?s=i.split("#")[0]!==t.split("#")[0]:a===FZ&&(s=o),s){var c=this.mp.track_pageview(gm);c&&(t=i),o&&(this.lastScrollCheckpoint=0,Dn.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},ni.prototype.initScrollTracking=function(){Pe.removeEventListener(fS,this.listenerScroll),this.getConfig(m4)&&(Dn.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=Pe.addEventListener(fS,qw((function(){if(this.getConfig(m4)&&!this.currentUrlBlocked()){var t=this.getConfig(BS),e=(this.getConfig(IS)||[]).slice().sort(function(c,l){return c-l}),r=Pe.scrollY,n=R.extend({$scroll_top:r},gm);try{var i=zt.body.scrollHeight,s=Math.round(r/(i-Pe.innerHeight)*100);if(n.$scroll_height=i,n.$scroll_percentage=s,s>this.lastScrollCheckpoint)for(var o=0;o<e.length;o++){var a=e[o];s>=a&&this.lastScrollCheckpoint<a&&(n.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,t=!0)}}catch(c){Dn.critical("Error while calculating scroll percentage",c)}t&&this.mp.track(WZ,n)}}).bind(this))))},ni.prototype.initSubmitTracking=function(){Pe.removeEventListener(c4,this.listenerSubmit),this.getConfig(g4)&&(Dn.log("Initializing submit tracking"),this.listenerSubmit=Pe.addEventListener(c4,(function(t){this.getConfig(g4)&&this.trackDomEvent(t,ZZ)}).bind(this)))},XC(ni);var zZ=Pe.fetch,Wn=Dc("flags"),MS="flags",PS="context",v4={};v4[PS]={};var Vt=function(t){this.getFullApiRoute=t.getFullApiRoute,this.getMpConfig=t.getConfigFunc,this.getMpProperty=t.getPropertyFunc,this.track=t.trackingFunc};Vt.prototype.init=function(){if(!GZ()){Wn.critical("Feature Flags unavailable: missing minimum required APIs");return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set},Vt.prototype.getFullConfig=function(){var t=this.getMpConfig(MS);return t?R.isObject(t)?R.extend({},v4,t):v4:{}},Vt.prototype.getConfig=function(t){return this.getFullConfig()[t]},Vt.prototype.isSystemEnabled=function(){return!!this.getMpConfig(MS)},Vt.prototype.areFlagsReady=function(){return this.isSystemEnabled()||Wn.error("Feature Flags not enabled"),!!this.flags},Vt.prototype.fetchFlags=function(){if(this.isSystemEnabled()){var t=this.getMpProperty("distinct_id"),e=this.getMpProperty("$device_id");Wn.log("Fetching flags for distinct ID: "+t);var r={context:R.extend({distinct_id:t,device_id:e},this.getConfig(PS))};this._fetchInProgressStartTime=Date.now(),this.fetchPromise=Pe.fetch(this.getFullApiRoute(),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),"Content-Type":"application/octet-stream"},body:JSON.stringify(r)}).then((function(n){return this.markFetchComplete(),n.json().then((function(i){var s=i.flags;if(!s)throw new Error("No flags in API response");var o=new Map;R.each(s,function(a,c){o.set(c,{key:a.variant_key,value:a.variant_value})}),this.flags=o}).bind(this)).catch((function(i){this.markFetchComplete(),Wn.error(i)}).bind(this))}).bind(this)).catch((function(n){this.markFetchComplete(),Wn.error(n)}).bind(this))}},Vt.prototype.markFetchComplete=function(){if(!this._fetchInProgressStartTime){Wn.error("Fetch in progress started time not set, cannot mark fetch complete");return}this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null},Vt.prototype.getVariant=function(t,e){return this.fetchPromise?this.fetchPromise.then((function(){return this.getVariantSync(t,e)}).bind(this)).catch(function(r){return Wn.error(r),e}):new Promise(function(r){Wn.critical("Feature Flags not initialized"),r(e)})},Vt.prototype.getVariantSync=function(t,e){if(!this.areFlagsReady())return Wn.log("Flags not loaded yet"),e;var r=this.flags.get(t);return r?(this.trackFeatureCheck(t,r),r):(Wn.log('No flag found: "'+t+'"'),e)},Vt.prototype.getVariantValue=function(t,e){return this.getVariant(t,{value:e}).then(function(r){return r.value}).catch(function(r){return Wn.error(r),e})},Vt.prototype.getFeatureData=function(t,e){return Wn.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(t,e)},Vt.prototype.getVariantValueSync=function(t,e){return this.getVariantSync(t,{value:e}).value},Vt.prototype.isEnabled=function(t,e){return this.getVariantValue(t).then((function(){return this.isEnabledSync(t,e)}).bind(this)).catch(function(r){return Wn.error(r),e})},Vt.prototype.isEnabledSync=function(t,e){e=e||!1;var r=this.getVariantValueSync(t,e);return r!==!0&&r!==!1&&(Wn.error('Feature flag "'+t+'" value: '+r+" is not a boolean; returning fallback value: "+e),r=e),r},Vt.prototype.trackFeatureCheck=function(t,e){this.trackedFeatures.has(t)||(this.trackedFeatures.add(t),this.track("$experiment_started",{"Experiment name":t,"Variant name":e.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency}))};function GZ(){return!!zZ&&typeof Promise<"u"&&typeof Map<"u"&&typeof Set<"u"}XC(Vt),Vt.prototype.are_flags_ready=Vt.prototype.areFlagsReady,Vt.prototype.get_variant=Vt.prototype.getVariant,Vt.prototype.get_variant_sync=Vt.prototype.getVariantSync,Vt.prototype.get_variant_value=Vt.prototype.getVariantValue,Vt.prototype.get_variant_value_sync=Vt.prototype.getVariantValueSync,Vt.prototype.is_enabled=Vt.prototype.isEnabled,Vt.prototype.is_enabled_sync=Vt.prototype.isEnabledSync,Vt.prototype.get_feature_data=Vt.prototype.getFeatureData;var ko=function(){};ko.prototype.create_properties=function(){},ko.prototype.event_handler=function(){},ko.prototype.after_track_handler=function(){},ko.prototype.init=function(t){return this.mp=t,this},ko.prototype.track=function(t,e,r,n){var i=this,s=R.dom_query(t);if(s.length===0){Gt.error("The DOM query ("+t+") returned 0 elements");return}return R.each(s,function(o){R.register_event(o,this.override_event,function(a){var c={},l=i.create_properties(r,this),u=i.mp.get_config("track_links_timeout");i.event_handler(a,this,c),window.setTimeout(i.track_callback(n,l,c,!0),u),i.mp.track(e,l,i.track_callback(n,l,c))})},this),!0},ko.prototype.track_callback=function(t,e,r,n){n=n||!1;var i=this;return function(){r.callback_fired||(r.callback_fired=!0,!(t&&t(n,e)===!1)&&i.after_track_handler(e,r,n))}},ko.prototype.create_properties=function(t,e){var r;return typeof t=="function"?r=t(e):r=R.extend({},t),r};var ad=function(){this.override_event="click"};R.inherit(ad,ko),ad.prototype.create_properties=function(t,e){var r=ad.superclass.create_properties.apply(this,arguments);return e.href&&(r.url=e.href),r},ad.prototype.event_handler=function(t,e,r){r.new_tab=t.which===2||t.metaKey||t.ctrlKey||e.target==="_blank",r.href=e.href,r.new_tab||t.preventDefault()},ad.prototype.after_track_handler=function(t,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var vm=function(){this.override_event="submit"};R.inherit(vm,ko),vm.prototype.event_handler=function(t,e,r){r.element=e,t.preventDefault()},vm.prototype.after_track_handler=function(t,e){setTimeout(function(){e.element.submit()},0)};var Ta="$set",cd="$set_once",Ji="$unset",Wc="$add",As="$append",Zc="$union",_o="$remove",HZ="$delete",VS={set_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[Ta]=n,r},unset_action:function(t){var e={},r=[];return R.isArray(t)||(t=[t]),R.each(t,function(n){this._is_reserved_property(n)||r.push(n)},this),e[Ji]=r,e},set_once_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[cd]=n,r},union_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=R.isArray(i)?i:[i])},this):n[t]=R.isArray(e)?e:[e],r[Zc]=n,r},append_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[As]=n,r},remove_action:function(t,e){var r={},n={};return R.isObject(t)?R.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[_o]=n,r},delete_action:function(){var t={};return t[HZ]="",t}},fr=function(){};R.extend(fr.prototype,VS),fr.prototype._init=function(t,e,r){this._mixpanel=t,this._group_key=e,this._group_id=r},fr.prototype.set=nd(function(t,e,r){var n=this.set_action(t,e);return R.isObject(t)&&(r=e),this._send_request(n,r)}),fr.prototype.set_once=nd(function(t,e,r){var n=this.set_once_action(t,e);return R.isObject(t)&&(r=e),this._send_request(n,r)}),fr.prototype.unset=nd(function(t,e){var r=this.unset_action(t);return this._send_request(r,e)}),fr.prototype.union=nd(function(t,e,r){R.isObject(t)&&(r=e);var n=this.union_action(t,e);return this._send_request(n,r)}),fr.prototype.delete=nd(function(t){var e=this.delete_action();return this._send_request(e,t)}),fr.prototype.remove=nd(function(t,e,r){var n=this.remove_action(t,e);return this._send_request(n,r)}),fr.prototype._send_request=function(t,e){t.$group_key=this._group_key,t.$group_id=this._group_id,t.$token=this._get_config("token");var r=R.encodeDates(t);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},fr.prototype._is_reserved_property=function(t){return t==="$group_key"||t==="$group_id"},fr.prototype._get_config=function(t){return this._mixpanel.get_config(t)},fr.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},fr.prototype.remove=fr.prototype.remove,fr.prototype.set=fr.prototype.set,fr.prototype.set_once=fr.prototype.set_once,fr.prototype.union=fr.prototype.union,fr.prototype.unset=fr.prototype.unset,fr.prototype.toString=fr.prototype.toString;var at=function(){};R.extend(at.prototype,VS),at.prototype._init=function(t){this._mixpanel=t},at.prototype.set=Ra(function(t,e,r){var n=this.set_action(t,e);return R.isObject(t)&&(r=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),n[Ta]=R.extend({},R.info.people_properties(),n[Ta]),this._send_request(n,r)}),at.prototype.set_once=Ra(function(t,e,r){var n=this.set_once_action(t,e);return R.isObject(t)&&(r=e),this._send_request(n,r)}),at.prototype.unset=Ra(function(t,e){var r=this.unset_action(t);return this._send_request(r,e)}),at.prototype.increment=Ra(function(t,e,r){var n={},i={};return R.isObject(t)?(R.each(t,function(s,o){if(!this._is_reserved_property(o))if(isNaN(parseFloat(s))){Gt.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[o]=s},this),r=e):(R.isUndefined(e)&&(e=1),i[t]=e),n[Wc]=i,this._send_request(n,r)}),at.prototype.append=Ra(function(t,e,r){R.isObject(t)&&(r=e);var n=this.append_action(t,e);return this._send_request(n,r)}),at.prototype.remove=Ra(function(t,e,r){R.isObject(t)&&(r=e);var n=this.remove_action(t,e);return this._send_request(n,r)}),at.prototype.union=Ra(function(t,e,r){R.isObject(t)&&(r=e);var n=this.union_action(t,e);return this._send_request(n,r)}),at.prototype.track_charge=Ra(function(){Gt.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),at.prototype.clear_charges=function(t){return this.set("$transactions",[],t)},at.prototype.delete_user=function(){if(!this._identify_called()){Gt.error("mixpanel.people.delete_user() requires you to call identify() first");return}var t={$delete:this._mixpanel.get_distinct_id()};return this._send_request(t)},at.prototype.toString=function(){return this._mixpanel.toString()+".people"},at.prototype._send_request=function(t,e){t.$token=this._get_config("token"),t.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),n=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(t.$device_id=r),n&&(t.$user_id=n),i&&(t.$had_persisted_distinct_id=i);var s=R.encodeDates(t);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:s,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(t),R.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),R.truncate(s,255))},at.prototype._get_config=function(t){return this._mixpanel.get_config(t)},at.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},at.prototype._enqueue=function(t){Ta in t?this._mixpanel.persistence._add_to_people_queue(Ta,t):cd in t?this._mixpanel.persistence._add_to_people_queue(cd,t):Ji in t?this._mixpanel.persistence._add_to_people_queue(Ji,t):Wc in t?this._mixpanel.persistence._add_to_people_queue(Wc,t):As in t?this._mixpanel.persistence._add_to_people_queue(As,t):_o in t?this._mixpanel.persistence._add_to_people_queue(_o,t):Zc in t?this._mixpanel.persistence._add_to_people_queue(Zc,t):Gt.error("Invalid call to _enqueue():",t)},at.prototype._flush_one_queue=function(t,e,r,n){var i=this,s=R.extend({},this._mixpanel.persistence.load_queue(t)),o=s;!R.isUndefined(s)&&R.isObject(s)&&!R.isEmptyObject(s)&&(i._mixpanel.persistence._pop_from_people_queue(t,s),i._mixpanel.persistence.save(),n&&(o=n(s)),e.call(i,o,function(a,c){a===0&&i._mixpanel.persistence._add_to_people_queue(t,s),R.isUndefined(r)||r(a,c)}))},at.prototype._flush=function(t,e,r,n,i,s,o){var a=this;this._flush_one_queue(Ta,this.set,t),this._flush_one_queue(cd,this.set_once,n),this._flush_one_queue(Ji,this.unset,s,function(m){return R.keys(m)}),this._flush_one_queue(Wc,this.increment,e),this._flush_one_queue(Zc,this.union,i);var c=this._mixpanel.persistence.load_queue(As);if(!R.isUndefined(c)&&R.isArray(c)&&c.length)for(var l,u=function(m,w){m===0&&a._mixpanel.persistence._add_to_people_queue(As,l),R.isUndefined(r)||r(m,w)},d=c.length-1;d>=0;d--)c=this._mixpanel.persistence.load_queue(As),l=c.pop(),a._mixpanel.persistence.save(),R.isEmptyObject(l)||a.append(l,u);var h=this._mixpanel.persistence.load_queue(_o);if(!R.isUndefined(h)&&R.isArray(h)&&h.length)for(var f,p=function(m,w){m===0&&a._mixpanel.persistence._add_to_people_queue(_o,f),R.isUndefined(o)||o(m,w)},v=h.length-1;v>=0;v--)h=this._mixpanel.persistence.load_queue(_o),f=h.pop(),a._mixpanel.persistence.save(),R.isEmptyObject(f)||a.remove(f,p)},at.prototype._is_reserved_property=function(t){return t==="$distinct_id"||t==="$token"||t==="$device_id"||t==="$user_id"||t==="$had_persisted_distinct_id"},at.prototype.set=at.prototype.set,at.prototype.set_once=at.prototype.set_once,at.prototype.unset=at.prototype.unset,at.prototype.increment=at.prototype.increment,at.prototype.append=at.prototype.append,at.prototype.remove=at.prototype.remove,at.prototype.union=at.prototype.union,at.prototype.track_charge=at.prototype.track_charge,at.prototype.clear_charges=at.prototype.clear_charges,at.prototype.delete_user=at.prototype.delete_user,at.prototype.toString=at.prototype.toString;var y4="__mps",w4="__mpso",b4="__mpus",k4="__mpa",_4="__mpap",E4="__mpr",C4="__mpu",FS="$people_distinct_id",ym="__alias",p0="__timers",jZ=[y4,w4,b4,k4,_4,E4,C4,FS,ym,p0],kt=function(t){this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="mp_"+t.persistence_name:this.name="mp_"+t.token+"_mixpanel";var e=t.persistence;e!=="cookie"&&e!=="localStorage"&&(Gt.critical("Unknown persistence type "+e+"; falling back to cookie"),e=t.persistence="cookie"),e==="localStorage"&&R.localStorage.is_supported()?this.storage=R.localStorage:this.storage=R.cookie,this.load(),this.update_config(t),this.upgrade(),this.save()};kt.prototype.properties=function(){var t={};return this.load(),R.each(this.props,function(e,r){R.include(jZ,r)||(t[r]=e)}),t},kt.prototype.load=function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=R.extend({},t))}},kt.prototype.upgrade=function(){var t,e;this.storage===R.localStorage?(t=R.cookie.parse(this.name),R.cookie.remove(this.name),R.cookie.remove(this.name,!0),t&&this.register_once(t)):this.storage===R.cookie&&(e=R.localStorage.parse(this.name),R.localStorage.remove(this.name),e&&this.register_once(e))},kt.prototype.save=function(){this.disabled||this.storage.set(this.name,rd(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},kt.prototype.load_prop=function(t){return this.load(),this.props[t]},kt.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},kt.prototype.clear=function(){this.remove(),this.props={}},kt.prototype.register_once=function(t,e,r){return R.isObject(t)?(typeof e>"u"&&(e="None"),this.expire_days=typeof r>"u"?this.default_expiry:r,this.load(),R.each(t,function(n,i){(!this.props.hasOwnProperty(i)||this.props[i]===e)&&(this.props[i]=n)},this),this.save(),!0):!1},kt.prototype.register=function(t,e){return R.isObject(t)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),R.extend(this.props,t),this.save(),!0):!1},kt.prototype.unregister=function(t){this.load(),t in this.props&&(delete this.props[t],this.save())},kt.prototype.update_search_keyword=function(t){this.register(R.info.searchInfo(t))},kt.prototype.update_referrer_info=function(t){this.register_once({$initial_referrer:t||"$direct",$initial_referring_domain:R.info.referringDomain(t)||"$direct"},"")},kt.prototype.get_referrer_info=function(){return R.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},kt.prototype.update_config=function(t){this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cookie_domain(t.cookie_domain),this.set_cross_site(t.cross_site_cookie),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie)},kt.prototype.set_disabled=function(t){this.disabled=t,this.disabled?this.remove():this.save()},kt.prototype.set_cookie_domain=function(t){t!==this.cookie_domain&&(this.remove(),this.cookie_domain=t,this.save())},kt.prototype.set_cross_site=function(t){t!==this.cross_site&&(this.cross_site=t,this.remove(),this.save())},kt.prototype.set_cross_subdomain=function(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())},kt.prototype.get_cross_subdomain=function(){return this.cross_subdomain},kt.prototype.set_secure=function(t){t!==this.secure&&(this.secure=!!t,this.remove(),this.save())},kt.prototype._add_to_people_queue=function(t,e){var r=this._get_queue_key(t),n=e[t],i=this._get_or_create_queue(Ta),s=this._get_or_create_queue(cd),o=this._get_or_create_queue(Ji),a=this._get_or_create_queue(Wc),c=this._get_or_create_queue(Zc),l=this._get_or_create_queue(_o,[]),u=this._get_or_create_queue(As,[]);r===y4?(R.extend(i,n),this._pop_from_people_queue(Wc,n),this._pop_from_people_queue(Zc,n),this._pop_from_people_queue(Ji,n)):r===w4?(R.each(n,function(d,h){h in s||(s[h]=d)}),this._pop_from_people_queue(Ji,n)):r===b4?R.each(n,function(d){R.each([i,s,a,c],function(h){d in h&&delete h[d]}),R.each(u,function(h){d in h&&delete h[d]}),o[d]=!0}):r===k4?(R.each(n,function(d,h){h in i?i[h]+=d:(h in a||(a[h]=0),a[h]+=d)},this),this._pop_from_people_queue(Ji,n)):r===C4?(R.each(n,function(d,h){R.isArray(d)&&(h in c||(c[h]=[]),R.each(d,function(f){R.include(c[h],f)||c[h].push(f)}))}),this._pop_from_people_queue(Ji,n)):r===E4?(l.push(n),this._pop_from_people_queue(As,n)):r===_4&&(u.push(n),this._pop_from_people_queue(Ji,n)),Gt.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Gt.log(e),this.save()},kt.prototype._pop_from_people_queue=function(t,e){var r=this.props[this._get_queue_key(t)];R.isUndefined(r)||R.each(e,function(n,i){t===As||t===_o?R.each(r,function(s){s[i]===n&&delete s[i]}):delete r[i]},this)},kt.prototype.load_queue=function(t){return this.load_prop(this._get_queue_key(t))},kt.prototype._get_queue_key=function(t){if(t===Ta)return y4;if(t===cd)return w4;if(t===Ji)return b4;if(t===Wc)return k4;if(t===As)return _4;if(t===_o)return E4;if(t===Zc)return C4;Gt.error("Invalid queue:",t)},kt.prototype._get_or_create_queue=function(t,e){var r=this._get_queue_key(t);return e=R.isUndefined(e)?{}:e,this.props[r]||(this.props[r]=e)},kt.prototype.set_event_timer=function(t,e){var r=this.load_prop(p0)||{};r[t]=e,this.props[p0]=r,this.save()},kt.prototype.remove_event_timer=function(t){var e=this.load_prop(p0)||{},r=e[t];return R.isUndefined(r)||(delete this.props[p0][t],this.save()),r};var S4,LS=function(t,e){throw new Error(t+" not available in this build.")},En,DS=0,QZ=1,JZ=function(t){return t},Ei="mixpanel",WS="base64",$Z="json",A4="$device:",ld=Pe.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ZS=!ld&&wo.indexOf("MSIE")===-1&&wo.indexOf("Mozilla")===-1,wm=null;Ca.sendBeacon&&(wm=function(){return Ca.sendBeacon.apply(Ca,arguments)});var zS={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},GS={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:zS,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:WS,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Sa,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Sa,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:a0,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},HS=!1,ne=function(){},R4=function(t,e,r){var n,i=r===Ei?En:En[r];if(i&&S4===DS)n=i;else{if(i&&!R.isArray(i)){Gt.error("You have already initialized "+r);return}n=new ne}if(n._cached_groups={},n._init(t,e,r),n.people=new at,n.people._init(n),!n.get_config("skip_first_touch_marketing")){var s=R.info.campaignParams(null),o={},a=!1;R.each(s,function(c,l){o["initial_"+l]=c,c&&(a=!0)}),a&&n.people.set_once(o)}return Qi.DEBUG=Qi.DEBUG||n.get_config("debug"),!R.isUndefined(i)&&R.isArray(i)&&(n._execute_array.call(n.people,i.people),n._execute_array(i)),n};ne.prototype.init=function(t,e,r){if(R.isUndefined(r)){this.report_error("You must name your new library: init(token, config, name)");return}if(r===Ei){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var n=R4(t,e,r);return En[r]=n,n._loaded(),n},ne.prototype._init=function(t,e,r){e=e||{},this.__loaded=!0,this.config={};var n={};if(!("api_payload_format"in e)){var i=e.api_host||GS.api_host;i.match(/\.mixpanel\.com/)&&(n.api_payload_format=$Z)}if(this.set_config(R.extend({},GS,n,e,{name:r,token:t,callback_fn:(r===Ei?r:Ei+"."+r)+"._jsc"})),this._jsc=Sa,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!R.localStorage.is_supported(!0)||!ld)this._batch_requests=!1,Gt.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),R.each(this.get_batcher_configs(),function(a){Gt.log("Clearing batch queue "+a.queue_key),R.localStorage.remove(a.queue_key)});else if(this.init_batchers(),wm&&Pe.addEventListener){var s=R.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);Pe.addEventListener("pagehide",function(a){a.persisted&&s()}),Pe.addEventListener("visibilitychange",function(){zt.visibilityState==="hidden"&&s()})}}this.persistence=this.cookie=new kt(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=R.UUID();this.get_distinct_id()||this.register_once({distinct_id:A4+o,$device_id:o},""),this.flags=new Vt({getFullApiRoute:R.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:R.bind(this.get_config,this),getPropertyFunc:R.bind(this.get_property,this),trackingFunc:R.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new ni(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},ne.prototype._init_tab_id=function(){if(R.sessionStorage.is_supported())try{var t=this.get_config("name")+"_"+this.get_config("token"),e="mp_tab_id_"+t,r="mp_gen_new_tab_id_"+t;(R.sessionStorage.get(r)||!R.sessionStorage.get(e))&&R.sessionStorage.set(e,"$tab-"+R.UUID()),R.sessionStorage.set(r,"1"),this.tab_id=R.sessionStorage.get(e),Pe.addEventListener("beforeunload",function(){R.sessionStorage.remove(r)})}catch(n){this.report_error("Error initializing tab id",n)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},ne.prototype.get_tab_id=function(){return this.tab_id||null},ne.prototype._should_load_recorder=function(){var t=new Es(n4),e=this.get_tab_id();return t.init().then(function(){return t.getAll()}).then(function(r){for(var n=0;n<r.length;n++)if(a4(r[n])||r[n].tabId===e)return!0;return!1}).catch(R.bind(function(r){this.report_error("Error checking recording registry",r)},this))},ne.prototype._check_and_start_session_recording=Aa(function(t){if(!Pe.MutationObserver){Gt.critical("Browser does not support MutationObserver; skipping session recording");return}var e=R.bind(function(n){var i=R.bind(function(){this._recorder=this._recorder||new Pe.__mp_recorder(this),this._recorder.resumeRecording(n)},this);R.isUndefined(Pe.__mp_recorder)?LS(this.get_config("recorder_src"),i):i()},this),r=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");t||r?e(!0):this._should_load_recorder().then(function(n){n&&e(!1)})}),ne.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},ne.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},ne.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},ne.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},ne.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},ne.prototype.get_session_recording_properties=function(){var t={},e=this._get_session_replay_id();return e&&(t.$mp_replay_id=e),t},ne.prototype.get_session_replay_url=function(){var t=null,e=this._get_session_replay_id();if(e){var r=R.HTTPBuildQuery({replay_id:e,distinct_id:this.get_distinct_id(),token:this.get_config("token")});t="https://mixpanel.com/projects/replay-redirect?"+r}return t},ne.prototype._get_session_replay_id=function(){var t=null;return this._recorder&&(t=this._recorder.replayId),t||null},ne.prototype.__get_recorder=function(){return this._recorder},ne.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var t=R.info.campaignParams(null);R.each(t,(function(e,r){this.unregister(r)}).bind(this))}},ne.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(zt.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(R.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(zt.referrer)},ne.prototype._dom_loaded=function(){R.each(this.__dom_loaded_queue,function(t){this._track_dom.apply(this,t)},this),this.has_opted_out_tracking()||R.each(this.__request_queue,function(t){this._send_request.apply(this,t)},this),delete this.__dom_loaded_queue,delete this.__request_queue},ne.prototype._track_dom=function(t,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!HS)return this.__dom_loaded_queue.push([t,e]),!1;var r=new t().init(this);return r.track.apply(r,e)},ne.prototype._prepare_callback=function(t,e){if(R.isUndefined(t))return null;if(ld){var r=function(o){t(o,e)};return r}else{var n=this._jsc,i=""+Math.floor(Math.random()*1e8),s=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(o){delete n[i],t(o,e)},s}},ne.prototype._send_request=function(t,e,r,n){var i=!0;if(ZS)return this.__request_queue.push(arguments),i;var s={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},o=null;!n&&(R.isFunction(r)||typeof r=="string")&&(n=r,r=null),r=R.extend(s,r||{}),ld||(r.method="GET");var a=r.method==="POST",c=wm&&a&&r.transport.toLowerCase()==="sendbeacon",l=r.verbose;e.verbose&&(l=!0),this.get_config("test")&&(e.test=1),l&&(e.verbose=1),this.get_config("img")&&(e.img=1),ld||(n?e.callback=n:(l||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),a&&(o="data="+encodeURIComponent(e.data),delete e.data),R.extend(e,this.get_config("api_extra_query_params")),t+="?"+R.HTTPBuildQuery(e);var u=this;if("img"in e){var d=zt.createElement("img");d.src=t,zt.body.appendChild(d)}else if(c){try{i=wm(t,o)}catch(w){u.report_error(w),i=!1}try{n&&n(i?1:0)}catch(w){u.report_error(w)}}else if(ld)try{var h=new XMLHttpRequest;h.open(r.method,t,!0);var f=this.get_config("xhr_headers");if(a&&(f["Content-Type"]="application/x-www-form-urlencoded"),R.each(f,function(w,_){h.setRequestHeader(_,w)}),r.timeout_ms&&typeof h.timeout<"u"){h.timeout=r.timeout_ms;var p=new Date().getTime()}h.withCredentials=!0,h.onreadystatechange=function(){if(h.readyState===4)if(h.status===200){if(n)if(l){var w;try{w=R.JSONDecode(h.responseText)}catch(T){if(u.report_error(T),r.ignore_json_errors)w=h.responseText;else return}n(w)}else n(Number(h.responseText))}else{var _;if(h.timeout&&!h.status&&new Date().getTime()-p>=h.timeout?_="timeout":_="Bad HTTP status: "+h.status+" "+h.statusText,u.report_error(_),n)if(l){var S=h.responseHeaders||{};n({status:0,httpStatusCode:h.status,error:_,retryAfter:S["Retry-After"]})}else n(0)}},h.send(o)}catch(w){u.report_error(w),i=!1}else{var v=zt.createElement("script");v.type="text/javascript",v.async=!0,v.defer=!0,v.src=t;var m=zt.getElementsByTagName("script")[0];m.parentNode.insertBefore(v,m)}return i},ne.prototype._execute_array=function(t){var e,r=[],n=[],i=[];R.each(t,function(o){o&&(e=o[0],R.isArray(e)?i.push(o):typeof o=="function"?o.call(this):R.isArray(o)&&e==="alias"?r.push(o):R.isArray(o)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?i.push(o):n.push(o))},this);var s=function(o,a){R.each(o,function(c){if(R.isArray(c[0])){var l=a;R.each(c,function(u){l=l[u[0]].apply(l,u.slice(1))})}else this[c[0]].apply(this,c.slice(1))},a)};s(r,this),s(n,this),s(i,this)},ne.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},ne.prototype.get_batcher_configs=function(){var t="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:t+"_ev"},people:{type:"people",api_name:"engage",queue_key:t+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:t+"_gr"}},this._batcher_configs},ne.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var t=R.bind(function(r){return new _i(r.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:R.bind(function(n,i,s){var o=this.get_config("api_routes");this._send_request(this.get_api_host(r.api_name)+"/"+o[r.api_name],this._encode_data_for_request(n),i,this._prepare_callback(s,n))},this),beforeSendHook:R.bind(function(n){return this._run_hook("before_send_"+r.type,n)},this),stopAllBatchingFunc:R.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:t(e.events),people:t(e.people),groups:t(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},ne.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,R.each(this.request_batchers,function(t){t.start()}))},ne.prototype.stop_batch_senders=function(){this._batch_requests=!1,R.each(this.request_batchers,function(t){t.stop(),t.clear()})},ne.prototype.push=function(t){this._execute_array([t])},ne.prototype.disable=function(t){typeof t>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(t)},ne.prototype._encode_data_for_request=function(t){var e=rd(t);return this.get_config("api_payload_format")===WS&&(e=R.base64Encode(e)),{data:e}},ne.prototype._track_or_batch=function(t,e){var r=R.truncate(t.data,255),n=t.endpoint,i=t.batcher,s=t.should_send_immediately,o=t.send_request_options||{};e=e||Sa;var a=!0,c=R.bind(function(){return o.skip_hooks||(r=this._run_hook("before_send_"+t.type,r)),r?(Gt.log("MIXPANEL REQUEST:"),Gt.log(r),this._send_request(n,this._encode_data_for_request(r),o,this._prepare_callback(e,r))):null},this);return this._batch_requests&&!s?i.enqueue(r).then(function(l){l?e(1,r):c()}):a=c(),a&&r},ne.prototype.track=Aa(function(t,e,r,n){!n&&typeof r=="function"&&(n=r,r=null),r=r||{};var i=r.transport;i&&(r.transport=i);var s=r.send_immediately;if(typeof n!="function"&&(n=Sa),R.isUndefined(t)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(t)){n(0);return}e=R.extend({},e),e.token=this.get_config("token");var o=this.persistence.remove_event_timer(t);if(!R.isUndefined(o)){var a=new Date().getTime()-o;e.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?R.info.marketingParams():{};e=R.extend({},R.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var l=this.get_config("property_blacklist");R.isArray(l)?R.each(l,function(h){delete e[h]}):this.report_error("Invalid value for property_blacklist config: "+l);var u={event:t,properties:e},d=this._track_or_batch({type:"events",data:u,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:r},n);return d}),ne.prototype.set_group=Aa(function(t,e,r){R.isArray(e)||(e=[e]);var n={};return n[t]=e,this.register(n),this.people.set(t,e,r)}),ne.prototype.add_group=Aa(function(t,e,r){var n=this.get_property(t),i={};return n===void 0?(i[t]=[e],this.register(i)):n.indexOf(e)===-1&&(n.push(e),i[t]=n,this.register(i)),this.people.union(t,e,r)}),ne.prototype.remove_group=Aa(function(t,e,r){var n=this.get_property(t);if(n!==void 0){var i=n.indexOf(e);i>-1&&(n.splice(i,1),this.register({group_key:n})),n.length===0&&this.unregister(t)}return this.people.remove(t,e,r)}),ne.prototype.track_with_groups=Aa(function(t,e,r,n){var i=R.extend({},e||{});return R.each(r,function(s,o){s!=null&&(i[o]=s)}),this.track(t,i,n)}),ne.prototype._create_map_key=function(t,e){return t+"_"+JSON.stringify(e)},ne.prototype._remove_group_from_cache=function(t,e){delete this._cached_groups[this._create_map_key(t,e)]},ne.prototype.get_group=function(t,e){var r=this._create_map_key(t,e),n=this._cached_groups[r];return(n===void 0||n._group_key!==t||n._group_id!==e)&&(n=new fr,n._init(this,t,e),this._cached_groups[r]=n),n},ne.prototype.track_pageview=Aa(function(t,e){typeof t!="object"&&(t={}),e=e||{};var r=e.event_name||"$mp_web_page_view",n=R.extend(R.info.mpPageViewProperties(),R.info.campaignParams(),R.info.clickParams()),i=R.extend({},n,t);return this.track(r,i)}),ne.prototype.track_links=function(){return this._track_dom.call(this,ad,arguments)},ne.prototype.track_forms=function(){return this._track_dom.call(this,vm,arguments)},ne.prototype.time_event=function(t){if(R.isUndefined(t)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(t)||this.persistence.set_event_timer(t,new Date().getTime())};var YZ={persistent:!0},T4=function(t){var e;return R.isObject(t)?e=t:R.isUndefined(t)?e={}:e={days:t},R.extend({},YZ,e)};ne.prototype.register=function(t,e){var r=T4(e);r.persistent?this.persistence.register(t,r.days):R.extend(this.unpersisted_superprops,t)},ne.prototype.register_once=function(t,e,r){var n=T4(r);n.persistent?this.persistence.register_once(t,e,n.days):(typeof e>"u"&&(e="None"),R.each(t,function(i,s){(!this.unpersisted_superprops.hasOwnProperty(s)||this.unpersisted_superprops[s]===e)&&(this.unpersisted_superprops[s]=i)},this))},ne.prototype.unregister=function(t,e){e=T4(e),e.persistent?this.persistence.unregister(t):delete this.unpersisted_superprops[t]},ne.prototype._register_single=function(t,e){var r={};r[t]=e,this.register(r)},ne.prototype.identify=function(t,e,r,n,i,s,o,a){var c=this.get_distinct_id();if(t&&c!==t){if(typeof t=="string"&&t.indexOf(A4)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:t})}if(!this.get_property("$device_id")){var l=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:l},"")}t!==c&&t!==this.get_property(ym)&&(this.unregister(ym),this.register({distinct_id:t})),this._flags.identify_called=!0,this.people._flush(e,r,n,i,s,o,a),t!==c&&this.track("$identify",{distinct_id:t,$anon_distinct_id:c},{skip_hooks:!0}),t!==c&&this.flags.fetchFlags()},ne.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var t=R.UUID();this.register_once({distinct_id:A4+t,$device_id:t},""),this._check_and_start_session_recording()},ne.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},ne.prototype.alias=function(t,e){if(t===this.get_property(FS))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return R.isUndefined(e)&&(e=this.get_distinct_id()),t!==e?(this._register_single(ym,t),this.track("$create_alias",{alias:t,distinct_id:e},{skip_hooks:!0},function(){r.identify(t)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(t),-1)},ne.prototype.name_tag=function(t){this._register_single("mp_name_tag",t)},ne.prototype.set_config=function(t){if(R.isObject(t)){R.extend(this.config,t);var e=t.batch_size;e&&R.each(this.request_batchers,function(r){r.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Qi.DEBUG=Qi.DEBUG||this.get_config("debug"),("autocapture"in t||"record_heatmap_data"in t)&&this.autocapture&&this.autocapture.init()}},ne.prototype.get_config=function(t){return this.config[t]},ne.prototype._run_hook=function(t){var e=(this.config.hooks[t]||JZ).apply(this,Ea.call(arguments,1));return typeof e>"u"&&(this.report_error(t+" hook did not return a value"),e=null),e},ne.prototype.get_property=function(t){return this.persistence.load_prop([t])},ne.prototype.get_api_host=function(t){return this.get_config("api_hosts")[t]||this.get_config("api_host")},ne.prototype.toString=function(){var t=this.get_config("name");return t!==Ei&&(t=Ei+"."+t),t},ne.prototype._event_is_disabled=function(t){return R.isBlockedUA(wo)||this._flags.disable_all_events||R.include(this.__disabled_events,t)},ne.prototype._gdpr_init=function(){var t=this.get_config("opt_out_tracking_persistence_type")==="localStorage";t&&R.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||R.cookie.get("mp_optout"))&&(R.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},ne.prototype._gdpr_update_persistence=function(t){var e;if(t&&t.clear_persistence)e=!0;else if(t&&t.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},ne.prototype._gdpr_call_func=function(t,e){return e=R.extend({track:R.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),R.localStorage.is_supported()||(e.persistence_type="cookie"),t(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},ne.prototype.opt_in_tracking=function(t){t=R.extend({enable_persistence:!0},t),this._gdpr_call_func(yZ,t),this._gdpr_update_persistence(t)},ne.prototype.opt_out_tracking=function(t){t=R.extend({clear_persistence:!0,delete_user:!0},t),t.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(wZ,t),this._gdpr_update_persistence(t)},ne.prototype.has_opted_in_tracking=function(t){return this._gdpr_call_func(bZ,t)},ne.prototype.has_opted_out_tracking=function(t){return this._gdpr_call_func(nS,t)},ne.prototype.clear_opt_in_out_tracking=function(t){t=R.extend({enable_persistence:!0},t),this._gdpr_call_func(kZ,t),this._gdpr_update_persistence(t)},ne.prototype.report_error=function(t,e){Gt.error.apply(Gt.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.get_config("error_reporter")(t,e)}catch(r){Gt.error(r)}},ne.prototype.init=ne.prototype.init,ne.prototype.reset=ne.prototype.reset,ne.prototype.disable=ne.prototype.disable,ne.prototype.time_event=ne.prototype.time_event,ne.prototype.track=ne.prototype.track,ne.prototype.track_links=ne.prototype.track_links,ne.prototype.track_forms=ne.prototype.track_forms,ne.prototype.track_pageview=ne.prototype.track_pageview,ne.prototype.register=ne.prototype.register,ne.prototype.register_once=ne.prototype.register_once,ne.prototype.unregister=ne.prototype.unregister,ne.prototype.identify=ne.prototype.identify,ne.prototype.alias=ne.prototype.alias,ne.prototype.name_tag=ne.prototype.name_tag,ne.prototype.set_config=ne.prototype.set_config,ne.prototype.get_config=ne.prototype.get_config,ne.prototype.get_api_host=ne.prototype.get_api_host,ne.prototype.get_property=ne.prototype.get_property,ne.prototype.get_distinct_id=ne.prototype.get_distinct_id,ne.prototype.toString=ne.prototype.toString,ne.prototype.opt_out_tracking=ne.prototype.opt_out_tracking,ne.prototype.opt_in_tracking=ne.prototype.opt_in_tracking,ne.prototype.has_opted_out_tracking=ne.prototype.has_opted_out_tracking,ne.prototype.has_opted_in_tracking=ne.prototype.has_opted_in_tracking,ne.prototype.clear_opt_in_out_tracking=ne.prototype.clear_opt_in_out_tracking,ne.prototype.get_group=ne.prototype.get_group,ne.prototype.set_group=ne.prototype.set_group,ne.prototype.add_group=ne.prototype.add_group,ne.prototype.remove_group=ne.prototype.remove_group,ne.prototype.track_with_groups=ne.prototype.track_with_groups,ne.prototype.start_batch_senders=ne.prototype.start_batch_senders,ne.prototype.stop_batch_senders=ne.prototype.stop_batch_senders,ne.prototype.start_session_recording=ne.prototype.start_session_recording,ne.prototype.stop_session_recording=ne.prototype.stop_session_recording,ne.prototype.pause_session_recording=ne.prototype.pause_session_recording,ne.prototype.resume_session_recording=ne.prototype.resume_session_recording,ne.prototype.get_session_recording_properties=ne.prototype.get_session_recording_properties,ne.prototype.get_session_replay_url=ne.prototype.get_session_replay_url,ne.prototype.get_tab_id=ne.prototype.get_tab_id,ne.prototype.DEFAULT_API_ROUTES=zS,ne.prototype.__get_recorder=ne.prototype.__get_recorder,kt.prototype.properties=kt.prototype.properties,kt.prototype.update_search_keyword=kt.prototype.update_search_keyword,kt.prototype.update_referrer_info=kt.prototype.update_referrer_info,kt.prototype.get_cross_subdomain=kt.prototype.get_cross_subdomain,kt.prototype.clear=kt.prototype.clear;var ud={},XZ=function(){R.each(ud,function(t,e){e!==Ei&&(En[e]=t)}),En._=R},KZ=function(){En.init=function(t,e,r){if(r)return En[r]||(En[r]=ud[r]=R4(t,e,r),En[r]._loaded()),En[r];var n=En;ud[Ei]?n=ud[Ei]:t&&(n=R4(t,e,Ei),n._loaded(),ud[Ei]=n),En=n,S4===QZ&&(Pe[Ei]=En),XZ()}},qZ=function(){function t(){t.done||(t.done=!0,HS=!0,ZS=!1,R.each(ud,function(n){n._dom_loaded()}))}function e(){try{zt.documentElement.doScroll("left")}catch{setTimeout(e,1);return}t()}if(zt.addEventListener)zt.readyState==="complete"?t():zt.addEventListener("DOMContentLoaded",t,!1);else if(zt.attachEvent){zt.attachEvent("onreadystatechange",t);var r=!1;try{r=Pe.frameElement===null}catch{}zt.documentElement.doScroll&&r&&e()}R.register_event(Pe,"load",t,!0)};function ez(t){return LS=t,S4=DS,En=new ne,KZ(),En.init(),qZ(),En}function tz(t,e){e()}var jS=ez(tz);let un=jS;const rz=t=>{const e=t===Oc.MAINNET?"99f02568157d7aa8d54f0843d18e7d91":"874af62961206fdd0dab0d95ae71dcf7";jS.init(e,{debug:!1,loaded:r=>un=r},t)},nz=()=>{const t=new URL(window.location.href);t.search="",history.pushState({},"",t.toString())},N4=0,iz="0xAebF6188EA36F166A15D9003a7F761122b695a70".toLowerCase(),x4={src:"https://customer-bmztknkgqgwr6a86.cloudflarestream.com/b6057185863fe1c1ca2875dbf11ea447/watch",embedded:!0},QS="We are processing your order..",sz=()=>{bt.set({...ve(bt),isProgressFinished:!1,isVideoEnded:!0})},B4=async()=>(bt.set({...ve(bt),isProgressFinished:!0,isVideoEnded:!1}),new Promise(t=>{const e=bt.subscribe(r=>{r.isVideoEnded&&(bt.set({...ve(bt),isProgressFinished:!1,isVideoEnded:!1}),e(),t(null))});setTimeout(()=>{try{e()}catch{}t(null)},60*1e3)})),oz=[{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"addOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"clearOwners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getDescription",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"target",type:"address"}],name:"getDropAvailableAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDropAvailableTotalAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDropPerAddressLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDropTotalLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"target",type:"address"}],name:"getDroppedAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getDroppedTotalAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getOwners",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTrustedForwarder",outputs:[{internalType:"address",name:"forwarder",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"isOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"forwarder",type:"address"}],name:"isTrustedForwarder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"removeOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"target",type:"address"}],name:"requestToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"description",type:"string"}],name:"setDescription",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"setDropPerAddressLimit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"setDropTotalLimit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_forwarder",type:"address"}],name:"setTrustedForwarder",outputs:[],stateMutability:"nonpayable",type:"function"}],tt=mn(),I4=Gg([ys,tt,bn,wi],([t,e,r,n])=>{var i,s,o,a,c;if(t)return t;if(n){if((i=e.auth)!=null&&i.extendedRegistration&&(!(r!=null&&r.name)||!(r!=null&&r.email)&&!((s=r==null?void 0:r.pending)!=null&&s.email)&&!(r!=null&&r.phone)&&!((o=r==null?void 0:r.pending)!=null&&o.phone)))return Be.UPDATE_PROFILE;if((a=r==null?void 0:r.pending)!=null&&a.email||(c=r==null?void 0:r.pending)!=null&&c.phone)return Be.CONFIRM_ACCOUNT}else return Be.LOGIN;return null}),O4=Gg([tt,wi],([t,e])=>{var r;return!e&&!!((r=t.content)!=null&&r.cloak)}),Dr=mn(),dd=mn(),az=Gg(Dr,async t=>{try{return t?(await(await t.getSigner()).getAddress()).toLowerCase():""}catch{return""}}),Bt={[Ae.POLYGON]:{name:"Polygon",rpcUrl:"https://polygon-rpc.com",scanUrl:"https://polygonscan.com"},[Ae.POLYGON_AMOY]:{name:"Amoy",rpcUrl:"https://rpc-amoy.polygon.technology",scanUrl:"https://www.oklink.com/amoy"},[Ae.CHILIZ]:{name:"Chiliz",rpcUrl:"https://rpc.chiliz.com",scanUrl:"https://scan.chiliz.com/"},[Ae.CHILIZ_SPICY]:{name:"Spicy",rpcUrl:"https://spicy-rpc.chiliz.com",scanUrl:"https://spicy-explorer.chiliz.com/"},[Ae.AVALANCHE_FUJI]:{name:"Fuji",rpcUrl:"https://api.avax-test.network/ext/bc/C/rpc",scanUrl:"https://testnet.snowscan.xyz/"},[Ae.AVALANCHE]:{name:"Avalanche",rpcUrl:"https://api.avax.network/ext/bc/C/rpc",scanUrl:"https://snowtrace.io/"},[Ae.BASE]:{name:"Base",rpcUrl:"https://mainnet.base.org",scanUrl:"https://basescan.org"},[Ae.BASE_SEPOLIA]:{name:"Base Sepolia",rpcUrl:"https://sepolia.base.org",scanUrl:"https://sepolia.basescan.org"}},JS=t=>{switch(t){case Ae.POLYGON:case Ae.CHILIZ:case Ae.AVALANCHE:case Ae.BASE:return Oc.MAINNET;default:return Oc.TESTNET}},Rs=Object.create(null);Rs.open="0",Rs.close="1",Rs.ping="2",Rs.pong="3",Rs.message="4",Rs.upgrade="5",Rs.noop="6";const bm=Object.create(null);Object.keys(Rs).forEach(t=>{bm[Rs[t]]=t});const U4={type:"error",data:"parser error"},$S=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",YS=typeof ArrayBuffer=="function",XS=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,M4=({type:t,data:e},r,n)=>$S&&e instanceof Blob?r?n(e):KS(e,n):YS&&(e instanceof ArrayBuffer||XS(e))?r?n(e):KS(new Blob([e]),n):n(Rs[t]+(e||"")),KS=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function qS(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let P4;function cz(t,e){if($S&&t.data instanceof Blob)return t.data.arrayBuffer().then(qS).then(e);if(YS&&(t.data instanceof ArrayBuffer||XS(t.data)))return e(qS(t.data));M4(t,!1,r=>{P4||(P4=new TextEncoder),e(P4.encode(r))})}const eA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m0=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<eA.length;t++)m0[eA.charCodeAt(t)]=t;const lz=t=>{let e=t.length*.75,r=t.length,n,i=0,s,o,a,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const l=new ArrayBuffer(e),u=new Uint8Array(l);for(n=0;n<r;n+=4)s=m0[t.charCodeAt(n)],o=m0[t.charCodeAt(n+1)],a=m0[t.charCodeAt(n+2)],c=m0[t.charCodeAt(n+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|c&63;return l},uz=typeof ArrayBuffer=="function",V4=(t,e)=>{if(typeof t!="string")return{type:"message",data:tA(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:dz(t.substring(1),e)}:bm[r]?t.length>1?{type:bm[r],data:t.substring(1)}:{type:bm[r]}:U4},dz=(t,e)=>{if(uz){const r=lz(t);return tA(r,e)}else return{base64:!0,data:t}},tA=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},rA="",hz=(t,e)=>{const r=t.length,n=new Array(r);let i=0;t.forEach((s,o)=>{M4(s,!1,a=>{n[o]=a,++i===r&&e(n.join(rA))})})},fz=(t,e)=>{const r=t.split(rA),n=[];for(let i=0;i<r.length;i++){const s=V4(r[i],e);if(n.push(s),s.type==="error")break}return n};function pz(){return new TransformStream({transform(t,e){cz(t,r=>{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(r)})}})}let F4;function km(t){return t.reduce((e,r)=>e+r.length,0)}function _m(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)r[i]=t[0][n++],n===t[0].length&&(t.shift(),n=0);return t.length&&n<t[0].length&&(t[0]=t[0].slice(n)),r}function mz(t,e){F4||(F4=new TextDecoder);const r=[];let n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(r.push(o);;){if(n===0){if(km(r)<1)break;const c=_m(r,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(km(r)<2)break;const c=_m(r,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(km(r)<8)break;const c=_m(r,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(U4);break}i=u*Math.pow(2,32)+l.getUint32(4),n=3}else{if(km(r)<i)break;const c=_m(r,i);a.enqueue(V4(s?c:F4.decode(c),e)),n=0}if(i===0||i>t){a.enqueue(U4);break}}}})}const nA=4;function Wr(t){if(t)return gz(t)}function gz(t){for(var e in Wr.prototype)t[e]=Wr.prototype[e];return t}Wr.prototype.on=Wr.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Wr.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},Wr.prototype.off=Wr.prototype.removeListener=Wr.prototype.removeAllListeners=Wr.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,i=0;i<r.length;i++)if(n=r[i],n===e||n.fn===e){r.splice(i,1);break}return r.length===0&&delete this._callbacks["$"+t],this},Wr.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n)r[n].apply(this,e)}return this},Wr.prototype.emitReserved=Wr.prototype.emit,Wr.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Wr.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Em=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Ci=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),vz="arraybuffer";function iK(){}function iA(t,...e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const yz=Ci.setTimeout,wz=Ci.clearTimeout;function Cm(t,e){e.useNativeTimers?(t.setTimeoutFn=yz.bind(Ci),t.clearTimeoutFn=wz.bind(Ci)):(t.setTimeoutFn=Ci.setTimeout.bind(Ci),t.clearTimeoutFn=Ci.clearTimeout.bind(Ci))}const bz=1.33;function kz(t){return typeof t=="string"?_z(t):Math.ceil((t.byteLength||t.size)*bz)}function _z(t){let e=0,r=0;for(let n=0,i=t.length;n<i;n++)e=t.charCodeAt(n),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}function sA(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ez(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function Cz(t){let e={},r=t.split("&");for(let n=0,i=r.length;n<i;n++){let s=r[n].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class Sz extends Error{constructor(e,r,n){super(e),this.description=r,this.context=n,this.type="TransportError"}}class L4 extends Wr{constructor(e){super(),this.writable=!1,Cm(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,r,n){return super.emitReserved("error",new Sz(e,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const r=V4(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const r=Ez(e);return r.length?"?"+r:""}}class Az extends L4{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};fz(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,hz(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=sA()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}}let oA=!1;try{oA=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Rz=oA;function Tz(){}class Nz extends Az{constructor(e){if(super(e),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class Ts extends Wr{constructor(e,r,n){super(),this.createRequest=e,Cm(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const r=iA(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ts.requestsCount++,Ts.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Tz,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ts.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Ts.requestsCount=0,Ts.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",aA);else if(typeof addEventListener=="function"){const t="onpagehide"in Ci?"pagehide":"unload";addEventListener(t,aA,!1)}}function aA(){for(let t in Ts.requests)Ts.requests.hasOwnProperty(t)&&Ts.requests[t].abort()}const xz=function(){const t=cA({xdomain:!1});return t&&t.responseType!==null}();class Bz extends Nz{constructor(e){super(e);const r=e&&e.forceBase64;this.supportsBinary=xz&&!r}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Ts(cA,this.uri(),e)}}function cA(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Rz))return new XMLHttpRequest}catch{}if(!e)try{return new Ci[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const lA=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Iz extends L4{get name(){return"websocket"}doOpen(){const e=this.uri(),r=this.opts.protocols,n=lA?{}:iA(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],i=r===e.length-1;M4(n,this.supportsBinary,s=>{try{this.doWrite(n,s)}catch{}i&&Em(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=sA()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}}const D4=Ci.WebSocket||Ci.MozWebSocket;class Oz extends Iz{createSocket(e,r,n){return lA?new D4(e,r,n):r?new D4(e,r):new D4(e)}doWrite(e,r){this.ws.send(r)}}class Uz extends L4{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const r=mz(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),i=pz();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{n.read().then(({done:a,value:c})=>{a||(this.onPacket(c),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],i=r===e.length-1;this._writer.write(n).then(()=>{i&&Em(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Mz={websocket:Oz,webtransport:Uz,polling:Bz},Pz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function W4(t){if(t.length>8e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let i=Pz.exec(t||""),s={},o=14;for(;o--;)s[Vz[o]]=i[o]||"";return r!=-1&&n!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Fz(s,s.path),s.queryKey=Lz(s,s.query),s}function Fz(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Lz(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,s){i&&(r[i]=s)}),r}const Z4=typeof addEventListener=="function"&&typeof removeEventListener=="function",Sm=[];Z4&&addEventListener("offline",()=>{Sm.forEach(t=>t())},!1);class Na extends Wr{constructor(e,r){if(super(),this.binaryType=vz,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(r=e,e=null),e){const n=W4(e);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=W4(r.host).host);Cm(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Cz(this.opts.query)),Z4&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Sm.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=nA,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Na.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(e);r.open(),this.setTransport(r)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Na.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=e.data,this._onError(r);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(r+=kz(i)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Em(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,r,n){return this._sendPacket("message",e,r,n),this}send(e,r,n){return this._sendPacket("message",e,r,n),this}_sendPacket(e,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const s={type:e,data:r,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Na.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Z4&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Sm.indexOf(this._offlineEventListener);n!==-1&&Sm.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this._prevBufferLen=0}}}Na.protocol=nA;class Dz extends Na{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let r=this.createTransport(e),n=!1;Na.priorWebsocketSuccess=!1;const i=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Na.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(u(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=r.name,this.emitReserved("upgradeError",h)}}))};function s(){n||(n=!0,u(),r.close(),r=null)}const o=d=>{const h=new Error("probe error: "+d);h.transport=r.name,s(),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function c(){o("socket closed")}function l(d){r&&d.name!==r.name&&s()}const u=()=>{r.removeListener("open",i),r.removeListener("error",o),r.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};r.once("open",i),r.once("error",o),r.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const r=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&r.push(e[n]);return r}}let Wz=class extends Dz{constructor(e,r={}){const n=typeof e=="object"?e:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>Mz[i]).filter(i=>!!i)),super(e,n)}};function Zz(t,e="",r){let n=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),n=W4(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+e,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}const zz=typeof ArrayBuffer=="function",Gz=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,uA=Object.prototype.toString,Hz=typeof Blob=="function"||typeof Blob<"u"&&uA.call(Blob)==="[object BlobConstructor]",jz=typeof File=="function"||typeof File<"u"&&uA.call(File)==="[object FileConstructor]";function z4(t){return zz&&(t instanceof ArrayBuffer||Gz(t))||Hz&&t instanceof Blob||jz&&t instanceof File}function Am(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(Am(t[r]))return!0;return!1}if(z4(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Am(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&Am(t[r]))return!0;return!1}function Qz(t){const e=[],r=t.data,n=t;return n.data=G4(r,e),n.attachments=e.length,{packet:n,buffers:e}}function G4(t,e){if(!t)return t;if(z4(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=G4(t[n],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=G4(t[n],e));return r}return t}function Jz(t,e){return t.data=H4(t.data,e),delete t.attachments,t}function H4(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=H4(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=H4(t[r],e));return t}const $z=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Yz=5;var At;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(At||(At={}));class Xz{constructor(e){this.replacer=e}encode(e){return(e.type===At.EVENT||e.type===At.ACK)&&Am(e)?this.encodeAsBinary({type:e.type===At.EVENT?At.BINARY_EVENT:At.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===At.BINARY_EVENT||e.type===At.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=Qz(e),n=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(n),i}}function dA(t){return Object.prototype.toString.call(t)==="[object Object]"}class j4 extends Wr{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);const n=r.type===At.BINARY_EVENT;n||r.type===At.BINARY_ACK?(r.type=n?At.EVENT:At.ACK,this.reconstructor=new Kz(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(z4(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const n={type:Number(e.charAt(0))};if(At[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===At.BINARY_EVENT||n.type===At.BINARY_ACK){const s=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const o=e.substring(s,r);if(o!=Number(o)||e.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(r+1)==="/"){const s=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););n.nsp=e.substring(s,r)}else n.nsp="/";const i=e.charAt(r+1);if(i!==""&&Number(i)==i){const s=r+1;for(;++r;){const o=e.charAt(r);if(o==null||Number(o)!=o){--r;break}if(r===e.length)break}n.id=Number(e.substring(s,r+1))}if(e.charAt(++r)){const s=this.tryParse(e.substr(r));if(j4.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case At.CONNECT:return dA(r);case At.DISCONNECT:return r===void 0;case At.CONNECT_ERROR:return typeof r=="string"||dA(r);case At.EVENT:case At.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&$z.indexOf(r[0])===-1);case At.ACK:case At.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Kz{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=Jz(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const qz=Object.freeze(Object.defineProperty({__proto__:null,Decoder:j4,Encoder:Xz,get PacketType(){return At},protocol:Yz},Symbol.toStringTag,{value:"Module"}));function $i(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const eG=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class hA extends Wr{constructor(e,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[$i(e,"open",this.onopen.bind(this)),$i(e,"packet",this.onpacket.bind(this)),$i(e,"error",this.onerror.bind(this)),$i(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...r){var n,i,s;if(eG.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const o={type:At.EVENT,data:r};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const u=this.ids++,d=r.pop();this._registerAckCallback(u,d),o.id=u}const a=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,r){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=r;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);r.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),r.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...r){return new Promise((n,i)=>{const s=(o,a)=>o?i(o):n(a);s.withError=!0,r.push(s),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>n!==this._queue[0]?void 0:(i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...s)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:At.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case At.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case At.EVENT:case At.BINARY_EVENT:this.onevent(e);break;case At.ACK:case At.BINARY_ACK:this.onack(e);break;case At.DISCONNECT:this.ondisconnect();break;case At.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:At.ACK,id:e,data:i}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:At.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,e.data)}}}function hd(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}hd.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0},hd.prototype.reset=function(){this.attempts=0},hd.prototype.setMin=function(t){this.ms=t},hd.prototype.setMax=function(t){this.max=t},hd.prototype.setJitter=function(t){this.jitter=t};class Q4 extends Wr{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,Cm(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new hd({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const i=r.parser||qz;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Wz(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=$i(r,"open",function(){n.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=$i(r,"error",s);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),r.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push($i(e,"ping",this.onping.bind(this)),$i(e,"data",this.ondata.bind(this)),$i(e,"error",this.onerror.bind(this)),$i(e,"close",this.onclose.bind(this)),$i(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){Em(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new hA(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;n<r.length;n++)this.engine.write(r[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const g0={};function Rm(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=Zz(t,e.path||"/socket.io"),n=r.source,i=r.id,s=r.path,o=g0[i]&&s in g0[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let c;return a?c=new Q4(n,e):(g0[i]||(g0[i]=new Q4(n,e)),c=g0[i]),r.query&&!e.query&&(e.query=r.queryKey),c.socket(r.path,e)}Object.assign(Rm,{Manager:Q4,Socket:hA,io:Rm,connect:Rm});const zc=new Map,tG=async t=>{const e=zc.get(t);e==null||e.disconnect(),zc.delete(t)},fA=async t=>{if(zc.has(t))return zc.get(t);const e=Rm(t,{auth:{bearer_token:ve(Fn)}});return await new Promise((r,n)=>{e.once("connect_error",i=>n(i)),e.once("connect",()=>r(e)),setTimeout(()=>n(new Error("Cannot connect to websocket server")),5e3)}),zc.set(t,e),e},rG=async t=>{(await fA(t)).on("passport_id/sign",sG)},nG=async(t,e)=>{const r=await fA(t);return new Promise((n,i)=>{r.emit("contracts/forward_transaction",{payload:{unsigned_serialized_meta_tx:e}},s=>{if(tG(t),s.error)return console.error(s.error),i(new Error("Transaction failed"));n(s.payload)})})},iG=async(t,e,r)=>{var n;try{if(!zc.has(t))throw new Error("Socket client not connected");(n=zc.get(t))==null||n.emit(r.emit_event,{headers:r.emit_event_headers,payload:{signature:e}})}catch(i){console.error(i)}},sG=async t=>{const{openUI:e}=ve(vr);e(Be.SIGN,{message:t.payload.message,socketEventDataHeaders:t.headers})},pA={connectSocketForSignatures:rG,signDataAndEmitEvent:iG},oG=async t=>{try{return(await t.getTrustedForwarder()).toLowerCase()===iz}catch(e){return console.warn("Gasless tx are not available for this contract",(e==null?void 0:e.message)||e),!1}},v0=async(t,e)=>{if(!await oG(e))return await(await ve(Dr).getSigner()).sendTransaction(t);const{credenza:r,chainId:n}=ve(tt);t.chainId=BigInt(n);const i=ir.Transaction.from(t).unsignedSerialized;return await nG(r.evmApiUrl,i)},mA=t=>{const{chainId:e}=ve(tt);return Bt[e].scanUrl+"/tx/"+t};var pt=(t=>(t.ERROR="ERROR",t.INIT="INIT",t.LOGIN="LOGIN",t.LOGOUT="LOGOUT",t.PAYMENT="PAYMENT",t.SEND_TOKENS="SEND_TOKENS",t.SEND_NFT="SEND_NFT",t.RECHECK_BALANCE="RECHECK_BALANCE",t.UPDATE_PROFILE="UPDATE_PROFILE",t.ACCOUNT_CONFIRMED="ACCOUNT_CONFIRMED",t.TRANSACTION="TRANSACTION",t.RECEIPT="RECEIPT",t.UI_CLOSED="UI_CLOSED",t.REQUEST_AIRDROP="REQUEST_AIRDROP",t.REQUEST_LOYALTY_POINTS="REQUEST_LOYALTY_POINTS",t))(pt||{});const Gc=new Map;let xa=0;function J4(t,e){const r=Gc.get(t);if(r!=null&&r.length){for(let n=r.length-1;n>=0;n--)if(r[n].id===e){r.splice(n,1),Gc.set(t,r);return}}}function $4(t,e){const r=Gc.get(t)??[];return xa=xa+1,r.push({callback:e,id:xa,once:!0}),Gc.set(t,r),()=>J4(t,xa)}function Y4(t,e){const r=Gc.get(t)??[];return xa=xa+1,r.push({callback:e,id:xa}),Gc.set(t,r),()=>J4(t,xa)}function It(t,e){const r=Gc.get(t);if(r!=null&&r.length)for(const n of r)n.callback(e),n.once&&J4(t,n.id)}var aG=Object.defineProperty,cG=(t,e,r)=>e in t?aG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dn=(t,e,r)=>cG(t,typeof e!="symbol"?e+"":e,r);let y0=class extends Error{};y0.prototype.name="InvalidTokenError";function lG(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function uG(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return lG(e)}catch{return atob(e)}}function dG(t,e){if(typeof t!="string")throw new y0("Invalid token specified: must be a string");e||(e={});const r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new y0(`Invalid token specified: missing part #${r+1}`);let i;try{i=uG(n)}catch(s){throw new y0(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new y0(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}const X4="credenza_web_sdk:";function K4(t,e){return localStorage.setItem(`${X4}${t}`,e)}function q4(t){return localStorage.getItem(`${X4}${t}`)}function gA(t){return localStorage.removeItem(`${X4}${t}`)}const vA={LOCAL:"local",STAGING:"staging",PROD:"prod"},eb="access_token",tb="refresh_token",yA="login_provider",Tm={ERROR:"ERROR",INIT:"INIT",LOGIN:"LOGIN",LOGOUT:"LOGOUT"},Hc=new Map;let Ba=0;function rb(t,e){const r=Hc.get(t);if(r!=null&&r.length){for(let n=r.length-1;n>=0;n--)if(r[n].id===e){r.splice(n,1),Hc.set(t,r);return}}}function hG(t,e){const r=Hc.get(t)??[];return Ba=Ba+1,r.push({callback:e,id:Ba,once:!0}),Hc.set(t,r),()=>rb(t,Ba)}function fG(t,e){const r=Hc.get(t)??[];return Ba=Ba+1,r.push({callback:e,id:Ba}),Hc.set(t,r),()=>rb(t,Ba)}function Nm(t,e){const r=Hc.get(t);if(r!=null&&r.length)for(const n of r)n.callback(e),n.once&&rb(t,n.id)}let w0=class{constructor(e){dn(this,"clientId"),dn(this,"env"),dn(this,"extensions",[]),dn(this,"oauth"),dn(this,"account"),dn(this,"metamask"),dn(this,"evm"),dn(this,"sui"),dn(this,"zklogin"),dn(this,"accessToken"),dn(this,"refreshToken"),dn(this,"loginProvider"),dn(this,"once",hG),dn(this,"on",fG),dn(this,"_emit",Nm),this.clientId=e.clientId,this.env=e.env||vA.PROD;for(const r of e.extensions||[])Object.assign(this,{[r.name]:r}),this.extensions.push(r.name)}async initialize(){var e;if(this.accessToken=q4(eb),this.refreshToken=q4(tb),this.loginProvider=q4(yA),this.accessToken){const r=dG(this.accessToken);(!r.exp||r.aud!==this.clientId||r.exp*1e3<new Date().getTime())&&this.logout()}for(const r of this.extensions)await((e=this[r])==null?void 0:e._initialize(this));Nm(Tm.INIT)}async _setAccessToken(e,r,n=!0){K4(yA,r),n&&K4(eb,e),this.accessToken=e,this.loginProvider=r,Nm(Tm.LOGIN)}_setRefreshToken(e){K4(tb,e),this.refreshToken=e}getRefreshToken(){return this.refreshToken}getAccessToken(){return this.accessToken}getLoginProvider(){return this.loginProvider}isLoggedIn(){return!!this.accessToken&&!!this.loginProvider}logout(){gA(eb),gA(tb),this.accessToken=null,this.refreshToken=null,this.loginProvider=null,Nm(Tm.LOGOUT)}};dn(w0,"SDK_ENV",vA),dn(w0,"SDK_EVENT",Tm);var pG=Object.defineProperty,mG=(t,e,r)=>e in t?pG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wA=(t,e,r)=>mG(t,typeof e!="symbol"?e+"":e,r);const fd={LOCAL:"local",STAGING:"staging",PROD:"prod"},nb={PROD:"https://accounts.credenza3.com",STAGING:"https://accounts.staging.credenza3.com",LOCAL:"http://localhost:8081"},ib={PROD:"https://auth.credenza3.com",STAGING:"https://auth.staging.credenza3.com",LOCAL:"https://auth.staging.credenza3.com"};function sb(t){switch(t.env){case fd.LOCAL:return nb.LOCAL;case fd.STAGING:return nb.STAGING;case fd.PROD:return nb.PROD;default:throw new Error("Invalid sdk env")}}function gG(t){switch(t.env){case fd.LOCAL:return ib.LOCAL;case fd.STAGING:return ib.STAGING;case fd.PROD:return ib.PROD;default:throw new Error("Invalid sdk env")}}const bA="credenza_web_sdk:";function ob(t,e){return localStorage.setItem(`${bA}${t}`,e)}function pd(t){return localStorage.getItem(`${bA}${t}`)}const vG={OAUTH:"oauth"};let b0=class extends Error{};b0.prototype.name="InvalidTokenError";function yG(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function wG(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return yG(e)}catch{return atob(e)}}function bG(t,e){if(typeof t!="string")throw new b0("Invalid token specified: must be a string");e||(e={});const r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new b0(`Invalid token specified: missing part #${r+1}`);let i;try{i=wG(n)}catch(s){throw new b0(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new b0(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}const kA="oauth:nonce",ab="oauth:state",xm="oauth:client_server_uri";function cb(t=64){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=new Uint8Array(t);return crypto.getRandomValues(r),Array.from(r,n=>e[n%e.length]).join("")}const _A="credenza_web_sdk:";function kG(t,e){return sessionStorage.setItem(`${_A}${t}`,e)}function _G(t){return sessionStorage.getItem(`${_A}${t}`)}const EA="oauth:client_code_verifier";async function EG(t,e,r){if(e.searchParams.append("response_type",r.responseType||"token"),r.responseType==="code"){const n=cb();kG(EA,n);const{codeChallenge:i,codeChallengeMethod:s}=await t.oauth.buildS256CodeChallenge(n);e.searchParams.append("code_challenge",i),e.searchParams.append("code_challenge_method",s)}}async function CA(t,e,r=!1){const n=r?sb:gG,i=new URL(n(t)+"/oauth2/authorize"+(r?"/jwt":""));return i.searchParams.append("client_id",t.clientId),i.searchParams.append("scope",e.scope),i.searchParams.append("nonce",e.nonce||cb(32)),i.searchParams.append("state",e.state||cb(32)),i.searchParams.append("credenza_session_length_seconds",String(e.sessionLengthSeconds??60*60)),await EG(t,i,e),i}function SA(t,e){t.searchParams.append("redirect_uri",e.redirectUrl)}function CG(t,e){e.clientServerUri&&t.searchParams.append("client_server_uri",e.clientServerUri)}function SG(t,e){e.forceEmail?t.searchParams.append("force_email",e.forceEmail):e.forcePhone&&t.searchParams.append("force_phone",e.forcePhone)}async function AG(t){try{const e=await fetch(`${sb(t)}/oauth2/revoke-session`,{method:"DELETE",headers:{Authorization:`Bearer ${t.getAccessToken()}`}});if(!e.ok)throw new Error(e.statusText)}catch(e){throw new Error(`Error revoking session: ${e.message}`)}}async function RG(t,e){try{const r=await fetch(e.clientServerUri.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e.code,client_id:t.clientId,grant_type:"authorization_code",code_verifier:_G(EA)})});if(!r.ok)throw new Error(r.statusText);return await r.json()}catch(r){throw new Error(`Code exchange failed: ${r.message}`)}}async function TG(t,e){try{const r=await fetch(e.clientServerUri.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e.refreshToken,client_id:t.clientId,grant_type:"refresh_token"})});if(!r.ok)throw new Error(r.statusText);return await r.json()}catch(r){throw new Error(`Code refresh failed: ${r.message}`)}}async function NG(t,e){try{const r=await CA(t,e,!0);SA(r,{redirectUrl:"none"});const n=await fetch(r.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({validator_id:e.validatorId,..."idToken"in e?{id_token:e.idToken}:{},..."accessToken"in e?{access_token:e.accessToken}:{}})});if(!n.ok)throw new Error(n.statusText);return await n.json()}catch(r){throw new Error(`Jwt login failed: ${r.message}`)}}const k0=t=>Array.isArray(t)?t.map(e=>k0(e)):typeof t=="function"||t!==Object(t)?t:Object.fromEntries(Object.entries(t).map(([e,r])=>[e.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,"")),k0(r)]));let xG=class{constructor(){wA(this,"name","oauth"),wA(this,"sdk")}async _initialize(e){this.sdk=e,await this._handleRedirectResult(),!this.sdk.getAccessToken()&&this.sdk.getRefreshToken()&&await this.refreshAccessToken()}async revokeSession(){if(!this.sdk.isLoggedIn())throw new Error("Revoke failed: User is not logged in");return await AG(this.sdk)}revokeBrowserSessionWithRedirect(e){const r=new URL(sb(this.sdk)+"/oauth2/logout");return r.searchParams.append("redirect_uri",e),window.location.href=r.toString()}login(e){return console.warn('login is deprecated and will be removed soon. Use "loginWithRedirect" instead.'),this.loginWithRedirect(e)}async loginWithRedirect(e){const r=await CA(this.sdk,e);SA(r,e),SG(r,e),CG(r,e),ob(kA,r.searchParams.get("nonce")),ob(ab,r.searchParams.get("state")),r.searchParams.has("client_server_uri")&&ob(xm,r.searchParams.get("client_server_uri")),window.location.href=r.toString()}async loginWithJwt(e){const r=await NG(this.sdk,e);return r.access_token&&await this.setAccessToken(r.access_token),k0(r)}async checkAndHandleHashRedirectResult(){const e=window.location.hash;if(!e)return!1;const r=e.replace("#","").split("&").reduce((s,o)=>{const[a,c]=o.split("=");return s[a]=c,s},{}),n=pd(ab);if(r.state!==n)throw new Error("Invalid state");if(!r.access_token)throw new Error("Invalid access token");const i=bG(r.access_token);if(pd(kA)!==i.nonce)throw new Error("Invalid nonce");return await this.setAccessToken(r.access_token),history&&window.location.hash?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash="",!0}async checkAndHandleSearchRedirectResult(){const e=new URLSearchParams(window.location.search);if(!e.has("state")||!e.has("code"))return;const r=pd(ab),n=pd(xm);if(e.get("state")!==r)throw new Error("Invalid state");if(!n)throw new Error("Invalid client server uri");if(!e.has("code"))throw new Error("Invalid code");await this._exchangeCodeForToken(e.get("code")),history&&window.location.search&&(e.delete("code"),e.delete("state"),history.replaceState(null,document.title,window.location.pathname+e.toString()))}async refreshAccessToken(){const e=this.sdk.getRefreshToken();if(!e)throw new Error("Invalid refresh token");const r=pd(xm);if(!r)throw new Error("Invalid client server uri");const n=await TG(this.sdk,{clientServerUri:r,refreshToken:e});return n.access_token&&await this.setAccessToken(n.access_token),n.refresh_token&&this.setRefreshToken(n.refresh_token),k0(n)}async _exchangeCodeForToken(e){const r=pd(xm);if(!r)throw new Error("Invalid client server uri");const n=await RG(this.sdk,{code:e,clientServerUri:r});return n.access_token&&await this.setAccessToken(n.access_token,!1),n.refresh_token&&this.setRefreshToken(n.refresh_token),k0(n)}async _handleRedirectResult(){await this.checkAndHandleHashRedirectResult()||await this.checkAndHandleSearchRedirectResult()}async buildS256CodeChallenge(e){const r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return{codeChallenge:btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(n)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),codeChallengeMethod:"S256"}}async setAccessToken(e,r=!0){await this.sdk._setAccessToken(e,vG.OAUTH,r)}setRefreshToken(e){this.sdk._setRefreshToken(e)}};var BG=Object.defineProperty,IG=(t,e,r)=>e in t?BG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AA=(t,e,r)=>IG(t,typeof e!="symbol"?e+"":e,r);const lb={LOCAL:"local",STAGING:"staging",PROD:"prod"},ub={PROD:"https://accounts.credenza3.com",STAGING:"https://accounts.staging.credenza3.com",LOCAL:"http://localhost:8081"};function _0(t){switch(t.env){case lb.LOCAL:return ub.LOCAL;case lb.STAGING:return ub.STAGING;case lb.PROD:return ub.PROD;default:throw new Error("Invalid sdk env")}}let OG=class{constructor(){AA(this,"name","account"),AA(this,"sdk")}async _initialize(e){this.sdk=e}async _updateAccountContact(e){const r=`${_0(this.sdk)}/accounts/me/change-contact`,n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sdk.getAccessToken()}`},body:JSON.stringify({..."email"in e?{email:e.email.trim()}:{},..."phone"in e?{phone:e.phone.trim()}:{},..."code"in e?{code:e.code.trim()}:{}})});if(!n.ok)throw new Error(`Request failed: ${n.statusText}`);return await n.json()}async changeEmail(e){return await this._updateAccountContact({email:e})}async changePhone(e){return await this._updateAccountContact({phone:e})}async verifyCode(e){return await this._updateAccountContact({code:e})}async pendingVerificationContacts(){const e=`${_0(this.sdk)}/accounts/me/change-contact`,r=await fetch(e,{headers:{Authorization:`Bearer ${this.sdk.getAccessToken()}`}});if(!r.ok)throw new Error(`Request failed: ${r.statusText}`);return await r.json()}async info(){const e=`${_0(this.sdk)}/oauth2/userinfo`,r=await fetch(e,{headers:{Authorization:`Bearer ${this.sdk.getAccessToken()}`}});if(!r.ok)throw new Error(`Cannot get userInfo: ${r.statusText}`);return await r.json()}async updateProfile(e){if(!e.name&&!e.picture)throw new Error("Nothing to update");const r=`${_0(this.sdk)}/accounts/me`,n=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sdk.getAccessToken()}`},body:JSON.stringify({...e.name?{name:e.name.trim()}:{},...e.picture?{image:e.picture.trim()}:{}})});if(!n.ok)throw new Error(`Cannot update user: ${n.statusText}`);return await n.json()}async changePassword(e){if(!e.oldPassword||!e.newPassword)throw new Error("Invalid parameters");if(e.newPassword!==e.confirmPassword)throw new Error("Passwords do not match");const r=`${_0(this.sdk)}/accounts/me/password`,n=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sdk.getAccessToken()}`},body:JSON.stringify({old_password:e.oldPassword.trim(),new_password:e.newPassword.trim(),confirm_password:e.confirmPassword.trim()})});if(!n.ok)throw new Error(`Cannot change password: ${n.statusText}`);return await n.json()}},pr;const UG=async(t,e,r=Oc.MAINNET)=>pr?void 0:(pr=new w0({env:r===Oc.MAINNET?w0.SDK_ENV.PROD:w0.SDK_ENV.STAGING,clientId:t,extensions:[...e,new xG,new OG]}),pr.initialize()),Ia=t=>`0x${Number(t).toString(16)}`,MG={chainId:Ia(Ae.POLYGON_AMOY),rpcUrl:Bt[Ae.POLYGON_AMOY].rpcUrl,displayName:Bt[Ae.POLYGON_AMOY].name,blockExplorer:Bt[Ae.POLYGON_AMOY].scanUrl,nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18}},PG={chainId:Ia(Ae.POLYGON),rpcUrl:Bt[Ae.POLYGON].rpcUrl,displayName:Bt[Ae.POLYGON].name,blockExplorer:Bt[Ae.POLYGON].scanUrl,nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18}},VG={chainId:Ia(Ae.CHILIZ_SPICY),rpcUrl:Bt[Ae.CHILIZ_SPICY].rpcUrl,displayName:Bt[Ae.CHILIZ_SPICY].name,blockExplorer:Bt[Ae.CHILIZ_SPICY].scanUrl,nativeCurrency:{name:"CHZ",symbol:"CHZ",decimals:18}},FG={chainId:Ia(Ae.CHILIZ),rpcUrl:Bt[Ae.CHILIZ].rpcUrl,displayName:Bt[Ae.CHILIZ].name,blockExplorer:Bt[Ae.CHILIZ].scanUrl,nativeCurrency:{name:"CHZ",symbol:"CHZ",decimals:18}},LG={chainId:Ia(Ae.AVALANCHE_FUJI),rpcUrl:Bt[Ae.AVALANCHE_FUJI].rpcUrl,displayName:Bt[Ae.AVALANCHE_FUJI].name,blockExplorer:Bt[Ae.AVALANCHE_FUJI].scanUrl,nativeCurrency:{name:"AVAX",symbol:"AVAX",decimals:18}},DG={chainId:Ia(Ae.AVALANCHE),rpcUrl:Bt[Ae.AVALANCHE].rpcUrl,displayName:Bt[Ae.AVALANCHE].name,blockExplorer:Bt[Ae.AVALANCHE].scanUrl,nativeCurrency:{name:"AVAX",symbol:"AVAX",decimals:18}},WG={chainId:Ia(Ae.BASE),rpcUrl:Bt[Ae.BASE].rpcUrl,displayName:Bt[Ae.BASE].name,blockExplorer:Bt[Ae.BASE].scanUrl,nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},ZG={chainId:Ia(Ae.BASE_SEPOLIA),rpcUrl:Bt[Ae.BASE_SEPOLIA].rpcUrl,displayName:Bt[Ae.BASE_SEPOLIA].name,blockExplorer:Bt[Ae.BASE_SEPOLIA].scanUrl,nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},RA=t=>{switch(t){case Ae.POLYGON_AMOY:return MG;case Ae.CHILIZ_SPICY:return VG;case Ae.CHILIZ:return FG;case Ae.POLYGON:return PG;case Ae.AVALANCHE_FUJI:return LG;case Ae.AVALANCHE:return DG;case Ae.BASE_SEPOLIA:return ZG;case Ae.BASE:return WG;default:throw new Error("Unsupported Chain Id: "+t)}};function zG(){return ve(Dr)}async function Zr(){return await ve(az)??null}async function GG({chainId:t}){if(this.networkType!==JS(t))throw new Error(`Passport is initialized in '${this.networkType}' environment.`);const e=RA(t);await pr.evm.switchChain(e),Dr.set(await pr.evm.getEthersProvider()),this.configurePassport({chainId:t,config:this.config,clientId:this.config.clientId})}async function TA(){const{address:t,decimals:e}=ve(dd).erc20Cred;if(!t||!e)throw new Error("not available for this chainId");const r=ve(Dr),{erc20MinAbi:n}=await Promise.resolve().then(()=>Pa);return{contract:new ir.Contract(t,n,r),decimals:e,address:t}}async function HG(t,e=ve(dd).membership.address){try{if(!e)throw new Error("Membership is not available for this chainId");const r=ve(Dr),{membershipMinAbi:n}=await Promise.resolve().then(()=>Pa),i=new ir.Contract(e,n,r),s=await i.confirmMembership(t);if(!s)return{isMember:s,meta:{}};const o=await i.getMembershipMetadata(t);return{isMember:s,meta:o&&JSON.parse(o)}}catch{return{isMember:!1,meta:{}}}}async function jG({contractAddress:t,tokenId:e,amount:r,targetAddress:n}){try{const i=ve(Dr),s=new ir.Contract(t,oz,i),o=await s["requestToken(uint256,uint256,address)"].populateTransaction(e||0,r||1,n),a=await v0(o,s);It(pt.REQUEST_AIRDROP,a),It(pt.RECHECK_BALANCE);const{chainId:c,clientId:l}=ve(tt);un.track("cp_airdrop",{chain:c,clientId:l,contract:t,tokenId:e,to:n,amount:r})}catch(i){throw It(pt.ERROR,{error:{message:i.statusText,title:"Air drop failed",code:i.status}}),i}}async function QG({contract:t,recipient:e,tokenId:r,amount:n}){const i=await t["safeTransferFrom(address,address,uint256,uint256,bytes)"].populateTransaction(await Zr(),e,r,n,ir.ZeroHash),s=await v0(i,t),{clientId:o,chainId:a}=ve(tt),c={chain:a,clientId:o,contract:await(t==null?void 0:t.getAddress())??null,tokenId:r,from:await Zr(),to:e,amount:n};return It(pt.SEND_NFT,{...s,...c}),un.track("cp_transfer_nft",c),s}async function JG({address:t,amount:e,instance:r}){try{const n=ve(dd).erc20Cred.decimals,i=await ve(Dr).getSigner(),s=r?await v0(await r.transfer.populateTransaction(t,e),r):await i.sendTransaction({to:t,value:e}),{chainId:o,clientId:a}=ve(tt);return It(pt.SEND_TOKENS,s),un.track("cp_transfer_tokens",{chain:o,clientId:a,contract:await(r==null?void 0:r.getAddress())??null,from:await Zr(),to:t,amount:ir.formatUnits(e,n)}),s}catch(n){throw It(pt.ERROR,{error:n}),n}}const $G=async()=>{try{const{contract:t}=await TA();return await t.balanceOf(await Zr())}catch(t){throw It(pt.ERROR,{error:t}),t}},YG=async t=>{const r=await(await pr.evm.getEthersProvider()).getSigner(),{erc1155MinAbi:n}=await Promise.resolve().then(()=>Pa);for(const i of t){if(i.directive.type!=="erc1155")continue;const s=i.directive.value.token_id,o=i.directive.resource_id,c=await new ir.Contract(o,n,r).uri(s.toString()),u=await(await fetch(c)).json();i.metadata=u}};async function XG(t,e){const n=await(await pr.evm.getEthersProvider()).getSigner(),{erc1155MinAbi:i}=await Promise.resolve().then(()=>Pa),o=await new ir.Contract(t,i,n).uri(Number(e)),a=await fetch(o);if(!a.ok)throw new Error(`Failed to fetch metadata: ${a.status} ${a.statusText}`);return await a.json()}const KG=t=>["contractAddress","amount","title"].every(r=>Object.prototype.hasOwnProperty.call(t,r))&&(t.tokenId||t.typeId),NA=({title:t,typeId:e,amount:r,tokenId:n,contractAddress:i,progressVideos:s})=>{bt.set({subtitle:t,...e?{memberships:[{contractAddress:i,typeId:e}]}:{},...n?{tokens:[{contractAddress:i,tokenId:n,amount:r}]}:{},loaderText:QS,progressVideos:s}),Mt.set(Be.PAYMENT)},qG=({userAddress:t,amount:e})=>{bt.set({to:t,amount:e}),Mt.set(Be.SEND_TOKENS)},eH=async t=>{const e=ve(tt).chainId;if(t.chainId!==e)throw new Error("Chain ID mismatch. Expected: "+e+", got: "+t.chainId);const r=await XG(t.contractAddress,String(t.tokenId));let n=r.image||"";const{requestAirDrop:i}=ve(Gk);try{bt.set({loaderText:`AirDropping Token: ${r.name}`||"...",progressVideos:t.progressVideos}),Mt.set(Be.LOADER);const s=await Zr();await i({...t,targetAddress:s}),await B4(),bt.set({subtitle:`Your account has a new token: ${r.name}`,receipt:!1,tokenImage:n}),Mt.set(Be.PAYMENT_RESULT)}catch(s){bt.set({errorMessage:s.statusText}),Mt.set(Be.ERROR)}},tH=async({eventId:t,contractAddress:e})=>{const{requestLoyaltyPoints:r}=ve(vr);try{bt.set({loaderText:"Issuing Loyalty points..",progressVideos:[]}),Mt.set(Be.LOADER),r&&await r(t,e),bt.set({subtitle:"The request for loyalty points was successful!",description:"",receipt:!1}),Mt.set(Be.PAYMENT_RESULT)}catch(n){bt.set({description:n.message,title:"The request failed"}),Mt.set(Be.ERROR)}};async function rH(t={}){var e;try{if(!Object.keys(t).length)return;const r=[];t.name&&r.push(pr.account.updateProfile({name:t.name})),t.email&&r.push(pr.account.changeEmail(t.email)),t.phone&&r.push(pr.account.changePhone(t.phone));const n=await Promise.all(r);for(const s of n)if((e=s.errors)!=null&&e.length)throw new Error(s.errors[0].error);const i=await Bm();return bn.set(i),It(pt.UPDATE_PROFILE,i),i}catch(r){throw It(pt.ERROR,{error:r}),r}}async function nH(t){try{const e=[];t.phoneCode&&e.push(pr.account.verifyCode(t.phoneCode)),t.emailCode&&e.push(pr.account.verifyCode(t.emailCode)),await Promise.all(e);const r=await Bm();return bn.set(r),It(pt.ACCOUNT_CONFIRMED,{...r!=null&&r.name?{name:r.name}:{},...r!=null&&r.email?{email:r.email}:{},...r!=null&&r.phone?{phone:r.phone}:{}}),r}catch(e){throw It(pt.ERROR,{error:e}),e}}const iH=async()=>(await pr.account.pendingVerificationContacts()).reduce((e,r)=>(r.phone&&(e.phone=r.phone),r.email&&(e.email=r.email),e),{}),Bm=async()=>({...await pr.account.info(),pending:{...await iH()}}),sH=async({address:t,tokenType:e})=>{const r=ve(Fn);if(!r)throw new Error("Passport access token doesn't exist.");const n=ve(tt),i=await fetch(n.credenza.apiUrl+`/users/${e}/${n.chainId}/${t}`,{headers:{Authorization:`Bearer ${r}`}});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return await i.json()},oH=async()=>{const{chainId:t,credenza:e}=ve(tt),r=ve(Fn);if(!r)throw new Error("Passport access token doesn't exist.");const n=await fetch(e.apiUrl+`/auth/gitbookToken/${t}`,{headers:{Authorization:`Bearer ${r}`}});if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return(await n.json()).gitbookToken},aH=t=>{const e=localStorage.getItem(Mc.QR_CODE);if(e)try{const{date:r,sig:n}=JSON.parse(e);if(ir.verifyMessage(r,n).toLowerCase()!==t.toLowerCase())throw new Error("Address mismatch")}catch{localStorage.removeItem(Mc.QR_CODE)}},cH=async()=>{try{Du.set(!0);const t=ve(tt),e=await pr.evm.getEthersProvider();Dr.set(e);const r=await(await e.getSigner()).getAddress(),n=pr.getAccessToken();Fn.set(n),aH(r);const i=await Bm();bn.set(i),wi.set(!0),Du.set(!1),un.identify(i.sub),un.people.set({$email:i.email,$phone:i.phone,$name:i.name,chain:t.chainId,clientId:t.clientId,provider:e,address:r,location:window.location.href}),un.track("cp_init",{$email:i.email,$phone:i.phone,chain:t.chainId,provider:e,address:r,location:window.location.href,clientId:t.clientId})}catch(t){localStorage.removeItem(Mc.ACCESS_TOKEN),wi.set(!1),Du.set(!1),bn.set(null),Fn.set(null),console.error("Cannot init credenza user",t)}},lH=(t,e)=>{const r=Object.fromEntries(new URLSearchParams(location.search));if(KG(r)){if(!t)return void e();NA({title:r.title,typeId:+r.typeId,amount:+r.amount,tokenId:r.tokenId,contractAddress:r.contractAddress}),e(),nz()}},xA=async t=>{if(!ve(Fn))throw new Error("Passport access token doesn't exist.");const r=ve(tt),n=await fetch(`${r.credenza.evmApiUrl}/accounts/${t}/assigned-address`,{method:"get",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ve(Fn)}`}}),i=await n.json();if(!n.ok)throw new Error(i.error);return i};var uH=Object.defineProperty,dH=(t,e,r)=>e in t?uH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jc=(t,e,r)=>dH(t,typeof e!="symbol"?e+"":e,r);function hn(){}const md=t=>t;function Im(t,e){for(const r in e)t[r]=e[r];return t}function BA(t){return t()}function IA(){return Object.create(null)}function Eo(t){t.forEach(BA)}function E0(t){return typeof t=="function"}function db(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function hH(t){return Object.keys(t).length===0}function fH(t,...e){if(t==null){for(const n of e)n(void 0);return hn}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function OA(t,e,r){t.$$.on_destroy.push(fH(e,r))}function UA(t){return t??""}function MA(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}const PA=typeof window<"u";let Om=PA?()=>window.performance.now():()=>Date.now(),hb=PA?t=>requestAnimationFrame(t):hn;const gd=new Set;function VA(t){gd.forEach(e=>{e.c(t)||(gd.delete(e),e.f())}),gd.size!==0&&hb(VA)}function Um(t){let e;return gd.size===0&&hb(VA),{promise:new Promise(r=>{gd.add(e={c:t,f:r})}),abort(){gd.delete(e)}}}function vd(t,e){t.appendChild(e)}function FA(t,e,r){const n=fb(t);if(!n.getElementById(e)){const i=So("style");i.id=e,i.textContent=r,LA(n,i)}}function fb(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function pH(t){const e=So("style");return e.textContent="/* empty */",LA(fb(t),e),e.sheet}function LA(t,e){return vd(t.head||t,e),e.sheet}function Qc(t,e,r){t.insertBefore(e,r||null)}function Co(t){t.parentNode&&t.parentNode.removeChild(t)}function So(t){return document.createElement(t)}function mH(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function DA(t){return document.createTextNode(t)}function pb(){return DA(" ")}function WA(){return DA("")}function Mm(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function Si(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}function gH(t){return Array.from(t.childNodes)}function Pm(t,e,r){t.classList.toggle(e,!!r)}function vH(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}class yH{constructor(e=!1){jc(this,"is_svg",!1),jc(this,"e"),jc(this,"n"),jc(this,"t"),jc(this,"a"),this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,r,n=null){this.e||(this.is_svg?this.e=mH(r.nodeName):this.e=So(r.nodeType===11?"TEMPLATE":r.nodeName),this.t=r.tagName!=="TEMPLATE"?r:r.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let r=0;r<this.n.length;r+=1)Qc(this.t,this.n[r],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Co)}}function ZA(t,e){return new t(e)}const Vm=new Map;let Fm=0;function wH(t){let e=5381,r=t.length;for(;r--;)e=(e<<5)-e^t.charCodeAt(r);return e>>>0}function bH(t,e){const r={stylesheet:pH(e),rules:{}};return Vm.set(t,r),r}function mb(t,e,r,n,i,s,o,a=0){const c=16.666/n;let l=`{
70
70
  `;for(let m=0;m<=1;m+=c){const w=e+(r-e)*s(m);l+=m*100+`%{${o(w,1-w)}}
71
71
  `}const u=l+`100% {${o(r,1-r)}}
72
72
  }`,d=`__svelte_${wH(u)}_${a}`,h=fb(t),{stylesheet:f,rules:p}=Vm.get(h)||bH(h,t);p[d]||(p[d]=!0,f.insertRule(`@keyframes ${d} ${u}`,f.cssRules.length));const v=t.style.animation||"";return t.style.animation=`${v?`${v}, `:""}${d} ${n}ms linear ${i}ms 1 both`,Fm+=1,d}function Lm(t,e){const r=(t.style.animation||"").split(", "),n=r.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),i=r.length-n.length;i&&(t.style.animation=n.join(", "),Fm-=i,Fm||kH())}function kH(){hb(()=>{Fm||(Vm.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&Co(e)}),Vm.clear())})}function _H(t,e,r,n){if(!e)return hn;const i=t.getBoundingClientRect();if(e.left===i.left&&e.right===i.right&&e.top===i.top&&e.bottom===i.bottom)return hn;const{delay:s=0,duration:o=300,easing:a=md,start:c=Om()+s,end:l=c+o,tick:u=hn,css:d}=r(t,{from:e,to:i},n);let h=!0,f=!1,p;function v(){d&&(p=mb(t,0,1,o,s,a,d)),s||(f=!0)}function m(){d&&Lm(t,p),h=!1}return Um(w=>{if(!f&&w>=c&&(f=!0),f&&w>=l&&(u(1,0),m()),!h)return!1;if(f){const _=w-c,S=0+1*a(_/o);u(S,1-S)}return!0}),v(),u(0,1),m}function EH(t){const e=getComputedStyle(t);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:r,height:n}=e,i=t.getBoundingClientRect();t.style.position="absolute",t.style.width=r,t.style.height=n,zA(t,i)}}function zA(t,e){const r=t.getBoundingClientRect();if(e.left!==r.left||e.top!==r.top){const n=getComputedStyle(t),i=n.transform==="none"?"":n.transform;t.style.transform=`${i} translate(${e.left-r.left}px, ${e.top-r.top}px)`}}let C0;function S0(t){C0=t}function GA(){if(!C0)throw new Error("Function called outside component initialization");return C0}function CH(t){GA().$$.on_mount.push(t)}function SH(t){GA().$$.on_destroy.push(t)}const yd=[],HA=[];let wd=[];const jA=[],AH=Promise.resolve();let gb=!1;function RH(){gb||(gb=!0,AH.then(QA))}function bd(t){wd.push(t)}const vb=new Set;let kd=0;function QA(){if(kd!==0)return;const t=C0;do{try{for(;kd<yd.length;){const e=yd[kd];kd++,S0(e),TH(e.$$)}}catch(e){throw yd.length=0,kd=0,e}for(S0(null),yd.length=0,kd=0;HA.length;)HA.pop()();for(let e=0;e<wd.length;e+=1){const r=wd[e];vb.has(r)||(vb.add(r),r())}wd.length=0}while(yd.length);for(;jA.length;)jA.pop()();gb=!1,vb.clear(),S0(t)}function TH(t){if(t.fragment!==null){t.update(),Eo(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(bd)}}function NH(t){const e=[],r=[];wd.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),wd=e}let A0;function JA(){return A0||(A0=Promise.resolve(),A0.then(()=>{A0=null})),A0}function Dm(t,e,r){t.dispatchEvent(vH(`${e?"intro":"outro"}${r}`))}const Wm=new Set;let Oa;function yb(){Oa={r:0,c:[],p:Oa}}function wb(){Oa.r||Eo(Oa.c),Oa=Oa.p}function Ua(t,e){t&&t.i&&(Wm.delete(t),t.i(e))}function Jc(t,e,r,n){if(t&&t.o){if(Wm.has(t))return;Wm.add(t),Oa.c.push(()=>{Wm.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}const $A={duration:0};function xH(t,e,r){const n={direction:"in"};let i=e(t,r,n),s=!1,o,a,c=0;function l(){o&&Lm(t,o)}function u(){const{delay:h=0,duration:f=300,easing:p=md,tick:v=hn,css:m}=i||$A;m&&(o=mb(t,0,1,f,h,p,m,c++)),v(0,1);const w=Om()+h,_=w+f;a&&a.abort(),s=!0,bd(()=>Dm(t,!0,"start")),a=Um(S=>{if(s){if(S>=_)return v(1,0),Dm(t,!0,"end"),l(),s=!1;if(S>=w){const T=p((S-w)/f);v(T,1-T)}}return s})}let d=!1;return{start(){d||(d=!0,Lm(t),E0(i)?(i=i(n),JA().then(u)):u())},invalidate(){d=!1},end(){s&&(l(),s=!1)}}}function BH(t,e,r){const n={direction:"out"};let i=e(t,r,n),s=!0,o;const a=Oa;a.r+=1;let c;function l(){const{delay:u=0,duration:d=300,easing:h=md,tick:f=hn,css:p}=i||$A;p&&(o=mb(t,1,0,d,u,h,p));const v=Om()+u,m=v+d;bd(()=>Dm(t,!1,"start")),"inert"in t&&(c=t.inert,t.inert=!0),Um(w=>{if(s){if(w>=m)return f(0,1),Dm(t,!1,"end"),--a.r||Eo(a.c),!1;if(w>=v){const _=h((w-v)/d);f(1-_,_)}}return s})}return E0(i)?JA().then(()=>{i=i(n),l()}):l(),{end(u){u&&"inert"in t&&(t.inert=c),u&&i.tick&&i.tick(1,0),s&&(o&&Lm(t,o),s=!1)}}}function YA(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function IH(t,e){Jc(t,1,1,()=>{e.delete(t.key)})}function OH(t,e){t.f(),IH(t,e)}function UH(t,e,r,n,i,s,o,a,c,l,u,d){let h=t.length,f=s.length,p=h;const v={};for(;p--;)v[t[p].key]=p;const m=[],w=new Map,_=new Map,S=[];for(p=f;p--;){const U=d(i,s,p),I=r(U);let Z=o.get(I);Z?S.push(()=>Z.p(U,e)):(Z=l(I,U),Z.c()),w.set(I,m[p]=Z),I in v&&_.set(I,Math.abs(p-v[I]))}const T=new Set,x=new Set;function O(U){Ua(U,1),U.m(a,u),o.set(U.key,U),u=U.first,f--}for(;h&&f;){const U=m[f-1],I=t[h-1],Z=U.key,W=I.key;U===I?(u=U.first,h--,f--):w.has(W)?!o.has(Z)||T.has(Z)?O(U):x.has(W)?h--:_.get(Z)>_.get(W)?(x.add(Z),O(U)):(T.add(W),h--):(c(I,o),h--)}for(;h--;){const U=t[h];w.has(U.key)||c(U,o)}for(;f;)O(m[f-1]);return Eo(S),m}function XA(t,e){const r={},n={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],a=e[s];if(a){for(const c in o)c in a||(n[c]=1);for(const c in a)i[c]||(r[c]=a[c],i[c]=1);t[s]=a}else for(const c in o)i[c]=1}for(const o in n)o in r||(r[o]=void 0);return r}function KA(t){return typeof t=="object"&&t!==null?t:{}}function bb(t){t&&t.c()}function Zm(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),bd(()=>{const s=t.$$.on_mount.map(BA).filter(E0);t.$$.on_destroy?t.$$.on_destroy.push(...s):Eo(s),t.$$.on_mount=[]}),i.forEach(bd)}function zm(t,e){const r=t.$$;r.fragment!==null&&(NH(r.after_update),Eo(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function MH(t,e){t.$$.dirty[0]===-1&&(yd.push(t),RH(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function qA(t,e,r,n,i,s,o=null,a=[-1]){const c=C0;S0(t);const l=t.$$={fragment:null,ctx:[],props:s,update:hn,not_equal:i,bound:IA(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:IA(),dirty:a,skip_bound:!1,root:e.target||c.$$.root};o&&o(l.root);let u=!1;if(l.ctx=r?r(t,e.props||{},(d,h,...f)=>{const p=f.length?f[0]:h;return l.ctx&&i(l.ctx[d],l.ctx[d]=p)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](p),u&&MH(t,d)),h}):[],l.update(),u=!0,Eo(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){const d=gH(e.target);l.fragment&&l.fragment.l(d),d.forEach(Co)}else l.fragment&&l.fragment.c();e.intro&&Ua(t.$$.fragment),Zm(t,e.target,e.anchor),QA()}S0(c)}class eR{constructor(){jc(this,"$$"),jc(this,"$$set")}$destroy(){zm(this,1),this.$destroy=hn}$on(e,r){if(!E0(r))return hn;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!hH(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const PH="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(PH);function tR(t){const e=t-1;return e*e*e+1}function VH(t,{delay:e=0,duration:r=400,easing:n=md}={}){const i=+getComputedStyle(t).opacity;return{delay:e,duration:r,easing:n,css:s=>`opacity: ${s*i}`}}function FH(t,{delay:e=0,duration:r=400,easing:n=tR,x:i=0,y:s=0,opacity:o=0}={}){const a=getComputedStyle(t),c=+a.opacity,l=a.transform==="none"?"":a.transform,u=c*(1-o),[d,h]=MA(i),[f,p]=MA(s);return{delay:e,duration:r,easing:n,css:(v,m)=>`