diff --git a/Makefile b/Makefile index aed66df7e6..ad4cb21f89 100644 --- a/Makefile +++ b/Makefile @@ -48,8 +48,6 @@ servewallet-prodservers: servewallet-mainnet-prodservers: go run -mod=vendor ./cmd/servewallet -mainnet -devservers=false buildweb: - node --version - npm --version rm -rf ${WEBROOT}/build cd ${WEBROOT} && npm ci cd ${WEBROOT} && npm run build diff --git a/frontends/web/.gitignore b/frontends/web/.gitignore index 5f7a7e1c5d..121df11bef 100644 --- a/frontends/web/.gitignore +++ b/frontends/web/.gitignore @@ -1,5 +1,7 @@ /.eslintcache -/build/ +/build/**/*.svg +/build/**/*.png +/build/**/*.webm /coverage/ /node_modules/ **/*/output.log diff --git a/frontends/web/build/assets/index.css b/frontends/web/build/assets/index.css new file mode 100644 index 0000000000..908509f33b --- /dev/null +++ b/frontends/web/build/assets/index.css @@ -0,0 +1,8387 @@ +._expandIcon_j17uw_1 { + stroke: var(--color-gray); + width: 18px; + height: 18px; +} +._logo_gbled_1 { + display: block; + margin: 0 auto var(--space-default) auto; + max-width: 160px; +} +._swissOpenSource_gbled_7 { + max-width: 240px !important; + width: 100% !important; +} +._swissOpenSource_gbled_7._large_gbled_12 { + max-width: 280px !important; +} +@media (max-width: 768px) { + ._swissOpenSource_gbled_7 { + max-width: 180px !important; + } + ._swissOpenSource_gbled_7._large_gbled_12 { + max-width: 210px !important; + } +} +._point2bitbox02_1vb0x_1 { + text-align: center; +} +._caret_1vb0x_5 { + display: block; + margin: 0 auto; +} +._bitbox02_1vb0x_10 { + display: inline-block; + max-width: 264px; + position: relative; + right: -16px; +} +._overlay_1u8gr_1 { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + position: fixed; + bottom: 0; + left: 0; + height: 100%; + width: 100%; + background: transparent; + z-index: 4010; +} +._overlay_1u8gr_1._activeOverlay_1u8gr_15 { + background-color: var(--bg-transparent-dark); +} +._modal_1u8gr_19 { + background-color: var(--background-secondary); + width: 100%; + max-width: 420px; + border-radius: 2px; + box-shadow: 0 3px 5px #0000004d; + text-align: left; + max-height: 100vh; + overflow: auto; +} +@media (min-width: 1200px) { + ._header_1u8gr_31 ._title_1u8gr_31 { + --size-subheader: 16px; + } + ._modal_1u8gr_19 { + margin-left: var(--sidebar-width-large); + } + ._modal_1u8gr_19 ._contentContainer_1u8gr_37 p { + --size-default: 14px; + } +} +._modal_1u8gr_19._small_1u8gr_42 { + max-width: 340px; + width: 100%; +} +._modal_1u8gr_19._medium_1u8gr_47 { + max-width: 520px; + width: 100%; +} +._modal_1u8gr_19._large_1u8gr_53 { + max-width: 800px; + width: 100%; +} +._header_1u8gr_31 { + height: var(--item-height); + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 0 var(--space-half); + border-bottom: solid 1px var(--background); +} +._header_1u8gr_31._centered_1u8gr_68 { + justify-content: center; +} +._header_1u8gr_31 ._title_1u8gr_31 { + margin: 0; + font-size: var(--size-subheader); + font-weight: 400; +} +._closeButton_1u8gr_78 { + background: none; + border: none; + padding: 0; + width: auto !important; +} +._closeButton_1u8gr_78:focus { + outline: none; +} +._closeButton_1u8gr_78:disabled { + color: var(--color-secondary); +} +._header_1u8gr_31 ._closeButton_1u8gr_78, +._header_1u8gr_31 ._closeButton_1u8gr_78 img { + width: 18px; + height: 18px; +} +._contentContainer_1u8gr_37 { + font-size: var(--size-default); + font-weight: 400; + padding: var(--space-half); +} +._contentContainer_1u8gr_37._slim_1u8gr_105 { + padding: 0; +} +._contentContainer_1u8gr_37._padded_1u8gr_109 { + padding: var(--space-default); +} +._content_1u8gr_37 p { + word-break: break-word; +} +._actions_1u8gr_117 button, +._actions_1u8gr_117 a, +._small_1u8gr_42 ._actions_1u8gr_117 button, +._small_1u8gr_42 ._actions_1u8gr_117 a { + width: 100%; +} +._actions_1u8gr_117 > *:not(:last-child), +._small_1u8gr_42 ._actions_1u8gr_117 > *:not(:last-child) { + margin-bottom: var(--space-quarter); +} +._actions_1u8gr_117 { + margin-top: var(--space-quarter); +} +._confirmationLabel_1u8gr_135 { + position: relative; + line-height: 1.3; + font-size: var(--size-default); + font-weight: 400; + margin-top: var(--space-half); + padding-left: 24px; +} +._confirmationLabelNumber_1u8gr_144 { + display: inline-block; + position: absolute; + left: 0; +} +._disabledLabel_1u8gr_150, +._disabledLabel_1u8gr_150 span { + color: var(--color-light) !important; +} +._noStep_1u8gr_155 { + padding-left: 0; +} +._confirmationInstructions_1u8gr_159 { + margin: 0; + padding: var(--space-half) 0 var(--space-quarter) 0; +} +._confirmationInstructions_1u8gr_159 > div { + width: 50%; +} +._confirmationInstructions_1u8gr_159 p { + line-height: 1; + margin-top: var(--space-quarter); +} +._confirmationInstructions_1u8gr_159._confirm_1u8gr_135 { + text-align: center; + font-size: var(--size-subheader); + padding: var(--space-half) calc(var(--space-half) * 1.5); +} +._image_1u8gr_179 { + height: 120px; + margin-right: var(--space-half); +} +._modalContent_1u8gr_184 p { + font-size: var(--size-default); + font-weight: 400; +} +._modalContent_1u8gr_184 > *:first-child { + margin-top: 0; +} +._detail_1u8gr_193 { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + min-height: var(--item-height); + padding: var(--space-half); +} +._detail_1u8gr_193:not(:first-child) { + border-bottom: solid 1px var(--background); +} +._detail_1u8gr_193 label { + white-space: nowrap; + margin-right: var(--space-half) !important; +} +._detail_1u8gr_193 label, +._detail_1u8gr_193 p { + margin: 0; + line-height: 1; +} +._detail_1u8gr_193._description_1u8gr_217 > span { + text-align: right; +} +._buttons_1u8gr_221 { + padding: var(--space-quarter); +} +._buttons_1u8gr_221 button:first-child { + margin-right: 10px; +} +._buttons_1u8gr_221 button { + width: 50%; +} +._dialogButtons_1u8gr_233 { + display: flex; + flex-direction: row-reverse; + justify-content: space-between; + margin-top: var(--space-default); +} +._dialogButtons_1u8gr_233 > *:only-child { + width: 100%; +} +@media (min-width: 769px) { + ._closingOverlay_1u8gr_244 { + display: none; + } +} +@media (max-width: 768px) { + ._header_1u8gr_31 ._title_1u8gr_31 { + font-size: var(--header-default-font-size); + } + ._modal_1u8gr_19 { + padding: 0; + } + ._modal_1u8gr_19, + ._modal_1u8gr_19._small_1u8gr_42, + ._modal_1u8gr_19._medium_1u8gr_47, + ._modal_1u8gr_19._large_1u8gr_53 { + max-width: 100vw; + height: 100vh; + transform: translateY(100vh); + transition: transform .3s; + border-top-right-radius: var(--space-half); + border-top-left-radius: var(--space-half); + } + ._modal_1u8gr_19._open_1u8gr_268 { + transition: transform .3s; + transform: translateY(0); + } + ._contentContainer_1u8gr_37._padded_1u8gr_109 { + padding: var(--space-half); + } +} +._link_28asd_1 { + align-items: center; + background: none; + border: none; + color: var(--color-blue); + cursor: default; + display: flex; + flex-direction: row; + font-size: var(--size-default); + justify-content: flex-start; + padding: var(--space-quarter); +} +._link_28asd_1 svg { + width: 18px; + height: 18px; + margin-right: calc(var(--space-quarter) / 2); +} +._language_28asd_20 { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + width: 100%; + height: var(--item-height); + padding: 0 var(--space-half); + color: var(--color-blue); + border: none; + background-color: transparent; + font-size: var(--size-default); +} +._language_28asd_20:focus { + outline: none; +} +._language_28asd_20._selected_28asd_38 { + color: var(--color-default); +} +._language_28asd_20:hover { + background-color: var(--background); +} +._checked_28asd_46 { + width: 18px; + height: 18px; +} +@media (max-width: 768px) { + ._link_28asd_1 { + font-size: var(--size-small); + } + ._language_28asd_20 { + font-size: var(--size-small) !important; + } +} +._fullscreen_q1y08_1 { + background: var(--background); + bottom: 0; + display: flex; + flex-grow: 1; + flex-direction: column; + left: 0; + overflow-x: inherit; + overflow-y: auto; + position: fixed; + right: 0; + top: 0; + z-index: 5100; +} +.container ._fullscreen_q1y08_1 { + z-index: 5050; +} +._dialog_q1y08_22 { + background-color: var(--bg-transparent-dark); + justify-content: center; +} +._fill_q1y08_28 { + align-self: center; + display: flex; + flex-direction: column; + flex-grow: 1; + padding: 0 var(--space-default) var(--space-default) var(--space-default); + max-width: var(--content-width); + width: 100%; +} +._inner_q1y08_38 { + display: flex; + flex-direction: column; + margin: 0 auto; + max-width: var(--content-width); + padding: var(--space-half) 0; + width: 100%; +} +._verticallyCentered_q1y08_46 ._inner_q1y08_38 { + margin-bottom: auto; + margin-top: auto; +} +._inner_q1y08_38._fit_q1y08_50 { + flex-shrink: 0; + max-height: 100%; + padding-bottom: 0; + padding-top: 0; +} +._fit_q1y08_50 ._content_q1y08_56 { + align-items: stretch; + display: flex; + flex-direction: column; +} +._textCenter_q1y08_61, +._text-center_q1y08_62 { + text-align: center; +} +._text-left_q1y08_65 { + text-align: left; +} +@media (max-width: 768px) { + ._inner_q1y08_38 { + flex-grow: 1; + display: flex; + flex-direction: column; + margin: 0 auto; + min-height: auto !important; + } + ._inner_q1y08_38._fit_q1y08_50 { + padding-bottom: var(--space-half); + padding-top: 2vh; + } +} +@media (min-width: 769px) { + ._fullscreen_q1y08_1 ._inner_q1y08_38 { + padding-left: var(--space-default); + padding-right: var(--space-default); + } +} +@media (max-width: 1080px) { + ._inner_q1y08_38 { + max-width: 100%; + } +} +@media (min-width: 1200px) { + ._inner_q1y08_38 { + padding-left: 0; + padding-right: 0; + } +} +._dialog_q1y08_22 ._inner_q1y08_38 { + background-color: var(--background-secondary); + box-shadow: 0 3px 5px #0000004d; + flex-grow: 0; + max-width: 100%; + padding-left: 0; + padding-right: 0; + width: 540px; +} +._header_q1y08_109 { + color: var(--color-secondary); + font-size: var(--size-default); + margin-bottom: var(--space-default); + word-break: break-word; +} +._dialog_q1y08_22 ._header_q1y08_109 { + padding-left: var(--space-default); + padding-top: 0; + padding-right: var(--space-default); +} +@media (max-width: 768px) { + ._fill_q1y08_28 { + padding: 0 0 var(--space-default) 0; + } + ._header_q1y08_109 { + padding-left: var(--space-half); + padding-top: var(--space-default); + padding-right: var(--space-half); + margin-bottom: 0; + } + ._smallHeader_q1y08_130 { + margin-bottom: var(--space-half); + padding-top: var(--space-half); + } + ._fill_q1y08_28 ._header_q1y08_109 { + padding-top: 0; + } +} +@media (max-width: 1199px) { + ._header_q1y08_109 { + padding-top: var(--space-large); + } + ._smallHeader_q1y08_130, + ._fill_q1y08_28 ._header_q1y08_109 { + padding-top: 0; + } + ._dialog_q1y08_22 ._header_q1y08_109 { + padding-left: var(--space-half); + padding-top: 0; + padding-right: var(--space-half); + } +} +._title_q1y08_155 { + color: var(--color-default); + font-size: var(--size-subheader); + font-weight: 400; + margin-bottom: var(--space-half); +} +._title_q1y08_155 span { + display: block; +} +._header_q1y08_109 p { + margin-top: var(--space-quarter); +} +._closeButton_q1y08_169 { + background: transparent; + border: none; + color: var(--color-primary); + height: var(--header-height); + left: 0; + position: absolute; + text-align: center; + top: 0; + width: var(--header-height); +} +._content_q1y08_56 { + flex-grow: 1; + flex-shrink: 0; + min-height: 80px; + word-break: break-word; +} +._fit_q1y08_50 ._content_q1y08_56 { + flex-shrink: 1; +} +@media (max-width: 768px) { + ._content_q1y08_56 { + flex-grow: 1; + flex-basis: auto; + flex-shrink: 0; + padding: 0 var(--space-half); + } + ._content_q1y08_56._fullWidth_q1y08_197 { + padding: 0; + } +} +@media (max-width: 1199px) { + ._dialog_q1y08_22 ._content_q1y08_56 { + padding: 0 var(--space-half); + } +} +@media (min-width: 1200px) { + ._content_q1y08_56 { + min-height: 130px; + } + ._dialog_q1y08_22 ._content_q1y08_56 { + padding: var(--space-half) var(--space-default); + } +} +._content_q1y08_56 ._largeIcon_q1y08_215 { + margin: var(--space-half) auto; + max-height: 100%; + max-width: 280px; + min-width: 80px; + width: 50%; +} +@media (max-width: 768px) { + ._content_q1y08_56 ._largeIcon_q1y08_215 { + margin-bottom: var(--space-half); + margin-top: var(--space-half); + max-width: 160px; + } +} +._content_q1y08_56 ul { + font-size: var(--size-default); + line-height: 1.625; + padding-left: 1.4em; +} +._content_q1y08_56 label { + color: var(--color-default); +} +._buttons_q1y08_240 { + display: flex; + flex-direction: row-reverse; + justify-content: space-between; + margin-top: var(--space-default); + padding-bottom: var(--space-half); +} +._dialog_q1y08_22 ._buttons_q1y08_240 { + padding-left: var(--space-default); + padding-right: var(--space-default); +} +@media (max-width: 768px) { + ._buttons_q1y08_240 { + padding: 0 var(--space-half); + } +} +@media (max-width: 768px) and (orientation: portrait) { + ._buttons_q1y08_240 { + align-items: stretch; + flex-direction: column; + flex-grow: 0; + justify-content: flex-end; + margin-top: var(--space-half); + } + ._buttons_q1y08_240 > *:not(:last-child) { + margin-bottom: var(--space-half); + } +} +@media (max-width: 1199px) { + ._dialog_q1y08_22 ._buttons_q1y08_240 { + padding: 0 var(--space-half); + } +} +._textCenter_q1y08_61 ._buttons_q1y08_240 > *:only-child { + justify-self: flex-end; + margin: 0 auto; +} +@media (min-width: 1200px) { + ._title_q1y08_155 { + --size-subheader: 28px; + } + ._header_q1y08_109, + ._inner_q1y08_38 p { + --size-default: 20px; + } + ._fullscreen_q1y08_1 { + --size-default: 18px; + } + ._inner_q1y08_38 footer p { + --size-default: 14px; + } +} +._footer_q1y08_294 { + align-items: center; + display: flex; + flex-direction: row; + justify-content: flex-end; + margin: var(--space-default) auto 0 auto; + max-width: var(--content-width); + padding: 0; + width: 100%; +} +._fullscreen_q1y08_1 ._footer_q1y08_294 { + margin: var(--space-default) auto; + padding: 0 var(--space-default); +} +._footer_q1y08_294 p { + color: var(--color-secondary); + font-size: var(--size-default); + margin: 0; +} +._footer_q1y08_294 img { + width: 120px; + margin: 0 auto 0 0; +} +@media (max-width: 768px) { + ._footer_q1y08_294 { + padding: 0 var(--space-half); + margin: var(--space-half) 0 0 0; + } + ._fullscreen_q1y08_1 ._footer_q1y08_294 { + margin: var(--space-half) 0; + } + ._footer_q1y08_294 p { + text-align: right; + font-size: var(--size-small); + } + ._footer_q1y08_294 img { + width: 80px; + } +} +._button_b8ew4_1 { + align-items: center; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border-color: transparent; + border-radius: 2px; + border-style: solid; + border-width: 1px; + cursor: default; + display: inline-flex; + flex-direction: row; + font-family: var(--font-family); + font-size: var(--size-default); + font-weight: 400; + justify-content: center; + min-width: 100px; + height: 50px; + outline: none; + padding: 0 var(--space-default); + position: relative; + text-align: center; + text-decoration: none; + transition: background-color .2s ease-out, color .2s ease-out; + will-change: background-color, color; +} +._button_b8ew4_1:hover { + cursor: pointer; +} +._button_b8ew4_1:disabled { + cursor: not-allowed; +} +._button_b8ew4_1:focus { + outline: none; +} +._primary_b8ew4_38 { + background: var(--color-blue); + color: var(--color-alt); +} +._primary_b8ew4_38:not([disabled]):focus, +._primary_b8ew4_38:not([disabled]):hover { + background-color: var(--color-lightblue); +} +._secondary_b8ew4_49 { + background-color: var(--background-secondary); + border-color: var(--background-tertiary); + color: var(--color-default); +} +._secondary_b8ew4_49:not([disabled]):focus, +._secondary_b8ew4_49:not([disabled]):hover { + border-color: var(--color-blue); + color: var(--color-blue); +} +._secondary_b8ew4_49[disabled] { + border-color: var(--background-quaternary); + color: var(--color-tertiary); +} +._danger_b8ew4_67 { + background-color: var(--color-softred); + border-color: var(--color-softred); + color: var(--color-alt); +} +._danger_b8ew4_67:not([disabled]):focus, +._danger_b8ew4_67:not([disabled]):hover { + background-color: var(--color-lightred); + border-color: var(--color-lightred); +} +._danger_b8ew4_67:focus { + outline-color: var(--color-swissred); +} +._transparent_b8ew4_84 { + background-color: transparent; + border-color: transparent; + color: var(--color-blue); + display: inline-block; + height: auto; + min-width: 0; + padding: var(--space-half); +} +._transparent_b8ew4_84:not([disabled]):focus, +._transparent_b8ew4_84:not([disabled]):hover { + color: var(--color-lightblue); +} +._primary_b8ew4_38[disabled], +._danger_b8ew4_67[disabled], +._transparent_b8ew4_84[disabled] { + opacity: .4; +} +._button_b8ew4_1[hidden] { + display: none; +} +@media (max-width: 768px) { + ._button_b8ew4_1 { + min-width: 90px; + } +} +._checkbox_1m6k1_1 input { + position: absolute; + opacity: 0; +} +._checkbox_1m6k1_1 input + label { + display: inline-block; + max-width: 100%; + padding-left: 2em; + position: relative; +} +._checkbox_1m6k1_1 input + label:before, +._checkbox_1m6k1_1 input + label:after { + background: var(--background-secondary); + box-sizing: border-box; + content: ""; + display: inline-block; + width: 1em; + height: 1em; + position: absolute; + left: 0; + vertical-align: top; + text-align: center; + transition: all .1s ease; +} +._checkbox_1m6k1_1 input + label:before { + border: 1px solid rgb(220, 220, 220); + border-radius: 2px; + top: -1px; +} +._success_1m6k1_33 input + label:before { + border-color: var(--background-secondary); + outline: 1px solid var(--color-success); +} +._warning_1m6k1_37 input + label:before { + border-color: var(--background-secondary); + outline: 1px solid var(--color-warning); +} +._info_1m6k1_41 input + label:before { + border-color: var(--background-secondary); + outline: 1px solid var(--color-info); +} +._checkbox_1m6k1_1 input + label:after { + background: transparent; + border: solid var(--background-secondary); + border-width: 0px 2px 2px 0; + width: .35em; + height: .55em; + position: absolute; + top: 3px; + left: 6px; + margin-left: -1px; + margin-top: -2px; + opacity: 0; + transform: scale(2) rotate(45deg); + transition: opacity .2s ease-out, transform .2s ease-out; +} +._checkbox_1m6k1_1 input:checked + label:before { + background-color: var(--color-blue); + border-color: var(--color-blue); +} +._success_1m6k1_33 input:checked + label:before { + background-color: var(--color-success); + border-color: var(--color-success); + color: var(--color-alt); +} +._warning_1m6k1_37 input:checked + label:before { + background-color: var(--color-warning); + border-color: var(--color-warning); + color: var(--color-alt); +} +._info_1m6k1_41 input:checked + label:before { + background-color: var(--color-info); + border-color: var(--color-info); + color: var(--color-alt); +} +._checkbox_1m6k1_1 input:checked + label:after { + opacity: 1; + transform: scale(1) rotate(37deg); +} +._checkbox_1m6k1_1 input[type=checkbox]:focus + label:before { + border-color: var(--color-blue); + outline: none; + outline-offset: 0; +} +._checkbox_1m6k1_1 input[type=checkbox]:checked:focus + label:before { + outline: 2px solid var(--color-blue); + outline-offset: -1px; +} +:is(._success_1m6k1_33, ._warning_1m6k1_37, ._info_1m6k1_41) input[type=checkbox]:focus + label:before, +:is(._success_1m6k1_33, ._warning_1m6k1_37, ._info_1m6k1_41) input[type=checkbox]:checked:focus + label:before { + border-color: transparent; + outline: 2px solid var(--color-blue); + outline-offset: 0; +} +._checkbox_1m6k1_1 input[disabled] + label:before { + background: rgb(248, 248, 248); + border-color: #dcdcdc; + cursor: not-allowed; +} +._radio_198i3_1 { + --size-default: 14px; +} +._radio_198i3_1 input { + position: absolute; + opacity: 0; +} +._radio_198i3_1 input + label { + display: inline-flex; + flex-direction: column; + font-size: var(--size-default); + line-height: 1.5; + margin-right: var(--space-half); + padding-left: calc(var(--space-half) + var(--space-quarter)); + position: relative; +} +._radio_198i3_1 input + label:before, +._radio_198i3_1 input + label:after { + background: var(--background-secondary); + content: ""; + display: inline-block; + width: 12px; + height: 12px; + position: absolute; + top: 4px; + left: 0; + transition: all .1s ease; +} +._radio_198i3_1 input + label:before { + border: 1px solid rgb(220, 220, 220); + border-radius: 1em; +} +._radio_198i3_1 input + label:after { + background: var(--color-blue); + border-radius: 1em; + width: 10px; + height: 10px; + position: absolute; + top: 6px; + left: 2px; + opacity: 0; + transform: scale(0); +} +._radio_198i3_1 input:checked + label:before { + background-color: var(--background-secondary); +} +._radio_198i3_1 input:checked + label:after { + opacity: 1; + transform: scale(1); +} +._radio_198i3_1 input[type=radio]:focus + label:before { + box-shadow: 0 0 2px 2px var(--color-blue); + outline: none; + outline-offset: 0; +} +._radio_198i3_1 input[type=radio]:checked:focus + label:before { + box-shadow: 0 0 2px 2px var(--color-blue); +} +._radio_198i3_1 input:disabled + label:before { + background: rgb(248, 248, 248); + border-color: #dcdcdc; + cursor: not-allowed; +} +._field_d2mb0_1 { + margin-bottom: var(--spacing-default); +} +._input_1dgl0_1 { + width: 100%; + margin-bottom: var(--space-half); + position: relative; +} +._input_1dgl0_1 label { + display: block; + margin: 0 0 var(--space-quarter) 0; +} +._align-left_1dgl0_12 label { + justify-self: flex-start; +} +._align-right_1dgl0_16 label { + flex-grow: 1; + justify-self: flex-end; + text-align: right; +} +._align-right_1dgl0_16 input { + text-align: right; +} +._input_1dgl0_1 input { + background-color: var(--background-secondary); + border-color: var(--background-quaternary); + border-radius: 2px; + border-style: solid; + border-width: 1px; + font-family: var(--font-family); + font-size: var(--size-default); + font-weight: 400; + height: 52px; + padding: 0 var(--space-half); + width: 100%; + transition: border-color .2s ease-out; + will-change: border-color; +} +._input_1dgl0_1 input:focus { + border-color: var(--color-blue); + outline: none; +} +._input_1dgl0_1 input::placeholder { + color: var(--color-secondary); +} +._input_1dgl0_1 input[disabled] { + background-color: var(--background-secondary) !important; + border-color: var(--background) !important; + color: var(--color-secondary) !important; + cursor: not-allowed; +} +._isTransparent_1dgl0_58 input[disabled] { + border-color: var(--background); + color: var(--color-default) !important; + cursor: default; +} +._errorText_1dgl0_64 { + color: var(--color-softred) !important; +} +._errorText_1dgl0_64 > span > span { + margin-left: 5px; +} +._input_1dgl0_1 input[type=checkbox] { + width: auto; + height: auto; +} +._label_53nw1_1 { + text-align: left; +} +._select_yd5xu_1 { + margin-bottom: var(--space-half); + position: relative; + width: 100%; +} +._select_yd5xu_1 label { + display: block; + margin-bottom: var(--space-quarter); + text-align: left; +} +._select_yd5xu_1 select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: var(--background-secondary); + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-labelledby='chevron down' color='%23777'%3E%3Cdefs/%3E%3Cpolyline points='6 10 12 16 18 10'/%3E%3C/svg%3E%0A"); + background-position: calc(100% - 12px); + background-repeat: no-repeat; + border: solid 1px var(--background-quaternary); + border-radius: 2px; + color: var(--color-default); + font-family: var(--font-family); + font-size: var(--size-default); + font-weight: 400; + height: 52px; + padding: 0 var(--space-half); + width: 100%; +} +._select_yd5xu_1 select[disabled] { + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-labelledby='chevron down' color='%23ccc'%3E%3Cdefs/%3E%3Cpolyline points='6 10 12 16 18 10'/%3E%3C/svg%3E%0A"); +} +._select_yd5xu_1 option { + background-color: var(--background-secondary); + color: var(--color-default); + padding: var(--spacing-default); + width: 100%; +} +._select_yd5xu_1 option[disabled] { + color: var(--color-disabled); +} +._message_ncb43_1 { + border: solid 1px var(--background-quaternary); + color: var(--color-secondary); + border-radius: 2px; + padding: var(--spacing-default); + margin-bottom: var(--spacing-default); + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + flex-shrink: 0; + overflow: hidden; +} +._message_ncb43_1._small_ncb43_15 { + flex-shrink: 1; + font-size: var(--size-default); +} +._message_ncb43_1 img { + margin-right: var(--spacing-default); +} +._message_ncb43_1 p:last-child { + margin-bottom: 0 !important; +} +._success_ncb43_28 { + color: var(--color-success); + border-color: var(--color-success); +} +._info_ncb43_34 { + color: var(--color-blue); + border-color: var(--color-blue); +} +._warning_ncb43_40 { + color: var(--color-warning); + border-color: var(--color-warning); +} +._error_ncb43_46 { + color: var(--color-error); + border-color: var(--color-error); +} +._capsWarning_1xqma_1 { + color: var(--color-warning); + font-weight: 700; + line-height: 42px; + position: absolute; + right: 0; + width: 2rem; +} +._badge_f2nw5_1 { + border-radius: var(--space-half); + border: 1px solid; + display: inline-block; + font-size: var(--size-small); + line-height: 14px; + padding: var(--space-eight) 10px; + white-space: nowrap; +} +._badge_f2nw5_1._iconOnly_f2nw5_11 { + align-items: center; + display: inline-flex; + height: 18px; + justify-content: center; + padding: 0; + width: 18px; +} +._badgeIcon_f2nw5_20 { + max-width: 10px; +} +._withChildren_f2nw5_24 ._badgeIcon_f2nw5_20 { + margin-right: var(--space-eight); +} +@media (max-width: 382px) { + ._badge_f2nw5_1 { + font-size: 10px; + } +} +._success_f2nw5_34 { + background: var(--color-palegreen); + border-color: var(--color-lightgreen); + color: var(--color-darkgreen); +} +._warning_f2nw5_40 { + background: var(--color-lightyellow); + border-color: var(--color-darkyellow); + color: var(--color-olive); +} +._closeButton_1xwfn_1 { + background: transparent; + border: none; + display: none; + padding: 12px; + transform: translate(14px); +} +._closeButton_1xwfn_1:focus { + outline: none; +} +._sidebarOverlay_1xwfn_13 { + position: fixed; + background-color: #0000004d; + width: 100%; + height: 100%; + top: 0; + left: 0; + z-index: -1; + opacity: 0; + animation-delay: .2s; + transition: opacity ease .2s; +} +._sidebarOverlay_1xwfn_13._active_1xwfn_26 { + opacity: 1; + z-index: 4001; +} +._sidebar_1xwfn_13 { + position: fixed; + margin-left: calc(var(--sidebar-width-large) * -1); + align-content: stretch; + background-color: var(--background-dark); + display: flex; + flex-direction: column; + flex-shrink: 0; + justify-content: flex-start; + height: 100vh; + padding: 0 0 var(--spacing-default) 0; + width: var(--sidebar-width-large); + z-index: 4002; + overflow-y: auto; +} +._sidebar_1xwfn_13 > *._end_1xwfn_47 { + margin-top: auto; + padding-top: var(--sidebar-margin); +} +._sidebar_1xwfn_13._forceShow_1xwfn_52 { + margin-left: 0; +} +._sidebar_1xwfn_13 ._sidebarLogoContainer_1xwfn_56 { + align-items: center; + display: flex; + flex-direction: row; + height: 70px; + justify-content: space-between; + padding: calc(var(--spacing-default) + var(--spacing-half)) var(--spacing-large); + background-size: cover; + background-color: #0000001a; + opacity: 1; + transition: opacity .2s ease; +} +._sidebarLogoContainer_1xwfn_56 img { + margin-bottom: 0; + width: auto !important; + height: var(--sidebar-icon-size) !important; +} +._sidebarHeaderContainer_1xwfn_75 { + margin-top: var(--sidebar-margin); + margin-bottom: var(--sidebar-header-size); + padding: 0 var(--sidebar-margin); + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} +._sidebarPortfolio_1xwfn_85 + ._sidebarHeaderContainer_1xwfn_75 { + margin-top: 28px; +} +._sidebarHeader_1xwfn_75 { + font-size: var(--sidebar-header-size); + line-height: var(--sidebar-header-line-height); + color: var(--color-secondary); +} +._sidebarIconVisible_1xwfn_95 { + visibility: visible; +} +._sidebarIconHidden_1xwfn_99 { + visibility: hidden; +} +._sidebarItem_1xwfn_103 { + display: block; +} +._sidebarItem_1xwfn_103 a { + position: relative; + color: #fff; + cursor: default; + height: var(--sidebar-item-height); + text-decoration: none; + overflow: hidden; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + border-radius: 2px; +} +._sidebarArrow_1xwfn_121 { + display: none; +} +._sidebarItem_1xwfn_103 a._sidebarActive_1xwfn_125 { + text-decoration: none; + background-color: #ffffff1a; +} +._activeGroup_1xwfn_130 ._sidebarArrow_1xwfn_121 { + display: inline; + margin-right: var(--sidebar-margin); +} +._sidebarItem_1xwfn_103 .stacked, +._sidebarItem_1xwfn_103 ._single_1xwfn_136 { + margin: 0 var(--sidebar-icon-margin) 0 var(--sidebar-margin); + height: var(--sidebar-icon-size); +} +a._sidebarActive_1xwfn_125 ._sidebarLabel_1xwfn_141, +._sidebar_1xwfn_13 a:hover ._sidebarLabel_1xwfn_141, +._activeGroup_1xwfn_130 ._sidebarLabel_1xwfn_141 { + color: var(--color-alt); +} +._sidebar_1xwfn_13 a._sidebarActive_1xwfn_125 ._sidebarLabel_1xwfn_141 { + font-weight: 400; +} +a._sidebarActive_1xwfn_125 .stacked img:first-child, +._sidebar_1xwfn_13 a:hover .stacked img:first-child { + opacity: 0; +} +a._sidebarActive_1xwfn_125 .stacked img:last-child, +._sidebar_1xwfn_13 a:hover .stacked img:last-child, +._activeGroup_1xwfn_130 .stacked img:last-child { + opacity: 1; +} +._sidebar_1xwfn_13 img { + width: var(--sidebar-icon-size); + height: auto; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} +._single_1xwfn_136 img { + opacity: .6; + transition: opacity .2s ease; +} +a._sidebarActive_1xwfn_125 ._single_1xwfn_136 img, +._sidebar_1xwfn_13 a:hover ._single_1xwfn_136 img { + opacity: 1; +} +._sidebarLabel_1xwfn_141 { + color: var(--color-light); + line-height: 1; + flex: 1; + padding-top: 0; + padding-right: var(--space-default); + font-size: var(--size-default); + font-weight: 400; + transition: all .2s ease; + word-break: break-word; +} +._activeGroup_1xwfn_130 { + background-color: #555; +} +._sidebarSubmenu_1xwfn_197 a svg { + width: 18px; + height: 18px; + margin-right: var(--sidebar-icon-margin); + margin-left: calc(var(--sidebar-margin) + var(--sidebar-icon-margin)); +} +._sidebarArrow_1xwfn_121 { + width: 12px; + height: 12px; +} +@media (max-width: 1199px) { + ._sidebar_1xwfn_13 { + transition: margin-left .2s ease; + } +} +@media (min-width: 1200px) { + ._sidebarContainer_1xwfn_216:not(._forceHide_1xwfn_216) ._sidebar_1xwfn_13 { + position: relative; + margin-left: 0; + width: var(--sidebar-width-large); + } +} +@media (max-width: 560px) { + ._closeButton_1xwfn_1 { + display: block; + } + ._sidebar_1xwfn_13 { + margin-left: -100vw; + transition: margin-left .3s ease; + width: 100vw; + } +} +._children_1y42x_1 { + display: flex; + flex-direction: row; + align-items: center; + margin-bottom: var(--space-quarter); +} +._children_1y42x_1 > a { + display: inline-block; + height: 18px; + font-size: var(--size-default); + text-decoration: none; + font-weight: 400; +} +._children_1y42x_1 > a > svg { + width: 18px; + height: 18px; + stroke-width: 2; +} +._container_1y42x_22 { + width: 100%; +} +._container_1y42x_22._fixed_1y42x_26 { + position: fixed; + left: var(--sidebar-width); + height: var(--header-height); + width: calc(100% - var(--sidebar-width)); + z-index: 1001; +} +._disabled_1y42x_34 { + opacity: .4; +} +._forceHidden_1y42x_38 ._sidebarToggler_1y42x_38 { + display: none !important; +} +._guideIcon_1y42x_42 { + font-size: var(--size-default); + text-decoration: none; + display: flex; + flex-direction: row; + align-items: center; +} +._guideIcon_1y42x_42 img { + width: 18px; + height: 18px; + color: var(--color-blue); + margin-right: calc(var(--space-quarter) / 2); +} +._guideIconContainer_1y42x_57 { + height: 18px; + margin-left: var(--space-half); +} +._header_1y42x_62 { + padding: 0 var(--space-default); + max-width: var(--content-width); + min-height: var(--header-height); + width: 100%; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + flex: none; + margin: 0 auto; + flex-wrap: wrap; +} +._header_1y42x_62._narrow_1y42x_76 > *:nth-child(2) { + text-align: center; +} +._header_1y42x_62._narrow_1y42x_76 > *:nth-child(2) > * { + max-width: 600px; + width: 100%; +} +._sidebarToggler_1y42x_38 { + width: 32px; + height: 32px; + margin-bottom: var(--space-quarter); + margin-right: var(--spacing-default); + display: flex; + flex-direction: row; + align-items: center; +} +._sidebarToggler_1y42x_38 img { + width: 20px; +} +._title_1y42x_99 { + white-space: nowrap; + flex-grow: 1; + margin-bottom: var(--space-quarter); + padding-right: var(--space-half); +} +._title_1y42x_99 > * { + margin: 0; + font-size: var(--header-default-font-size); + font-weight: 400; + line-height: 1; + display: inline-flex; + align-items: center; + -webkit-user-select: none; + user-select: none; +} +@media (max-width: 768px) { + ._header_1y42x_62 { + padding: var(--space-half); + } + ._sidebarToggler_1y42x_38._hideSidebarToggler_1y42x_120 { + display: none; + } + ._container_1y42x_22 ._sidebarToggler_1y42x_38 { + margin-right: 0; + } +} +@media (min-width: 1200px) { + ._sidebarToggler_1y42x_38 { + display: none; + } +} +._main_1ntet_1 { + display: flex; + flex-direction: column; + flex-grow: 1; + flex-shrink: 1; + overflow-x: inherit; + overflow-y: auto; + position: relative; +} +._columnAsCard_1rob5_1 { + background-color: var(--background-secondary); + padding: var(--space-default); +} +._column_1rob5_1 p { + margin-top: 0; +} +._columnButtons_1rob5_10:not(._columnButtonsInline_1rob5_10) button { + width: 100%; +} +._columnButtons_1rob5_10 button:not(:first-child) { + margin-top: var(--space-quarter); +} +._columnButtonsInline_1rob5_10 { + display: flex; + flex-direction: row-reverse; +} +._columnButtonsInline_1rob5_10 > a:not(:first-child), +._columnButtonsInline_1rob5_10 > button:not(:first-child) { + margin-right: var(--space-half); + margin-top: 0; +} +._left_1rob5_29 { + text-align: left; +} +._center_1rob5_33 { + text-align: center; +} +@media (max-width: 768px) { + ._columnAsCard_1rob5_1 { + padding: var(--space-half); + } + ._columnAsCard_1rob5_1 + ._columnAsCard_1rob5_1 { + margin-top: var(--space-default); + } +} +@media (min-width: 769px) { + ._grid_1rob5_47 { + display: grid; + gap: var(--space-default); + grid-auto-rows: minmax(100px, auto); + } + ._grid-columns-1_1rob5_53 { + grid-template-columns: repeat(1, 1fr); + } + ._grid-columns-2_1rob5_56 { + grid-template-columns: repeat(2, 1fr); + } + ._column_1rob5_1 { + display: flex; + flex-direction: column; + } + ._columnButtons_1rob5_10 { + margin-top: auto; + } +} +._footer_19w3c_1 { + max-width: var(--content-width); + width: 100%; + padding: 0 var(--space-default); + margin: var(--space-default) auto; +} +._footer_19w3c_1 p { + color: var(--color-secondary); + font-size: var(--size-default); + margin: 0; +} +._footer_19w3c_1 img { + width: 120px; + margin: 0 auto 0 0; +} +@media (max-width: 768px) { + ._footer_19w3c_1 { + padding: 0 var(--space-half); + margin: var(--space-half) 0; + } + ._footer_19w3c_1 p { + text-align: right; + font-size: var(--size-small); + } + ._footer_19w3c_1 img { + width: 80px; + } +} +._contentWithGuide_1gscs_1 { + display: flex; + flex-grow: 1; + flex-direction: row; + overflow: hidden; +} +._container_1gscs_8 { + display: flex; + flex: 1 1 auto; + flex-direction: column; + overflow: auto; + position: relative; + width: 100%; +} +:root { + --icon-size: 10px; + --icon-size-small: 8px; +} +._steps_1l429_6 { + align-items: flex-start; + display: inline-flex; + flex-shrink: 0; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + margin-bottom: var(--space-half); + overflow: hidden; + position: relative; + width: 100%; +} +._step_1l429_6 { + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + position: relative; + text-align: left; +} +._dot_1l429_38 { + display: inline-block; + margin-bottom: var(--space-quarter); + min-height: var(--icon-size); +} +._dot_1l429_38:before { + background: var(--color-primary); + border: 4px solid var(--background-secondary); + border-radius: 50%; + content: ""; + display: inline-block; + flex-shrink: 0; + font-size: 14px; + height: var(--icon-size); + line-height: var(--icon-size); + position: relative; + text-align: center; + transition: background-color .3s, border-color .3s; + vertical-align: top; + width: var(--icon-size); + z-index: 13; +} +._dot_1l429_38:after { + border-top: 5px solid var(--background-secondary); + content: ""; + position: absolute; + top: 6px; + right: 50%; + width: 100vw; + z-index: 12; +} +._line_1l429_72 ._dot_1l429_38:after { + z-index: 1; +} +._finish_1l429_76 ._dot_1l429_38:before { + height: var(--icon-size-small); + width: var(--icon-size-small); +} +._wait_1l429_81 { + color: var(--color-tertiary); +} +._finish_1l429_76 ._dot_1l429_38:before, +._wait_1l429_81 ._dot_1l429_38:before { + margin-top: 1px; +} +._wait_1l429_81 ._dot_1l429_38:before { + background: var(--background-quaternary); + height: var(--icon-size-small); + width: var(--icon-size-small); +} +._finish_1l429_76._line_1l429_72 ._dot_1l429_38:after, +._process_1l429_97._line_1l429_72 ._dot_1l429_38:after { + border-color: var(--color-primary); + border-top-width: 3px; + z-index: 11; + top: 7px; +} +._wait_1l429_81._line_1l429_72 ._dot_1l429_38:after { + border-color: var(--background-quaternary); + border-top-width: 3px; + top: 7px; +} +._content_1l429_110 { + font-size: var(--size-small); + line-height: 1; + margin: 0; + min-width: 90px; + position: relative; + text-align: center; + width: min-content; + white-space: nowrap; +} +._link_1o1mh_1 { + color: var(--color-blue); + cursor: pointer; + text-decoration: underline; +} +._link_1o1mh_1:focus { + outline: 1px solid var(--color-blue); + text-decoration: none; +} +._overlay_14an4_1 { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #0000004d; + z-index: -1; + opacity: 0; + transition: opacity ease .2s; +} +._close_14an4_13 { + color: var(--color-alt); + font-size: var(--size-default) !important; + text-decoration: none; + display: flex; + flex-direction: row; + align-items: center; + line-height: 1; +} +._close_14an4_13 img { + width: 18px; + height: 18px; + margin-left: calc(var(--space-quarter) / 2); +} +._wrapper_14an4_29 { + position: relative; +} +._guide_14an4_33 { + margin-right: calc(var(--guide-width) * -1); + height: 100vh; + width: var(--guide-width); + color: #fff; + background-color: var(--color-lightblue); + overflow-y: auto; + transition: margin-right .2s ease, transform .2s ease; + will-change: margin-right, transform; +} +._header_14an4_44 { + margin-bottom: var(--space-default); + height: var(--header-height); + padding: 0 var(--space-default); + background-color: var(--color-blue); +} +._header_14an4_44 h2 { + margin: 0; + font-size: var(--header-default-font-size); + font-weight: 400; +} +._header_14an4_44 a { + cursor: pointer; + font-size: 20px; +} +._content_14an4_62 { + padding: 0 var(--space-default); +} +._content_14an4_62 h1 { + margin-top: 0; + font-size: 1.5em; +} +._content_14an4_62 h2 { + margin: 0; + font-size: 1.1em; + line-height: 1.2em; + font-weight: 400; +} +._guide_14an4_33 p { + margin: .4em 0; + font-size: var(--size-default); +} +._show_14an4_83 { + margin-right: 0; +} +._entry_14an4_87 { + margin-top: var(--space-default); +} +._entryTitle_14an4_91 { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + cursor: default; +} +._entryTitle_14an4_91 ._entryToggle_14an4_99 { + width: 16px; + line-height: 1.2em; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + font-weight: 700; +} +._entryTitle_14an4_91 ._entryTitleText_14an4_109 { + flex: 1; +} +._entryContent_14an4_113 { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + padding-left: 16px; +} +._expanded_14an4_121 { + flex-basis: 0; +} +._link_14an4_125 { + color: inherit; + text-decoration: underline; +} +._link_14an4_125:focus { + outline-color: inherit; +} +@media (max-width: 1348px) { + ._guideWrapper_14an4_135 { + width: calc((((100% - var(--sidebar-width-large)) - var(--content-width)) / 2) + 18px + var(--space-default)); + } +} +@media screen and (max-width: 1601px) { + ._overlay_14an4_1._show_14an4_83 { + opacity: 1; + } + ._guide_14an4_33 { + position: fixed; + margin-right: 0; + top: 0; + right: 0; + width: 100%; + max-width: 460px; + opacity: 0; + z-index: -10; + transform: translate(100%); + transition-delay: .2s; + } + ._show_14an4_83 { + opacity: 1; + z-index: 4002; + } + ._guide_14an4_33._show_14an4_83 { + transform: translate(0); + } +} +@media (max-width: 768px) { + ._guideWrapper_14an4_135 { + position: fixed; + top: 0; + right: 0; + width: calc(var(--space-half) + 18px); + } + ._header_14an4_44, + ._content_14an4_62 { + padding-left: var(--space-half); + padding-right: var(--space-half); + } +} +@media screen and (max-width: 640px) { + ._guide_14an4_33 h2 { + font-size: 1.05em; + } +} +._manageContainer_1n5md_1 { + flex-basis: 490px; + flex-shrink: 1; + margin-bottom: var(--header-height); + min-height: 390px; + max-height: 100%; +} +._title_1n5md_9 { + font-size: var(--size-large); + font-weight: 400; +} +._successCheck_1n5md_14 { + background-color: var(--color-success); + border: .5rem solid var(--color-success); + border-radius: 100px; +} +._successMessage_1n5md_20 { + color: var(--color-secondary); +} +._successMessage_1n5md_20 strong { + color: var(--color-default); +} +._spinnerContainer_rthjr_1 { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + background-color: var(--background-secondary); + z-index: 2000; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + -webkit-transform-style: preserve-3d; + -webkit-backface-visibility: hidden; +} +._spinner_rthjr_1 { + display: inline-block; + position: relative; + width: 64px; + height: 64px; +} +._spinnerText_rthjr_24 { + margin: 0; +} +._spinner_rthjr_1 div { + position: absolute; + top: 27px; + width: 11px; + height: 11px; + border-radius: 50%; + background: var(--color-blue); + animation-timing-function: cubic-bezier(0, 1, 1, 0); +} +._spinner_rthjr_1 div:nth-child(1) { + left: 6px; + animation: _spinner1_rthjr_1 .6s infinite; +} +._spinner_rthjr_1 div:nth-child(2) { + left: 6px; + animation: _spinner2_rthjr_1 .6s infinite; +} +._spinner_rthjr_1 div:nth-child(3) { + left: 26px; + animation: _spinner2_rthjr_1 .6s infinite; +} +._spinner_rthjr_1 div:nth-child(4) { + left: 45px; + animation: _spinner3_rthjr_1 .6s infinite; +} +._horizontallyCentered_rthjr_59 { + left: 50%; + position: absolute; + transform: translate(-50%); +} +@keyframes _spinner1_rthjr_1 { + 0% { + transform: scale(0); + } + to { + transform: scale(1); + } +} +@keyframes _spinner3_rthjr_1 { + 0% { + transform: scale(1); + } + to { + transform: scale(0); + } +} +@keyframes _spinner2_rthjr_1 { + 0% { + transform: translate(0); + } + to { + transform: translate(19px); + } +} +._overlay_rthjr_81 { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: var(--background-secondary); + animation: _fadein_rthjr_1 .3s; + opacity: 0; +} +@keyframes _fadein_rthjr_1 { + 0% { + opacity: 1; + } + 66% { + opacity: 1; + } + to { + opacity: 0; + } +} +._togglersContainer_rthjr_98 { + position: fixed; + top: calc((var(--header-height) - 32px) / 2); + max-width: var(--content-width); + width: 100%; + padding: 0 var(--space-default); + z-index: 1; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} +._guideToggler_rthjr_111 { + display: flex; + flex-direction: row; + align-items: center; + height: 32px; + color: var(--color-primary); + font-size: var(--size-default); + cursor: default; +} +._guideToggler_rthjr_111 svg { + width: 18px; + height: 18px; + margin-right: calc(var(--space-quarter) / 2); +} +._toggler_rthjr_98 { + width: 32px; + height: 32px; + margin-right: var(--spacing-default); + display: flex; + flex-direction: row; + align-items: center; +} +._toggler_rthjr_98 img { + width: 20px; +} +@media (min-width: 1200px) { + ._togglersContainer_rthjr_98 { + flex-direction: row-reverse; + } + ._togglerContainer_rthjr_145 { + display: none; + } +} +@media (max-width: 768px) { + ._togglersContainer_rthjr_98 { + padding: 0 var(--space-half); + } +} +._disclaimerContainer_5gxwf_1 { + align-items: center; + display: flex; + flex-basis: 100%; + flex-direction: column; + flex-grow: 0; + flex-shrink: 1; + justify-content: center; + margin: 0 auto; + overflow: auto; + padding: 0 var(--space-half) var(--header-height) var(--space-half); + width: 100%; +} +._title_5gxwf_15 { + font-size: 2rem; + font-weight: 400; + text-align: center; +} +._disclaimer_5gxwf_1 { + background-color: var(--background-secondary); + flex-basis: 100%; + font-family: var(--font-family); + flex-grow: 0; + flex-shrink: 1; + margin: var(--space-default) 0; + max-width: 660px; + overflow: auto; + padding: var(--space-quarter) 1em 1em 1em; +} +._disclaimer_5gxwf_1::-webkit-scrollbar-track { + background-color: #fff; +} +._disclaimer_5gxwf_1 ._title_5gxwf_15 { + font-size: .875rem; + font-weight: 700; + text-align: left; +} +._disclaimer_5gxwf_1 p { + font-size: .875rem; + line-height: 1.5; +} +._disclaimer_5gxwf_1 p + ._title_5gxwf_15 { + margin: 2.5rem 0 0; +} +._table_5gxwf_52 { + overflow: auto; +} +._table_5gxwf_52 table { + border-collapse: collapse; + font-size: .875rem; + text-align: left; +} +._table_5gxwf_52 td, +._table_5gxwf_52 th { + padding: var(--spacing-half); + vertical-align: top; +} +._table_5gxwf_52 td { + border-top: 1px solid var(--color-mediumgray); +} +._table_5gxwf_52 td:not(:last-child), +._table_5gxwf_52 th:not(:last-child) { + padding-left: 0; +} +._nowrap_5gxwf_77 { + white-space: nowrap; +} +._container_yg57j_1 { + display: flex; + flex-basis: 100%; + flex-grow: 0; + flex-shrink: 1; + flex-direction: column; + overflow: hidden; + position: relative; +} +._iframe_yg57j_12 { + max-width: 100%; + position: relative; + z-index: 3000; +} +._header_yg57j_18 { + position: relative; + z-index: 2200; +} +._balance_17xkv_1, +._balanceSingleValue_17xkv_1 { + color: var(--color-secondary); + margin-left: auto; + text-transform: uppercase; +} +._balanceSingleValue_17xkv_1 { + margin-right: var(--space-quarter); +} +._dropdown_17xkv_11 { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-labelledby='chevron down' color='%23777'%3E%3Cdefs/%3E%3Cpolyline points='6 10 12 16 18 10'/%3E%3C/svg%3E%0A"); + background-repeat: no-repeat; + font-weight: 400; + height: calc(var(--space-quarter) * 3); + padding: 0 calc(var(--space-quarter) + var(--space-eight)); +} +._select_17xkv_20 { + margin-bottom: var(--space-half); +} +._select_17xkv_20 .react-select__menu, +._select_17xkv_20 .react-select__option { + background-color: var(--background-secondary); +} +._select_17xkv_20 .react-select__option:hover { + background-color: var(--background-custom-select-hover); +} +._select_17xkv_20 .react-select__option--is-selected, +._select_17xkv_20 .react-select__option--is-selected:hover { + background-color: var(--background-custom-select-selected); +} +._select_17xkv_20 .react-select__option--is-disabled span { + color: var(--color-secondary); +} +._select_17xkv_20 .react-select__option--is-disabled.react-select__option--is-selected:hover { + background-color: var(--background-custom-select-selected); +} +._select_17xkv_20 .react-select__option--is-disabled:hover { + background-color: transparent; +} +._select_17xkv_20 .react-select__option--is-selected ._balance_17xkv_1 { + color: var(--color-default); +} +._select_17xkv_20 .react-select__control { + background-color: var(--background-secondary); + padding: var(--space-quarter) var(--space-eight); +} +._select_17xkv_20 .react-select__single-value { + width: 100%; +} +._selectLabelText_17xkv_66 { + margin-left: 6px; +} +._singleValueContainer_17xkv_70 { + align-items: center; + display: flex; + left: var(--space-quarter); + position: absolute; + width: 100%; +} +._valueContainer_17xkv_78 { + align-items: center; + color: var(--color-default); + display: flex; +} +._select_17xkv_20 .react-select__option--is-selected ._selectLabelText_17xkv_66 { + color: var(--color-default); +} +._valueContainer_17xkv_78 > img { + width: 20px; + height: 20px; +} +._button_1riw8_1 { + border-width: 0; + display: flex; + padding: 0; +} +._button_1riw8_1 img { + width: 18px; + height: 18px; +} +._button_1riw8_1 span { + width: 96px; + margin-left: var(--space-eight); +} +.fib, +.fi { + background-size: contain; + background-position: 50%; + background-repeat: no-repeat; +} +.fi { + position: relative; + display: inline-block; + width: 1.333333em; + line-height: 1em; +} +.fi:before { + content: " "; +} +.fi.fis { + width: 1em; +} +.fi-xx { + background-image: url(./xx2.svg); +} +.fi-xx.fis { + background-image: url(./xx.svg); +} +.fi-ad { + background-image: url(./ad.svg); +} +.fi-ad.fis { + background-image: url(./ad2.svg); +} +.fi-ae { + background-image: url(./ae.svg); +} +.fi-ae.fis { + background-image: url(./ae2.svg); +} +.fi-af { + background-image: url(./af2.svg); +} +.fi-af.fis { + background-image: url(./af.svg); +} +.fi-ag { + background-image: url(./ag2.svg); +} +.fi-ag.fis { + background-image: url(./ag.svg); +} +.fi-ai { + background-image: url(./ai.svg); +} +.fi-ai.fis { + background-image: url(./ai2.svg); +} +.fi-al { + background-image: url(./al.svg); +} +.fi-al.fis { + background-image: url(./al2.svg); +} +.fi-am { + background-image: url(./am.svg); +} +.fi-am.fis { + background-image: url(./am2.svg); +} +.fi-ao { + background-image: url(./ao.svg); +} +.fi-ao.fis { + background-image: url(./ao2.svg); +} +.fi-aq { + background-image: url(./aq.svg); +} +.fi-aq.fis { + background-image: url(./aq2.svg); +} +.fi-ar { + background-image: url(./ar.svg); +} +.fi-ar.fis { + background-image: url(./ar2.svg); +} +.fi-as { + background-image: url(./as.svg); +} +.fi-as.fis { + background-image: url(./as2.svg); +} +.fi-at { + background-image: url(./at.svg); +} +.fi-at.fis { + background-image: url(./at2.svg); +} +.fi-au { + background-image: url(./au.svg); +} +.fi-au.fis { + background-image: url(./au2.svg); +} +.fi-aw { + background-image: url(./aw.svg); +} +.fi-aw.fis { + background-image: url(./aw2.svg); +} +.fi-ax { + background-image: url(./ax.svg); +} +.fi-ax.fis { + background-image: url(./ax2.svg); +} +.fi-az { + background-image: url(./az2.svg); +} +.fi-az.fis { + background-image: url(./az.svg); +} +.fi-ba { + background-image: url(./ba.svg); +} +.fi-ba.fis { + background-image: url(./ba2.svg); +} +.fi-bb { + background-image: url(./bb.svg); +} +.fi-bb.fis { + background-image: url(./bb2.svg); +} +.fi-bd { + background-image: url(./bd.svg); +} +.fi-bd.fis { + background-image: url(./bd2.svg); +} +.fi-be { + background-image: url(./be.svg); +} +.fi-be.fis { + background-image: url(./be2.svg); +} +.fi-bf { + background-image: url(./bf.svg); +} +.fi-bf.fis { + background-image: url(./bf2.svg); +} +.fi-bg { + background-image: url(./bg.svg); +} +.fi-bg.fis { + background-image: url(./bg2.svg); +} +.fi-bh { + background-image: url(./bh.svg); +} +.fi-bh.fis { + background-image: url(./bh2.svg); +} +.fi-bi { + background-image: url(./bi2.svg); +} +.fi-bi.fis { + background-image: url(./bi.svg); +} +.fi-bj { + background-image: url(./bj.svg); +} +.fi-bj.fis { + background-image: url(./bj2.svg); +} +.fi-bl { + background-image: url(./bl.svg); +} +.fi-bl.fis { + background-image: url(./bl2.svg); +} +.fi-bm { + background-image: url(./bm.svg); +} +.fi-bm.fis { + background-image: url(./bm2.svg); +} +.fi-bn { + background-image: url(./bn.svg); +} +.fi-bn.fis { + background-image: url(./bn2.svg); +} +.fi-bo { + background-image: url(./bo.svg); +} +.fi-bo.fis { + background-image: url(./bo2.svg); +} +.fi-bq { + background-image: url(./bq.svg); +} +.fi-bq.fis { + background-image: url(./bq2.svg); +} +.fi-br { + background-image: url(./br.svg); +} +.fi-br.fis { + background-image: url(./br2.svg); +} +.fi-bs { + background-image: url(./bs.svg); +} +.fi-bs.fis { + background-image: url(./bs2.svg); +} +.fi-bt { + background-image: url(./bt2.svg); +} +.fi-bt.fis { + background-image: url(./bt.svg); +} +.fi-bv { + background-image: url(./bv2.svg); +} +.fi-bv.fis { + background-image: url(./bv.svg); +} +.fi-bw { + background-image: url(./bw.svg); +} +.fi-bw.fis { + background-image: url(./bw2.svg); +} +.fi-by { + background-image: url(./by2.svg); +} +.fi-by.fis { + background-image: url(./by.svg); +} +.fi-bz { + background-image: url(./bz2.svg); +} +.fi-bz.fis { + background-image: url(./bz.svg); +} +.fi-ca { + background-image: url(./ca2.svg); +} +.fi-ca.fis { + background-image: url(./ca.svg); +} +.fi-cc { + background-image: url(./cc.svg); +} +.fi-cc.fis { + background-image: url(./cc2.svg); +} +.fi-cd { + background-image: url(./cd.svg); +} +.fi-cd.fis { + background-image: url(./cd2.svg); +} +.fi-cf { + background-image: url(./cf.svg); +} +.fi-cf.fis { + background-image: url(./cf2.svg); +} +.fi-cg { + background-image: url(./cg.svg); +} +.fi-cg.fis { + background-image: url(./cg2.svg); +} +.fi-ch { + background-image: url(./ch.svg); +} +.fi-ch.fis { + background-image: url(./ch2.svg); +} +.fi-ci { + background-image: url(./ci.svg); +} +.fi-ci.fis { + background-image: url(./ci2.svg); +} +.fi-ck { + background-image: url(./ck.svg); +} +.fi-ck.fis { + background-image: url(./ck2.svg); +} +.fi-cl { + background-image: url(./cl2.svg); +} +.fi-cl.fis { + background-image: url(./cl.svg); +} +.fi-cm { + background-image: url(./cm.svg); +} +.fi-cm.fis { + background-image: url(./cm2.svg); +} +.fi-cn { + background-image: url(./cn2.svg); +} +.fi-cn.fis { + background-image: url(./cn.svg); +} +.fi-co { + background-image: url(./co.svg); +} +.fi-co.fis { + background-image: url(./co2.svg); +} +.fi-cr { + background-image: url(./cr.svg); +} +.fi-cr.fis { + background-image: url(./cr2.svg); +} +.fi-cu { + background-image: url(./cu2.svg); +} +.fi-cu.fis { + background-image: url(./cu.svg); +} +.fi-cv { + background-image: url(./cv.svg); +} +.fi-cv.fis { + background-image: url(./cv2.svg); +} +.fi-cw { + background-image: url(./cw.svg); +} +.fi-cw.fis { + background-image: url(./cw2.svg); +} +.fi-cx { + background-image: url(./cx.svg); +} +.fi-cx.fis { + background-image: url(./cx2.svg); +} +.fi-cy { + background-image: url(./cy.svg); +} +.fi-cy.fis { + background-image: url(./cy2.svg); +} +.fi-cz { + background-image: url(./cz.svg); +} +.fi-cz.fis { + background-image: url(./cz2.svg); +} +.fi-de { + background-image: url(./de.svg); +} +.fi-de.fis { + background-image: url(./de2.svg); +} +.fi-dj { + background-image: url(./dj.svg); +} +.fi-dj.fis { + background-image: url(./dj2.svg); +} +.fi-dk { + background-image: url(./dk.svg); +} +.fi-dk.fis { + background-image: url(./dk2.svg); +} +.fi-dm { + background-image: url(./dm.svg); +} +.fi-dm.fis { + background-image: url(./dm2.svg); +} +.fi-do { + background-image: url(./do.svg); +} +.fi-do.fis { + background-image: url(./do2.svg); +} +.fi-dz { + background-image: url(./dz.svg); +} +.fi-dz.fis { + background-image: url(./dz2.svg); +} +.fi-ec { + background-image: url(./ec.svg); +} +.fi-ec.fis { + background-image: url(./ec2.svg); +} +.fi-ee { + background-image: url(./ee.svg); +} +.fi-ee.fis { + background-image: url(./ee2.svg); +} +.fi-eg { + background-image: url(./eg.svg); +} +.fi-eg.fis { + background-image: url(./eg2.svg); +} +.fi-eh { + background-image: url(./eh.svg); +} +.fi-eh.fis { + background-image: url(./eh2.svg); +} +.fi-er { + background-image: url(./er2.svg); +} +.fi-er.fis { + background-image: url(./er.svg); +} +.fi-es { + background-image: url(./es.svg); +} +.fi-es.fis { + background-image: url(./es2.svg); +} +.fi-et { + background-image: url(./et.svg); +} +.fi-et.fis { + background-image: url(./et2.svg); +} +.fi-fi { + background-image: url(./fi.svg); +} +.fi-fi.fis { + background-image: url(./fi2.svg); +} +.fi-fj { + background-image: url(./fj2.svg); +} +.fi-fj.fis { + background-image: url(./fj.svg); +} +.fi-fk { + background-image: url(./fk.svg); +} +.fi-fk.fis { + background-image: url(./fk2.svg); +} +.fi-fm { + background-image: url(./fm2.svg); +} +.fi-fm.fis { + background-image: url(./fm.svg); +} +.fi-fo { + background-image: url(./fo.svg); +} +.fi-fo.fis { + background-image: url(./fo2.svg); +} +.fi-fr { + background-image: url(./fr.svg); +} +.fi-fr.fis { + background-image: url(./fr2.svg); +} +.fi-ga { + background-image: url(./ga.svg); +} +.fi-ga.fis { + background-image: url(./ga2.svg); +} +.fi-gb { + background-image: url(./gb2.svg); +} +.fi-gb.fis { + background-image: url(./gb.svg); +} +.fi-gd { + background-image: url(./gd2.svg); +} +.fi-gd.fis { + background-image: url(./gd.svg); +} +.fi-ge { + background-image: url(./ge2.svg); +} +.fi-ge.fis { + background-image: url(./ge.svg); +} +.fi-gf { + background-image: url(./gf2.svg); +} +.fi-gf.fis { + background-image: url(./gf.svg); +} +.fi-gg { + background-image: url(./gg.svg); +} +.fi-gg.fis { + background-image: url(./gg2.svg); +} +.fi-gh { + background-image: url(./gh.svg); +} +.fi-gh.fis { + background-image: url(./gh2.svg); +} +.fi-gi { + background-image: url(./gi.svg); +} +.fi-gi.fis { + background-image: url(./gi2.svg); +} +.fi-gl { + background-image: url(./gl.svg); +} +.fi-gl.fis { + background-image: url(./gl2.svg); +} +.fi-gm { + background-image: url(./gm.svg); +} +.fi-gm.fis { + background-image: url(./gm2.svg); +} +.fi-gn { + background-image: url(./gn.svg); +} +.fi-gn.fis { + background-image: url(./gn2.svg); +} +.fi-gp { + background-image: url(./gp2.svg); +} +.fi-gp.fis { + background-image: url(./gp.svg); +} +.fi-gq { + background-image: url(./gq.svg); +} +.fi-gq.fis { + background-image: url(./gq2.svg); +} +.fi-gr { + background-image: url(./gr.svg); +} +.fi-gr.fis { + background-image: url(./gr2.svg); +} +.fi-gs { + background-image: url(./gs.svg); +} +.fi-gs.fis { + background-image: url(./gs2.svg); +} +.fi-gt { + background-image: url(./gt.svg); +} +.fi-gt.fis { + background-image: url(./gt2.svg); +} +.fi-gu { + background-image: url(./gu2.svg); +} +.fi-gu.fis { + background-image: url(./gu.svg); +} +.fi-gw { + background-image: url(./gw.svg); +} +.fi-gw.fis { + background-image: url(./gw2.svg); +} +.fi-gy { + background-image: url(./gy.svg); +} +.fi-gy.fis { + background-image: url(./gy2.svg); +} +.fi-hk { + background-image: url(./hk.svg); +} +.fi-hk.fis { + background-image: url(./hk2.svg); +} +.fi-hm { + background-image: url(./hm2.svg); +} +.fi-hm.fis { + background-image: url(./hm.svg); +} +.fi-hn { + background-image: url(./hn.svg); +} +.fi-hn.fis { + background-image: url(./hn2.svg); +} +.fi-hr { + background-image: url(./hr2.svg); +} +.fi-hr.fis { + background-image: url(./hr.svg); +} +.fi-ht { + background-image: url(./ht.svg); +} +.fi-ht.fis { + background-image: url(./ht2.svg); +} +.fi-hu { + background-image: url(./hu.svg); +} +.fi-hu.fis { + background-image: url(./hu2.svg); +} +.fi-id { + background-image: url(./id.svg); +} +.fi-id.fis { + background-image: url(./id2.svg); +} +.fi-ie { + background-image: url(./ie.svg); +} +.fi-ie.fis { + background-image: url(./ie2.svg); +} +.fi-il { + background-image: url(./il.svg); +} +.fi-il.fis { + background-image: url(./il2.svg); +} +.fi-im { + background-image: url(./im2.svg); +} +.fi-im.fis { + background-image: url(./im.svg); +} +.fi-in { + background-image: url(./in.svg); +} +.fi-in.fis { + background-image: url(./in2.svg); +} +.fi-io { + background-image: url(./io.svg); +} +.fi-io.fis { + background-image: url(./io2.svg); +} +.fi-iq { + background-image: url(./iq2.svg); +} +.fi-iq.fis { + background-image: url(./iq.svg); +} +.fi-ir { + background-image: url(./ir.svg); +} +.fi-ir.fis { + background-image: url(./ir2.svg); +} +.fi-is { + background-image: url(./is.svg); +} +.fi-is.fis { + background-image: url(./is2.svg); +} +.fi-it { + background-image: url(./it.svg); +} +.fi-it.fis { + background-image: url(./it2.svg); +} +.fi-je { + background-image: url(./je.svg); +} +.fi-je.fis { + background-image: url(./je2.svg); +} +.fi-jm { + background-image: url(./jm.svg); +} +.fi-jm.fis { + background-image: url(./jm2.svg); +} +.fi-jo { + background-image: url(./jo2.svg); +} +.fi-jo.fis { + background-image: url(./jo.svg); +} +.fi-jp { + background-image: url(./jp.svg); +} +.fi-jp.fis { + background-image: url(./jp2.svg); +} +.fi-ke { + background-image: url(./ke.svg); +} +.fi-ke.fis { + background-image: url(./ke2.svg); +} +.fi-kg { + background-image: url(./kg.svg); +} +.fi-kg.fis { + background-image: url(./kg2.svg); +} +.fi-kh { + background-image: url(./kh.svg); +} +.fi-kh.fis { + background-image: url(./kh2.svg); +} +.fi-ki { + background-image: url(./ki.svg); +} +.fi-ki.fis { + background-image: url(./ki2.svg); +} +.fi-km { + background-image: url(./km.svg); +} +.fi-km.fis { + background-image: url(./km2.svg); +} +.fi-kn { + background-image: url(./kn.svg); +} +.fi-kn.fis { + background-image: url(./kn2.svg); +} +.fi-kp { + background-image: url(./kp.svg); +} +.fi-kp.fis { + background-image: url(./kp2.svg); +} +.fi-kr { + background-image: url(./kr.svg); +} +.fi-kr.fis { + background-image: url(./kr2.svg); +} +.fi-kw { + background-image: url(./kw.svg); +} +.fi-kw.fis { + background-image: url(./kw2.svg); +} +.fi-ky { + background-image: url(./ky.svg); +} +.fi-ky.fis { + background-image: url(./ky2.svg); +} +.fi-kz { + background-image: url(./kz.svg); +} +.fi-kz.fis { + background-image: url(./kz2.svg); +} +.fi-la { + background-image: url(./la.svg); +} +.fi-la.fis { + background-image: url(./la2.svg); +} +.fi-lb { + background-image: url(./lb.svg); +} +.fi-lb.fis { + background-image: url(./lb2.svg); +} +.fi-lc { + background-image: url(./lc.svg); +} +.fi-lc.fis { + background-image: url(./lc2.svg); +} +.fi-li { + background-image: url(./li.svg); +} +.fi-li.fis { + background-image: url(./li2.svg); +} +.fi-lk { + background-image: url(./lk.svg); +} +.fi-lk.fis { + background-image: url(./lk2.svg); +} +.fi-lr { + background-image: url(./lr.svg); +} +.fi-lr.fis { + background-image: url(./lr2.svg); +} +.fi-ls { + background-image: url(./ls.svg); +} +.fi-ls.fis { + background-image: url(./ls2.svg); +} +.fi-lt { + background-image: url(./lt.svg); +} +.fi-lt.fis { + background-image: url(./lt2.svg); +} +.fi-lu { + background-image: url(./lu.svg); +} +.fi-lu.fis { + background-image: url(./lu2.svg); +} +.fi-lv { + background-image: url(./lv.svg); +} +.fi-lv.fis { + background-image: url(./lv2.svg); +} +.fi-ly { + background-image: url(./ly.svg); +} +.fi-ly.fis { + background-image: url(./ly2.svg); +} +.fi-ma { + background-image: url(./ma.svg); +} +.fi-ma.fis { + background-image: url(./ma2.svg); +} +.fi-mc { + background-image: url(./mc.svg); +} +.fi-mc.fis { + background-image: url(./mc2.svg); +} +.fi-md { + background-image: url(./md2.svg); +} +.fi-md.fis { + background-image: url(./md.svg); +} +.fi-me { + background-image: url(./me.svg); +} +.fi-me.fis { + background-image: url(./me2.svg); +} +.fi-mf { + background-image: url(./mf.svg); +} +.fi-mf.fis { + background-image: url(./mf2.svg); +} +.fi-mg { + background-image: url(./mg.svg); +} +.fi-mg.fis { + background-image: url(./mg2.svg); +} +.fi-mh { + background-image: url(./mh2.svg); +} +.fi-mh.fis { + background-image: url(./mh.svg); +} +.fi-mk { + background-image: url(./mk.svg); +} +.fi-mk.fis { + background-image: url(./mk2.svg); +} +.fi-ml { + background-image: url(./ml2.svg); +} +.fi-ml.fis { + background-image: url(./ml.svg); +} +.fi-mm { + background-image: url(./mm.svg); +} +.fi-mm.fis { + background-image: url(./mm2.svg); +} +.fi-mn { + background-image: url(./mn.svg); +} +.fi-mn.fis { + background-image: url(./mn2.svg); +} +.fi-mo { + background-image: url(./mo.svg); +} +.fi-mo.fis { + background-image: url(./mo2.svg); +} +.fi-mp { + background-image: url(./mp2.svg); +} +.fi-mp.fis { + background-image: url(./mp.svg); +} +.fi-mq { + background-image: url(./mq.svg); +} +.fi-mq.fis { + background-image: url(./mq2.svg); +} +.fi-mr { + background-image: url(./mr.svg); +} +.fi-mr.fis { + background-image: url(./mr2.svg); +} +.fi-ms { + background-image: url(./ms.svg); +} +.fi-ms.fis { + background-image: url(./ms2.svg); +} +.fi-mt { + background-image: url(./mt.svg); +} +.fi-mt.fis { + background-image: url(./mt2.svg); +} +.fi-mu { + background-image: url(./mu.svg); +} +.fi-mu.fis { + background-image: url(./mu2.svg); +} +.fi-mv { + background-image: url(./mv.svg); +} +.fi-mv.fis { + background-image: url(./mv2.svg); +} +.fi-mw { + background-image: url(./mw.svg); +} +.fi-mw.fis { + background-image: url(./mw2.svg); +} +.fi-mx { + background-image: url(./mx.svg); +} +.fi-mx.fis { + background-image: url(./mx2.svg); +} +.fi-my { + background-image: url(./my.svg); +} +.fi-my.fis { + background-image: url(./my2.svg); +} +.fi-mz { + background-image: url(./mz.svg); +} +.fi-mz.fis { + background-image: url(./mz2.svg); +} +.fi-na { + background-image: url(./na.svg); +} +.fi-na.fis { + background-image: url(./na2.svg); +} +.fi-nc { + background-image: url(./nc.svg); +} +.fi-nc.fis { + background-image: url(./nc2.svg); +} +.fi-ne { + background-image: url(./ne.svg); +} +.fi-ne.fis { + background-image: url(./ne2.svg); +} +.fi-nf { + background-image: url(./nf.svg); +} +.fi-nf.fis { + background-image: url(./nf2.svg); +} +.fi-ng { + background-image: url(./ng2.svg); +} +.fi-ng.fis { + background-image: url(./ng.svg); +} +.fi-ni { + background-image: url(./ni.svg); +} +.fi-ni.fis { + background-image: url(./ni2.svg); +} +.fi-nl { + background-image: url(./nl.svg); +} +.fi-nl.fis { + background-image: url(./nl2.svg); +} +.fi-no { + background-image: url(./no.svg); +} +.fi-no.fis { + background-image: url(./no2.svg); +} +.fi-np { + background-image: url(./np2.svg); +} +.fi-np.fis { + background-image: url(./np.svg); +} +.fi-nr { + background-image: url(./nr.svg); +} +.fi-nr.fis { + background-image: url(./nr2.svg); +} +.fi-nu { + background-image: url(./nu.svg); +} +.fi-nu.fis { + background-image: url(./nu2.svg); +} +.fi-nz { + background-image: url(./nz.svg); +} +.fi-nz.fis { + background-image: url(./nz2.svg); +} +.fi-om { + background-image: url(./om.svg); +} +.fi-om.fis { + background-image: url(./om2.svg); +} +.fi-pa { + background-image: url(./pa.svg); +} +.fi-pa.fis { + background-image: url(./pa2.svg); +} +.fi-pe { + background-image: url(./pe.svg); +} +.fi-pe.fis { + background-image: url(./pe2.svg); +} +.fi-pf { + background-image: url(./pf2.svg); +} +.fi-pf.fis { + background-image: url(./pf.svg); +} +.fi-pg { + background-image: url(./pg.svg); +} +.fi-pg.fis { + background-image: url(./pg2.svg); +} +.fi-ph { + background-image: url(./ph.svg); +} +.fi-ph.fis { + background-image: url(./ph2.svg); +} +.fi-pk { + background-image: url(./pk.svg); +} +.fi-pk.fis { + background-image: url(./pk2.svg); +} +.fi-pl { + background-image: url(./pl.svg); +} +.fi-pl.fis { + background-image: url(./pl2.svg); +} +.fi-pm { + background-image: url(./pm.svg); +} +.fi-pm.fis { + background-image: url(./pm2.svg); +} +.fi-pn { + background-image: url(./pn.svg); +} +.fi-pn.fis { + background-image: url(./pn2.svg); +} +.fi-pr { + background-image: url(./pr2.svg); +} +.fi-pr.fis { + background-image: url(./pr.svg); +} +.fi-ps { + background-image: url(./ps.svg); +} +.fi-ps.fis { + background-image: url(./ps2.svg); +} +.fi-pt { + background-image: url(./pt.svg); +} +.fi-pt.fis { + background-image: url(./pt2.svg); +} +.fi-pw { + background-image: url(./pw.svg); +} +.fi-pw.fis { + background-image: url(./pw2.svg); +} +.fi-py { + background-image: url(./py.svg); +} +.fi-py.fis { + background-image: url(./py2.svg); +} +.fi-qa { + background-image: url(./qa2.svg); +} +.fi-qa.fis { + background-image: url(./qa.svg); +} +.fi-re { + background-image: url(./re.svg); +} +.fi-re.fis { + background-image: url(./re2.svg); +} +.fi-ro { + background-image: url(./ro2.svg); +} +.fi-ro.fis { + background-image: url(./ro.svg); +} +.fi-rs { + background-image: url(./rs.svg); +} +.fi-rs.fis { + background-image: url(./rs2.svg); +} +.fi-ru { + background-image: url(./ru2.svg); +} +.fi-ru.fis { + background-image: url(./ru.svg); +} +.fi-rw { + background-image: url(./rw.svg); +} +.fi-rw.fis { + background-image: url(./rw2.svg); +} +.fi-sa { + background-image: url(./sa.svg); +} +.fi-sa.fis { + background-image: url(./sa2.svg); +} +.fi-sb { + background-image: url(./sb.svg); +} +.fi-sb.fis { + background-image: url(./sb2.svg); +} +.fi-sc { + background-image: url(./sc.svg); +} +.fi-sc.fis { + background-image: url(./sc2.svg); +} +.fi-sd { + background-image: url(./sd2.svg); +} +.fi-sd.fis { + background-image: url(./sd.svg); +} +.fi-se { + background-image: url(./se.svg); +} +.fi-se.fis { + background-image: url(./se2.svg); +} +.fi-sg { + background-image: url(./sg.svg); +} +.fi-sg.fis { + background-image: url(./sg2.svg); +} +.fi-sh { + background-image: url(./sh.svg); +} +.fi-sh.fis { + background-image: url(./sh2.svg); +} +.fi-si { + background-image: url(./si2.svg); +} +.fi-si.fis { + background-image: url(./si.svg); +} +.fi-sj { + background-image: url(./sj.svg); +} +.fi-sj.fis { + background-image: url(./sj2.svg); +} +.fi-sk { + background-image: url(./sk2.svg); +} +.fi-sk.fis { + background-image: url(./sk.svg); +} +.fi-sl { + background-image: url(./sl.svg); +} +.fi-sl.fis { + background-image: url(./sl2.svg); +} +.fi-sm { + background-image: url(./sm.svg); +} +.fi-sm.fis { + background-image: url(./sm2.svg); +} +.fi-sn { + background-image: url(./sn.svg); +} +.fi-sn.fis { + background-image: url(./sn2.svg); +} +.fi-so { + background-image: url(./so.svg); +} +.fi-so.fis { + background-image: url(./so2.svg); +} +.fi-sr { + background-image: url(./sr.svg); +} +.fi-sr.fis { + background-image: url(./sr2.svg); +} +.fi-ss { + background-image: url(./ss.svg); +} +.fi-ss.fis { + background-image: url(./ss2.svg); +} +.fi-st { + background-image: url(./st.svg); +} +.fi-st.fis { + background-image: url(./st2.svg); +} +.fi-sv { + background-image: url(./sv.svg); +} +.fi-sv.fis { + background-image: url(./sv2.svg); +} +.fi-sx { + background-image: url(./sx.svg); +} +.fi-sx.fis { + background-image: url(./sx2.svg); +} +.fi-sy { + background-image: url(./sy.svg); +} +.fi-sy.fis { + background-image: url(./sy2.svg); +} +.fi-sz { + background-image: url(./sz.svg); +} +.fi-sz.fis { + background-image: url(./sz2.svg); +} +.fi-tc { + background-image: url(./tc.svg); +} +.fi-tc.fis { + background-image: url(./tc2.svg); +} +.fi-td { + background-image: url(./td2.svg); +} +.fi-td.fis { + background-image: url(./td.svg); +} +.fi-tf { + background-image: url(./tf.svg); +} +.fi-tf.fis { + background-image: url(./tf2.svg); +} +.fi-tg { + background-image: url(./tg2.svg); +} +.fi-tg.fis { + background-image: url(./tg.svg); +} +.fi-th { + background-image: url(./th.svg); +} +.fi-th.fis { + background-image: url(./th2.svg); +} +.fi-tj { + background-image: url(./tj2.svg); +} +.fi-tj.fis { + background-image: url(./tj.svg); +} +.fi-tk { + background-image: url(./tk.svg); +} +.fi-tk.fis { + background-image: url(./tk2.svg); +} +.fi-tl { + background-image: url(./tl.svg); +} +.fi-tl.fis { + background-image: url(./tl2.svg); +} +.fi-tm { + background-image: url(./tm.svg); +} +.fi-tm.fis { + background-image: url(./tm2.svg); +} +.fi-tn { + background-image: url(./tn.svg); +} +.fi-tn.fis { + background-image: url(./tn2.svg); +} +.fi-to { + background-image: url(./to.svg); +} +.fi-to.fis { + background-image: url(./to2.svg); +} +.fi-tr { + background-image: url(./tr.svg); +} +.fi-tr.fis { + background-image: url(./tr2.svg); +} +.fi-tt { + background-image: url(./tt.svg); +} +.fi-tt.fis { + background-image: url(./tt2.svg); +} +.fi-tv { + background-image: url(./tv.svg); +} +.fi-tv.fis { + background-image: url(./tv2.svg); +} +.fi-tw { + background-image: url(./tw.svg); +} +.fi-tw.fis { + background-image: url(./tw2.svg); +} +.fi-tz { + background-image: url(./tz2.svg); +} +.fi-tz.fis { + background-image: url(./tz.svg); +} +.fi-ua { + background-image: url(./ua2.svg); +} +.fi-ua.fis { + background-image: url(./ua.svg); +} +.fi-ug { + background-image: url(./ug.svg); +} +.fi-ug.fis { + background-image: url(./ug2.svg); +} +.fi-um { + background-image: url(./um.svg); +} +.fi-um.fis { + background-image: url(./um2.svg); +} +.fi-us { + background-image: url(./us.svg); +} +.fi-us.fis { + background-image: url(./us2.svg); +} +.fi-uy { + background-image: url(./uy.svg); +} +.fi-uy.fis { + background-image: url(./uy2.svg); +} +.fi-uz { + background-image: url(./uz.svg); +} +.fi-uz.fis { + background-image: url(./uz2.svg); +} +.fi-va { + background-image: url(./va.svg); +} +.fi-va.fis { + background-image: url(./va2.svg); +} +.fi-vc { + background-image: url(./vc.svg); +} +.fi-vc.fis { + background-image: url(./vc2.svg); +} +.fi-ve { + background-image: url(./ve.svg); +} +.fi-ve.fis { + background-image: url(./ve2.svg); +} +.fi-vg { + background-image: url(./vg.svg); +} +.fi-vg.fis { + background-image: url(./vg2.svg); +} +.fi-vi { + background-image: url(./vi.svg); +} +.fi-vi.fis { + background-image: url(./vi2.svg); +} +.fi-vn { + background-image: url(./vn.svg); +} +.fi-vn.fis { + background-image: url(./vn2.svg); +} +.fi-vu { + background-image: url(./vu.svg); +} +.fi-vu.fis { + background-image: url(./vu2.svg); +} +.fi-wf { + background-image: url(./wf2.svg); +} +.fi-wf.fis { + background-image: url(./wf.svg); +} +.fi-ws { + background-image: url(./ws.svg); +} +.fi-ws.fis { + background-image: url(./ws2.svg); +} +.fi-ye { + background-image: url(./ye.svg); +} +.fi-ye.fis { + background-image: url(./ye2.svg); +} +.fi-yt { + background-image: url(./yt.svg); +} +.fi-yt.fis { + background-image: url(./yt2.svg); +} +.fi-za { + background-image: url(./za.svg); +} +.fi-za.fis { + background-image: url(./za2.svg); +} +.fi-zm { + background-image: url(./zm.svg); +} +.fi-zm.fis { + background-image: url(./zm2.svg); +} +.fi-zw { + background-image: url(./zw.svg); +} +.fi-zw.fis { + background-image: url(./zw2.svg); +} +.fi-arab { + background-image: url(./arab.svg); +} +.fi-arab.fis { + background-image: url(./arab2.svg); +} +.fi-cefta { + background-image: url(./cefta.svg); +} +.fi-cefta.fis { + background-image: url(./cefta2.svg); +} +.fi-cp { + background-image: url(./cp.svg); +} +.fi-cp.fis { + background-image: url(./cp2.svg); +} +.fi-dg { + background-image: url(./dg2.svg); +} +.fi-dg.fis { + background-image: url(./dg.svg); +} +.fi-eac { + background-image: url(./eac.svg); +} +.fi-eac.fis { + background-image: url(./eac2.svg); +} +.fi-es-ct { + background-image: url(./es-ct.svg); +} +.fi-es-ct.fis { + background-image: url(./es-ct2.svg); +} +.fi-es-ga { + background-image: url(./es-ga.svg); +} +.fi-es-ga.fis { + background-image: url(./es-ga2.svg); +} +.fi-es-pv { + background-image: url(./es-pv.svg); +} +.fi-es-pv.fis { + background-image: url(./es-pv2.svg); +} +.fi-eu { + background-image: url(./eu.svg); +} +.fi-eu.fis { + background-image: url(./eu2.svg); +} +.fi-gb-eng { + background-image: url(./gb-eng.svg); +} +.fi-gb-eng.fis { + background-image: url(./gb-eng2.svg); +} +.fi-gb-nir { + background-image: url(./gb-nir.svg); +} +.fi-gb-nir.fis { + background-image: url(./gb-nir2.svg); +} +.fi-gb-sct { + background-image: url(./gb-sct.svg); +} +.fi-gb-sct.fis { + background-image: url(./gb-sct2.svg); +} +.fi-gb-wls { + background-image: url(./gb-wls.svg); +} +.fi-gb-wls.fis { + background-image: url(./gb-wls2.svg); +} +.fi-ic { + background-image: url(./ic.svg); +} +.fi-ic.fis { + background-image: url(./ic2.svg); +} +.fi-pc { + background-image: url(./pc.svg); +} +.fi-pc.fis { + background-image: url(./pc2.svg); +} +.fi-sh-ac { + background-image: url(./sh-ac.svg); +} +.fi-sh-ac.fis { + background-image: url(./sh-ac2.svg); +} +.fi-sh-hl { + background-image: url(./sh-hl.svg); +} +.fi-sh-hl.fis { + background-image: url(./sh-hl2.svg); +} +.fi-sh-ta { + background-image: url(./sh-ta.svg); +} +.fi-sh-ta.fis { + background-image: url(./sh-ta2.svg); +} +.fi-un { + background-image: url(./un.svg); +} +.fi-un.fis { + background-image: url(./un2.svg); +} +.fi-xk { + background-image: url(./xk.svg); +} +.fi-xk.fis { + background-image: url(./xk2.svg); +} +._button_diw5d_1 { + background: none; + border: none; + cursor: pointer; + padding: 0; + position: absolute; + right: calc(var(--space-default) * -1); + top: 50%; + transform: translateY(-50%); +} +._container_1ksto_17, +._paymentMethodContainer_1ksto_17 { + display: flex; +} +._exchangeName_1ksto_21 { + width: 30%; +} +._infoButton_1ksto_25 { + background: none; + border: none; + cursor: pointer; + padding: 0; + position: absolute; + right: calc(var(--space-default) * -1); + top: 50%; + transform: translateY(-50%); +} +._outerContainer_1ksto_37 { + position: relative; +} +._paymentMethodsContainer_1ksto_41 { + display: flex; + flex-direction: column; + width: 70%; +} +._paymentMethodName_1ksto_47 { + color: var(--color-default); + display: inline-block; + font-weight: 400; + line-height: 22px; + margin: 0; +} +._paymentMethodName_1ksto_47 img { + margin-right: var(--space-quarter); +} +._paymentMethodContainer_1ksto_17:not(:first-child) { + margin-top: var(--space-eight); +} +._paymentMethodContainer_1ksto_17 > span { + flex-basis: 124px; + flex-grow: 1; +} +._radio_1ksto_67 { + --size-default: 14px; + background-color: var(--background-secondary); + border: 1px solid var(--background-quaternary); + display: block; + padding: 8px; +} +._radio_1ksto_67:hover, +._radio_1ksto_67 *:hover { + cursor: pointer; +} +._radio_1ksto_67 input { + display: none; +} +._radio_1ksto_67 input + label { + display: inline-flex; + flex-direction: column; + font-size: var(--size-default); + line-height: 1.5; + margin: 0; + padding-left: calc(var(--space-half) + var(--space-quarter)); + position: relative; +} +._radio_1ksto_67 input + label:before, +._radio_1ksto_67 input + label:after { + background: var(--background-secondary); + content: ""; + display: inline-block; + width: 12px; + height: 12px; + position: absolute; + top: 4px; + left: 0; + transition: all .1s ease; +} +._radio_1ksto_67 input + label:before { + border: 1px solid rgb(220, 220, 220); + border-radius: 1em; +} +._radio_1ksto_67 input + label:after { + background: var(--color-info); + border-radius: 1em; + width: 10px; + height: 10px; + position: absolute; + top: 6px; + left: 2px; + opacity: 0; + transform: scale(0); +} +._radioLabel_1ksto_123 { + width: 100%; +} +._text_1ksto_127 { + color: var(--color-default); + margin: 0; +} +._radio_1ksto_67[aria-checked=true] { + background-color: var(--background-focus); +} +._radio_1ksto_67:focus { + position: relative; + z-index: 2; +} +._radio_1ksto_67 input:checked + label:before { + background-color: var(--background-secondary); +} +._radio_1ksto_67 input:checked + label:after { + opacity: 1; + transform: scale(1); +} +._radio_1ksto_67 input[type=radio]:focus + label:before { + box-shadow: 0 0 2px 2px var(--color-info); + outline: none; + outline-offset: 0; +} +._radio_1ksto_67 input[type=radio]:checked:focus + label:before { + box-shadow: 0 0 2px 2px var(--color-info); +} +._radio_1ksto_67 input:disabled + label:before { + background: rgb(248, 248, 248); + border-color: #dcdcdc; + cursor: not-allowed; +} +._radio_1ksto_67[aria-disabled=true] { + background-color: #fff; +} +._radio_1ksto_67[aria-disabled=true], +._radio_1ksto_67[aria-disabled=true] * { + cursor: not-allowed; +} +span[role=radio]:focus { + outline-color: var(--color-blue); +} +._container_h94uh_1 p, +._container_h94uh_1 ul { + margin: 0; +} +._buttonBack_62uya_17 { + margin-right: auto; +} +._buttonsContainer_62uya_21 { + display: flex; + margin-top: var(--space-half); + justify-content: center; +} +._container_62uya_27 { + margin-top: calc(var(--space-default) * 1.5); +} +._exchangeContainer_62uya_31 { + display: flex; + flex-direction: column; + min-height: 300px; +} +._exchangeContainer_62uya_31.content { + flex-grow: 0; + flex-shrink: 0; + margin: auto; + padding-right: 40px; +} +._header_62uya_44 { + position: relative; + z-index: 2200; +} +._selectContainer_62uya_49 { + position: relative; + margin-bottom: var(--space-half); +} +._selectContainer_62uya_49 > div { + position: relative; +} +._selectContainer_62uya_49 > div > div { + margin: 0; +} +._label_62uya_62 { + color: var(--color-gray-alt); + line-height: 22px; + margin: 0; + margin-bottom: var(--space-eight); +} +._noExchangeText_62uya_69 { + color: var(--color-gray-alt); + line-height: 22px; + margin: 0; + margin-top: calc((var(--space-eight) + var(--space-half))); + margin-left: calc((var(--space-eight) + var(--space-quarter))); +} +._radioButtonsContainer_62uya_77 { + min-height: 180px; +} +._title_62uya_81 { + font-size: 2rem; + font-weight: 400; + margin-top: 0; + margin-bottom: var(--space-default); + text-align: center; +} +._dropdown_9chnx_1 { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-labelledby='chevron down' color='%23777'%3E%3Cdefs/%3E%3Cpolyline points='6 10 12 16 18 10'/%3E%3C/svg%3E%0A"); + background-repeat: no-repeat; + font-weight: 400; + height: calc(var(--space-quarter) * 3); + padding: 0 calc(var(--space-half) + var(--space-eight)); +} +._flag_9chnx_10 { + font-size: 20px; +} +._globe_9chnx_14 { + margin-top: 3px; + width: 26px; + height: 22px; +} +._optionsContainer_9chnx_20 { + align-items: center; + display: flex; +} +._select_9chnx_25 .react-select__input-container, +._select_9chnx_25 .react-select__single-value { + color: var(--color-default); +} +._select_9chnx_25 .react-select__menu, +._select_9chnx_25 .react-select__option { + background-color: var(--background-secondary); +} +._select_9chnx_25 .react-select__option:hover { + background-color: var(--background-custom-select-hover); +} +._select_9chnx_25 .react-select__option--is-selected, +._select_9chnx_25 .react-select__option--is-selected:hover { + background-color: var(--background-custom-select-selected); +} +._select_9chnx_25 .react-select__control { + background-color: var(--background-secondary); + padding: var(--space-quarter) var(--space-eight); +} +._select_9chnx_25 .react-select__input-container { + padding-left: var(--space-default); +} +._selectLabelText_9chnx_59 { + color: var(--color-default); + margin-left: 6px; +} +._singleValueContainer_9chnx_64 { + align-items: center; + display: flex; + left: var(--space-quarter); + position: absolute; +} +._overlay_12k4v_1 { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + position: fixed; + bottom: 0; + left: 0; + height: 100%; + width: 100%; + background-color: var(--bg-transparent-dark); + z-index: 4010; + opacity: 0; +} +._overlay_12k4v_1._activeOverlay_12k4v_16 { + opacity: 1; +} +._modal_12k4v_20 { + background-color: var(--background-secondary); + width: 100%; + max-width: 420px; + border-radius: 2px; + box-shadow: 0 3px 5px #0000004d; + text-align: left; + max-height: 100vh; + overflow: auto; + opacity: 0; +} +._modal_12k4v_20._activeModal_12k4v_32 { + opacity: 1; +} +._modal_12k4v_20._small_12k4v_38 { + max-width: 340px; + width: 100%; +} +._modal_12k4v_20._medium_12k4v_43 { + max-width: 520px; + width: 100%; +} +._modal_12k4v_20._large_12k4v_49 { + max-width: 800px; + width: 100%; +} +._header_12k4v_54 { + height: var(--item-height); + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 0 var(--space-half); + border-bottom: solid 1px var(--color-lightgray); +} +._header_12k4v_54._centered_12k4v_64 { + justify-content: center; +} +._header_12k4v_54 ._title_12k4v_68 { + margin: 0; + font-size: var(--size-subheader); + font-weight: 400; +} +._closeButton_12k4v_74 { + background: none; + border: none; + padding: 0; + width: auto !important; +} +._closeButton_12k4v_74:focus { + outline: none; +} +._closeButton_12k4v_74:disabled { + color: var(--color-secondary); +} +._header_12k4v_54 ._closeButton_12k4v_74, +._header_12k4v_54 ._closeButton_12k4v_74 img { + width: 18px; + height: 18px; +} +._contentContainer_12k4v_95 { + font-size: var(--size-default); + font-weight: 400; + padding: var(--space-half); +} +._contentContainer_12k4v_95._slim_12k4v_101 { + padding: 0; +} +._contentContainer_12k4v_95._padded_12k4v_105 { + padding: var(--space-default); +} +._content_12k4v_95 p { + word-break: break-word; +} +._actions_12k4v_113 button, +._actions_12k4v_113 a, +._small_12k4v_38 ._actions_12k4v_113 button, +._small_12k4v_38 ._actions_12k4v_113 a { + width: 100%; +} +._actions_12k4v_113 > *:not(:last-child), +._small_12k4v_38 ._actions_12k4v_113 > *:not(:last-child) { + margin-bottom: var(--space-quarter); +} +._actions_12k4v_113 { + margin-top: var(--space-quarter); +} +._confirmationLabel_12k4v_131 { + position: relative; + line-height: 1.3; + font-size: var(--size-default); + font-weight: 400; + margin-top: var(--space-half); + padding-left: 24px; +} +._confirmationLabelNumber_12k4v_140 { + display: inline-block; + position: absolute; + left: 0; +} +._disabledLabel_12k4v_146, +._disabledLabel_12k4v_146 span { + color: var(--color-mediumgray) !important; +} +._noStep_12k4v_151 { + padding-left: 0; +} +._confirmationInstructions_12k4v_155 { + margin: 0; + padding: var(--space-half) 0 var(--space-quarter) 0; +} +._confirmationInstructions_12k4v_155 > div { + width: 50%; +} +._confirmationInstructions_12k4v_155 p { + line-height: 1; + margin-top: var(--space-quarter); +} +._confirmationInstructions_12k4v_155._confirm_12k4v_131 { + text-align: center; + font-size: var(--size-subheader); + padding: var(--space-half) calc(var(--space-half) * 1.5); +} +._image_12k4v_175 { + height: 120px; + margin-right: var(--space-half); +} +._modalContent_12k4v_180 p { + font-size: var(--size-default); + font-weight: 400; +} +._modalContent_12k4v_180 > *:first-child { + margin-top: 0; +} +._detail_12k4v_189 { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + min-height: var(--item-height); + padding: var(--space-half); +} +._detail_12k4v_189:not(:first-child) { + border-top: solid 1px var(--color-lightgray); +} +._detail_12k4v_189 label { + white-space: nowrap; + margin-right: var(--space-half) !important; +} +._detail_12k4v_189 label, +._detail_12k4v_189 p { + margin: 0; + line-height: 1; +} +._detail_12k4v_189._description_12k4v_213 > span { + text-align: right; +} +._buttons_12k4v_217 { + padding: var(--space-quarter); +} +._buttons_12k4v_217 button:first-child { + margin-right: 10px; +} +._buttons_12k4v_217 button { + width: 50%; +} +._dialogButtons_12k4v_229 { + display: flex; + flex-direction: row-reverse; + justify-content: space-between; + margin-top: var(--space-default); +} +._dialogButtons_12k4v_229 > *:only-child { + width: 100%; +} +@media (max-width: 768px) { + ._modal_12k4v_20 { + padding: 0; + } + ._contentContainer_12k4v_95._padded_12k4v_105 { + padding: var(--space-half); + } +} +._button_1djzh_1 { + align-items: center; + background-color: var(--background-secondary); + border: none; + border-radius: 50%; + cursor: pointer; + display: flex; + flex-direction: row; + height: 18px; + justify-content: center; + margin-top: var(--spacing-half); + min-width: 18px !important; + padding: 0; + position: absolute; + right: var(--spacing-default); + top: 10px; + transition: background-color ease .2s; + width: 18px; + will-change: background-color; +} +._button_1djzh_1 img { + width: 18px; +} +._button_1djzh_1:focus { + outline: none; +} +._button_1djzh_1:disabled { + cursor: not-allowed; +} +._success_1djzh_34 { + background-color: var(--color-success) !important; +} +._container_1djzh_38 { + position: relative; +} +._inputField_1djzh_42 { + border: 1px solid var(--background-quaternary); + border-radius: 2px; + flex: 1; + font-size: var(--size-default); + font-weight: 400; + height: 52px; + margin-bottom: 0; + min-width: 200px !important; + padding: var(--space-half) calc(var(--space-default) * 1.2 + 5px) var(--space-half) calc(var(--space-half) * .5); + resize: none; + width: 100%; +} +@media screen and (min-width: 640px) { + ._inputField_1djzh_42 { + text-align: center; + } +} +._inputField_1djzh_42:focus { + outline: solid 1px var(--color-blue); +} +@media screen and (max-width: 640px) { + ._button_1djzh_1 { + margin-left: var(--space-quarter); + } +} +._flexibleHeight_1djzh_72 { + height: auto; +} +._alignLeft_1djzh_76 { + text-align: left; +} +._alignRight_1djzh_80 { + text-align: right; +} +._borderLess_1djzh_84, +._borderLess_1djzh_84:focus { + border: none; + border-radius: 0; + outline: none; +} +._empty_gzy3c_1 { + width: 256px; + height: 256px; + color: var(--color-secondary); +} +._title_nnme6_1 { + font-size: var(--header-default-font-size); + font-weight: 400; +} +._nextButton_nnme6_6 { + background: transparent; + border: none; + color: var(--color-primary); + cursor: pointer; + font-size: inherit; + padding: 2px; + text-align: left; + margin: 0 0 0 -2px; +} +._details_nnme6_17 { + font-size: var(--size-default); + margin-bottom: var(--space-default); +} +._qrCode_nnme6_22 { + min-height: 260px; + text-align: center; +} +._qrCode_nnme6_22 img { + height: auto; + max-width: 100%; +} +._buttons_nnme6_35 { + clear: both; + display: flex; + justify-content: space-between; + min-height: 3.5rem; +} +._verifyButton_nnme6_42 { + order: 2; +} +._entry_nnme6_46 { + align-items: baseline; + display: flex; + justify-content: space-between; + margin-bottom: var(--space-half); +} +@media screen and (min-width: 640px) { + ._xPubInfo_nnme6_55 { + max-width: calc(100% - 218px); + } + ._details_nnme6_17 { + display: flex; + flex-direction: column; + min-height: 180px; + } + ._entry_nnme6_46:first-child { + margin-top: 0; + } + ._qrCode_nnme6_22 { + float: right; + position: relative; + top: -38px; + right: calc(-1 * var(--space-default)); + } +} +@media (max-width: 640px) { + ._infoContent_nnme6_82 { + width: 100%; + } + ._largeEntry_nnme6_86 { + align-items: stretch; + flex-direction: column; + } + ._largeEntry_nnme6_86 strong { + display: block; + margin-bottom: var(--space-quarter); + } + ._addressField_nnme6_96 input { + font-size: var(--size-small); + } + ._qrCode_nnme6_22 { + margin-left: calc(-1 * var(--space-default)); + margin-right: calc(-1 * var(--space-default)); + } +} +._labels_1m4jx_1 { + align-items: center; + display: flex; + justify-content: space-between; + margin: var(--spacing-default) 0; +} +._label_1m4jx_1 { + color: var(--color-secondary); + flex-grow: 1; + font-size: var(--size-default); + font-weight: 400; + margin: 0; + padding: 0 var(--space-quarter); +} +._qrCodeContainer_1m4jx_17 { + margin-bottom: var(--space-default); + min-height: 260px; +} +._arrowLeft_1m4jx_22, +._arrowRight_1m4jx_23 { + width: 16px; + position: relative; + top: 3px; +} +._arrowLeft_1m4jx_22 { + margin-right: 3px; +} +._arrowRight_1m4jx_23 { + margin-left: 3px; +} +._previous_1m4jx_37, +._next_1m4jx_38 { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: none; + border: 0; + color: var(--color-blue); + font-size: var(--size-button); + line-height: 1; + padding: 0; + text-decoration: none; +} +._hide_1m4jx_49 { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: var(--background-secondary); +} +._changeType_1m4jx_58 { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: none; + border: none; + color: var(--color-secondary); + cursor: pointer; + display: inline-block; + text-align: center; + text-decoration: underline; + padding: var(--space-quarter); +} +._container_1ooxc_1 { + margin: 0 auto; + position: relative; + padding: calc(var(--space-default) * 1.5); + width: 100%; +} +._container_1ooxc_1._withCloseBtn_1ooxc_7 { + padding-right: 60px; +} +.padded ._container_1ooxc_1 { + max-width: var(--content-width); +} +._status_1ooxc_15 { + font-size: var(--size-subheader); + max-width: 800px; + text-align: left; +} +._success_1ooxc_21 { + background-color: var(--color-success); +} +._warning_1ooxc_25 { + background-color: var(--color-warning); +} +._info_1ooxc_29 { + background-color: var(--color-info); +} +._success_1ooxc_21, +._warning_1ooxc_25, +._info_1ooxc_29, +._success_1ooxc_21 label, +._warning_1ooxc_25 label, +._info_1ooxc_29 label { + color: var(--color-alt); +} +._close-success_1ooxc_42 { + background: var(--color-darkgreen); +} +._close-warning_1ooxc_46 { + background: var(--color-swissred); +} +._close-info_1ooxc_50 { + background: var(--color-darkblue); +} +._close_1ooxc_42 { + border: none; + line-height: .5; + padding: var(--space-half); + position: absolute; + top: 0; + right: 0; +} +._close_1ooxc_42 svg { + width: 18px; + height: 18px; +} +._withCloseBtn_1ooxc_7 ._status_1ooxc_15:before { + content: ""; + float: right; + height: 18px; + padding-bottom: 2px; + padding-left: var(--space-default); + width: 18px; +} +@media (max-width: 1199px) { + ._container_1ooxc_1 { + padding: calc(var(--space-half) * 1.5); + } +} +._space_tpxrt_1 { + margin-left: .33ch; +} +._rates_19qqe_1 { + cursor: default; + line-height: 1; + margin: 0; + white-space: nowrap; +} +._unit_19qqe_8 { + font-weight: 400; +} +._unit_19qqe_8, +._unitAction_19qqe_13 { + color: var(--color-secondary); + font-size: var(--size-default); + font-variant: normal; + position: relative; +} +._availableFiatAmount_19qqe_24 { + padding-right: var(--space-quarter) !important; + text-align: right; +} +._availableFiatUnitNoAction_19qqe_29, +._availableFiatUnit_19qqe_29 { + color: var(--color-secondary); + cursor: default; + position: relative; +} +._unitAction_19qqe_13:after, +._availableFiatUnit_19qqe_29:after { + border-bottom: dotted 1px var(--color-softblack); + content: ""; + position: absolute; + bottom: 0; + left: 2px; + right: 2px; +} +._notAvailable_19qqe_46 { + color: var(--color-default); +} +@media (max-width: 880px) { + ._fiatRow_19qqe_20 { + bottom: 0; + } + ._availableFiatAmount_19qqe_24, + ._availableFiatUnit_19qqe_29 { + line-height: 24px; + } +} +@media (max-width: 640px) { + ._availableFiatUnit_19qqe_29:after { + border-bottom: none; + } +} +._balanceTable_m2hui_1 { + align-items: flex-end; + border-collapse: collapse; + border-spacing: 0; + display: flex; + flex-direction: row; + position: relative; +} +._balanceTable_m2hui_1 tr { + display: inline-block; + vertical-align: bottom; +} +._balanceTable_m2hui_1 td { + font-size: var(--size-large); + font-weight: 400; + line-height: 1.2; + padding: 0; + vertical-align: baseline; +} +._balanceTable_m2hui_1 td:last-child { + font-size: var(--size-default); +} +._balanceTable_m2hui_1 ._availableAmount_m2hui_27 { + padding-right: var(--space-quarter); + text-align: right; +} +._balanceTable_m2hui_1 ._availableUnit_m2hui_32 { + color: var(--color-secondary); + padding-right: var(--space-half); +} +._pendingBalance_m2hui_37 { + color: var(--color-secondary); + font-size: var(--size-small); + line-height: 1; + margin: 0; + padding-top: var(--space-half); +} +@media (max-width: 768px) { + ._balanceTable_m2hui_1 { + display: inline-block; + margin: 0 auto; + } + ._balanceTable_m2hui_1 td { + font-size: var(--size-large-mobile); + line-height: 1.5; + } + ._pendingBalance_m2hui_37 { + padding-top: var(--space-quarter); + } +} +@media (max-width: 560px) { + ._balanceTable_m2hui_1 td { + font-size: var(--size-subheader); + } +} +._row_1qpuo_1 { + display: flex; + flex-direction: column; +} +._rowCustomFee_1qpuo_6 { + display: flex; + flex-direction: row; + flex-wrap: wrap; +} +._column_1qpuo_12 { + flex-basis: 50%; + flex-grow: 1; + flex-shrink: 0; +} +._rowCustomFee_1qpuo_6 ._column_1qpuo_12:first-child { + flex-basis: 50%; +} +._rowCustomFee_1qpuo_6 ._column_1qpuo_12:nth-child(2) { + flex-basis: 50%; +} +@media (min-width: 640px) { + ._row_1qpuo_1 { + display: flex; + flex-direction: row; + flex-wrap: wrap; + } + ._column_1qpuo_12:first-child { + flex-basis: 50%; + } + ._column_1qpuo_12:nth-child(2) { + flex-basis: 50%; + } +} +._rowCustomFee_1qpuo_6 select._priority_1qpuo_38 { + border-right: none; + padding-right: 0; +} +._rowCustomFee_1qpuo_6 ._fee_1qpuo_42 input { + border-bottom-left-radius: 0; + border-left: none; + border-top-left-radius: 0; + padding-left: 0; + border-color: var(--background-quaternary) !important; +} +@media (min-width: 640px) { + ._fee_1qpuo_42 input { + border-bottom-left-radius: 0; + border-left: none; + border-top-left-radius: 0; + padding-left: 0; + } +} +select:disabled._priority_1qpuo_38 { + border-color: var(--background) !important; +} +select._priority_1qpuo_38 { + border-color: var(--background-quaternary) !important; +} +@media (min-width: 640px) { + ._fee_1qpuo_42 input:disabled { + border-color: var(--background) !important; + } + ._fee_1qpuo_42 input { + border-color: var(--background-quaternary) !important; + } +} +@media (max-width: 639px) { + ._row_1qpuo_1 ._fee_1qpuo_42 * { + display: block !important; + text-align: left !important; + } + ._row_1qpuo_1 ._fee_1qpuo_42 input { + border: none; + color: var(--color-secondary) !important; + font-size: var(--size-small); + font-weight: 400; + height: auto; + margin-top: 0; + padding: 0; + } +} +._feeCustom_1qpuo_91 input { + padding-right: 58px; +} +._feeDescription_1qpuo_95, +._feeProposed_1qpuo_96 { + color: var(--color-secondary); + flex: 0 0 100%; + font-size: var(--size-small); + font-weight: 400; + margin-top: 0; +} +._feeProposed_1qpuo_96 { + margin: 0; +} +._feeDescription_1qpuo_95 + ._feeProposed_1qpuo_96 { + margin: var(--space-quarter) 0 0 0; +} +._customFeeUnit_1qpuo_112 { + bottom: 0; + color: var(--color-secondary); + font-size: var(--size-default); + line-height: 50px; + padding-right: var(--space-half); + position: absolute; + right: 0; + width: auto; +} +._utxosList_8ra1q_1 { + list-style: none; + padding: 0 0 var(--space-half) 0; +} +._utxosList_8ra1q_1 label { + -webkit-user-select: text; + user-select: text; + width: 100%; +} +._utxo_8ra1q_1 { + margin-top: var(--space-half); + padding: 0 0 var(--space-eight) 0; + border-bottom: solid 1px var(--color-lightgray); +} +._utxoContent_8ra1q_17 { + align-items: flex-start; + color: var(--color-default); + display: flex; + flex-wrap: nowrap; + font-size: var(--size-subheader); +} +._note_8ra1q_25 { + color: var(--color-default); + font-size: var(--size-subheader); + line-height: 1.5; + margin-top: -7px; + margin-bottom: var(--space-quarter); +} +._utxoData_8ra1q_33 { + flex-basis: auto; + flex-grow: 1; + flex-shrink: 1; + overflow-x: hidden; + overflow-y: auto; +} +._utxoExplorer_8ra1q_41 { + margin-top: calc(var(--space-quarter) * -1); + padding: var(--space-quarter); +} +._utxoExplorer_8ra1q_41 img { + width: 18px; + height: 18px; +} +._amounts_8ra1q_51 { + padding-bottom: var(--space-quarter); +} +._amount_8ra1q_51 { + margin-right: var(--space-quarter); +} +._label_8ra1q_59, +._unit_8ra1q_60 { + color: var(--color-secondary); +} +._label_8ra1q_59 { + display: inline-block; + padding-right: 4px; +} +._unit_8ra1q_60 { + font-size: var(--size-default); +} +._address_8ra1q_73, +._transaction_8ra1q_74 { + display: flex; + font-size: var(--size-default); + line-height: 1.4; + white-space: nowrap; +} +._shrink_8ra1q_81 { + overflow: hidden; + text-overflow: ellipsis; +} +._confirmItem_1e5e5_1 p { + margin-top: var(--space-quarter); + word-break: break-all; +} +._confirmationValue_1e5e5_6 { + font-size: var(--size-default); + font-weight: 400; + line-height: 1; + overflow: hidden; + text-overflow: ellipsis; + direction: rtl; +} +._total_1e5e5_15 p { + font-size: var(--size-subheader) !important; + margin-bottom: var(--space-quarter); +} +._spinnerAnimationContainer_18sha_1 { + align-items: center; + display: flex; + height: 0; + justify-content: center; + position: relative; + top: 150px; +} +._qrVideo_18sha_10 { + width: 100%; + margin-bottom: var(--spacing-default); +} +._qrVideo_18sha_10 + .scan-region-highlight svg { + stroke: var(--color-darkyellow) !important; + stroke-width: 3 !important; +} +._inputWithIcon_drrz7_1 { + position: relative; +} +._inputWithIcon_drrz7_1 input { + padding-right: calc(var(--spacing-default) * 2 + 18px); +} +._action_drrz7_9 { + color: var(--color-blue); + font-size: var(--size-small); + font-weight: 400; + line-height: 1; + cursor: pointer; + -webkit-user-select: none; + user-select: none; +} +._qrButton_drrz7_18 { + align-items: center; + display: flex; + border: none; + background-color: var(--background-secondary); + height: 36px; + width: 36px; + justify-content: center; + padding: 0; + position: absolute; + top: calc(50% - var(--space-quarter)); + right: calc(var(--spacing-default) - var(--space-quarter)); + cursor: pointer; +} +._qrButton_drrz7_18 img { + width: 18px; + height: 18px; +} +._maxAmount_1t5n0_1 label { + display: block !important; + margin-right: 0 !important; +} +._maxAmount_1t5n0_1 label:before { + top: -2px !important; +} +._maxAmount_1t5n0_1 label:after { + margin-top: -3px !important; +} +._labelDescription_5etm5_1 { + color: var(--color-secondary); + font-size: var(--size-small); + font-weight: 400; + margin-top: 0; +} +._container_8f83b_1 { + margin-top: calc(var(--space-default) * 1.5); +} +._skeleton_13p4i_1 { + animation: _skeleton-loading_13p4i_1 1.4s ease infinite; + background: linear-gradient(90deg, rgba(190, 190, 190, .2) 25%, rgba(129, 129, 129, .24) 37%, rgba(190, 190, 190, .2) 63%); + background-size: 400% 100%; + display: inline-block; + max-width: 100%; + overflow: clip; +} +._skeleton_13p4i_1:before { + color: transparent; + content: "_"; + display: block; + line-height: 1; + min-width: 1em; +} +@keyframes _skeleton-loading_13p4i_1 { + 0% { + background-position: 100% 50%; + } + to { + background-position: 0 50%; + } +} +._chart_1bo3n_1 { + box-sizing: border-box; + margin-bottom: var(--spacing-large); + position: relative; +} +._invisible_1bo3n_7 { + visibility: hidden; +} +._chartUpdatingMessage_1bo3n_11 { + align-items: center; + color: var(--color-tertiary); + display: flex; + flex-direction: column; + justify-content: center; + padding: 0 var(--space-half); + text-align: center; +} +._chart_1bo3n_1 header { + display: flex; + flex-wrap: wrap; + margin-bottom: var(--spacing-half); + min-height: 68px; +} +._summary_1bo3n_28 { + margin: 0 auto; + display: flex; + flex-direction: column; + align-items: flex-start; +} +._filters_1bo3n_35 { + align-items: baseline; + display: flex; + flex-wrap: wrap; + flex-grow: 1; + justify-content: flex-end; + margin: var(--spacing-half) 0 0 0; +} +@media (max-width: 640px) { + ._chart_1bo3n_1 { + margin-bottom: var(--spacing-default); + } + ._summary_1bo3n_28 { + align-items: center; + } + ._filters_1bo3n_35 { + justify-content: center; + margin-top: var(--spacing-default); + } +} +._filters_1bo3n_35 button { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: var(--background-secondary); + border: 2px solid var(--background-secondary); + border-radius: 2rem; + color: var(--color-default); + font-size: var(--size-default); + line-height: 1.75; + margin-bottom: var(--spacing-half); + margin-left: var(--spacing-half); + padding: 0 calc(var(--spacing-default) * .75); +} +._filters_1bo3n_35 button:hover:not([disabled]) { + cursor: pointer; +} +._filters_1bo3n_35 button:hover:is([disabled]) { + cursor: not-allowed; +} +._filters_1bo3n_35 button:focus { + border: 2px solid var(--color-blue); + outline: none; +} +._filters_1bo3n_35 button._filterActive_1bo3n_87 { + background: var(--color-blue); + border-color: var(--color-blue); + color: var(--color-alt); +} +._filters_1bo3n_35 button[disabled] { + background: var(--background-quaternary); + border-color: var(--background-quaternary); + color: var(--color-alt); +} +.dark-mode ._filters_1bo3n_35 button[disabled] { + background: var(--background-secondary); + border-color: var(--background-secondary); + color: var(--color-disabled); +} +._arrow_1bo3n_104 svg { + margin-right: .25rem; + vertical-align: text-bottom; +} +._up_1bo3n_109 { + color: var(--color-green); +} +._down_1bo3n_113 { + color: var(--color-softred); +} +._totalValue_1bo3n_117 { + font-size: 2rem; +} +._totalUnit_1bo3n_121 { + color: var(--color-secondary); + display: inline-block; + font-size: 1.4rem; + padding: 0 .25rem; +} +._diffValue_1bo3n_128 { + font-size: 1.2rem; +} +._diffUnit_1bo3n_132 { + font-size: 1rem; + padding: 0 .25rem; +} +._chartCanvas_1bo3n_137 { + position: relative; +} +@media (max-width: 640px) { + ._chartCanvas_1bo3n_137 { + max-width: 100%; + overflow: hidden; + } +} +._tooltip_1bo3n_149 { + background: var(--background-secondary); + border: 1px solid var(--background); + border-radius: 3px; + font-size: var(--size-small); + margin-top: -25px; + min-width: 140px; + padding: .75rem .6rem; + pointer-events: none; + position: absolute; + text-align: center; + transition: left .03s ease-out, top .03s ease-out; + z-index: 12; +} +._toolTipValue_1bo3n_164 { + font-weight: 400; + font-size: 1rem; + margin: 0 0 .25rem; +} +._toolTipUnit_1bo3n_170 { + color: var(--color-secondary); + font-size: var(--size-small); + padding: 0 .125rem; +} +._toolTipTime_1bo3n_176 { + white-space: nowrap; +} +._spinnerContainer_1akm7_1 { + position: relative; + display: inline-block; +} +._spinner_1akm7_1 { + color: var(--color-blue); +} +._spinner_1akm7_1:after { + position: relative; + top: 2px; + animation: _changeContent_1akm7_1 .8s linear infinite; + display: block; + content: "⠋"; + font-size: 14px; + margin-left: 3px; +} +@keyframes _changeContent_1akm7_1 { + 10% { + content: "⠙"; + } + 20% { + content: "⠹"; + } + 30% { + content: "⠸"; + } + 40% { + content: "⠼"; + } + 50% { + content: "⠴"; + } + 60% { + content: "⠦"; + } + 70% { + content: "⠧"; + } + 80% { + content: "⠇"; + } + 90% { + content: "⠏"; + } +} +._balanceTable_1v4c8_1 { + margin: 0 0 var(--spacing-large) 0; +} +._coincode_1v4c8_4 { + height: 24px; +} +._coinheader_1v4c8_9 { + display: flex; + flex-direction: row; + align-items: center; +} +._coinheader_1v4c8_9 > div:first-child { + height: 24px; + margin-right: calc(var(--space-half) / 2); +} +._dataMissing_1v4c8_20 { + text-align: center; +} +._openFileText_1v4c8_24 { + color: var(--color-primary); + cursor: pointer; + font-size: var(--size-small); +} +._table_1v4c8_30 { + width: 100%; + border-collapse: collapse; + margin-bottom: var(--spacing-default); + border: solid 1px var(--background-quaternary); +} +._table_1v4c8_30 tr td, +._table_1v4c8_30 tr th { + height: 52px; + padding: var(--space-half); + text-align: left; + font-weight: 400; +} +._table_1v4c8_30 tr td._noAccount_1v4c8_45 { + text-align: center; +} +._table_1v4c8_30 tr > td:not(:first-child), +._table_1v4c8_30 tr > th:not(:first-child) { + text-align: right; +} +._table_1v4c8_30 thead th { + border-bottom: solid 1px var(--background-quaternary); +} +._table_1v4c8_30 thead th, +._table_1v4c8_30 tfoot th { + background-color: var(--background-secondary); + font-size: var(--size-default); + font-weight: 700; +} +._table_1v4c8_30 thead th:first-child, +._table_1v4c8_30 tfoot th:first-child { + padding-left: calc(24px + var(--space-default)); +} +._table_1v4c8_30 tr td { + font-size: var(--size-default) !important; + line-height: 1.5714; +} +._table_1v4c8_30 tbody td { + background-color: var(--background-secondary); +} +._clickable_1v4c8_80 { + cursor: pointer; +} +._summaryTableBalance_1v4c8_84 { + white-space: nowrap; +} +._table_1v4c8_30 tfoot th, +._table_1v4c8_30 tfoot td { + background-color: var(--background-secondary); + padding-bottom: calc(var(--space-quarter) + var(--space-half)); +} +._coinName_1v4c8_94 { + display: flex; +} +._coinName_1v4c8_94 img { + flex-shrink: 0; + margin-right: var(--spacing-default); + vertical-align: middle; +} +._coinUnit_1v4c8_104 { + color: var(--color-secondary); +} +._syncText_1v4c8_108 { + font-variant: tabular-nums; +} +._showOnTableView_1v4c8_112 { + display: block; +} +._showInCollapsedView_1v4c8_116 { + display: none; +} +@media (max-width: 640px) { + ._showOnTableView_1v4c8_112 { + display: none; + } + ._showInCollapsedView_1v4c8_116 { + display: block; + } + ._table_1v4c8_30 tr td, + ._table_1v4c8_30 tr th { + padding: var(--spacing-default); + } + ._table_1v4c8_30 thead { + display: none; + } + ._table_1v4c8_30, + ._table_1v4c8_30 tbody, + ._table_1v4c8_30 tbody tr, + ._table_1v4c8_30 tfoot { + display: block; + } + ._table_1v4c8_30 tfoot tr { + background-color: var(--background-secondary); + display: flex; + justify-content: space-between; + } + ._table_1v4c8_30 tfoot th:first-child { + padding-left: var(--space-half); + } + ._table_1v4c8_30 tbody td { + display: flex; + justify-content: space-between; + height: auto; + padding-bottom: 0; + } + ._table_1v4c8_30 tbody td:before { + content: attr(data-label); + white-space: nowrap; + } + ._subTotal_1v4c8_167 td:before { + font-weight: 700; + } + ._table_1v4c8_30 tbody td:last-child { + border-bottom: solid 1px var(--color-mediumgray); + padding-bottom: var(--spacing-default); + } + ._coinName_1v4c8_94 { + position: relative; + } + ._coinName_1v4c8_94 img { + left: -2rem; + position: absolute; + top: -3px; + } +} +._container_1mptn_1 { + display: flex; + justify-content: center; +} +._container_1mptn_1 > button:first-child { + margin-right: var(--space-half); +} +._main_1mptn_8 { + padding: calc(var(--space-default) * 1.5) 0; +} +._main_1mptn_8 > * { + margin-right: 0 !important; + text-align: center; +} +._walletConnect_1mptn_17 { + margin-left: var(--space-half); +} +._walletConnect_1mptn_17 span { + margin-left: var(--space-eight); +} +._container_17oq2_1 { + align-items: center; + background-position: center bottom; + background-size: cover; + display: flex; + flex-grow: 1; + flex-shrink: 1; + flex-basis: auto; + flex-direction: column; + justify-content: center; + margin: 0 auto; + max-height: 100vh; + overflow: auto; + padding: 0 var(--space-half); +} +._scrollable_17oq2_17 { + overflow: auto; +} +._agreements_17oq2_22 { + margin-bottom: var(--spacing-default); +} +._agreementsLabel_17oq2_26 { + margin: var(--spacing-half) 0; +} +._title_17oq2_30 { + margin-top: 0; + margin-bottom: var(--spacing-large); + font-weight: 400; +} +._summary_17oq2_36 { + margin: var(--spacing-large) auto; + max-width: 450px; +} +._summary_17oq2_36 li { + margin-bottom: var(--spacing-default); +} +._heading_17oq2_45 { + margin-top: 1px; +} +._content_17oq2_49 { + display: flex; + flex-basis: auto; + flex-direction: column; + flex-grow: 1; + flex-shrink: 1; + max-width: var(--content-width); + width: 100%; + padding: var(--spacing-large) var(--spacing-default) 0 var(--spacing-default); +} +._verticalButtons_17oq2_60 { + display: flex; + flex-direction: column; + max-width: 300px; + width: 100%; + margin: 0 auto; +} +._verticalButtons_17oq2_60 button:first-child { + margin-bottom: var(--spacing-default); +} +._block_17oq2_72 { + flex: 1; +} +._block_17oq2_72 p:first-child, +._block_17oq2_72 h2:first-child { + margin-top: 0; +} +._block_17oq2_72 p:last-child { + margin-bottom: var(--spacing-large); +} +._list_17oq2_85 { + padding-left: 18px; +} +._list_17oq2_85 li:not(:first-child) { + margin-top: var(--spacing-half); +} +._buttons_17oq2_93 { + margin-bottom: 0; + margin-top: var(--spacing-large); +} +._stepNumber_17oq2_98 { + min-width: 20px !important; + margin-right: 20px; + text-align: center; + color: var(--color-secondary); + font-size: var(--size-extra-large); + line-height: var(--size-extra-large); + font-weight: 400; +} +._badge_17oq2_108 { + max-height: 40px; + height: 40px; +} +._waitingLogo_17oq2_113 { + margin-bottom: var(--space-default); +} +._waitingContent_17oq2_117 { + max-width: 540px; + width: 100%; + background-color: var(--background-secondary); + padding: var(--space-default); + margin: 0 auto; + text-align: center; +} +._waitingText_17oq2_126 { + margin-top: 0; + margin-bottom: var(--space-half); + text-align: center; + font-weight: 400; + font-size: var(--size-subheader); +} +._waitingDescription_17oq2_134 { + text-align: center; + margin-bottom: 0; +} +@media screen and (max-width: 640px) { + ._qrcodeContainer_17oq2_140 { + width: 50%; + } + ._qrcodeContainer_17oq2_140 img { + width: 100%; + height: auto; + } +} +._container_l7fdu_1 { + width: 100%; + min-width: 230px; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + height: var(--item-height); + text-decoration: none; + text-align: left; + border: none; + color: var(--color-blue); + background-color: var(--background-secondary); + font-size: var(--size-default); + font-weight: 400; + padding: 0 var(--space-half); + cursor: pointer; +} +._container_l7fdu_1 svg, +._container_l7fdu_1 img { + width: 18px; + height: 18px; + color: var(--color-secondary); +} +._danger_l7fdu_27 { + color: var(--color-softred); +} +._children_l7fdu_31 { + min-width: 120px; +} +._optionalText_l7fdu_35 { + margin-left: auto; + margin-right: var(--space-quarter); + font-size: var(--size-small); + color: var(--color-secondary); + white-space: nowrap; + max-width: 300px; + text-overflow: ellipsis; + overflow: hidden; +} +._secondaryText_l7fdu_46 { + color: var(--color-secondary); + font-size: var(--size-small); + margin-top: 4px; + overflow: hidden; + text-overflow: ellipsis; +} +._primaryText_l7fdu_54 { + display: block; +} +._icon_l7fdu_58 img { + margin-left: 8px; + margin-bottom: -4px; +} +._disabled_l7fdu_63 { + opacity: .5; + cursor: default; +} +._item_l7fdu_68 { + color: var(--color-secondary); + cursor: default; +} +._container_l7fdu_1:focus { + outline: solid 1px var(--color-blue); +} +._stepContext_g2o2c_1 { + margin: var(--space-default) 0; +} +._backupsList_g2o2c_5 { + background: var(--background-secondary); + border: 1px solid var(--background-secondary); + display: flex; + flex-direction: column; + text-align: left; + flex: 1; +} +._listContainer_g2o2c_14 { + display: flex; + flex-direction: column; + max-height: 45vh; + overflow-x: hidden; + overflow-y: scroll; + position: relative; + width: 100%; +} +._item_g2o2c_24 { + width: 100%; + padding: var(--space-quarter) var(--space-half); +} +._item_g2o2c_24:not(:first-child) { + border-top: solid 1px var(--background); +} +._item_g2o2c_24 label { + margin-bottom: 0 !important; +} +._agreements_g2o2c_37 { + margin-bottom: 1rem; +} +._emptyText_g2o2c_41 { + text-align: center; + color: var(--color-secondary); + padding: var(--spacing-large) 0; +} +._backupItem_g2o2c_47 + label { + color: var(--color-default); + word-break: break-all; +} +._backupID_g2o2c_52 { + word-break: break-all; + margin-bottom: var(--space-quarter); + font-size: var(--size-small); + color: var(--color-secondary); +} +._backupButtons_g2o2c_59 { + display: flex; + flex-wrap: wrap; + flex-direction: row-reverse; + margin-top: var(--space-default); +} +@media (min-width: 769px) { + ._backupButtons_g2o2c_59 > *:not(:first-child) { + margin-right: var(--space-half); + } +} +@media (max-width: 768px) { + ._backupButtons_g2o2c_59 { + align-items: center; + flex-direction: column; + margin-top: var(--space-default); + } + ._backupButtons_g2o2c_59 > *:not(:first-child) { + margin-top: var(--space-half); + } +} +._container_6tizs_1 { + height: var(--item-height-xlarge); + width: 100%; + min-width: 230px; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + text-decoration: none; + text-align: left; + border: none; + background-color: var(--background-secondary); + font-size: var(--size-default); + font-weight: 400; + padding: 16px 24px; + color: var(--color-dark); + margin-bottom: var(--size-default); +} +._primaryText_6tizs_21 { + color: var(--color-default); + font-size: 16px; + margin: 0; +} +._isButton_6tizs_27:hover { + cursor: pointer; +} +._rightContentContainer_6tizs_32 { + display: flex; + align-items: center; + flex-shrink: 0; +} +._displayedValue_6tizs_38 { + color: var(--color-secondary); + font-size: 14px; + margin: 0; + padding-left: var(--space-half); + overflow: hidden; + text-overflow: ellipsis; +} +._displayedValue_6tizs_38._withMargin_6tizs_47 { + margin-right: var(--space-quarter); +} +._secondaryText_6tizs_51 { + color: var(--color-secondary); + font-size: 14px; + margin: 0; + margin-top: var(--space-quarter); + overflow: hidden; + text-overflow: ellipsis; +} +@media (max-width: 768px) { + ._container_6tizs_1 { + height: auto; + margin-bottom: 5px; + min-width: 100%; + } + ._secondaryText_6tizs_51 { + display: none; + } +} +@media (max-width: 560px) { + ._container_6tizs_1._collapse_6tizs_74 { + align-items: start; + flex-direction: column; + } + ._container_6tizs_1._collapse_6tizs_74 ._displayedValue_6tizs_38._withMargin_6tizs_47 { + margin-right: 0; + } + ._container_6tizs_1._collapse_6tizs_74 ._rightContentContainer_6tizs_32 { + width: 100%; + } + ._hideDisplayedValueOnSmall_6tizs_87 { + display: none; + } +} +._container_1rta5_1 { + display: flex; + margin-bottom: var(--space-default); + word-break: keep-all; +} +._container_1rta5_1 a { + margin-right: var(--space-default); + font-size: var(--size-subheader); + text-decoration: none; +} +._container_1rta5_1 a._active_1rta5_13 { + padding-bottom: var(--space-quarter); + border-bottom: 2px solid var(--color-blue); +} +@media (max-width: 768px) { + ._container_1rta5_1, + ._container_1rta5_1 a, + ._container_1rta5_1 a._active_1rta5_13 { + all: unset; + } +} +._settingNameContainer_usdew_1 { + display: flex; +} +._settingName_usdew_1 { + color: var(--color-swissred); + font-size: 16px; + margin: 0; + margin-left: var(--space-quarter); +} +._section_18i3w_1 { + margin-bottom: var(--space-default); +} +._section_18i3w_1 h3 { + margin-bottom: var(--space-half); +} +._skeletonWrapper_18i3w_9 { + margin-bottom: var(--size-default); +} +@media (max-width: 768px) { + ._skeletonWrapper_18i3w_9 { + margin-bottom: 2px; + } +} +._container_flzib_1 { + align-items: center; + display: none; + position: relative; +} +._backButton_flzib_7 { + background-color: transparent; + border: none; + color: var(--color-default); + display: flex; + align-items: center; + font-size: var(--size-title); + padding: var(--space-quarter); + padding-left: 0; + text-decoration: none; +} +._backButton_flzib_7:focus { + outline: none; +} +._backButton_flzib_7:hover { + cursor: pointer; +} +._backButton_flzib_7 img { + margin-right: var(--space-eight); +} +._headerText_flzib_31 { + font-size: var(--size-title); + font-weight: 400; + margin: 0 auto; + position: absolute; + left: 50%; + transform: translate(-50%); +} +._withGuide_flzib_40 ._headerText_flzib_31 { + left: calc(50% + 37px); +} +@media (max-width: 768px) { + ._container_flzib_1 { + display: flex; + } +} +._container_18axn_1 { + align-items: stretch; + background-position: center bottom; + background-size: cover; + display: flex; + flex-grow: 1; + flex-shrink: 1; + flex-basis: auto; + flex-direction: column; + justify-content: center; + margin: 0 auto; + max-height: 100vh; + overflow: auto; + max-width: var(--content-width-small); + width: 100%; +} +._container_14uup_1 { + display: inline-block; + flex-shrink: 0; + margin: 0; + min-height: var(--item-height-xsmall); + position: relative; + width: 60px; +} +._container_14uup_1 input { + height: 0; + opacity: 0; + width: 0; +} +._container_14uup_1 input[disabled] + ._slider_14uup_16 { + cursor: default; + background-color: var(--color-disabled); +} +._slider_14uup_16 { + background-color: var(--background-tertiary); + border-radius: 2px; + bottom: 0; + cursor: pointer; + left: 0; + position: absolute; + right: 0; + top: 0; + transition: .2s; +} +._slider_14uup_16:before { + background-color: #fff; + border-radius: 2px; + bottom: 4px; + content: ""; + height: 16px; + left: 4px; + position: absolute; + width: 26px; + transition: .2s; +} +input:checked + ._slider_14uup_16 { + background-color: var(--color-blue); +} +input:checked + ._slider_14uup_16:before { + transform: translate(26px); +} +._toast_4ztjp_1 { + position: fixed; + display: block; + bottom: calc(var(--item-height-large) + var(--space-half)); + right: 50%; + transform: translate(50%, 120%); + max-width: calc(100% - (var(--guide-width) + var(--sidebar-width) + var(--spacing-large))); + min-width: 180px; + min-height: 20px; + border-radius: 2px; + padding: var(--space-half); + box-shadow: 0 1px 5px #0003; + transition: transform ease-out .2s; + z-index: 1; +} +._active_4ztjp_17 { + transform: translate(50%); +} +._active_4ztjp_17._shifted_4ztjp_21 { + right: calc(var(--spacing-default) + 350px); +} +._info_4ztjp_25 { + background-color: var(--color-darkblue); +} +._success_4ztjp_29 { + background-color: var(--color-success); +} +._warning_4ztjp_33 { + background-color: var(--color-softred); +} +._toast_4ztjp_1 p { + margin: 0; + color: var(--color-alt); +} +@media (max-width: 768px) { + ._toast_4ztjp_1 { + position: initial; + transition: none; + transform: none; + } +} +._label_g3ts4_1 { + white-space: nowrap; +} +._labelText_g3ts4_5 { + display: inline-block; + font-size: 14px; + line-height: 1; + margin-right: 8px; + vertical-align: sub; +} +._addAccountBtn_17bcq_2 { + margin-bottom: var(--spacing-default); +} +._walletHeader_17bcq_6 { + align-items: end; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + margin-bottom: var(--space-eight); +} +._walletTitle_17bcq_14 { + font-size: 20px; + font-weight: 400; + margin: 0 0 var(--space-quarter) 0; +} +._walletTitle_17bcq_14 small { + color: var(--color-secondary); + font-size: var(--size-default); +} +._setting_17bcq_25 { + align-items: center; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + min-height: var(--item-height); + padding: var(--space-quarter) 0; +} +._setting_17bcq_25:not(:last-child) { + border-bottom: solid 1px var(--background); +} +._coinLogo_17bcq_39 { + position: relative; + z-index: 2; +} +._acccountLink_17bcq_44 { + align-items: center; + display: flex; + flex-basis: 0; + flex-grow: 1; + flex-shrink: 1; +} +._editBtn_17bcq_52 { + min-width: 0; + padding: 0 0 0 var(--space-quarter); +} +._editBtn_17bcq_52 img { + margin-right: var(--space-quarter); + max-width: 18px; + height: auto; + vertical-align: text-bottom; +} +._toggleLabel_17bcq_64 { + align-items: center; + display: flex; + justify-content: space-between; +} +._toggleLabelText_17bcq_70 { + color: var(--color-secondary); +} +._toggleLabelText_17bcq_70 img { + color: var(--color-secondary); + margin-right: var(--space-quarter); + max-width: 18px; + vertical-align: bottom; +} +._toggle_17bcq_64 { + flex-basis: 60px; + flex-shrink: 0; + margin-left: var(--spacing-half); +} +._accountActive_17bcq_87 { + cursor: pointer; +} +._tokenSection_17bcq_91 { + align-items: flex-start; + display: flex; + flex-basis: 100%; + flex-direction: column; + flex-wrap: wrap; + padding: 0 0 0 4px; +} +._tokenContainer_17bcq_100 { + max-height: 0vh; + overflow: hidden; + transition: max-height .27s ease; + width: 100%; +} +._tokenContainerOpen_17bcq_107 { + max-height: 200vh; + padding: 10px 0 0; +} +._token_17bcq_91 { + align-items: center; + display: flex; + flex-direction: row; + justify-content: space-between; + min-height: var(--item-height); + padding: 10px 0; + position: relative; + width: 100%; +} +._token_17bcq_91:before { + background-color: #ddd; + content: ""; + height: 22px; + left: 10px; + position: absolute; + top: -13px; + right: 8px; + width: 3px; +} +._token_17bcq_91:first-child:before { + height: 16px; + top: -7px; +} +._token_17bcq_91 img:first-child { + margin-right: 0; +} +._tokenIcon_17bcq_149 { + max-height: 24px; + max-width: 24px; +} +._tokenName_17bcq_154 { + flex: 1; + display: inline-block; + padding-left: 20px; +} +._tokenInactive_17bcq_160 { + color: var(--color-tertiary); + transition: color .2s ease; +} +._expandBtn_17bcq_165 { + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.4' aria-labelledby='chevron down' color='%235e94bf'%3E%3Cdefs/%3E%3Cpolyline points='6 10 12 16 18 10'/%3E%3C/svg%3E%0A"); + background-position: 100% center; + background-repeat: no-repeat; + height: 40px; + padding: 0 var(--space-default); +} +._expandBtnOpen_17bcq_173 { + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.4' aria-labelledby='chevron down' color='%235e94bf'%3E%3Cdefs/%3E%3Cpolyline points='6 16 12 10 18 16'/%3E%3C/svg%3E%0A"); +} +._expandBtn_17bcq_165, +._expandBtn_17bcq_165:focus, +._expandBtn_17bcq_165:hover { + border-color: transparent !important; + margin-left: 10px; + outline: none; +} +._watchOnlyContainer_17bcq_186 { + align-items: center; + display: flex; + justify-content: space-between; + margin-top: var(--space-half); +} +._watchOnlyNote_17bcq_193 { + margin: 0; + margin-top: var(--space-half); +} +._watchOnlyAccountHidden_17bcq_198 { + background-color: var(--color-success); + margin-top: var(--space-half); + padding: var(--space-half); +} +._watchOnlyAccountHidden_17bcq_198 p { + color: var(--color-alt); + margin: 0; +} +._title_ahh86_1 { + margin: 0; + font-size: var(--size-subheader); + font-weight: 400; +} +._resetLink_ahh86_7 { + color: var(--color-softred) !important; +} +._serversContainer_ahh86_11 { + margin-top: var(--space-default); +} +._servers_ahh86_11 { + background-color: var(--background-secondary); + list-style: none; + padding: var(--space-quarter) var(--space-half); + margin: 0; + word-break: break-word; +} +._servers_ahh86_11 li ._server_ahh86_11 { + display: flex; + width: 100%; + align-items: center; + font-weight: 400; + font-size: var(--size-default); + min-height: 52px; +} +._serverLabel_ahh86_32 { + padding: var(--space-quarter) 0; + word-break: break-word; +} +._servers_ahh86_11 li ._server_ahh86_11 > div:last-child { + margin-left: auto; +} +._servers_ahh86_11 li ._server_ahh86_11 > div:last-child button { + border: none; + border-radius: 2px; + font-size: var(--size-small); + padding: var(--space-quarter) var(--space-half); + word-break: normal; +} +._servers_ahh86_11 ._server_ahh86_11 > div button[disabled] { + background-color: var(--color-disabled); + color: var(--color-secondary); +} +._servers_ahh86_11 ._server_ahh86_11 > div button:focus { + outline: none; +} +._servers_ahh86_11 ._server_ahh86_11 > div button:not(:last-child) { + margin-right: var(--space-quarter); +} +@media (max-width: 768px) { + ._servers_ahh86_11 { + padding: 0 var(--space-quarter); + } + ._serverLabel_ahh86_32 { + padding-right: var(--space-quarter); + } + ._servers_ahh86_11 ._server_ahh86_11 > div button { + margin: var(--space-quarter) 0; + } + ._servers_ahh86_11 li ._server_ahh86_11 > div:last-child button { + display: block; + padding: var(--space-quarter); + width: 100%; + } +} +._primary_ahh86_82 { + background-color: var(--color-blue); + color: var(--color-alt); + transition: background-color .2s ease-in-out; + will-change: background-color; +} +._primary_ahh86_82:hover { + background-color: var(--color-lightblue); +} +._warning_ahh86_93 { + background-color: var(--color-softred); + color: var(--color-alt); + transition: background-color .2s ease-in-out; + will-change: background-color; +} +._warning_ahh86_93:hover { + background-color: var(--color-lightred); +} +._textarea_ahh86_104 { + width: 100%; + border-radius: 2px; + border-color: var(--background-quaternary); + padding: var(--space-half) var(--space-half); + margin-bottom: var(--space-quarter); +} +._block_ahh86_112 { + margin-bottom: var(--space-half); +} +._addServer_ahh86_116 { + margin-top: var(--space-half); + margin-bottom: var(--space-default); + background-color: var(--background-secondary); + padding: var(--space-half); +} +._addServer_ahh86_116 p { + font-size: var(--size-default); + font-weight: 400; + margin-top: var(--space-half); + margin-bottom: var(--space-quarter); +} +._addServer_ahh86_116 > div:first-child p { + margin-top: var(--spacing-default); +} +@media (max-width: 768px) { + ._addServer_ahh86_116 { + padding: var(--space-half) var(--space-quarter); + } +} +._badge_ahh86_140 { + color: var(--color-secondary); + border-radius: 2px; + margin-right: var(--space-quarter); + width: 16px; + text-align: center; +} +._badge_ahh86_140:after { + content: "."; +} +._miniSpinnerContainer_ahh86_152 { + position: relative; + margin-right: 4px; + display: inline-block; +} +._miniSpinner_ahh86_152 { + color: var(--color-blue); +} +._miniSpinner_ahh86_152:after { + position: relative; + animation: _changeContent_ahh86_1 .8s linear infinite; + display: block; + content: "⠋"; +} +@keyframes _changeContent_ahh86_1 { + 10% { + content: "⠙"; + } + 20% { + content: "⠹"; + } + 30% { + content: "⠸"; + } + 40% { + content: "⠼"; + } + 50% { + content: "⠴"; + } + 60% { + content: "⠦"; + } + 70% { + content: "⠧"; + } + 80% { + content: "⠇"; + } + 90% { + content: "⠏"; + } +} +._syncContainer_nrzbt_1 { + position: relative; + width: 100%; + top: -18px; + margin-bottom: -18px; +} +._progressBar_nrzbt_8 { + width: 100%; + height: 1px; + background-color: var(--background); +} +._progressValue_nrzbt_14 { + height: 100%; + background-color: var(--color-blue); + transition: width 1s ease; + will-change: width; +} +._syncMessage_nrzbt_21 { + height: 16px; + width: 100%; + max-width: var(--content-width); + font-size: var(--size-small); + color: var(--color-secondary); + text-align: right; + margin: 0 auto 1px; + padding: 0 var(--spacing-large); +} +._syncText_nrzbt_33 { + display: inline-block; + height: 100%; + font-variant: tabular-nums; +} +._spinnerContainer_nrzbt_39 { + position: relative; + display: inline-block; +} +._spinner_nrzbt_39 { + color: var(--color-blue); +} +._spinner_nrzbt_39:after { + position: relative; + top: 2px; + animation: _changeContent_nrzbt_1 .8s linear infinite; + display: block; + content: "⠋"; + font-size: 14px; + margin-left: 3px; +} +@keyframes _changeContent_nrzbt_1 { + 10% { + content: "⠙"; + } + 20% { + content: "⠹"; + } + 30% { + content: "⠸"; + } + 40% { + content: "⠼"; + } + 50% { + content: "⠴"; + } + 60% { + content: "⠦"; + } + 70% { + content: "⠧"; + } + 80% { + content: "⠇"; + } + 90% { + content: "⠏"; + } +} +@media (max-width: 900px) { + ._syncMessage_nrzbt_21 { + padding: 0 var(--spacing-default); + } +} +@media (max-width: 640px) { + ._syncMessage_nrzbt_21 { + padding: 0 var(--spacing-half); + } +} +._container_13974_1 { + transform: rotate(-90deg); + background-color: transparent !important; +} +._background_13974_6, +._foreground_13974_7 { + fill: none; +} +._background_13974_6 { + stroke: var(--color-mediumgray); +} +._complete_13974_19 { + stroke: var(--color-success); +} +._pending_13974_23, +._generic_13974_24 { + stroke: var(--color-primary); +} +._error_13974_28 { + stroke: var(--color-danger); +} +._txArrowType_m24u9_1 { + width: 18px; + height: 18px; +} +._txArrowTypeIn_m24u9_6 { + stroke: var(--color-success) !important; +} +._txArrowTypeOut_m24u9_10 { + stroke: var(--color-danger) !important; +} +._txArrowTypeSelf_m24u9_14 { + stroke: var(--color-secondary) !important; +} +._container_1j01g_1 { + margin: calc(var(--space-default) * 1.5) 0; +} +._header_1j01g_5 { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin-bottom: var(--space-default); +} +._header_1j01g_5 label { + font-size: var(--size-default); +} +._columns_1j01g_17 { + align-items: center; + background-color: var(--background-secondary); + display: flex; + flex-direction: row; + justify-content: flex-start; + margin-bottom: 1px; + width: 100%; +} +._headers_1j01g_27 { + font-weight: 700; + height: 48px; +} +._columns_1j01g_17 > *, +._columnGroup_1j01g_33 > * { + display: flex; + flex-direction: row; + align-items: center; + font-size: var(--size-default); + padding: 0 var(--space-quarter); +} +._columnGroup_1j01g_33 { + width: 100%; + padding: 0; +} +._type_1j01g_46 { + min-width: 54px; + width: 54px; + justify-content: center; +} +._date_1j01g_52 { + min-width: 98px; + width: 98px; +} +._activity_1j01g_57 { + min-width: 334px; + width: 334px; + text-align: left; +} +._status_1j01g_63 { + min-width: 106px; + width: 106px; +} +._fiat_1j01g_68 { + min-width: 134px; + width: 134px; + justify-content: flex-end; +} +._currency_1j01g_74 { + min-width: 230px; + width: 230px; + justify-content: flex-end; +} +._action_1j01g_80 { + min-width: 60px; + width: 60px; + justify-content: center; + align-items: center; +} +._empty_1j01g_87 { + background-color: var(--background-secondary); + height: 52px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} +._empty_1j01g_87 p { + font-size: var(--size-default); + font-weight: 400; + color: var(--color-secondary); +} +@media (min-width: 1081px) and (max-width: 1199px), (min-width: 1323px) { + ._hideOnMedium_1j01g_103 { + display: none; + } + ._activity_1j01g_57 { + padding: var(--space-quarter) 0; + } +} +@media (max-width: 1080px), (min-width: 1200px) and (max-width: 1322px) { + ._showOnMedium_1j01g_113 { + display: none; + } + ._columns_1j01g_17 { + flex-direction: column; + justify-content: center; + } + ._columnGroup_1j01g_33:last-child { + margin-top: var(--space-quarter); + } + ._type_1j01g_46 { + min-width: 36px; + width: 36px; + justify-content: flex-start; + } + ._date_1j01g_52 { + min-width: 126px; + width: 126px; + } + ._activity_1j01g_57 { + flex: 1; + } + ._fiat_1j01g_68, + ._currency_1j01g_74 { + justify-content: flex-start; + min-width: 0; + width: auto; + text-align: right; + } + ._action_1j01g_80 { + justify-content: flex-end; + min-width: 36px; + width: 36px; + } + ._status_1j01g_63 { + justify-content: flex-start; + width: auto; + margin-left: 36px; + margin-right: auto; + } +} +@media (max-width: 768px) { + ._container_1j01g_1 { + margin: var(--space-default) 0; + } + ._fiat_1j01g_68, + ._currency_1j01g_74 { + min-width: 0; + width: auto; + } + ._fiat_1j01g_68 { + flex-grow: 1; + flex-shrink: 0; + justify-content: flex-end; + } + ._currency_1j01g_74 { + flex-grow: 0; + flex-shrink: 1; + } +} +@media (max-width: 666px) { + ._columns_1j01g_17 > *, + ._columnGroup_1j01g_33 > * { + padding: 0 var(--space-eight); + } + ._type_1j01g_46 { + min-width: 26px; + width: 26px; + } + ._activity_1j01g_57 { + min-width: 0; + width: auto; + } + ._date_1j01g_52 { + min-width: 80px; + width: 80px; + } + ._status_1j01g_63 { + margin-left: 2px; + min-width: 14px; + padding-right: 0; + } +} +._container_1tutj_1 { + margin: 0 0 1px; +} +._row_1tutj_5 { + background-color: var(--background-secondary) !important; + min-height: 52px; +} +._row_1tutj_5 * { + font-size: var(--size-default); + font-weight: 400; +} +._address_1tutj_19 { + text-overflow: ellipsis; + overflow: hidden; +} +._address_1tutj_19 ._badge_1tutj_24 { + margin-left: 5px; + color: var(--color-secondary); +} +._statusIndicator_1tutj_29 { + width: 9px; + height: 9px; + border-radius: 50%; + background-color: var(--background); + margin-right: var(--space-quarter); +} +._statusIndicatorComplete_1tutj_37 { + background-color: var(--color-success); +} +._statusIndicatorPending_1tutj_41 { + background-color: var(--color-yellow); +} +._statusIndicatorFailed_1tutj_45 { + background-color: var(--color-danger); +} +._fiat_1tutj_53 { + font-variant: tabular-nums; +} +._amount_1tutj_57 { + font-variant: tabular-nums; + max-width: 100%; +} +._amountOverflow_1tutj_62 { + overflow: hidden; + position: relative; + text-overflow: ellipsis; +} +._amountOverflow_1tutj_62:after { + content: attr(data-unit); + color: transparent; +} +._send_1tutj_74 { + color: var(--color-softred) !important; +} +._receive_1tutj_78 { + color: var(--color-success); +} +._currency_1tutj_82 { + font-variant: tabular-nums; +} +._currencyUnit_1tutj_86 { + color: var(--color-secondary); + font-variant: normal; +} +._amountOverflow_1tutj_62 ._currencyUnit_1tutj_86 { + position: absolute; + right: 0; + top: 0; +} +._action_1tutj_97 { + align-items: center; + background: none; + border: none; + display: flex; + flex-direction: column; + justify-content: center; + padding: 0; + -webkit-appearance: none; +} +._label_1tutj_108 { + white-space: nowrap; +} +._label_1tutj_108, +._columnLabel_1tutj_113, +._inlineLabel_1tutj_114 { + color: var(--color-secondary); + font-size: var(--size-default); +} +._label_1tutj_108, +._columnLabel_1tutj_113 { + margin-right: var(--space-quarter); +} +._columnLabel_1tutj_113 { + display: none; +} +._inlineValue_1tutj_128 { + margin-left: var(--space-quarter); +} +._fee_1tutj_132 { + min-width: 140px; +} +._transactionId_1tutj_136 { + overflow: hidden; + text-overflow: ellipsis; +} +._detail_1tutj_141, +._detailInput_1tutj_142 { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + min-height: var(--item-height); + padding: var(--space-half); +} +._detailInput_1tutj_142 { + padding: 0 0 0 var(--space-half); +} +._detailInput_1tutj_142 label { + margin-bottom: 0; +} +._textOnlyInput_1tutj_159 { + margin: 0; +} +._textOnlyInput_1tutj_159 input { + border: none; +} +._editButton_1tutj_167 { + background: none; + border: none; + height: 20px; + margin-right: var(--space-half); + padding: 0; + -webkit-appearance: none; + width: 20px; +} +._editButton_1tutj_167:focus { + outline: none; +} +._editButton_1tutj_167 img { + opacity: .4; + vertical-align: text-bottom; + outline: none; +} +._editButton_1tutj_167:hover img { + opacity: .55; +} +._detail_1tutj_141:not(:first-child) { + border-top: solid 1px var(--background); +} +._detail_1tutj_141 label { + white-space: nowrap; + margin-right: var(--space-half) !important; +} +._detail_1tutj_141 label, +._detail_1tutj_141 p { + margin: 0; + line-height: 1; +} +._detail_1tutj_141._addresses_1tutj_207 { + align-items: baseline; + padding-bottom: 0; + padding-right: 0; + padding-top: 0; +} +._addresses_1tutj_207 label { + padding: var(--space-half) 0; +} +._detailAddresses_1tutj_218 { + flex-grow: 1; +} +._detailAddress_1tutj_218 + ._detailAddress_1tutj_218 { + margin-top: calc(var(--space-quarter) * -1); +} +@media (max-width: 1080px), (min-width: 1200px) and (max-width: 1322px) { + ._container_1tutj_1 { + margin: 0 0 var(--space-quarter) 0; + } + ._row_1tutj_5 { + height: auto; + padding: var(--space-half); + } + ._columnLabel_1tutj_113 { + display: inline; + } + ._action_1tutj_97 { + align-items: flex-end; + } +} +@media (max-width: 926px) { + ._inlineLabel_1tutj_114 { + display: block; + margin-bottom: var(--space-quarter); + } + ._inlineValue_1tutj_128 { + margin-left: 0; + text-align: center; + } +} +@media (max-width: 666px) { + ._columnLabel_1tutj_113 { + display: none; + } + ._row_1tutj_5 { + padding: var(--space-half) var(--space-quarter); + } + ._inlineLabel_1tutj_114 { + white-space: nowrap; + } + ._fee_1tutj_132 { + min-width: 0; + } +} +@media (max-width: 560px) { + ._status_1tutj_29 { + display: none; + } +} +._container_8wadt_1 { + max-width: 100%; + width: 100%; + min-height: 100%; + padding: 0; + margin: 0 auto; + display: flex; + flex-direction: column; + justify-content: flex-start; +} +._header_8wadt_12 { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-start; + flex: none; + margin: 0 auto; + padding: var(--spacing-large) var(--spacing-large) 0 var(--spacing-large); + width: 800px; +} +._actionsContainer_8wadt_23 { + display: flex; + transform: translateY(-36%); + margin-top: var(--space-quarter); +} +._buy_8wadt_29, +._receive_8wadt_30, +._walletConnect_8wadt_31, +._send_8wadt_32 { + background-color: var(--color-blue); + border-radius: 2px; + color: var(--color-alt); + display: inline-block; + font-size: var(--size-default); + height: calc(var(--item-height) / 1.5); + line-height: calc(var(--item-height) / 1.5); + margin-left: var(--space-quarter); + min-width: calc(var(--item-height) * 2); + padding: 0 var(--space-half); + text-align: center; + text-decoration: none; + transition: background-color ease-out .2s; + width: auto; + will-change: background-color; +} +._withWalletConnect_8wadt_50._actionsContainer_8wadt_23 { + flex-wrap: wrap; + justify-content: flex-end; +} +._withWalletConnect_8wadt_50 ._walletConnect_8wadt_31 { + display: flex; +} +._buy_8wadt_29:hover, +._receive_8wadt_30:hover, +._send_8wadt_32:not(._disabled_8wadt_62):hover { + background-color: var(--color-lightblue); +} +._send_8wadt_32._disabled_8wadt_62 { + cursor: default; + opacity: .4; +} +._accountIcon_8wadt_71 { + width: 18px; + height: 18px; + margin-right: calc(var(--space-quarter) / 2); +} +@media (max-width: 768px) { + ._actionsContainer_8wadt_23 { + flex: 0 0 91%; + justify-content: space-between; + margin-bottom: var(--space-default); + max-width: 91%; + transform: none; + width: 91%; + margin-left: auto; + margin-right: auto; + flex-wrap: wrap; + } + ._withWalletConnect_8wadt_50._actionsContainer_8wadt_23 { + justify-content: center; + } + ._withWalletConnect_8wadt_50 ._buy_8wadt_29, + ._withWalletConnect_8wadt_50 ._receive_8wadt_30, + ._withWalletConnect_8wadt_50 ._send_8wadt_32 { + max-width: 25%; + } + ._withWalletConnect_8wadt_50 ._walletConnect_8wadt_31 { + align-items: center; + display: flex; + justify-content: center; + max-width: 15%; + } + ._actionsContainer_8wadt_23 a { + flex: 1 0 30%; + margin-right: 0; + max-width: 30%; + min-width: unset; + } + ._send_8wadt_32, + ._receive_8wadt_30, + ._buy_8wadt_29 { + font-size: var(--size-small); + width: auto; + } +} +._dropdown_1uw27_1 { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23777' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-labelledby='chevron down' color='%23777'%3E%3Cdefs/%3E%3Cpolyline points='6 10 12 16 18 10'/%3E%3C/svg%3E%0A"); + background-repeat: no-repeat; + font-weight: 400; + height: calc(var(--space-quarter) * 3); + padding: 0 calc(var(--space-quarter) + var(--space-eight)); +} +._select_1uw27_10 .react-select__control { + background-color: var(--background-secondary); + border: 2px solid var(--color-custom-select-border); + border-radius: 0; + padding: 0 var(--space-eight); +} +._select_1uw27_10 { + width: 280px; + background-color: var(--background-secondary); + color: var(--color-default); +} +._select_1uw27_10 .react-select__option.react-select__option--is-focused:not(:hover) { + outline: solid 1px var(--color-blue); +} +._select_1uw27_10 .react-select__option.react-select__option--is-selected, +._select_1uw27_10 .react-select__option:hover { + background-color: var(--background-custom-select-selected); +} +._select_1uw27_10 .react-select__menu { + background-color: var(--background-secondary); +} +._select_1uw27_10 .react-select__option { + background-color: var(--background-secondary); + font-size: var(--size-default); + color: var(--color-default); + padding: var(--space-half) var(--space-quarter); + cursor: pointer; +} +._select_1uw27_10 .react-select__menu-list { + padding: 1px; +} +._select_1uw27_10 .react-select__control:hover { + cursor: pointer; +} +._select_1uw27_10 .react-select__single-value, +._select_1uw27_10 .react-select__input-container { + font-size: var(--size-default); + color: var(--color-default); +} +._select_1uw27_10 .react-select__multi-value { + padding: 0; + margin: 0; + background: transparent; +} +._select_1uw27_10 .react-select__multi-value__label { + padding: 0; + color: var(--color-default); + font-size: var(--size-default); +} +@media (max-width: 560px) { + ._select_1uw27_10 { + margin-top: var(--space-quarter); + width: 100%; + } +} +._select_1j2fm_1 .react-select__input-container { + position: absolute; + top: -2px; + left: 6px; +} +._select_1j2fm_1 .react-select__option { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} +._select_1j2fm_1 .react-select__multi-value:nth-child(n+4) { + display: none; +} +._select_1j2fm_1:not(._hideMultiSelect_1j2fm_30) .react-select__multi-value:not(:nth-last-child(2)):after { + content: ","; + padding-right: 2px; +} +._select_1j2fm_1:not(._hideMultiSelect_1j2fm_30) .react-select__multi-value:nth-child(3):not(:nth-last-child(2)):after { + content: "…"; +} +._select_1j2fm_1._hideMultiSelect_1j2fm_30 .react-select__multi-value { + display: none; +} +._select_1j2fm_1 .react-select__value-container--is-multi { + height: var(--item-height-xsmall); +} +._defaultCurrency_1j2fm_51:hover { + cursor: not-allowed; +} +._defaultLabel_1j2fm_55 { + font-size: var(--size-small); + margin: 0; + text-transform: capitalize; +} +._inlineMessage_gi9x3_1 { + position: relative; + padding: var(--spacing-default) 42px var(--spacing-default) var(--spacing-default); + border-radius: 3px; +} +._inlineMessage_gi9x3_1._success_gi9x3_7 { + background-color: var(--color-success); + color: var(--color-alt); +} +._inlineMessage_gi9x3_1._left_gi9x3_12 { + text-align: left; +} +._close_gi9x3_16 { + position: absolute; + top: var(--spacing-default); + right: var(--spacing-default); + line-height: 1; + cursor: pointer; +} +._settingItem_6ge6v_3 { + margin-top: var(--space-half); +} +@media (max-width: 768px) { + ._settingItem_6ge6v_3 { + margin-top: 2px; + } +} +._headerContainer_wug0g_1 { + display: flex; + flex-direction: column; + align-items: center; +} +._headerContainer_wug0g_1 p, +._headerContainer_wug0g_1 h1 { + margin: 0; +} +._headerContainer_wug0g_1 h1 { + margin-top: var(--space-half); + font-size: var(--size-large); + font-weight: 400; +} +._headerContainer_wug0g_1 img { + width: 64px; + height: 64px; +} +._headerContainer_wug0g_1 p { + color: var(--color-secondary); + margin-top: var(--space-quarter); +} +._accountName_wug0g_28 { + font-size: 20px; +} +._receiveAddress_wug0g_32 { + font-size: 16px; +} +@media (max-width: 768px) { + ._headerContainer_wug0g_1 h1 { + margin-top: var(--space-eight); + font-size: var(--size-subheader); + } + ._headerContainer_wug0g_1 p { + font-size: var(--size-small); + } + ._headerContainer_wug0g_1 img { + width: 36px; + height: 36px; + } + ._headerContainer_wug0g_1 p._receiveAddress_wug0g_32 { + margin-top: var(--space-eight); + } +} +._formContainer_1wrji_1 { + display: flex; + flex-direction: column; +} +._formButtonsContainer_1wrji_6 { + display: flex; + justify-content: space-between; +} +._inputWithIcon_1wrji_11 { + position: relative; +} +._inputWithIcon_1wrji_11 input { + padding-right: calc(var(--spacing-default) * 2 + 18px); +} +@media (max-width: 768px) { + ._formButtonsContainer_1wrji_6 { + flex-direction: column-reverse; + margin-top: calc(var(--space-half) + var(--space-quarter)); + } + ._formButtonsContainer_1wrji_6 button + button { + margin-bottom: var(--space-half); + } + ._mobileQRScanner_1wrji_28 { + display: flex; + flex-direction: column; + margin-bottom: calc(var(--space-half) + var(--space-eight)); + } + ._mobileQRScanner_1wrji_28 video { + max-width: 320px; + height: 320px; + margin: 0 auto; + object-fit: cover; + } + ._mobileQRScanner_1wrji_28 ._scanQRLabel_1wrji_41 { + margin-bottom: var(--space-quarter); + margin-left: auto; + margin-right: auto; + text-align: center; + } +} +._buttonsContainer_yg3s8_1 { + margin-top: var(--space-default); + display: flex; + justify-content: space-between; +} +._container_yg3s8_7 { + display: flex; + flex-direction: column; +} +._container_yg3s8_7 p._connectionRequest_yg3s8_12 { + margin-bottom: 24px; +} +._container_yg3s8_7 p._receiveAddress_yg3s8_16 { + color: var(--color-secondary); + margin-top: 24px; +} +._pairingDetailContainer_yg3s8_21 { + display: flex; + align-items: center; + justify-content: space-between; +} +._pairingDetailContainer_yg3s8_21 img { + width: 64px; + height: 64px; +} +._pairingDetailContainer_yg3s8_21 p._metadata_yg3s8_32 { + color: var(--color-default); + margin-bottom: var(--space-eight); +} +@media (max-width: 768px) { + ._buttonsContainer_yg3s8_1 { + flex-direction: column-reverse; + } + ._buttonsContainer_yg3s8_1 > *:not(:last-child) { + margin-top: var(--space-quarter); + } + ._buttonsContainer_yg3s8_1 button { + height: calc(var(--space-quarter) + var(--space-default)); + } + ._container_yg3s8_7 p._connectionRequest_yg3s8_12 { + text-align: center; + } + ._pairingDetailContainer_yg3s8_21 { + align-items: flex-start; + flex-direction: column-reverse; + } + ._pairingDetailContainer_yg3s8_21 img { + margin-left: auto; + margin-right: auto; + margin-bottom: var(--space-default); + } +} +._container_1h5wj_1 { + align-items: center; + display: flex; + flex-direction: column; +} +._successIcon_1h5wj_7 { + width: 180px; + height: 180px; +} +._container_1h5wj_1 p._successText_1h5wj_12 { + margin: calc(var(--space-quarter) + var(--space-half)) 0; + text-align: center; +} +@media (max-width: 768px) { + ._container_1h5wj_1 p._successText_1h5wj_12 { + margin-bottom: var(--space-large); + margin-top: calc(var(--space-quarter) + var(--space-default)); + } + ._container_1h5wj_1 button { + height: calc(var(--space-quarter) + var(--space-default)); + width: 100%; + } +} +._contentContainer_1iwqe_1 { + display: flex; + margin-top: var(--space-default); + margin-left: auto; + margin-right: auto; + max-width: 800px; + min-height: 320px; +} +._contentContainer_1iwqe_1 > div { + width: 100%; +} +._contentContainer_1iwqe_1 p { + color: var(--color-secondary); + font-size: 16px; + margin: 0; +} +@media (max-width: 768px) { + ._contentContainer_1iwqe_1 p { + font-size: var(--size-default); + } +} +._container_1jggi_1 { + background-color: var(--background-session-card); + display: flex; + margin-top: calc(var(--space-quarter) + var(--space-half)); + padding: calc(var(--space-half) + var(--space-quarter)); + width: 100%; +} +._container_1jggi_1 p { + color: var(--color-default); + font-size: 16px; + line-height: 1.9; + margin-bottom: 0; +} +._textDataContainer_1jggi_16 { + display: flex; + flex-direction: column; +} +._receiveAddress_1jggi_21 { + color: var(--color-secondary); + margin: 0; +} +._accountName_1jggi_26 { + font-weight: 700; + margin: 0; + padding-right: 16px; + width: 240px; +} +._dAppMetadataAndIconContainer_1jggi_33 { + align-items: center; + display: flex; +} +._dAppMetadataAndIconContainer_1jggi_33 p { + margin-top: 0; +} +._dAppMetadataAndIconContainer_1jggi_33 img { + width: var(--item-height); + height: var(--item-height); + margin-left: calc(var(--space-quarter) + var(--space-half)); +} +._dAppNameAndUrlContainer_1jggi_48 { + display: flex; + flex-direction: column; + width: 240px; +} +._dAppMetadataAndIconContainer_1jggi_33 p._dappUrl_1jggi_54 { + margin-top: var(--space-quarter); +} +._accountNameAndWalletContainer_1jggi_58 { + display: flex; + margin-bottom: calc(var(--space-quarter) + var(--space-half)); +} +._buttonAndIconContainer_1jggi_63 { + align-items: flex-end; + display: flex; + margin-left: auto; +} +._buttonDisconnect_1jggi_69 { + height: unset; + padding: calc(var(--space-eight) + var(--space-quarter)) calc(var(--space-default) + var(--space-default)); +} +@media (max-width: 768px) { + ._container_1jggi_1 { + margin-top: var(--space-half); + padding: calc(var(--space-quarter) * 2); + } + ._container_1jggi_1 p { + font-size: var(--size-default); + } + ._textDataContainer_1jggi_16 { + width: 50%; + } + ._dAppNameAndUrlContainer_1jggi_48, + ._accountName_1jggi_26 { + width: 100%; + } + ._accountNameAndWalletContainer_1jggi_58 { + margin-bottom: var(--space-quarter); + } + ._buttonAndIconContainer_1jggi_63 { + flex-direction: column; + justify-content: flex-end; + } + ._buttonDisconnect_1jggi_69 { + font-size: var(--size-default); + height: var(--item-height-small); + padding: var(--space-eight) calc(var(--space-quarter) + var(--space-half)); + } + ._buttonAndIconContainer_1jggi_63 img { + height: var(--item-height-small); + width: var(--item-height-small); + margin-top: var(--space-default); + margin-bottom: var(--space-default); + } +} +._buttonNewConnection_13so1_1 { + height: calc(var(--space-default) + var(--space-quarter)); +} +._headerContainer_13so1_5 { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: calc(var(--space-half) + var(--space-quarter)); +} +._headerContainer_13so1_5 p { + margin: 0; +} +._headerContainer_13so1_5 p._receiveAddress_13so1_16 { + color: var(--color-secondary); + margin-top: var(--space-quarter); + font-size: 16px; +} +._noConnectedSessions_13so1_22 { + color: var(--color-secondary); + font-size: 16px; + margin: 0; + margin-top: var(--space-large); + text-align: center; +} +._separator_13so1_30 { + background: var(--color-disabled); + border: none; + height: 2px; + margin: 0; +} +._sessionCardsContainer_13so1_37 { + display: flex; + flex-direction: column; +} +._allSessionsHeading_13so1_42 { + color: var(--color-secondary); + font-size: 16px; + margin: 0; + margin-top: var(--space-half); +} +@media (max-width: 768px) { + ._buttonNewConnection_13so1_1 { + height: var(--space-default); + padding: 0 16px; + } + ._headerContainer_13so1_5 p { + font-size: 16px; + } + ._headerContainer_13so1_5 p._receiveAddress_13so1_16, + ._noConnectedSessions_13so1_22, + ._allSessionsHeading_13so1_42 { + font-size: var(--size-default); + } + ._allSessionsHeading_13so1_42 { + margin-top: var(--space-quarter); + } +} +._passwordGesturesWrapper_mvckk_1 { + height: auto; + margin: var(--space-default) auto 0 auto; + position: relative; + width: 100%; +} +._passwordGestures_mvckk_1 { + background-color: #fff; + display: block; + height: 75%; + margin: 0 auto; + max-width: 600px; + object-fit: cover; + width: 100%; +} +._passwordGestures_mvckk_1[src=""]:after { + background-color: #fff; + content: ""; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} +._toggle_1lt1t_1 { + align-items: center; + display: flex; + flex-direction: row; +} +._toggleLabel_1lt1t_7 { + flex-grow: 1; + line-height: 1.4; + margin-bottom: 0; + padding-right: var(--space-half); +} +._textIcon_1lt1t_14 { + height: 1.2em; + margin-right: .5em; + vertical-align: text-bottom; +} +._wizardCheckbox_1shxj_2 label { + font-size: var(--size-wizard-text) !important; + line-height: 1.4; +} +._wizardCheckbox_1shxj_2 label:before { + top: 2px !important; +} +._wizardCheckbox_1shxj_2 label:after { + top: 6px !important; +} +._wizardLabel_11dvu_2 label { + font-size: var(--size-wizard-text) !important; +} +._logo_rqpye_1 { + display: block; + filter: grayscale(100%); + margin: var(--space-half) auto; + max-height: 32px; + max-width: 100%; + opacity: .61; +} +._prominent_rqpye_9 { + max-height: 48px; +} +@media (min-width: 1200px) { + ._logo_rqpye_1 { + margin-top: var(--space-default); + max-height: 42px; + } + ._prominent_rqpye_9 { + max-height: 72px; + } +} +._hostname_rqpye_22 { + color: var(--color-secondary); +} +@media (min-width: 769px) { + ._hostname_rqpye_22 { + margin: 0; + } +} +._capitalized_rqpye_31:first-letter { + text-transform: capitalize; +} +._banner_yebbr_1 { + background-color: var(--color-blue); + color: var(--color-alt); + font-weight: 400; + font-size: var(--size-subheader); + padding: var(--space-half); + text-align: center; +} +._smallIcon_yebbr_10 { + margin: auto 0; + width: 30px; +} +._successText_yebbr_15 { + color: var(--color-secondary); + font-weight: 400; + font-size: var(--size-subheader); + margin-bottom: var(--space-quarter); +} +@media (max-width: 768px) { + ._successText_yebbr_15 { + font-size: var(--size-default); + margin-top: 0; + } +} +._proceed_yebbr_28 { + margin-bottom: var(--space-half); + margin-top: 0; +} +._message_yebbr_33 { + background-color: var(--background-secondary); + border-color: var(--background-quaternary); + border-radius: 2px; + border-style: solid; + border-width: 1px; + font-family: var(--font-family); + font-size: var(--size-default); + font-weight: 400; + min-height: 52px; + padding: var(--space-quarter) var(--space-half); + text-align: left; + width: 100%; + white-space: pre-line; +} +@media (min-width: 1200px) { + ._message_yebbr_33 { + --size-default: 18px; + } +} +._link_4u2en_1 { + color: var(--color-alt); +} +._link_4u2en_1:focus { + outline-color: inherit; +} +._bitboxContainer_1nxo8_1 { + margin-top: calc(var(--space-default) + var(--space-quarter)); + margin-bottom: calc(var(--space-default) + var(--space-quarter)); +} +._bitboxContainer_1nxo8_1 > div img { + width: 198px; + height: 115px; + margin-right: var(--space-default); +} +._bitboxContainer_1nxo8_1 > div svg { + width: 20px; + height: 20px; +} +._bitboxContainer_1nxo8_1._failed_1nxo8_18 { + align-items: center; + display: flex; + flex-direction: column; +} +._bitboxImage_1nxo8_24 { + width: 198px; + height: 115px; +} +._cancelIcon_1nxo8_29 { + margin-right: 16px; + width: 48px; +} +._text_1nxo8_35 { + font-size: 16px; +} +@media (max-width: 768px) { + ._text_1nxo8_35 { + font-size: var(--size-default); + } +} +._link_13in7_1 { + color: inherit; +} +._auth_xdrxz_1 { + position: absolute; + width: 100%; + height: 100%; + z-index: 9999; +} +._accountName_gsa52_1 { + font-size: 16px; + margin: 0 var(--space-half) 0 0; +} +._accountNameAndAddress_gsa52_6 { + display: flex; +} +._address_gsa52_10 { + color: var(--color-secondary); + font-size: 16px; + margin: 0; +} +._animationAndTextContainer_gsa52_16 { + align-items: center; + display: flex; + flex-direction: column; + margin: auto; +} +._animationAndTextContainer_gsa52_16 p { + font-size: var(--header-default-font-size); + margin-top: var(--space-quarter); +} +._chainContainer_gsa52_28 { + align-items: center; + display: flex; +} +._chainContainer_gsa52_28 ._itemText_gsa52_33 { + margin-right: calc(var(--space-quarter) + var(--space-eight)); +} +._chainContainer_gsa52_28 img { + height: 20px; + width: 20px; +} +._dappIcon_gsa52_42 { + height: 96px; + width: 96px; +} +._item_gsa52_33 { + display: flex; + flex-direction: column; +} +._item_gsa52_33 + ._item_gsa52_33 { + margin-top: var(--space-half); +} +._itemText_gsa52_33 { + font-size: 16px; + margin: 0; +} +._label_gsa52_62 { + color: var(--color-secondary); + font-size: var(--size-default); + margin: 0 0 var(--space-quarter) 0; +} +._listContainer_gsa52_68 { + display: flex; + flex-direction: column; + list-style: none; + margin: 0; + padding: 0; + width: 100%; +} +._outerContainer_gsa52_77 { + display: flex; + flex-direction: column; + min-height: 460px; + padding: 0 var(--space-half); +} +._successIcon_gsa52_84 { + height: 240px; + width: 240px; +} +._textarea_gsa52_89 { + border-color: var(--background-quaternary); + border-radius: var(--space-eight); + font-family: var(--font-family); + padding: var(--space-quarter); + width: 100%; +} +._titleContainer_gsa52_97 { + align-items: center; + display: flex; + margin-bottom: var(--space-half); +} +._titleContainer_gsa52_97 h3 { + font-size: var(--header-default-font-size); + font-weight: 400; + margin: 0 0 0 var(--space-eight); + padding: 0 var(--space-quarter); +} +:root { + --color-darkgreen: #4f9879; + --color-green: #7aba7a; + --color-lightgreen: rgba(79, 152, 121, .33); + --color-palegreen: rgba(79, 152, 121, .2); + --color-softred: #EC644B; + --color-lightred: #F28E72; + --color-swissred: #E30613; + --color-white: #FFFFFF; + --color-lightgray: #F5F5F5; + --color-mediumgray: #E5E5E5; + --color-gray-alt: #999999; + --color-gray: #777777; + --color-softblack: #333333; + --color-dark: #1D1D1B; + --color-yellow: #fef160; + --color-darkyellow: rgb(243, 234, 0, .66); + --color-lightyellow: rgba(255, 252, 177, .15); + --color-darkblue: #4f7998; + --color-blue: #5E94BF; + --color-lightblue: #73A5CD; + --color-light-skyblue: #ECF7FF; + --color-electric-blue: #2684FF; + --color-powder-blue: #DEEBFF; + --color-pale-ice-blue: #E6F7FF; + --color-blue-alt: #91BFCF; + --color-orange: #F5A04C; + --color-olive: #908B00; + --color-lightorange: #F9AC60; + --color-success: var(--color-green); + --color-info: var(--color-blue); + --color-warning: var(--color-softred); + --color-error: var(--color-swissred); + --color-danger: var(--color-error); + --size-extra-large: 2.2rem; + --size-large: 2rem; + --size-large-mobile: 1.4rem; + --size-subheader: 18px; + --size-medium: var(--size-default); + --size-default: 14px; + --size-small: 12px; + --size-xsmall: 11px; + --size-label: var(--size-small); + --size-button: var(--size-default); + --size-title: 32px; + --size-wizard-text: 16px; + --spacing-large: 2rem; + --spacing-default: 1rem; + --spacing-half: .5rem; + --space-large: 64px; + --space-default: 32px; + --space-half: 16px; + --space-quarter: 8px; + --space-eight: 4px; + --item-height-xsmall: 24px; + --item-height-small: 36px; + --item-height: 52px; + --item-height-large: 72px; + --item-height-xlarge: 84px; + --font-family: + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + "Ubuntu", + "Roboto", + "Oxygen", + "Cantarell", + "Fira Sans", + "Droid Sans", + "Helvetica Neue", + sans-serif; + --sidebar-width-large: 250px; + --sidebar-margin: 32px; + --sidebar-item-height: 52px; + --sidebar-icon-margin: 14px; + --sidebar-icon-size: 24px; + --sidebar-header-size: 12px; + --sidebar-header-line-height: 16px; + --header-height: 70px; + --header-default-font-size: 24px; + --content-width: 1080px; + --content-width-small: 550px; + --content-width-larger: 740px; + --guide-width: 350px; +} +:root, +.light-mode { + --color-disabled: var(--color-mediumgray); + --color-default: var(--color-dark); + --color-primary: var(--color-blue); + --color-secondary: var(--color-gray); + --color-light: var(--color-mediumgray); + --color-alt: var(--color-white); + --color-tertiary: var(--color-gray-alt); + --color-custom-select-border: var(--color-lightgray); + --background: var(--color-lightgray); + --background-blue: var(--color-blue); + --bg-transparent-dark: rgba(0, 0, 0, .4); + --background-secondary: var(--color-white); + --background-dark: var(--color-softblack); + --background-focus: var(--color-light-skyblue); + --background-tertiary: var(--color-gray-alt); + --background-quaternary: var(--color-mediumgray); + --background-custom-select-hover: var(--color-powder-blue); + --background-custom-select-selected: var(--color-pale-ice-blue); + --background-session-card: var(--color-white); +} +@media (prefers-color-scheme: dark) { + :root { + --color-disabled: var(--color-gray); + --color-default: var(--color-lightgray); + --color-primary: var(--color-blue); + --color-secondary: var(--color-gray-alt); + --color-light: var(--color-mediumgray); + --color-alt: var(--color-white); + --color-tertiary: var(--color-gray-alt); + --color-custom-select-border: var(--color-gray); + --background: var(--color-dark); + --bg-transparent-dark: rgba(0, 0, 0, .4); + --background-secondary: var(--color-softblack); + --background-dark: var(--color-softblack); + --background-focus: var(--color-softblack); + --background-tertiary: var(--color-gray); + --background-quaternary: var(--color-dark); + --background-custom-select-hover: var(--color-dark); + --background-custom-select-selected: var(--color-dark); + --background-session-card: var(--color-softblack); + } +} +@media (prefers-color-scheme: light) { + .dark-mode { + --color-disabled: var(--color-gray); + --color-default: var(--color-lightgray); + --color-primary: var(--color-blue); + --color-secondary: var(--color-gray-alt); + --color-light: var(--color-mediumgray); + --color-alt: var(--color-white); + --color-tertiary: var(--color-gray-alt); + --color-custom-select-border: var(--color-gray); + --background: var(--color-dark); + --bg-transparent-dark: rgba(0, 0, 0, .4); + --background-secondary: var(--color-softblack); + --background-dark: var(--color-softblack); + --background-focus: var(--color-softblack); + --background-tertiary: var(--color-gray); + --background-quaternary: var(--color-dark); + --background-custom-select-hover: var(--color-dark); + --background-custom-select-selected: var(--color-dark); + --background-session-card: var(--color-softblack); + } +} +@media (max-width: 1199px) { + :root { + --size-title: 18px; + } +} +@media (max-width: 768px) { + :root { + --header-default-font-size: 20px; + --size-subheader: 16px; + --size-title: 16px; + --size-wizard-text: 14px; + } +} +html, +body { + background-color: var(--background); + color: var(--color-default); + font-family: var(--font-family); + font-weight: 400; + height: 100%; + line-height: 1.3; + margin: 0; + overflow: hidden; + padding: 0; + width: 100%; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-app-region: drag; +} +* { + box-sizing: border-box; +} +hr { + background: none; + border-color: var(--background-quaternary) transparent; + border-style: solid; + border-width: 1px 0 0 0; + margin: var(--spacing-large) 0; +} +h1, +h2, +h3, +h4, +h5 { + line-height: 1.25; +} +::-webkit-scrollbar-track { + background-color: #f5f5f5; +} +::-webkit-scrollbar { + width: 4px; + background-color: #f5f5f5; +} +::-webkit-scrollbar-thumb { + background-color: var(--color-gray); +} +p { + font-weight: 400; + font-size: var(--size-default); +} +a { + color: var(--color-blue); + cursor: pointer; +} +dl div { + display: inline-block; + margin-right: var(--spacing-large); +} +dl dt { + margin-right: var(--spacing-half); + text-indent: 0; +} +dl dd { + margin: 0; + font-weight: 700; + overflow: hidden; + text-overflow: ellipsis; +} +img, +button { + -webkit-user-select: none; + user-select: none; +} +svg { + stroke-width: 1.6 !important; +} +pre { + background-color: var(--background-secondary); + display: block; + font-family: monospace; + font-size: 20px; + margin: 0 0 var(--space-default) 0; + padding: var(--space-default); + text-align: center; +} +progress { + display: block; + width: 100%; +} +.flex { + display: flex !important; +} +.flex-row { + flex-direction: row; +} +.flex-column { + flex-direction: column; +} +.flex-center { + justify-content: center; +} +.flex-start { + justify-content: flex-start; +} +.flex-around { + justify-content: space-around; +} +.flex-between { + justify-content: space-between; +} +.flex-end { + justify-content: flex-end; +} +.flex-items-center { + align-items: center; +} +.flex-items-baseline { + align-items: baseline; +} +.flex-items-start { + align-items: flex-start; +} +.flex-items-end { + align-items: flex-end; +} +.flex-items-stretch { + align-items: stretch; +} +.flex-wrap { + flex-wrap: wrap; +} +.flex-nowrap { + flex-wrap: nowrap; +} +.flex-1 { + flex: 1; +} +.flex-grow { + flex-grow: 1; +} +.flex-none { + flex: none !important; +} +.flex > * { + min-width: 0; +} +@media (max-width: 768px) { + .flex-column-mobile { + flex-direction: column; + } + .flex-reverse-mobile { + flex-direction: column-reverse; + } + .flex-self-start-mobile { + align-self: flex-start; + } +} +.text-center { + text-align: center; +} +.text-right { + text-align: right; +} +.text-small { + font-size: var(--size-small); +} +.text-medium { + font-size: var(--size-default); +} +.text-medium > label { + font-size: var(--size-default); + text-transform: none; +} +.text-blue { + color: var(--color-blue); +} +.text-red { + color: var(--color-danger); +} +.text-green { + color: var(--color-success); +} +.text-gray { + color: var(--color-secondary); +} +.show-on-small { + display: none; +} +.text-ellipsis { + overflow-x: hidden; + text-overflow: ellipsis; +} +.text-break { + word-break: break-all; +} +.first { + margin-top: 0 !important; +} +.spaced > *:not(:last-child) { + margin-right: var(--space-default); +} +.app { + display: flex; + flex: 1 1 auto; + min-height: 100vh; +} +.appContent { + height: 100vh; +} +@media (max-width: 900px) { + .appContent { + position: absolute; + width: 100%; + } +} +@media (max-width: 768px) { + .spaced > *:not(:last-child) { + margin-right: var(--space-quarter); + } +} +.contentWithGuide { + display: flex; + flex-grow: 1; + flex-direction: row; + overflow: hidden; +} +.container { + display: flex; + flex: 1 1 auto; + flex-direction: column; + position: relative; + width: 100%; +} +.innerContainer { + display: flex; + flex-direction: column; + height: 100%; +} +.scrollableContainer { + overflow: auto; +} +.scrollContainer { + overflow-x: auto; + overflow-y: scroll; +} +.subTitle { + font-size: var(--size-subheader); + font-weight: 400; + line-height: 1; + margin: 0 0 calc(var(--space-half) * 1.5) 0; +} +.title { + font-size: var(--size-title); + font-weight: 400; + line-height: 1; + margin: 0 0 var(--space-half) 0; +} +@media (min-width: 1200px) { + .title { + margin: 0 0 var(--space-default) 0; + } +} +.content { + flex: 1; + margin: 0 auto; + max-width: var(--content-width); + padding: 0 var(--space-default); + width: 100%; +} +.content.narrow { + max-width: var(--content-width-small); +} +.content.larger { + max-width: var(--content-width-larger); +} +.content.padded { + padding-top: var(--space-default); +} +@media (max-width: 768px) { + .content { + padding: 0 var(--space-half); + } +} +.tabs { + width: 100%; + max-width: var(--content-width); + margin: 0 auto; +} +.tabs .tab { + width: 50%; + height: 52px; + border: solid 1px var(--color-gray); + transition: all .2s ease-out; +} +.tabs .tab.active { + border: solid 1px var(--color-blue); +} +.tabs .tab a { + width: 100%; + height: 100%; + padding: var(--space-quarter); + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + text-align: center; + text-decoration: none; + font-size: var(--size-default); + color: var(--color-secondary); + transition: all .2s ease-out; +} +.tabs .tab.active a { + color: var(--color-blue); + background-color: var(--background-secondary); +} +@media (max-width: 768px) { + .tabs .tab a { + font-size: var(--size-small); + } +} +.row:not(:first-child) { + margin-top: var(--space-quarter); +} +.row:not(:first-child).extra { + margin-top: var(--space-half); +} +.isVerticallyCentered { + display: flex; + flex-direction: column; + justify-content: center; +} +.box { + background-color: var(--background-secondary); + padding: var(--space-half); +} +.box > *:first-child { + margin-top: 0; +} +.box.large { + padding: var(--space-default); +} +.box.larger { + padding: var(--space-large); +} +.box.slim { + padding: 0; +} +.box.slim.divide > *:not(:first-child) { + border-top: solid 1px var(--background); +} +.box .buttons { + margin-top: var(--space-default); + width: 100%; +} +.box .buttons.ignore { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; +} +.box .buttons.ignore.reverse { + flex-direction: row-reverse; +} +.box .buttons.ignore > *:not(:first-child) { + margin-left: var(--space-half); + margin-right: 0; +} +.box .buttons.ignore.reverse > *:not(:first-child) { + margin-right: var(--space-half); + margin-left: 0; +} +.box .buttons:not(.ignore) > *:not(:first-child) { + margin-top: var(--space-quarter); +} +.box .buttons:not(.ignore) button, +.box .buttons:not(.ignore) a { + width: 100%; +} +.m-none { + margin: 0 !important; +} +.m-top-none { + margin-top: 0 !important; +} +.m-top-quarter { + margin-top: var(--space-quarter) !important; +} +.m-top-half { + margin-top: var(--space-half) !important; +} +.m-top-default { + margin-top: var(--space-default) !important; +} +.m-top-default-extra { + margin-top: calc(var(--space-default) * 1.5) !important; +} +.m-top-large { + margin-top: var(--space-large) !important; +} +.m-right-tiny { + margin-right: calc(var(--space-quarter) / 2) !important; +} +.m-right-quarter { + margin-right: var(--space-quarter) !important; +} +.m-right-half { + margin-right: var(--space-half) !important; +} +.m-right-default { + margin-right: var(--space-default) !important; +} +.m-bottom-none { + margin-bottom: 0 !important; +} +.m-bottom-quarter { + margin-bottom: var(--space-quarter) !important; +} +.m-bottom-half { + margin-bottom: var(--space-half) !important; +} +.m-bottom-default { + margin-bottom: var(--space-default) !important; +} +.m-bottom-large { + margin-bottom: calc(var(--space-half) * 1.5) !important; +} +.m-bottom-xlarge { + margin-bottom: calc(var(--space-half) * 3) !important; +} +.m-bottom-xxlarge { + margin-bottom: calc(var(--space-half) * 6) !important; +} +.m-left-quarter { + margin-left: var(--space-quarter) !important; +} +.m-left-half { + margin-left: var(--space-half) !important; +} +.m-left-default { + margin-left: var(--space-default) !important; +} +.width-1-1 { + width: 100% !important; +} +.noPadding, +.p-none { + padding: 0 !important; +} +.p-top-none { + padding-top: 0 !important; +} +.p-top-quarter { + padding-top: var(--space-quarter) !important; +} +.p-top-half { + padding-top: var(--space-half) !important; +} +.p-top-default { + padding-top: var(--space-default) !important; +} +.p-top-default-extra { + padding-top: calc(var(--space-default) * 1.5) !important; +} +.p-top-large { + padding-top: var(--space-large) !important; +} +.p-right-none { + padding-right: 0 !important; +} +.p-right-quarter { + padding-right: var(--space-quarter) !important; +} +.p-right-half { + padding-right: var(--space-half) !important; +} +.p-right-default { + padding-right: var(--space-default) !important; +} +.p-bottom-none { + padding-bottom: 0 !important; +} +.p-bottom-quarter { + padding-bottom: var(--space-quarter) !important; +} +.p-bottom-half { + padding-bottom: var(--space-half) !important; +} +.p-bottom-default { + padding-bottom: var(--space-default) !important; +} +.p-bottom-large { + padding-bottom: calc(var(--space-half) * 1.5) !important; +} +.p-left-none { + padding-left: 0 !important; +} +.p-left-quarter { + padding-left: var(--space-quarter) !important; +} +.p-left-half { + padding-left: var(--space-half) !important; +} +.p-left-default { + padding-left: var(--space-default) !important; +} +.wrapped { + margin-top: calc(var(--spacing-half) * -1); +} +.wrapped > * { + margin-top: var(--spacing-half); +} +.items { + flex-shrink: 0; + position: relative; + margin: calc(var(--space-quarter) * -1); +} +.items.marginBottom { + margin-bottom: var(--space-half); +} +.buttons-end { + text-align: right; +} +.items > * { + display: inline-block; + margin: var(--space-quarter); +} +.stacked { + position: relative; +} +.stacked img { + transition: opacity .2s ease; +} +.stacked img:last-child { + opacity: 0; + position: absolute; + top: 0; + left: 50%; + transform: translate(-50%); +} +.transparent { + display: none; +} +@media (max-width: 768px) { + .row:not(:first-child) { + margin-top: var(--space-quarter); + } + .box.large { + padding: var(--space-half); + } + .box.larger { + padding: var(--space-default); + } + .m-top-quarter-on-small { + margin-top: var(--space-quarter); + } + .full-width-on-small { + width: 100%; + } + .hide-on-small { + display: none; + } + .show-on-small { + display: initial; + } +} +.light-mode .show-in-darkmode, +.dark-mode .show-in-lightmode { + display: none; +} +.columnsContainer { + width: 100%; +} +.columns { + display: block; + margin-right: calc(var(--space-default) * -1); +} +.columnsContainer.half .columns { + margin-right: calc(var(--space-half) * -1); +} +.columns > * { + margin-right: var(--space-default); + margin-bottom: var(--space-default); + display: inline-block; + vertical-align: top; +} +.columnsContainer.half .columns > * { + margin-right: var(--space-half); + margin-bottom: var(--space-half); +} +.columns.quarter > * { + margin-bottom: var(--space-quarter) !important; +} +.columnsContainer .columns .column { + width: calc(100% - var(--space-default)); +} +.columnsContainer.half .columns .column { + width: calc(100% - var(--space-half)); +} +.columnsContainer .columns .column.column-1-2 { + width: calc((100% - (var(--space-default) * 2)) / 2); +} +.columnsContainer.half .columns .column.column-1-2 { + width: calc((100% - (var(--space-half) * 2)) / 2); +} +.columnsContainer .columns .column.column-1-3 { + width: calc((100% - (var(--space-default) * 3)) / 3); +} +.columnsContainer.half .columns .column.column-1-3 { + width: calc((100% - (var(--space-half) * 3)) / 3); +} +.columns .column.column-2-3 { + width: calc((100% - (var(--space-half) * 3)) / 1.5); +} +.column > *:first-child { + margin-top: 0; +} +.column > *:last-child { + margin-bottom: 0; +} +@media (max-width: 768px) { + .columnsContainer { + margin-right: calc(var(--space-half) * -1); + } + .columnsContainer > * { + margin-right: var(--space-half); + } + .columns { + margin-right: calc(var(--space-half) * -1); + } + .columns > * { + margin-right: var(--space-half); + margin-bottom: calc(var(--space-half) * 1.5); + } + .columnsContainer.half .columns > * { + margin-bottom: var(--space-quarter); + } + .columns .column { + width: calc(100% - (var(--space-half))) !important; + } + .columns .column-1-2 { + width: calc((100% - (var(--space-half) * 2)) / 2); + } + .columns .column.column-1-3 { + width: calc((100% - (var(--space-half) * 3)) / 3); + } +} +button, +input[type=checkbox], +input[type=radio] { + -webkit-user-select: none; + user-select: none; +} +input[type=number], +input[type=password], +input[type=text], +textarea { + color: var(--color-default); + background: var(--background-secondary); +} +label, +dt { + color: var(--color-secondary); + display: block; + font-size: var(--size-default); + font-weight: 400; + line-height: 1; + margin-bottom: var(--space-quarter); +} +.labelXLarge { + font-size: var(--size-subheader); + margin-bottom: calc(var(--space-half) * 1.5); + color: var(--color-default); +} +input:invalid, +input:invalid:focus { + border-color: var(--color-error); +} +input::-webkit-credentials-auto-fill-button { + visibility: hidden; + display: none !important; + pointer-events: none; + position: absolute; + right: 0; +} +a[tabindex="0"]:focus, +button:focus, +input:focus, +select:focus, +input[type=checkbox]:focus + label:before { + outline-color: var(--color-blue); + outline-offset: -2px; + outline-style: auto; + outline-width: 4px; +} +@media (max-width: 768px) { + .labelXLarge { + margin-bottom: var(--space-half); + } +} +.checked-circle { + stroke-dasharray: 166; + stroke-dashoffset: 166; + stroke-width: 1; + stroke-miterlimit: 10; + stroke: #7aba7a; + fill: none; + animation: stroke .6s cubic-bezier(.65, 0, .45, 1) forwards; +} +.checked { + border-radius: 50%; + stroke: #fff; + stroke-miterlimit: 10; + stroke-width: 1 !important; + box-shadow: inset 0 0 #7aba7a; + animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both; +} +.checked-check { + transform-origin: 50% 50%; + stroke-dasharray: 48; + stroke-dashoffset: 48; + animation: stroke .3s cubic-bezier(.65, 0, .45, 1) .8s forwards; + stroke: #7aba7a; +} +@keyframes stroke { + to { + stroke-dashoffset: 0; + } +} +@keyframes scale { + 0%, to { + transform: none; + } + 50% { + transform: scale3d(1.02, 1.02, 1); + } +} +.caretDown { + animation: fadeinout 3s cubic-bezier(.45, .05, .55, .95) infinite; + stroke-width: 1 !important; + max-width: 26px; +} +.dark-mode .caretDown { + fill: #fff; +} +@keyframes fadeinout { + 0%, to { + opacity: 1; + } + 50% { + opacity: .1; + } +} diff --git a/frontends/web/build/assets/index.es.js b/frontends/web/build/assets/index.es.js new file mode 100644 index 0000000000..ffc4ea1537 --- /dev/null +++ b/frontends/web/build/assets/index.es.js @@ -0,0 +1,4678 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 }); +import { g as getDefaultExportFromCjs, a as getAugmentedNamespace, E as require$$0$1, b as cjs$3, I as binary, M as wipe, O as random, P as fromString, R as toString, S as concat, c as commonjsGlobal, N as N$1, T as rt$1, V as ot$1, Z as kn, $ as Vn, a0 as Mn, K as Kn, a1 as Te, a2 as qn, a3 as xn, a4 as Hn, a5 as Fn, a6 as ee$1, a7 as $$1, L as Ln, a8 as vt$1, U, a9 as Et$1, aa as ut$1, ab as k$1, ac as Jn, ad as er$1, ae as Xn, af as nr$1, w as w$2, ag as Vt$1, ah as Mt$1, _ as _$1, p as pt$1, ai as It$1, aj as wt$1, d as at$1, y as yt$1, m as mt$1, H as Ht, k as kt$1, n as h$3, C as ft$1, ak as lt$1, al as dt$1, am as C, D as D$2, an as te$1, ao as p$1 } from "./index.js"; +var events = { exports: {} }, R$1 = typeof Reflect == "object" ? Reflect : null, ReflectApply = R$1 && typeof R$1.apply == "function" ? R$1.apply : /* @__PURE__ */ __name(function(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); +}, "ReflectApply"), ReflectOwnKeys; +R$1 && typeof R$1.ownKeys == "function" ? ReflectOwnKeys = R$1.ownKeys : Object.getOwnPropertySymbols ? ReflectOwnKeys = /* @__PURE__ */ __name(function(target) { + return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); +}, "ReflectOwnKeys") : ReflectOwnKeys = /* @__PURE__ */ __name(function(target) { + return Object.getOwnPropertyNames(target); +}, "ReflectOwnKeys"); +function ProcessEmitWarning(warning) { + console && console.warn && console.warn(warning); +} +__name(ProcessEmitWarning, "ProcessEmitWarning"); +var NumberIsNaN = Number.isNaN || /* @__PURE__ */ __name(function(value) { + return value !== value; +}, "NumberIsNaN"); +function EventEmitter() { + EventEmitter.init.call(this); +} +__name(EventEmitter, "EventEmitter"); +events.exports = EventEmitter; +events.exports.once = once2; +EventEmitter.EventEmitter = EventEmitter; +EventEmitter.prototype._events = void 0; +EventEmitter.prototype._eventsCount = 0; +EventEmitter.prototype._maxListeners = void 0; +var defaultMaxListeners = 10; +function checkListener(listener) { + if (typeof listener != "function") + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); +} +__name(checkListener, "checkListener"); +Object.defineProperty(EventEmitter, "defaultMaxListeners", { + enumerable: !0, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg != "number" || arg < 0 || NumberIsNaN(arg)) + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + "."); + defaultMaxListeners = arg; + } +}); +EventEmitter.init = function() { + (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; +}; +EventEmitter.prototype.setMaxListeners = /* @__PURE__ */ __name(function(n2) { + if (typeof n2 != "number" || n2 < 0 || NumberIsNaN(n2)) + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + "."); + return this._maxListeners = n2, this; +}, "setMaxListeners"); +function _getMaxListeners(that) { + return that._maxListeners === void 0 ? EventEmitter.defaultMaxListeners : that._maxListeners; +} +__name(_getMaxListeners, "_getMaxListeners"); +EventEmitter.prototype.getMaxListeners = /* @__PURE__ */ __name(function() { + return _getMaxListeners(this); +}, "getMaxListeners"); +EventEmitter.prototype.emit = /* @__PURE__ */ __name(function(type) { + for (var args = [], i = 1; i < arguments.length; i++) + args.push(arguments[i]); + var doError = type === "error", events2 = this._events; + if (events2 !== void 0) + doError = doError && events2.error === void 0; + else if (!doError) + return !1; + if (doError) { + var er2; + if (args.length > 0 && (er2 = args[0]), er2 instanceof Error) + throw er2; + var err = new Error("Unhandled error." + (er2 ? " (" + er2.message + ")" : "")); + throw err.context = er2, err; + } + var handler = events2[type]; + if (handler === void 0) + return !1; + if (typeof handler == "function") + ReflectApply(handler, this, args); + else + for (var len = handler.length, listeners2 = arrayClone(handler, len), i = 0; i < len; ++i) + ReflectApply(listeners2[i], this, args); + return !0; +}, "emit"); +function _addListener(target, type, listener, prepend) { + var m, events2, existing; + if (checkListener(listener), events2 = target._events, events2 === void 0 ? (events2 = target._events = /* @__PURE__ */ Object.create(null), target._eventsCount = 0) : (events2.newListener !== void 0 && (target.emit( + "newListener", + type, + listener.listener ? listener.listener : listener + ), events2 = target._events), existing = events2[type]), existing === void 0) + existing = events2[type] = listener, ++target._eventsCount; + else if (typeof existing == "function" ? existing = events2[type] = prepend ? [listener, existing] : [existing, listener] : prepend ? existing.unshift(listener) : existing.push(listener), m = _getMaxListeners(target), m > 0 && existing.length > m && !existing.warned) { + existing.warned = !0; + var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit"); + w2.name = "MaxListenersExceededWarning", w2.emitter = target, w2.type = type, w2.count = existing.length, ProcessEmitWarning(w2); + } + return target; +} +__name(_addListener, "_addListener"); +EventEmitter.prototype.addListener = /* @__PURE__ */ __name(function(type, listener) { + return _addListener(this, type, listener, !1); +}, "addListener"); +EventEmitter.prototype.on = EventEmitter.prototype.addListener; +EventEmitter.prototype.prependListener = /* @__PURE__ */ __name(function(type, listener) { + return _addListener(this, type, listener, !0); +}, "prependListener"); +function onceWrapper() { + if (!this.fired) + return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); +} +__name(onceWrapper, "onceWrapper"); +function _onceWrap(target, type, listener) { + var state = { fired: !1, wrapFn: void 0, target, type, listener }, wrapped = onceWrapper.bind(state); + return wrapped.listener = listener, state.wrapFn = wrapped, wrapped; +} +__name(_onceWrap, "_onceWrap"); +EventEmitter.prototype.once = /* @__PURE__ */ __name(function(type, listener) { + return checkListener(listener), this.on(type, _onceWrap(this, type, listener)), this; +}, "once"); +EventEmitter.prototype.prependOnceListener = /* @__PURE__ */ __name(function(type, listener) { + return checkListener(listener), this.prependListener(type, _onceWrap(this, type, listener)), this; +}, "prependOnceListener"); +EventEmitter.prototype.removeListener = /* @__PURE__ */ __name(function(type, listener) { + var list, events2, position, i, originalListener; + if (checkListener(listener), events2 = this._events, events2 === void 0) + return this; + if (list = events2[type], list === void 0) + return this; + if (list === listener || list.listener === listener) + --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete events2[type], events2.removeListener && this.emit("removeListener", type, list.listener || listener)); + else if (typeof list != "function") { + for (position = -1, i = list.length - 1; i >= 0; i--) + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener, position = i; + break; + } + if (position < 0) + return this; + position === 0 ? list.shift() : spliceOne(list, position), list.length === 1 && (events2[type] = list[0]), events2.removeListener !== void 0 && this.emit("removeListener", type, originalListener || listener); + } + return this; +}, "removeListener"); +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.removeAllListeners = /* @__PURE__ */ __name(function(type) { + var listeners2, events2, i; + if (events2 = this._events, events2 === void 0) + return this; + if (events2.removeListener === void 0) + return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : events2[type] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete events2[type]), this; + if (arguments.length === 0) { + var keys2 = Object.keys(events2), key; + for (i = 0; i < keys2.length; ++i) + key = keys2[i], key !== "removeListener" && this.removeAllListeners(key); + return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this; + } + if (listeners2 = events2[type], typeof listeners2 == "function") + this.removeListener(type, listeners2); + else if (listeners2 !== void 0) + for (i = listeners2.length - 1; i >= 0; i--) + this.removeListener(type, listeners2[i]); + return this; +}, "removeAllListeners"); +function _listeners(target, type, unwrap) { + var events2 = target._events; + if (events2 === void 0) + return []; + var evlistener = events2[type]; + return evlistener === void 0 ? [] : typeof evlistener == "function" ? unwrap ? [evlistener.listener || evlistener] : [evlistener] : unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} +__name(_listeners, "_listeners"); +EventEmitter.prototype.listeners = /* @__PURE__ */ __name(function(type) { + return _listeners(this, type, !0); +}, "listeners"); +EventEmitter.prototype.rawListeners = /* @__PURE__ */ __name(function(type) { + return _listeners(this, type, !1); +}, "rawListeners"); +EventEmitter.listenerCount = function(emitter, type) { + return typeof emitter.listenerCount == "function" ? emitter.listenerCount(type) : listenerCount.call(emitter, type); +}; +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events2 = this._events; + if (events2 !== void 0) { + var evlistener = events2[type]; + if (typeof evlistener == "function") + return 1; + if (evlistener !== void 0) + return evlistener.length; + } + return 0; +} +__name(listenerCount, "listenerCount"); +EventEmitter.prototype.eventNames = /* @__PURE__ */ __name(function() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}, "eventNames"); +function arrayClone(arr, n2) { + for (var copy = new Array(n2), i = 0; i < n2; ++i) + copy[i] = arr[i]; + return copy; +} +__name(arrayClone, "arrayClone"); +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} +__name(spliceOne, "spliceOne"); +function unwrapListeners(arr) { + for (var ret = new Array(arr.length), i = 0; i < ret.length; ++i) + ret[i] = arr[i].listener || arr[i]; + return ret; +} +__name(unwrapListeners, "unwrapListeners"); +function once2(emitter, name) { + return new Promise(function(resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver), reject(err); + } + __name(errorListener, "errorListener"); + function resolver() { + typeof emitter.removeListener == "function" && emitter.removeListener("error", errorListener), resolve([].slice.call(arguments)); + } + __name(resolver, "resolver"), eventTargetAgnosticAddListener(emitter, name, resolver, { once: !0 }), name !== "error" && addErrorHandlerIfEventEmitter(emitter, errorListener, { once: !0 }); + }); +} +__name(once2, "once"); +function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + typeof emitter.on == "function" && eventTargetAgnosticAddListener(emitter, "error", handler, flags); +} +__name(addErrorHandlerIfEventEmitter, "addErrorHandlerIfEventEmitter"); +function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on == "function") + flags.once ? emitter.once(name, listener) : emitter.on(name, listener); + else if (typeof emitter.addEventListener == "function") + emitter.addEventListener(name, /* @__PURE__ */ __name(function wrapListener(arg) { + flags.once && emitter.removeEventListener(name, wrapListener), listener(arg); + }, "wrapListener")); + else + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); +} +__name(eventTargetAgnosticAddListener, "eventTargetAgnosticAddListener"); +var eventsExports = events.exports; +const Ye$1 = /* @__PURE__ */ getDefaultExportFromCjs(eventsExports), suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/; +function jsonParseTransform(key, value) { + if (key === "__proto__" || key === "constructor" && value && typeof value == "object" && "prototype" in value) { + warnKeyDropped(key); + return; + } + return value; +} +__name(jsonParseTransform, "jsonParseTransform"); +function warnKeyDropped(key) { + console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`); +} +__name(warnKeyDropped, "warnKeyDropped"); +function destr(value, options = {}) { + if (typeof value != "string") + return value; + const _value = value.trim(); + if ( + // eslint-disable-next-line unicorn/prefer-at + value[0] === '"' && value.at(-1) === '"' && !value.includes("\\") + ) + return _value.slice(1, -1); + if (_value.length <= 9) { + const _lval = _value.toLowerCase(); + if (_lval === "true") + return !0; + if (_lval === "false") + return !1; + if (_lval === "undefined") + return; + if (_lval === "null") + return null; + if (_lval === "nan") + return Number.NaN; + if (_lval === "infinity") + return Number.POSITIVE_INFINITY; + if (_lval === "-infinity") + return Number.NEGATIVE_INFINITY; + } + if (!JsonSigRx.test(value)) { + if (options.strict) + throw new SyntaxError("[destr] Invalid JSON"); + return value; + } + try { + if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) { + if (options.strict) + throw new Error("[destr] Possible prototype pollution"); + return JSON.parse(value, jsonParseTransform); + } + return JSON.parse(value); + } catch (error) { + if (options.strict) + throw error; + return value; + } +} +__name(destr, "destr"); +function wrapToPromise(value) { + return !value || typeof value.then != "function" ? Promise.resolve(value) : value; +} +__name(wrapToPromise, "wrapToPromise"); +function asyncCall(function_, ...arguments_) { + try { + return wrapToPromise(function_(...arguments_)); + } catch (error) { + return Promise.reject(error); + } +} +__name(asyncCall, "asyncCall"); +function isPrimitive(value) { + const type = typeof value; + return value === null || type !== "object" && type !== "function"; +} +__name(isPrimitive, "isPrimitive"); +function isPureObject(value) { + const proto = Object.getPrototypeOf(value); + return !proto || proto.isPrototypeOf(Object); +} +__name(isPureObject, "isPureObject"); +function stringify(value) { + if (isPrimitive(value)) + return String(value); + if (isPureObject(value) || Array.isArray(value)) + return JSON.stringify(value); + if (typeof value.toJSON == "function") + return stringify(value.toJSON()); + throw new Error("[unstorage] Cannot stringify value!"); +} +__name(stringify, "stringify"); +function checkBufferSupport() { + if (typeof Buffer === void 0) + throw new TypeError("[unstorage] Buffer is not supported!"); +} +__name(checkBufferSupport, "checkBufferSupport"); +const BASE64_PREFIX = "base64:"; +function serializeRaw(value) { + if (typeof value == "string") + return value; + checkBufferSupport(); + const base64 = Buffer.from(value).toString("base64"); + return BASE64_PREFIX + base64; +} +__name(serializeRaw, "serializeRaw"); +function deserializeRaw(value) { + return typeof value != "string" || !value.startsWith(BASE64_PREFIX) ? value : (checkBufferSupport(), Buffer.from(value.slice(BASE64_PREFIX.length), "base64")); +} +__name(deserializeRaw, "deserializeRaw"); +function normalizeKey(key) { + return key ? key.split("?")[0].replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "") : ""; +} +__name(normalizeKey, "normalizeKey"); +function joinKeys(...keys2) { + return normalizeKey(keys2.join(":")); +} +__name(joinKeys, "joinKeys"); +function normalizeBaseKey(base) { + return base = normalizeKey(base), base ? base + ":" : ""; +} +__name(normalizeBaseKey, "normalizeBaseKey"); +const DRIVER_NAME = "memory", memory = () => { + const data = /* @__PURE__ */ new Map(); + return { + name: DRIVER_NAME, + options: {}, + hasItem(key) { + return data.has(key); + }, + getItem(key) { + return data.get(key) ?? null; + }, + getItemRaw(key) { + return data.get(key) ?? null; + }, + setItem(key, value) { + data.set(key, value); + }, + setItemRaw(key, value) { + data.set(key, value); + }, + removeItem(key) { + data.delete(key); + }, + getKeys() { + return Array.from(data.keys()); + }, + clear() { + data.clear(); + }, + dispose() { + data.clear(); + } + }; +}; +function createStorage(options = {}) { + const context = { + mounts: { "": options.driver || memory() }, + mountpoints: [""], + watching: !1, + watchListeners: [], + unwatch: {} + }, getMount = /* @__PURE__ */ __name((key) => { + for (const base of context.mountpoints) + if (key.startsWith(base)) + return { + base, + relativeKey: key.slice(base.length), + driver: context.mounts[base] + }; + return { + base: "", + relativeKey: key, + driver: context.mounts[""] + }; + }, "getMount"), getMounts = /* @__PURE__ */ __name((base, includeParent) => context.mountpoints.filter( + (mountpoint) => mountpoint.startsWith(base) || includeParent && base.startsWith(mountpoint) + ).map((mountpoint) => ({ + relativeBase: base.length > mountpoint.length ? base.slice(mountpoint.length) : void 0, + mountpoint, + driver: context.mounts[mountpoint] + })), "getMounts"), onChange = /* @__PURE__ */ __name((event, key) => { + if (context.watching) { + key = normalizeKey(key); + for (const listener of context.watchListeners) + listener(event, key); + } + }, "onChange"), startWatch = /* @__PURE__ */ __name(async () => { + if (!context.watching) { + context.watching = !0; + for (const mountpoint in context.mounts) + context.unwatch[mountpoint] = await watch( + context.mounts[mountpoint], + onChange, + mountpoint + ); + } + }, "startWatch"), stopWatch = /* @__PURE__ */ __name(async () => { + if (context.watching) { + for (const mountpoint in context.unwatch) + await context.unwatch[mountpoint](); + context.unwatch = {}, context.watching = !1; + } + }, "stopWatch"), runBatch = /* @__PURE__ */ __name((items, commonOptions, cb) => { + const batches = /* @__PURE__ */ new Map(), getBatch = /* @__PURE__ */ __name((mount) => { + let batch = batches.get(mount.base); + return batch || (batch = { + driver: mount.driver, + base: mount.base, + items: [] + }, batches.set(mount.base, batch)), batch; + }, "getBatch"); + for (const item of items) { + const isStringItem = typeof item == "string", key = normalizeKey(isStringItem ? item : item.key), value = isStringItem ? void 0 : item.value, options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options }, mount = getMount(key); + getBatch(mount).items.push({ + key, + value, + relativeKey: mount.relativeKey, + options: options2 + }); + } + return Promise.all([...batches.values()].map((batch) => cb(batch))).then( + (r) => r.flat() + ); + }, "runBatch"), storage = { + // Item + hasItem(key, opts = {}) { + key = normalizeKey(key); + const { relativeKey, driver } = getMount(key); + return asyncCall(driver.hasItem, relativeKey, opts); + }, + getItem(key, opts = {}) { + key = normalizeKey(key); + const { relativeKey, driver } = getMount(key); + return asyncCall(driver.getItem, relativeKey, opts).then( + (value) => destr(value) + ); + }, + getItems(items, commonOptions) { + return runBatch(items, commonOptions, (batch) => batch.driver.getItems ? asyncCall( + batch.driver.getItems, + batch.items.map((item) => ({ + key: item.relativeKey, + options: item.options + })), + commonOptions + ).then( + (r) => r.map((item) => ({ + key: joinKeys(batch.base, item.key), + value: destr(item.value) + })) + ) : Promise.all( + batch.items.map((item) => asyncCall( + batch.driver.getItem, + item.relativeKey, + item.options + ).then((value) => ({ + key: item.key, + value: destr(value) + }))) + )); + }, + getItemRaw(key, opts = {}) { + key = normalizeKey(key); + const { relativeKey, driver } = getMount(key); + return driver.getItemRaw ? asyncCall(driver.getItemRaw, relativeKey, opts) : asyncCall(driver.getItem, relativeKey, opts).then( + (value) => deserializeRaw(value) + ); + }, + async setItem(key, value, opts = {}) { + if (value === void 0) + return storage.removeItem(key); + key = normalizeKey(key); + const { relativeKey, driver } = getMount(key); + driver.setItem && (await asyncCall(driver.setItem, relativeKey, stringify(value), opts), driver.watch || onChange("update", key)); + }, + async setItems(items, commonOptions) { + await runBatch(items, commonOptions, async (batch) => { + batch.driver.setItems && await asyncCall( + batch.driver.setItems, + batch.items.map((item) => ({ + key: item.relativeKey, + value: stringify(item.value), + options: item.options + })), + commonOptions + ), batch.driver.setItem && await Promise.all( + batch.items.map((item) => asyncCall( + batch.driver.setItem, + item.relativeKey, + stringify(item.value), + item.options + )) + ); + }); + }, + async setItemRaw(key, value, opts = {}) { + if (value === void 0) + return storage.removeItem(key, opts); + key = normalizeKey(key); + const { relativeKey, driver } = getMount(key); + if (driver.setItemRaw) + await asyncCall(driver.setItemRaw, relativeKey, value, opts); + else if (driver.setItem) + await asyncCall(driver.setItem, relativeKey, serializeRaw(value), opts); + else + return; + driver.watch || onChange("update", key); + }, + async removeItem(key, opts = {}) { + typeof opts == "boolean" && (opts = { removeMeta: opts }), key = normalizeKey(key); + const { relativeKey, driver } = getMount(key); + driver.removeItem && (await asyncCall(driver.removeItem, relativeKey, opts), (opts.removeMeta || opts.removeMata) && await asyncCall(driver.removeItem, relativeKey + "$", opts), driver.watch || onChange("remove", key)); + }, + // Meta + async getMeta(key, opts = {}) { + typeof opts == "boolean" && (opts = { nativeOnly: opts }), key = normalizeKey(key); + const { relativeKey, driver } = getMount(key), meta = /* @__PURE__ */ Object.create(null); + if (driver.getMeta && Object.assign(meta, await asyncCall(driver.getMeta, relativeKey, opts)), !opts.nativeOnly) { + const value = await asyncCall( + driver.getItem, + relativeKey + "$", + opts + ).then((value_) => destr(value_)); + value && typeof value == "object" && (typeof value.atime == "string" && (value.atime = new Date(value.atime)), typeof value.mtime == "string" && (value.mtime = new Date(value.mtime)), Object.assign(meta, value)); + } + return meta; + }, + setMeta(key, value, opts = {}) { + return this.setItem(key + "$", value, opts); + }, + removeMeta(key, opts = {}) { + return this.removeItem(key + "$", opts); + }, + // Keys + async getKeys(base, opts = {}) { + base = normalizeBaseKey(base); + const mounts = getMounts(base, !0); + let maskedMounts = []; + const allKeys = []; + for (const mount of mounts) { + const keys2 = (await asyncCall( + mount.driver.getKeys, + mount.relativeBase, + opts + )).map((key) => mount.mountpoint + normalizeKey(key)).filter((key) => !maskedMounts.some((p2) => key.startsWith(p2))); + allKeys.push(...keys2), maskedMounts = [ + mount.mountpoint, + ...maskedMounts.filter((p2) => !p2.startsWith(mount.mountpoint)) + ]; + } + return base ? allKeys.filter((key) => key.startsWith(base) && !key.endsWith("$")) : allKeys.filter((key) => !key.endsWith("$")); + }, + // Utils + async clear(base, opts = {}) { + base = normalizeBaseKey(base), await Promise.all( + getMounts(base, !1).map(async (m) => { + if (m.driver.clear) + return asyncCall(m.driver.clear, m.relativeBase, opts); + if (m.driver.removeItem) { + const keys2 = await m.driver.getKeys(m.relativeBase || "", opts); + return Promise.all( + keys2.map((key) => m.driver.removeItem(key, opts)) + ); + } + }) + ); + }, + async dispose() { + await Promise.all( + Object.values(context.mounts).map((driver) => dispose(driver)) + ); + }, + async watch(callback) { + return await startWatch(), context.watchListeners.push(callback), async () => { + context.watchListeners = context.watchListeners.filter( + (listener) => listener !== callback + ), context.watchListeners.length === 0 && await stopWatch(); + }; + }, + async unwatch() { + context.watchListeners = [], await stopWatch(); + }, + // Mount + mount(base, driver) { + if (base = normalizeBaseKey(base), base && context.mounts[base]) + throw new Error(`already mounted at ${base}`); + return base && (context.mountpoints.push(base), context.mountpoints.sort((a2, b2) => b2.length - a2.length)), context.mounts[base] = driver, context.watching && Promise.resolve(watch(driver, onChange, base)).then((unwatcher) => { + context.unwatch[base] = unwatcher; + }).catch(console.error), storage; + }, + async unmount(base, _dispose = !0) { + base = normalizeBaseKey(base), !(!base || !context.mounts[base]) && (context.watching && base in context.unwatch && (context.unwatch[base](), delete context.unwatch[base]), _dispose && await dispose(context.mounts[base]), context.mountpoints = context.mountpoints.filter((key) => key !== base), delete context.mounts[base]); + }, + getMount(key = "") { + key = normalizeKey(key) + ":"; + const m = getMount(key); + return { + driver: m.driver, + base: m.base + }; + }, + getMounts(base = "", opts = {}) { + return base = normalizeKey(base), getMounts(base, opts.parents).map((m) => ({ + driver: m.driver, + base: m.mountpoint + })); + } + }; + return storage; +} +__name(createStorage, "createStorage"); +function watch(driver, onChange, base) { + return driver.watch ? driver.watch((event, key) => onChange(event, base + key)) : () => { + }; +} +__name(watch, "watch"); +async function dispose(driver) { + typeof driver.dispose == "function" && await asyncCall(driver.dispose); +} +__name(dispose, "dispose"); +function promisifyRequest(request) { + return new Promise((resolve, reject) => { + request.oncomplete = request.onsuccess = () => resolve(request.result), request.onabort = request.onerror = () => reject(request.error); + }); +} +__name(promisifyRequest, "promisifyRequest"); +function createStore(dbName, storeName) { + const request = indexedDB.open(dbName); + request.onupgradeneeded = () => request.result.createObjectStore(storeName); + const dbp = promisifyRequest(request); + return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName))); +} +__name(createStore, "createStore"); +let defaultGetStoreFunc; +function defaultGetStore() { + return defaultGetStoreFunc || (defaultGetStoreFunc = createStore("keyval-store", "keyval")), defaultGetStoreFunc; +} +__name(defaultGetStore, "defaultGetStore"); +function get(key, customStore = defaultGetStore()) { + return customStore("readonly", (store) => promisifyRequest(store.get(key))); +} +__name(get, "get"); +function set(key, value, customStore = defaultGetStore()) { + return customStore("readwrite", (store) => (store.put(value, key), promisifyRequest(store.transaction))); +} +__name(set, "set"); +function del(key, customStore = defaultGetStore()) { + return customStore("readwrite", (store) => (store.delete(key), promisifyRequest(store.transaction))); +} +__name(del, "del"); +function clear(customStore = defaultGetStore()) { + return customStore("readwrite", (store) => (store.clear(), promisifyRequest(store.transaction))); +} +__name(clear, "clear"); +function eachCursor(store, callback) { + return store.openCursor().onsuccess = function() { + this.result && (callback(this.result), this.result.continue()); + }, promisifyRequest(store.transaction); +} +__name(eachCursor, "eachCursor"); +function keys(customStore = defaultGetStore()) { + return customStore("readonly", (store) => { + if (store.getAllKeys) + return promisifyRequest(store.getAllKeys()); + const items = []; + return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items); + }); +} +__name(keys, "keys"); +const JSONStringify = /* @__PURE__ */ __name((data) => JSON.stringify(data, (_2, value) => typeof value == "bigint" ? value.toString() + "n" : value), "JSONStringify"), JSONParse = /* @__PURE__ */ __name((json) => { + const numbersBiggerThanMaxInt = /([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g, serializedData = json.replace(numbersBiggerThanMaxInt, '$1"$2n"$3'); + return JSON.parse(serializedData, (_2, value) => typeof value == "string" && value.match(/^\d+n$/) ? BigInt(value.substring(0, value.length - 1)) : value); +}, "JSONParse"); +function safeJsonParse(value) { + if (typeof value != "string") + throw new Error(`Cannot safe json parse value of type ${typeof value}`); + try { + return JSONParse(value); + } catch { + return value; + } +} +__name(safeJsonParse, "safeJsonParse"); +function safeJsonStringify(value) { + return typeof value == "string" ? value : JSONStringify(value) || ""; +} +__name(safeJsonStringify, "safeJsonStringify"); +const x = "idb-keyval"; +var z = /* @__PURE__ */ __name((i = {}) => { + const t = i.base && i.base.length > 0 ? `${i.base}:` : "", e = /* @__PURE__ */ __name((s) => t + s, "e"); + let n2; + return i.dbName && i.storeName && (n2 = createStore(i.dbName, i.storeName)), { name: x, options: i, async hasItem(s) { + return !(typeof await get(e(s), n2) > "u"); + }, async getItem(s) { + return await get(e(s), n2) ?? null; + }, setItem(s, a2) { + return set(e(s), a2, n2); + }, removeItem(s) { + return del(e(s), n2); + }, getKeys() { + return keys(n2); + }, clear() { + return clear(n2); + } }; +}, "z"); +const D$1 = "WALLET_CONNECT_V2_INDEXED_DB", E$1 = "keyvaluestorage", __ = class __ { + constructor() { + this.indexedDb = createStorage({ driver: z({ dbName: D$1, storeName: E$1 }) }); + } + async getKeys() { + return this.indexedDb.getKeys(); + } + async getEntries() { + return (await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((t) => [t.key, t.value]); + } + async getItem(t) { + const e = await this.indexedDb.getItem(t); + if (e !== null) + return e; + } + async setItem(t, e) { + await this.indexedDb.setItem(t, safeJsonStringify(e)); + } + async removeItem(t) { + await this.indexedDb.removeItem(t); + } +}; +__name(__, "_"); +let _ = __; +var l = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, c = { exports: {} }; +(function() { + let i; + function t() { + } + __name(t, "t"), i = t, i.prototype.getItem = function(e) { + return this.hasOwnProperty(e) ? String(this[e]) : null; + }, i.prototype.setItem = function(e, n2) { + this[e] = String(n2); + }, i.prototype.removeItem = function(e) { + delete this[e]; + }, i.prototype.clear = function() { + const e = this; + Object.keys(e).forEach(function(n2) { + e[n2] = void 0, delete e[n2]; + }); + }, i.prototype.key = function(e) { + return e = e || 0, Object.keys(this)[e]; + }, i.prototype.__defineGetter__("length", function() { + return Object.keys(this).length; + }), typeof l < "u" && l.localStorage ? c.exports = l.localStorage : typeof window < "u" && window.localStorage ? c.exports = window.localStorage : c.exports = new t(); +})(); +function k(i) { + var t; + return [i[0], safeJsonParse((t = i[1]) != null ? t : "")]; +} +__name(k, "k"); +const _K = class _K { + constructor() { + this.localStorage = c.exports; + } + async getKeys() { + return Object.keys(this.localStorage); + } + async getEntries() { + return Object.entries(this.localStorage).map(k); + } + async getItem(t) { + const e = this.localStorage.getItem(t); + if (e !== null) + return safeJsonParse(e); + } + async setItem(t, e) { + this.localStorage.setItem(t, safeJsonStringify(e)); + } + async removeItem(t) { + this.localStorage.removeItem(t); + } +}; +__name(_K, "K"); +let K = _K; +const N = "wc_storage_version", y$1 = 1, O$1 = /* @__PURE__ */ __name(async (i, t, e) => { + const n2 = N, s = await t.getItem(n2); + if (s && s >= y$1) { + e(t); + return; + } + const a2 = await i.getKeys(); + if (!a2.length) { + e(t); + return; + } + const m = []; + for (; a2.length; ) { + const r = a2.shift(); + if (!r) + continue; + const o = r.toLowerCase(); + if (o.includes("wc@") || o.includes("walletconnect") || o.includes("wc_") || o.includes("wallet_connect")) { + const f2 = await i.getItem(r); + await t.setItem(r, f2), m.push(r); + } + } + await t.setItem(n2, y$1), e(t), j(i, m); +}, "O$1"), j = /* @__PURE__ */ __name(async (i, t) => { + t.length && t.forEach(async (e) => { + await i.removeItem(e); + }); +}, "j"); +var _a; +let h$2 = (_a = class { + constructor() { + this.initialized = !1, this.setInitialized = (e) => { + this.storage = e, this.initialized = !0; + }; + const t = new K(); + this.storage = t; + try { + const e = new _(); + O$1(t, e, this.setInitialized); + } catch { + this.initialized = !0; + } + } + async getKeys() { + return await this.initialize(), this.storage.getKeys(); + } + async getEntries() { + return await this.initialize(), this.storage.getEntries(); + } + async getItem(t) { + return await this.initialize(), this.storage.getItem(t); + } + async setItem(t, e) { + return await this.initialize(), this.storage.setItem(t, e); + } + async removeItem(t) { + return await this.initialize(), this.storage.removeItem(t); + } + async initialize() { + this.initialized || await new Promise((t) => { + const e = setInterval(() => { + this.initialized && (clearInterval(e), t()); + }, 20); + }); + } +}, __name(_a, "h"), _a); +var cjs$2 = {}, heartbeat$2 = {}, types = {}, heartbeat$1 = {}, _a2; +let IEvents$1 = (_a2 = class { +}, __name(_a2, "IEvents"), _a2); +const esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + IEvents: IEvents$1 +}, Symbol.toStringTag, { value: "Module" })), require$$0 = /* @__PURE__ */ getAugmentedNamespace(esm); +var hasRequiredHeartbeat$2; +function requireHeartbeat$2() { + if (hasRequiredHeartbeat$2) + return heartbeat$1; + hasRequiredHeartbeat$2 = 1, Object.defineProperty(heartbeat$1, "__esModule", { value: !0 }), heartbeat$1.IHeartBeat = void 0; + const events_1 = require$$0, _IHeartBeat = class _IHeartBeat extends events_1.IEvents { + constructor(opts) { + super(); + } + }; + __name(_IHeartBeat, "IHeartBeat"); + let IHeartBeat = _IHeartBeat; + return heartbeat$1.IHeartBeat = IHeartBeat, heartbeat$1; +} +__name(requireHeartbeat$2, "requireHeartbeat$2"); +var hasRequiredTypes; +function requireTypes() { + return hasRequiredTypes || (hasRequiredTypes = 1, function(exports) { + Object.defineProperty(exports, "__esModule", { value: !0 }), require$$0$1.__exportStar(requireHeartbeat$2(), exports); + }(types)), types; +} +__name(requireTypes, "requireTypes"); +var constants$1 = {}, heartbeat = {}, hasRequiredHeartbeat$1; +function requireHeartbeat$1() { + if (hasRequiredHeartbeat$1) + return heartbeat; + hasRequiredHeartbeat$1 = 1, Object.defineProperty(heartbeat, "__esModule", { value: !0 }), heartbeat.HEARTBEAT_EVENTS = heartbeat.HEARTBEAT_INTERVAL = void 0; + const time_1 = cjs$3; + return heartbeat.HEARTBEAT_INTERVAL = time_1.FIVE_SECONDS, heartbeat.HEARTBEAT_EVENTS = { + pulse: "heartbeat_pulse" + }, heartbeat; +} +__name(requireHeartbeat$1, "requireHeartbeat$1"); +var hasRequiredConstants$1; +function requireConstants$1() { + return hasRequiredConstants$1 || (hasRequiredConstants$1 = 1, function(exports) { + Object.defineProperty(exports, "__esModule", { value: !0 }), require$$0$1.__exportStar(requireHeartbeat$1(), exports); + }(constants$1)), constants$1; +} +__name(requireConstants$1, "requireConstants$1"); +var hasRequiredHeartbeat; +function requireHeartbeat() { + if (hasRequiredHeartbeat) + return heartbeat$2; + hasRequiredHeartbeat = 1, Object.defineProperty(heartbeat$2, "__esModule", { value: !0 }), heartbeat$2.HeartBeat = void 0; + const tslib_1 = require$$0$1, events_1 = eventsExports, time_1 = cjs$3, types_1 = requireTypes(), constants_1 = requireConstants$1(), _HeartBeat = class _HeartBeat extends types_1.IHeartBeat { + constructor(opts) { + super(opts), this.events = new events_1.EventEmitter(), this.interval = constants_1.HEARTBEAT_INTERVAL, this.interval = (opts == null ? void 0 : opts.interval) || constants_1.HEARTBEAT_INTERVAL; + } + static init(opts) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const heartbeat2 = new _HeartBeat(opts); + return yield heartbeat2.init(), heartbeat2; + }); + } + init() { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + yield this.initialize(); + }); + } + stop() { + clearInterval(this.intervalRef); + } + on(event, listener) { + this.events.on(event, listener); + } + once(event, listener) { + this.events.once(event, listener); + } + off(event, listener) { + this.events.off(event, listener); + } + removeListener(event, listener) { + this.events.removeListener(event, listener); + } + initialize() { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + this.intervalRef = setInterval(() => this.pulse(), time_1.toMiliseconds(this.interval)); + }); + } + pulse() { + this.events.emit(constants_1.HEARTBEAT_EVENTS.pulse); + } + }; + __name(_HeartBeat, "HeartBeat"); + let HeartBeat = _HeartBeat; + return heartbeat$2.HeartBeat = HeartBeat, heartbeat$2; +} +__name(requireHeartbeat, "requireHeartbeat"); +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: !0 }); + const tslib_1 = require$$0$1; + tslib_1.__exportStar(requireHeartbeat(), exports), tslib_1.__exportStar(requireTypes(), exports), tslib_1.__exportStar(requireConstants$1(), exports); +})(cjs$2); +var cjs$1 = {}, quickFormatUnescaped, hasRequiredQuickFormatUnescaped; +function requireQuickFormatUnescaped() { + if (hasRequiredQuickFormatUnescaped) + return quickFormatUnescaped; + hasRequiredQuickFormatUnescaped = 1; + function tryStringify(o) { + try { + return JSON.stringify(o); + } catch { + return '"[Circular]"'; + } + } + __name(tryStringify, "tryStringify"), quickFormatUnescaped = format; + function format(f2, args, opts) { + var ss2 = opts && opts.stringify || tryStringify, offset = 1; + if (typeof f2 == "object" && f2 !== null) { + var len = args.length + offset; + if (len === 1) + return f2; + var objects = new Array(len); + objects[0] = ss2(f2); + for (var index = 1; index < len; index++) + objects[index] = ss2(args[index]); + return objects.join(" "); + } + if (typeof f2 != "string") + return f2; + var argLen = args.length; + if (argLen === 0) + return f2; + for (var str = "", a2 = 1 - offset, lastPos = -1, flen = f2 && f2.length || 0, i = 0; i < flen; ) { + if (f2.charCodeAt(i) === 37 && i + 1 < flen) { + switch (lastPos = lastPos > -1 ? lastPos : 0, f2.charCodeAt(i + 1)) { + case 100: + case 102: + if (a2 >= argLen || args[a2] == null) + break; + lastPos < i && (str += f2.slice(lastPos, i)), str += Number(args[a2]), lastPos = i + 2, i++; + break; + case 105: + if (a2 >= argLen || args[a2] == null) + break; + lastPos < i && (str += f2.slice(lastPos, i)), str += Math.floor(Number(args[a2])), lastPos = i + 2, i++; + break; + case 79: + case 111: + case 106: + if (a2 >= argLen || args[a2] === void 0) + break; + lastPos < i && (str += f2.slice(lastPos, i)); + var type = typeof args[a2]; + if (type === "string") { + str += "'" + args[a2] + "'", lastPos = i + 2, i++; + break; + } + if (type === "function") { + str += args[a2].name || "", lastPos = i + 2, i++; + break; + } + str += ss2(args[a2]), lastPos = i + 2, i++; + break; + case 115: + if (a2 >= argLen) + break; + lastPos < i && (str += f2.slice(lastPos, i)), str += String(args[a2]), lastPos = i + 2, i++; + break; + case 37: + lastPos < i && (str += f2.slice(lastPos, i)), str += "%", lastPos = i + 2, i++, a2--; + break; + } + ++a2; + } + ++i; + } + return lastPos === -1 ? f2 : (lastPos < flen && (str += f2.slice(lastPos)), str); + } + return __name(format, "format"), quickFormatUnescaped; +} +__name(requireQuickFormatUnescaped, "requireQuickFormatUnescaped"); +var browser, hasRequiredBrowser; +function requireBrowser() { + if (hasRequiredBrowser) + return browser; + hasRequiredBrowser = 1; + const format = requireQuickFormatUnescaped(); + browser = pino; + const _console = pfGlobalThisOrFallback().console || {}, stdSerializers = { + mapHttpRequest: mock, + mapHttpResponse: mock, + wrapRequestSerializer: passthrough, + wrapResponseSerializer: passthrough, + wrapErrorSerializer: passthrough, + req: mock, + res: mock, + err: asErrValue + }; + function shouldSerialize(serialize, serializers) { + return Array.isArray(serialize) ? serialize.filter(function(k2) { + return k2 !== "!stdSerializers.err"; + }) : serialize === !0 ? Object.keys(serializers) : !1; + } + __name(shouldSerialize, "shouldSerialize"); + function pino(opts) { + opts = opts || {}, opts.browser = opts.browser || {}; + const transmit2 = opts.browser.transmit; + if (transmit2 && typeof transmit2.send != "function") + throw Error("pino: transmit option must have a send function"); + const proto = opts.browser.write || _console; + opts.browser.write && (opts.browser.asObject = !0); + const serializers = opts.serializers || {}, serialize = shouldSerialize(opts.browser.serialize, serializers); + let stdErrSerialize = opts.browser.serialize; + Array.isArray(opts.browser.serialize) && opts.browser.serialize.indexOf("!stdSerializers.err") > -1 && (stdErrSerialize = !1); + const levels = ["error", "fatal", "warn", "info", "debug", "trace"]; + typeof proto == "function" && (proto.error = proto.fatal = proto.warn = proto.info = proto.debug = proto.trace = proto), opts.enabled === !1 && (opts.level = "silent"); + const level = opts.level || "info", logger = Object.create(proto); + logger.log || (logger.log = noop), Object.defineProperty(logger, "levelVal", { + get: getLevelVal + }), Object.defineProperty(logger, "level", { + get: getLevel, + set: setLevel + }); + const setOpts = { + transmit: transmit2, + serialize, + asObject: opts.browser.asObject, + levels, + timestamp: getTimeFunction(opts) + }; + logger.levels = pino.levels, logger.level = level, logger.setMaxListeners = logger.getMaxListeners = logger.emit = logger.addListener = logger.on = logger.prependListener = logger.once = logger.prependOnceListener = logger.removeListener = logger.removeAllListeners = logger.listeners = logger.listenerCount = logger.eventNames = logger.write = logger.flush = noop, logger.serializers = serializers, logger._serialize = serialize, logger._stdErrSerialize = stdErrSerialize, logger.child = child, transmit2 && (logger._logEvent = createLogEventShape()); + function getLevelVal() { + return this.level === "silent" ? 1 / 0 : this.levels.values[this.level]; + } + __name(getLevelVal, "getLevelVal"); + function getLevel() { + return this._level; + } + __name(getLevel, "getLevel"); + function setLevel(level2) { + if (level2 !== "silent" && !this.levels.values[level2]) + throw Error("unknown level " + level2); + this._level = level2, set2(setOpts, logger, "error", "log"), set2(setOpts, logger, "fatal", "error"), set2(setOpts, logger, "warn", "error"), set2(setOpts, logger, "info", "log"), set2(setOpts, logger, "debug", "log"), set2(setOpts, logger, "trace", "log"); + } + __name(setLevel, "setLevel"); + function child(bindings, childOptions) { + if (!bindings) + throw new Error("missing bindings for child Pino"); + childOptions = childOptions || {}, serialize && bindings.serializers && (childOptions.serializers = bindings.serializers); + const childOptionsSerializers = childOptions.serializers; + if (serialize && childOptionsSerializers) { + var childSerializers = Object.assign({}, serializers, childOptionsSerializers), childSerialize = opts.browser.serialize === !0 ? Object.keys(childSerializers) : serialize; + delete bindings.serializers, applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize); + } + function Child(parent) { + this._childLevel = (parent._childLevel | 0) + 1, this.error = bind(parent, bindings, "error"), this.fatal = bind(parent, bindings, "fatal"), this.warn = bind(parent, bindings, "warn"), this.info = bind(parent, bindings, "info"), this.debug = bind(parent, bindings, "debug"), this.trace = bind(parent, bindings, "trace"), childSerializers && (this.serializers = childSerializers, this._serialize = childSerialize), transmit2 && (this._logEvent = createLogEventShape( + [].concat(parent._logEvent.bindings, bindings) + )); + } + return __name(Child, "Child"), Child.prototype = this, new Child(this); + } + return __name(child, "child"), logger; + } + __name(pino, "pino"), pino.levels = { + values: { + fatal: 60, + error: 50, + warn: 40, + info: 30, + debug: 20, + trace: 10 + }, + labels: { + 10: "trace", + 20: "debug", + 30: "info", + 40: "warn", + 50: "error", + 60: "fatal" + } + }, pino.stdSerializers = stdSerializers, pino.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime }); + function set2(opts, logger, level, fallback) { + const proto = Object.getPrototypeOf(logger); + logger[level] = logger.levelVal > logger.levels.values[level] ? noop : proto[level] ? proto[level] : _console[level] || _console[fallback] || noop, wrap(opts, logger, level); + } + __name(set2, "set"); + function wrap(opts, logger, level) { + !opts.transmit && logger[level] === noop || (logger[level] = function(write) { + return /* @__PURE__ */ __name(function() { + const ts2 = opts.timestamp(), args = new Array(arguments.length), proto = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this; + for (var i = 0; i < args.length; i++) + args[i] = arguments[i]; + if (opts.serialize && !opts.asObject && applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize), opts.asObject ? write.call(proto, asObject(this, level, args, ts2)) : write.apply(proto, args), opts.transmit) { + const transmitLevel = opts.transmit.level || logger.level, transmitValue = pino.levels.values[transmitLevel], methodValue = pino.levels.values[level]; + if (methodValue < transmitValue) + return; + transmit(this, { + ts: ts2, + methodLevel: level, + methodValue, + transmitLevel, + transmitValue: pino.levels.values[opts.transmit.level || logger.level], + send: opts.transmit.send, + val: logger.levelVal + }, args); + } + }, "LOG"); + }(logger[level])); + } + __name(wrap, "wrap"); + function asObject(logger, level, args, ts2) { + logger._serialize && applySerializers(args, logger._serialize, logger.serializers, logger._stdErrSerialize); + const argsCloned = args.slice(); + let msg = argsCloned[0]; + const o = {}; + ts2 && (o.time = ts2), o.level = pino.levels.values[level]; + let lvl = (logger._childLevel | 0) + 1; + if (lvl < 1 && (lvl = 1), msg !== null && typeof msg == "object") { + for (; lvl-- && typeof argsCloned[0] == "object"; ) + Object.assign(o, argsCloned.shift()); + msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0; + } else + typeof msg == "string" && (msg = format(argsCloned.shift(), argsCloned)); + return msg !== void 0 && (o.msg = msg), o; + } + __name(asObject, "asObject"); + function applySerializers(args, serialize, serializers, stdErrSerialize) { + for (const i in args) + if (stdErrSerialize && args[i] instanceof Error) + args[i] = pino.stdSerializers.err(args[i]); + else if (typeof args[i] == "object" && !Array.isArray(args[i])) + for (const k2 in args[i]) + serialize && serialize.indexOf(k2) > -1 && k2 in serializers && (args[i][k2] = serializers[k2](args[i][k2])); + } + __name(applySerializers, "applySerializers"); + function bind(parent, bindings, level) { + return function() { + const args = new Array(1 + arguments.length); + args[0] = bindings; + for (var i = 1; i < args.length; i++) + args[i] = arguments[i - 1]; + return parent[level].apply(this, args); + }; + } + __name(bind, "bind"); + function transmit(logger, opts, args) { + const send = opts.send, ts2 = opts.ts, methodLevel = opts.methodLevel, methodValue = opts.methodValue, val = opts.val, bindings = logger._logEvent.bindings; + applySerializers( + args, + logger._serialize || Object.keys(logger.serializers), + logger.serializers, + logger._stdErrSerialize === void 0 ? !0 : logger._stdErrSerialize + ), logger._logEvent.ts = ts2, logger._logEvent.messages = args.filter(function(arg) { + return bindings.indexOf(arg) === -1; + }), logger._logEvent.level.label = methodLevel, logger._logEvent.level.value = methodValue, send(methodLevel, logger._logEvent, val), logger._logEvent = createLogEventShape(bindings); + } + __name(transmit, "transmit"); + function createLogEventShape(bindings) { + return { + ts: 0, + messages: [], + bindings: bindings || [], + level: { label: "", value: 0 } + }; + } + __name(createLogEventShape, "createLogEventShape"); + function asErrValue(err) { + const obj = { + type: err.constructor.name, + msg: err.message, + stack: err.stack + }; + for (const key in err) + obj[key] === void 0 && (obj[key] = err[key]); + return obj; + } + __name(asErrValue, "asErrValue"); + function getTimeFunction(opts) { + return typeof opts.timestamp == "function" ? opts.timestamp : opts.timestamp === !1 ? nullTime : epochTime; + } + __name(getTimeFunction, "getTimeFunction"); + function mock() { + return {}; + } + __name(mock, "mock"); + function passthrough(a2) { + return a2; + } + __name(passthrough, "passthrough"); + function noop() { + } + __name(noop, "noop"); + function nullTime() { + return !1; + } + __name(nullTime, "nullTime"); + function epochTime() { + return Date.now(); + } + __name(epochTime, "epochTime"); + function unixTime() { + return Math.round(Date.now() / 1e3); + } + __name(unixTime, "unixTime"); + function isoTime() { + return new Date(Date.now()).toISOString(); + } + __name(isoTime, "isoTime"); + function pfGlobalThisOrFallback() { + function defd(o) { + return typeof o < "u" && o; + } + __name(defd, "defd"); + try { + return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", { + get: function() { + return delete Object.prototype.globalThis, this.globalThis = this; + }, + configurable: !0 + }), globalThis; + } catch { + return defd(self) || defd(window) || defd(this) || {}; + } + } + return __name(pfGlobalThisOrFallback, "pfGlobalThisOrFallback"), browser; +} +__name(requireBrowser, "requireBrowser"); +var constants = {}, hasRequiredConstants; +function requireConstants() { + return hasRequiredConstants || (hasRequiredConstants = 1, Object.defineProperty(constants, "__esModule", { value: !0 }), constants.PINO_CUSTOM_CONTEXT_KEY = constants.PINO_LOGGER_DEFAULTS = void 0, constants.PINO_LOGGER_DEFAULTS = { + level: "info" + }, constants.PINO_CUSTOM_CONTEXT_KEY = "custom_context"), constants; +} +__name(requireConstants, "requireConstants"); +var utils = {}, hasRequiredUtils; +function requireUtils() { + if (hasRequiredUtils) + return utils; + hasRequiredUtils = 1, Object.defineProperty(utils, "__esModule", { value: !0 }), utils.generateChildLogger = utils.formatChildLoggerContext = utils.getLoggerContext = utils.setBrowserLoggerContext = utils.getBrowserLoggerContext = utils.getDefaultLoggerOptions = void 0; + const constants_1 = requireConstants(); + function getDefaultLoggerOptions(opts) { + return Object.assign(Object.assign({}, opts), { level: (opts == null ? void 0 : opts.level) || constants_1.PINO_LOGGER_DEFAULTS.level }); + } + __name(getDefaultLoggerOptions, "getDefaultLoggerOptions"), utils.getDefaultLoggerOptions = getDefaultLoggerOptions; + function getBrowserLoggerContext(logger, customContextKey = constants_1.PINO_CUSTOM_CONTEXT_KEY) { + return logger[customContextKey] || ""; + } + __name(getBrowserLoggerContext, "getBrowserLoggerContext"), utils.getBrowserLoggerContext = getBrowserLoggerContext; + function setBrowserLoggerContext(logger, context, customContextKey = constants_1.PINO_CUSTOM_CONTEXT_KEY) { + return logger[customContextKey] = context, logger; + } + __name(setBrowserLoggerContext, "setBrowserLoggerContext"), utils.setBrowserLoggerContext = setBrowserLoggerContext; + function getLoggerContext(logger, customContextKey = constants_1.PINO_CUSTOM_CONTEXT_KEY) { + let context = ""; + return typeof logger.bindings > "u" ? context = getBrowserLoggerContext(logger, customContextKey) : context = logger.bindings().context || "", context; + } + __name(getLoggerContext, "getLoggerContext"), utils.getLoggerContext = getLoggerContext; + function formatChildLoggerContext(logger, childContext, customContextKey = constants_1.PINO_CUSTOM_CONTEXT_KEY) { + const parentContext = getLoggerContext(logger, customContextKey); + return parentContext.trim() ? `${parentContext}/${childContext}` : childContext; + } + __name(formatChildLoggerContext, "formatChildLoggerContext"), utils.formatChildLoggerContext = formatChildLoggerContext; + function generateChildLogger(logger, childContext, customContextKey = constants_1.PINO_CUSTOM_CONTEXT_KEY) { + const context = formatChildLoggerContext(logger, childContext, customContextKey), child = logger.child({ context }); + return setBrowserLoggerContext(child, context, customContextKey); + } + return __name(generateChildLogger, "generateChildLogger"), utils.generateChildLogger = generateChildLogger, utils; +} +__name(requireUtils, "requireUtils"); +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: !0 }), exports.pino = void 0; + const tslib_1 = require$$0$1, pino_1 = tslib_1.__importDefault(requireBrowser()); + Object.defineProperty(exports, "pino", { enumerable: !0, get: function() { + return pino_1.default; + } }), tslib_1.__exportStar(requireConstants(), exports), tslib_1.__exportStar(requireUtils(), exports); +})(cjs$1); +const _n = class _n extends IEvents$1 { + constructor(s) { + super(), this.opts = s, this.protocol = "wc", this.version = 2; + } +}; +__name(_n, "n"); +let n = _n; +var _a3; +let h$1 = (_a3 = class extends IEvents$1 { + constructor(s, t) { + super(), this.core = s, this.logger = t, this.records = /* @__PURE__ */ new Map(); + } +}, __name(_a3, "h"), _a3); +var _a4; +let a$1 = (_a4 = class { + constructor(s, t) { + this.logger = s, this.core = t; + } +}, __name(_a4, "a"), _a4); +const _u = class _u extends IEvents$1 { + constructor(s, t) { + super(), this.relayer = s, this.logger = t; + } +}; +__name(_u, "u"); +let u = _u; +var _a5; +let g$1 = (_a5 = class extends IEvents$1 { + constructor(s) { + super(); + } +}, __name(_a5, "g"), _a5); +const _p = class _p { + constructor(s, t, o, w2) { + this.core = s, this.logger = t, this.name = o; + } +}; +__name(_p, "p"); +let p = _p; +const _d = class _d extends IEvents$1 { + constructor(s, t) { + super(), this.relayer = s, this.logger = t; + } +}; +__name(_d, "d"); +let d = _d; +const _E = class _E extends IEvents$1 { + constructor(s, t) { + super(), this.core = s, this.logger = t; + } +}; +__name(_E, "E"); +let E = _E; +const _y = class _y { + constructor(s, t) { + this.projectId = s, this.logger = t; + } +}; +__name(_y, "y"); +let y = _y; +var _a6; +let b$1 = (_a6 = class { + constructor(s) { + this.opts = s, this.protocol = "wc", this.version = 2; + } +}, __name(_a6, "b"), _a6); +var _a7; +let S$1 = (_a7 = class { + constructor(s) { + this.client = s; + } +}, __name(_a7, "S"), _a7); +var ed25519 = {}, sha512 = {}; +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: !0 }); + var binary_1 = binary, wipe_1 = wipe; + exports.DIGEST_LENGTH = 64, exports.BLOCK_SIZE = 128; + var SHA512 = ( + /** @class */ + function() { + function SHA5122() { + this.digestLength = exports.DIGEST_LENGTH, this.blockSize = exports.BLOCK_SIZE, this._stateHi = new Int32Array(8), this._stateLo = new Int32Array(8), this._tempHi = new Int32Array(16), this._tempLo = new Int32Array(16), this._buffer = new Uint8Array(256), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this.reset(); + } + return __name(SHA5122, "SHA512"), SHA5122.prototype._initState = function() { + this._stateHi[0] = 1779033703, this._stateHi[1] = 3144134277, this._stateHi[2] = 1013904242, this._stateHi[3] = 2773480762, this._stateHi[4] = 1359893119, this._stateHi[5] = 2600822924, this._stateHi[6] = 528734635, this._stateHi[7] = 1541459225, this._stateLo[0] = 4089235720, this._stateLo[1] = 2227873595, this._stateLo[2] = 4271175723, this._stateLo[3] = 1595750129, this._stateLo[4] = 2917565137, this._stateLo[5] = 725511199, this._stateLo[6] = 4215389547, this._stateLo[7] = 327033209; + }, SHA5122.prototype.reset = function() { + return this._initState(), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this; + }, SHA5122.prototype.clean = function() { + wipe_1.wipe(this._buffer), wipe_1.wipe(this._tempHi), wipe_1.wipe(this._tempLo), this.reset(); + }, SHA5122.prototype.update = function(data, dataLength) { + if (dataLength === void 0 && (dataLength = data.length), this._finished) + throw new Error("SHA512: can't update because hash was finished."); + var dataPos = 0; + if (this._bytesHashed += dataLength, this._bufferLength > 0) { + for (; this._bufferLength < exports.BLOCK_SIZE && dataLength > 0; ) + this._buffer[this._bufferLength++] = data[dataPos++], dataLength--; + this._bufferLength === this.blockSize && (hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, this.blockSize), this._bufferLength = 0); + } + for (dataLength >= this.blockSize && (dataPos = hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, data, dataPos, dataLength), dataLength %= this.blockSize); dataLength > 0; ) + this._buffer[this._bufferLength++] = data[dataPos++], dataLength--; + return this; + }, SHA5122.prototype.finish = function(out) { + if (!this._finished) { + var bytesHashed = this._bytesHashed, left = this._bufferLength, bitLenHi = bytesHashed / 536870912 | 0, bitLenLo = bytesHashed << 3, padLength = bytesHashed % 128 < 112 ? 128 : 256; + this._buffer[left] = 128; + for (var i = left + 1; i < padLength - 8; i++) + this._buffer[i] = 0; + binary_1.writeUint32BE(bitLenHi, this._buffer, padLength - 8), binary_1.writeUint32BE(bitLenLo, this._buffer, padLength - 4), hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, padLength), this._finished = !0; + } + for (var i = 0; i < this.digestLength / 8; i++) + binary_1.writeUint32BE(this._stateHi[i], out, i * 8), binary_1.writeUint32BE(this._stateLo[i], out, i * 8 + 4); + return this; + }, SHA5122.prototype.digest = function() { + var out = new Uint8Array(this.digestLength); + return this.finish(out), out; + }, SHA5122.prototype.saveState = function() { + if (this._finished) + throw new Error("SHA256: cannot save finished state"); + return { + stateHi: new Int32Array(this._stateHi), + stateLo: new Int32Array(this._stateLo), + buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : void 0, + bufferLength: this._bufferLength, + bytesHashed: this._bytesHashed + }; + }, SHA5122.prototype.restoreState = function(savedState) { + return this._stateHi.set(savedState.stateHi), this._stateLo.set(savedState.stateLo), this._bufferLength = savedState.bufferLength, savedState.buffer && this._buffer.set(savedState.buffer), this._bytesHashed = savedState.bytesHashed, this._finished = !1, this; + }, SHA5122.prototype.cleanSavedState = function(savedState) { + wipe_1.wipe(savedState.stateHi), wipe_1.wipe(savedState.stateLo), savedState.buffer && wipe_1.wipe(savedState.buffer), savedState.bufferLength = 0, savedState.bytesHashed = 0; + }, SHA5122; + }() + ); + exports.SHA512 = SHA512; + var K2 = new Int32Array([ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 + ]); + function hashBlocks(wh, wl, hh, hl, m, pos, len) { + for (var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7], h2, l2, th, tl, a2, b2, c2, d2; len >= 128; ) { + for (var i = 0; i < 16; i++) { + var j2 = 8 * i + pos; + wh[i] = binary_1.readUint32BE(m, j2), wl[i] = binary_1.readUint32BE(m, j2 + 4); + } + for (var i = 0; i < 80; i++) { + var bh0 = ah0, bh1 = ah1, bh2 = ah2, bh3 = ah3, bh4 = ah4, bh5 = ah5, bh6 = ah6, bh7 = ah7, bl0 = al0, bl1 = al1, bl2 = al2, bl3 = al3, bl4 = al4, bl5 = al5, bl6 = al6, bl7 = al7; + if (h2 = ah7, l2 = al7, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)), l2 = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)), a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, h2 = ah4 & ah5 ^ ~ah4 & ah6, l2 = al4 & al5 ^ ~al4 & al6, a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, h2 = K2[i * 2], l2 = K2[i * 2 + 1], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, h2 = wh[i % 16], l2 = wl[i % 16], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, th = c2 & 65535 | d2 << 16, tl = a2 & 65535 | b2 << 16, h2 = th, l2 = tl, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)), l2 = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)), a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, h2 = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2, l2 = al0 & al1 ^ al0 & al2 ^ al1 & al2, a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, bh7 = c2 & 65535 | d2 << 16, bl7 = a2 & 65535 | b2 << 16, h2 = bh3, l2 = bl3, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = th, l2 = tl, a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, bh3 = c2 & 65535 | d2 << 16, bl3 = a2 & 65535 | b2 << 16, ah1 = bh0, ah2 = bh1, ah3 = bh2, ah4 = bh3, ah5 = bh4, ah6 = bh5, ah7 = bh6, ah0 = bh7, al1 = bl0, al2 = bl1, al3 = bl2, al4 = bl3, al5 = bl4, al6 = bl5, al7 = bl6, al0 = bl7, i % 16 === 15) + for (var j2 = 0; j2 < 16; j2++) + h2 = wh[j2], l2 = wl[j2], a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = wh[(j2 + 9) % 16], l2 = wl[(j2 + 9) % 16], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, th = wh[(j2 + 1) % 16], tl = wl[(j2 + 1) % 16], h2 = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7, l2 = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7), a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, th = wh[(j2 + 14) % 16], tl = wl[(j2 + 14) % 16], h2 = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6, l2 = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6), a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, wh[j2] = c2 & 65535 | d2 << 16, wl[j2] = a2 & 65535 | b2 << 16; + } + h2 = ah0, l2 = al0, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[0], l2 = hl[0], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[0] = ah0 = c2 & 65535 | d2 << 16, hl[0] = al0 = a2 & 65535 | b2 << 16, h2 = ah1, l2 = al1, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[1], l2 = hl[1], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[1] = ah1 = c2 & 65535 | d2 << 16, hl[1] = al1 = a2 & 65535 | b2 << 16, h2 = ah2, l2 = al2, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[2], l2 = hl[2], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[2] = ah2 = c2 & 65535 | d2 << 16, hl[2] = al2 = a2 & 65535 | b2 << 16, h2 = ah3, l2 = al3, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[3], l2 = hl[3], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[3] = ah3 = c2 & 65535 | d2 << 16, hl[3] = al3 = a2 & 65535 | b2 << 16, h2 = ah4, l2 = al4, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[4], l2 = hl[4], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[4] = ah4 = c2 & 65535 | d2 << 16, hl[4] = al4 = a2 & 65535 | b2 << 16, h2 = ah5, l2 = al5, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[5], l2 = hl[5], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[5] = ah5 = c2 & 65535 | d2 << 16, hl[5] = al5 = a2 & 65535 | b2 << 16, h2 = ah6, l2 = al6, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[6], l2 = hl[6], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[6] = ah6 = c2 & 65535 | d2 << 16, hl[6] = al6 = a2 & 65535 | b2 << 16, h2 = ah7, l2 = al7, a2 = l2 & 65535, b2 = l2 >>> 16, c2 = h2 & 65535, d2 = h2 >>> 16, h2 = hh[7], l2 = hl[7], a2 += l2 & 65535, b2 += l2 >>> 16, c2 += h2 & 65535, d2 += h2 >>> 16, b2 += a2 >>> 16, c2 += b2 >>> 16, d2 += c2 >>> 16, hh[7] = ah7 = c2 & 65535 | d2 << 16, hl[7] = al7 = a2 & 65535 | b2 << 16, pos += 128, len -= 128; + } + return pos; + } + __name(hashBlocks, "hashBlocks"); + function hash(data) { + var h2 = new SHA512(); + h2.update(data); + var digest = h2.digest(); + return h2.clean(), digest; + } + __name(hash, "hash"), exports.hash = hash; +})(sha512); +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: !0 }), exports.convertSecretKeyToX25519 = exports.convertPublicKeyToX25519 = exports.verify = exports.sign = exports.extractPublicKeyFromSecretKey = exports.generateKeyPair = exports.generateKeyPairFromSeed = exports.SEED_LENGTH = exports.SECRET_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = exports.SIGNATURE_LENGTH = void 0; + const random_1 = random, sha512_1 = sha512, wipe_1 = wipe; + exports.SIGNATURE_LENGTH = 64, exports.PUBLIC_KEY_LENGTH = 32, exports.SECRET_KEY_LENGTH = 64, exports.SEED_LENGTH = 32; + function gf(init) { + const r = new Float64Array(16); + if (init) + for (let i = 0; i < init.length; i++) + r[i] = init[i]; + return r; + } + __name(gf, "gf"); + const _9 = new Uint8Array(32); + _9[0] = 9; + const gf0 = gf(), gf1 = gf([1]), D2 = gf([ + 30883, + 4953, + 19914, + 30187, + 55467, + 16705, + 2637, + 112, + 59544, + 30585, + 16505, + 36039, + 65139, + 11119, + 27886, + 20995 + ]), D22 = gf([ + 61785, + 9906, + 39828, + 60374, + 45398, + 33411, + 5274, + 224, + 53552, + 61171, + 33010, + 6542, + 64743, + 22239, + 55772, + 9222 + ]), X2 = gf([ + 54554, + 36645, + 11616, + 51542, + 42930, + 38181, + 51040, + 26924, + 56412, + 64982, + 57905, + 49316, + 21502, + 52590, + 14035, + 8553 + ]), Y = gf([ + 26200, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214, + 26214 + ]), I = gf([ + 41136, + 18958, + 6951, + 50414, + 58488, + 44335, + 6150, + 12099, + 55207, + 15867, + 153, + 11085, + 57099, + 20417, + 9344, + 11139 + ]); + function set25519(r, a2) { + for (let i = 0; i < 16; i++) + r[i] = a2[i] | 0; + } + __name(set25519, "set25519"); + function car25519(o) { + let c2 = 1; + for (let i = 0; i < 16; i++) { + let v2 = o[i] + c2 + 65535; + c2 = Math.floor(v2 / 65536), o[i] = v2 - c2 * 65536; + } + o[0] += c2 - 1 + 37 * (c2 - 1); + } + __name(car25519, "car25519"); + function sel25519(p2, q2, b2) { + const c2 = ~(b2 - 1); + for (let i = 0; i < 16; i++) { + const t = c2 & (p2[i] ^ q2[i]); + p2[i] ^= t, q2[i] ^= t; + } + } + __name(sel25519, "sel25519"); + function pack25519(o, n2) { + const m = gf(), t = gf(); + for (let i = 0; i < 16; i++) + t[i] = n2[i]; + car25519(t), car25519(t), car25519(t); + for (let j2 = 0; j2 < 2; j2++) { + m[0] = t[0] - 65517; + for (let i = 1; i < 15; i++) + m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1), m[i - 1] &= 65535; + m[15] = t[15] - 32767 - (m[14] >> 16 & 1); + const b2 = m[15] >> 16 & 1; + m[14] &= 65535, sel25519(t, m, 1 - b2); + } + for (let i = 0; i < 16; i++) + o[2 * i] = t[i] & 255, o[2 * i + 1] = t[i] >> 8; + } + __name(pack25519, "pack25519"); + function verify32(x2, y2) { + let d2 = 0; + for (let i = 0; i < 32; i++) + d2 |= x2[i] ^ y2[i]; + return (1 & d2 - 1 >>> 8) - 1; + } + __name(verify32, "verify32"); + function neq25519(a2, b2) { + const c2 = new Uint8Array(32), d2 = new Uint8Array(32); + return pack25519(c2, a2), pack25519(d2, b2), verify32(c2, d2); + } + __name(neq25519, "neq25519"); + function par25519(a2) { + const d2 = new Uint8Array(32); + return pack25519(d2, a2), d2[0] & 1; + } + __name(par25519, "par25519"); + function unpack25519(o, n2) { + for (let i = 0; i < 16; i++) + o[i] = n2[2 * i] + (n2[2 * i + 1] << 8); + o[15] &= 32767; + } + __name(unpack25519, "unpack25519"); + function add(o, a2, b2) { + for (let i = 0; i < 16; i++) + o[i] = a2[i] + b2[i]; + } + __name(add, "add"); + function sub(o, a2, b2) { + for (let i = 0; i < 16; i++) + o[i] = a2[i] - b2[i]; + } + __name(sub, "sub"); + function mul(o, a2, b2) { + let v2, c2, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b2[0], b1 = b2[1], b22 = b2[2], b3 = b2[3], b4 = b2[4], b5 = b2[5], b6 = b2[6], b7 = b2[7], b8 = b2[8], b9 = b2[9], b10 = b2[10], b11 = b2[11], b12 = b2[12], b13 = b2[13], b14 = b2[14], b15 = b2[15]; + v2 = a2[0], t0 += v2 * b0, t1 += v2 * b1, t2 += v2 * b22, t3 += v2 * b3, t4 += v2 * b4, t5 += v2 * b5, t6 += v2 * b6, t7 += v2 * b7, t8 += v2 * b8, t9 += v2 * b9, t10 += v2 * b10, t11 += v2 * b11, t12 += v2 * b12, t13 += v2 * b13, t14 += v2 * b14, t15 += v2 * b15, v2 = a2[1], t1 += v2 * b0, t2 += v2 * b1, t3 += v2 * b22, t4 += v2 * b3, t5 += v2 * b4, t6 += v2 * b5, t7 += v2 * b6, t8 += v2 * b7, t9 += v2 * b8, t10 += v2 * b9, t11 += v2 * b10, t12 += v2 * b11, t13 += v2 * b12, t14 += v2 * b13, t15 += v2 * b14, t16 += v2 * b15, v2 = a2[2], t2 += v2 * b0, t3 += v2 * b1, t4 += v2 * b22, t5 += v2 * b3, t6 += v2 * b4, t7 += v2 * b5, t8 += v2 * b6, t9 += v2 * b7, t10 += v2 * b8, t11 += v2 * b9, t12 += v2 * b10, t13 += v2 * b11, t14 += v2 * b12, t15 += v2 * b13, t16 += v2 * b14, t17 += v2 * b15, v2 = a2[3], t3 += v2 * b0, t4 += v2 * b1, t5 += v2 * b22, t6 += v2 * b3, t7 += v2 * b4, t8 += v2 * b5, t9 += v2 * b6, t10 += v2 * b7, t11 += v2 * b8, t12 += v2 * b9, t13 += v2 * b10, t14 += v2 * b11, t15 += v2 * b12, t16 += v2 * b13, t17 += v2 * b14, t18 += v2 * b15, v2 = a2[4], t4 += v2 * b0, t5 += v2 * b1, t6 += v2 * b22, t7 += v2 * b3, t8 += v2 * b4, t9 += v2 * b5, t10 += v2 * b6, t11 += v2 * b7, t12 += v2 * b8, t13 += v2 * b9, t14 += v2 * b10, t15 += v2 * b11, t16 += v2 * b12, t17 += v2 * b13, t18 += v2 * b14, t19 += v2 * b15, v2 = a2[5], t5 += v2 * b0, t6 += v2 * b1, t7 += v2 * b22, t8 += v2 * b3, t9 += v2 * b4, t10 += v2 * b5, t11 += v2 * b6, t12 += v2 * b7, t13 += v2 * b8, t14 += v2 * b9, t15 += v2 * b10, t16 += v2 * b11, t17 += v2 * b12, t18 += v2 * b13, t19 += v2 * b14, t20 += v2 * b15, v2 = a2[6], t6 += v2 * b0, t7 += v2 * b1, t8 += v2 * b22, t9 += v2 * b3, t10 += v2 * b4, t11 += v2 * b5, t12 += v2 * b6, t13 += v2 * b7, t14 += v2 * b8, t15 += v2 * b9, t16 += v2 * b10, t17 += v2 * b11, t18 += v2 * b12, t19 += v2 * b13, t20 += v2 * b14, t21 += v2 * b15, v2 = a2[7], t7 += v2 * b0, t8 += v2 * b1, t9 += v2 * b22, t10 += v2 * b3, t11 += v2 * b4, t12 += v2 * b5, t13 += v2 * b6, t14 += v2 * b7, t15 += v2 * b8, t16 += v2 * b9, t17 += v2 * b10, t18 += v2 * b11, t19 += v2 * b12, t20 += v2 * b13, t21 += v2 * b14, t22 += v2 * b15, v2 = a2[8], t8 += v2 * b0, t9 += v2 * b1, t10 += v2 * b22, t11 += v2 * b3, t12 += v2 * b4, t13 += v2 * b5, t14 += v2 * b6, t15 += v2 * b7, t16 += v2 * b8, t17 += v2 * b9, t18 += v2 * b10, t19 += v2 * b11, t20 += v2 * b12, t21 += v2 * b13, t22 += v2 * b14, t23 += v2 * b15, v2 = a2[9], t9 += v2 * b0, t10 += v2 * b1, t11 += v2 * b22, t12 += v2 * b3, t13 += v2 * b4, t14 += v2 * b5, t15 += v2 * b6, t16 += v2 * b7, t17 += v2 * b8, t18 += v2 * b9, t19 += v2 * b10, t20 += v2 * b11, t21 += v2 * b12, t22 += v2 * b13, t23 += v2 * b14, t24 += v2 * b15, v2 = a2[10], t10 += v2 * b0, t11 += v2 * b1, t12 += v2 * b22, t13 += v2 * b3, t14 += v2 * b4, t15 += v2 * b5, t16 += v2 * b6, t17 += v2 * b7, t18 += v2 * b8, t19 += v2 * b9, t20 += v2 * b10, t21 += v2 * b11, t22 += v2 * b12, t23 += v2 * b13, t24 += v2 * b14, t25 += v2 * b15, v2 = a2[11], t11 += v2 * b0, t12 += v2 * b1, t13 += v2 * b22, t14 += v2 * b3, t15 += v2 * b4, t16 += v2 * b5, t17 += v2 * b6, t18 += v2 * b7, t19 += v2 * b8, t20 += v2 * b9, t21 += v2 * b10, t22 += v2 * b11, t23 += v2 * b12, t24 += v2 * b13, t25 += v2 * b14, t26 += v2 * b15, v2 = a2[12], t12 += v2 * b0, t13 += v2 * b1, t14 += v2 * b22, t15 += v2 * b3, t16 += v2 * b4, t17 += v2 * b5, t18 += v2 * b6, t19 += v2 * b7, t20 += v2 * b8, t21 += v2 * b9, t22 += v2 * b10, t23 += v2 * b11, t24 += v2 * b12, t25 += v2 * b13, t26 += v2 * b14, t27 += v2 * b15, v2 = a2[13], t13 += v2 * b0, t14 += v2 * b1, t15 += v2 * b22, t16 += v2 * b3, t17 += v2 * b4, t18 += v2 * b5, t19 += v2 * b6, t20 += v2 * b7, t21 += v2 * b8, t22 += v2 * b9, t23 += v2 * b10, t24 += v2 * b11, t25 += v2 * b12, t26 += v2 * b13, t27 += v2 * b14, t28 += v2 * b15, v2 = a2[14], t14 += v2 * b0, t15 += v2 * b1, t16 += v2 * b22, t17 += v2 * b3, t18 += v2 * b4, t19 += v2 * b5, t20 += v2 * b6, t21 += v2 * b7, t22 += v2 * b8, t23 += v2 * b9, t24 += v2 * b10, t25 += v2 * b11, t26 += v2 * b12, t27 += v2 * b13, t28 += v2 * b14, t29 += v2 * b15, v2 = a2[15], t15 += v2 * b0, t16 += v2 * b1, t17 += v2 * b22, t18 += v2 * b3, t19 += v2 * b4, t20 += v2 * b5, t21 += v2 * b6, t22 += v2 * b7, t23 += v2 * b8, t24 += v2 * b9, t25 += v2 * b10, t26 += v2 * b11, t27 += v2 * b12, t28 += v2 * b13, t29 += v2 * b14, t30 += v2 * b15, t0 += 38 * t16, t1 += 38 * t17, t2 += 38 * t18, t3 += 38 * t19, t4 += 38 * t20, t5 += 38 * t21, t6 += 38 * t22, t7 += 38 * t23, t8 += 38 * t24, t9 += 38 * t25, t10 += 38 * t26, t11 += 38 * t27, t12 += 38 * t28, t13 += 38 * t29, t14 += 38 * t30, c2 = 1, v2 = t0 + c2 + 65535, c2 = Math.floor(v2 / 65536), t0 = v2 - c2 * 65536, v2 = t1 + c2 + 65535, c2 = Math.floor(v2 / 65536), t1 = v2 - c2 * 65536, v2 = t2 + c2 + 65535, c2 = Math.floor(v2 / 65536), t2 = v2 - c2 * 65536, v2 = t3 + c2 + 65535, c2 = Math.floor(v2 / 65536), t3 = v2 - c2 * 65536, v2 = t4 + c2 + 65535, c2 = Math.floor(v2 / 65536), t4 = v2 - c2 * 65536, v2 = t5 + c2 + 65535, c2 = Math.floor(v2 / 65536), t5 = v2 - c2 * 65536, v2 = t6 + c2 + 65535, c2 = Math.floor(v2 / 65536), t6 = v2 - c2 * 65536, v2 = t7 + c2 + 65535, c2 = Math.floor(v2 / 65536), t7 = v2 - c2 * 65536, v2 = t8 + c2 + 65535, c2 = Math.floor(v2 / 65536), t8 = v2 - c2 * 65536, v2 = t9 + c2 + 65535, c2 = Math.floor(v2 / 65536), t9 = v2 - c2 * 65536, v2 = t10 + c2 + 65535, c2 = Math.floor(v2 / 65536), t10 = v2 - c2 * 65536, v2 = t11 + c2 + 65535, c2 = Math.floor(v2 / 65536), t11 = v2 - c2 * 65536, v2 = t12 + c2 + 65535, c2 = Math.floor(v2 / 65536), t12 = v2 - c2 * 65536, v2 = t13 + c2 + 65535, c2 = Math.floor(v2 / 65536), t13 = v2 - c2 * 65536, v2 = t14 + c2 + 65535, c2 = Math.floor(v2 / 65536), t14 = v2 - c2 * 65536, v2 = t15 + c2 + 65535, c2 = Math.floor(v2 / 65536), t15 = v2 - c2 * 65536, t0 += c2 - 1 + 37 * (c2 - 1), c2 = 1, v2 = t0 + c2 + 65535, c2 = Math.floor(v2 / 65536), t0 = v2 - c2 * 65536, v2 = t1 + c2 + 65535, c2 = Math.floor(v2 / 65536), t1 = v2 - c2 * 65536, v2 = t2 + c2 + 65535, c2 = Math.floor(v2 / 65536), t2 = v2 - c2 * 65536, v2 = t3 + c2 + 65535, c2 = Math.floor(v2 / 65536), t3 = v2 - c2 * 65536, v2 = t4 + c2 + 65535, c2 = Math.floor(v2 / 65536), t4 = v2 - c2 * 65536, v2 = t5 + c2 + 65535, c2 = Math.floor(v2 / 65536), t5 = v2 - c2 * 65536, v2 = t6 + c2 + 65535, c2 = Math.floor(v2 / 65536), t6 = v2 - c2 * 65536, v2 = t7 + c2 + 65535, c2 = Math.floor(v2 / 65536), t7 = v2 - c2 * 65536, v2 = t8 + c2 + 65535, c2 = Math.floor(v2 / 65536), t8 = v2 - c2 * 65536, v2 = t9 + c2 + 65535, c2 = Math.floor(v2 / 65536), t9 = v2 - c2 * 65536, v2 = t10 + c2 + 65535, c2 = Math.floor(v2 / 65536), t10 = v2 - c2 * 65536, v2 = t11 + c2 + 65535, c2 = Math.floor(v2 / 65536), t11 = v2 - c2 * 65536, v2 = t12 + c2 + 65535, c2 = Math.floor(v2 / 65536), t12 = v2 - c2 * 65536, v2 = t13 + c2 + 65535, c2 = Math.floor(v2 / 65536), t13 = v2 - c2 * 65536, v2 = t14 + c2 + 65535, c2 = Math.floor(v2 / 65536), t14 = v2 - c2 * 65536, v2 = t15 + c2 + 65535, c2 = Math.floor(v2 / 65536), t15 = v2 - c2 * 65536, t0 += c2 - 1 + 37 * (c2 - 1), o[0] = t0, o[1] = t1, o[2] = t2, o[3] = t3, o[4] = t4, o[5] = t5, o[6] = t6, o[7] = t7, o[8] = t8, o[9] = t9, o[10] = t10, o[11] = t11, o[12] = t12, o[13] = t13, o[14] = t14, o[15] = t15; + } + __name(mul, "mul"); + function square(o, a2) { + mul(o, a2, a2); + } + __name(square, "square"); + function inv25519(o, i) { + const c2 = gf(); + let a2; + for (a2 = 0; a2 < 16; a2++) + c2[a2] = i[a2]; + for (a2 = 253; a2 >= 0; a2--) + square(c2, c2), a2 !== 2 && a2 !== 4 && mul(c2, c2, i); + for (a2 = 0; a2 < 16; a2++) + o[a2] = c2[a2]; + } + __name(inv25519, "inv25519"); + function pow2523(o, i) { + const c2 = gf(); + let a2; + for (a2 = 0; a2 < 16; a2++) + c2[a2] = i[a2]; + for (a2 = 250; a2 >= 0; a2--) + square(c2, c2), a2 !== 1 && mul(c2, c2, i); + for (a2 = 0; a2 < 16; a2++) + o[a2] = c2[a2]; + } + __name(pow2523, "pow2523"); + function edadd(p2, q2) { + const a2 = gf(), b2 = gf(), c2 = gf(), d2 = gf(), e = gf(), f2 = gf(), g2 = gf(), h2 = gf(), t = gf(); + sub(a2, p2[1], p2[0]), sub(t, q2[1], q2[0]), mul(a2, a2, t), add(b2, p2[0], p2[1]), add(t, q2[0], q2[1]), mul(b2, b2, t), mul(c2, p2[3], q2[3]), mul(c2, c2, D22), mul(d2, p2[2], q2[2]), add(d2, d2, d2), sub(e, b2, a2), sub(f2, d2, c2), add(g2, d2, c2), add(h2, b2, a2), mul(p2[0], e, f2), mul(p2[1], h2, g2), mul(p2[2], g2, f2), mul(p2[3], e, h2); + } + __name(edadd, "edadd"); + function cswap(p2, q2, b2) { + for (let i = 0; i < 4; i++) + sel25519(p2[i], q2[i], b2); + } + __name(cswap, "cswap"); + function pack(r, p2) { + const tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p2[2]), mul(tx, p2[0], zi), mul(ty, p2[1], zi), pack25519(r, ty), r[31] ^= par25519(tx) << 7; + } + __name(pack, "pack"); + function scalarmult(p2, q2, s) { + set25519(p2[0], gf0), set25519(p2[1], gf1), set25519(p2[2], gf1), set25519(p2[3], gf0); + for (let i = 255; i >= 0; --i) { + const b2 = s[i / 8 | 0] >> (i & 7) & 1; + cswap(p2, q2, b2), edadd(q2, p2), edadd(p2, p2), cswap(p2, q2, b2); + } + } + __name(scalarmult, "scalarmult"); + function scalarbase(p2, s) { + const q2 = [gf(), gf(), gf(), gf()]; + set25519(q2[0], X2), set25519(q2[1], Y), set25519(q2[2], gf1), mul(q2[3], X2, Y), scalarmult(p2, q2, s); + } + __name(scalarbase, "scalarbase"); + function generateKeyPairFromSeed(seed) { + if (seed.length !== exports.SEED_LENGTH) + throw new Error(`ed25519: seed must be ${exports.SEED_LENGTH} bytes`); + const d2 = (0, sha512_1.hash)(seed); + d2[0] &= 248, d2[31] &= 127, d2[31] |= 64; + const publicKey = new Uint8Array(32), p2 = [gf(), gf(), gf(), gf()]; + scalarbase(p2, d2), pack(publicKey, p2); + const secretKey = new Uint8Array(64); + return secretKey.set(seed), secretKey.set(publicKey, 32), { + publicKey, + secretKey + }; + } + __name(generateKeyPairFromSeed, "generateKeyPairFromSeed"), exports.generateKeyPairFromSeed = generateKeyPairFromSeed; + function generateKeyPair2(prng) { + const seed = (0, random_1.randomBytes)(32, prng), result = generateKeyPairFromSeed(seed); + return (0, wipe_1.wipe)(seed), result; + } + __name(generateKeyPair2, "generateKeyPair"), exports.generateKeyPair = generateKeyPair2; + function extractPublicKeyFromSecretKey(secretKey) { + if (secretKey.length !== exports.SECRET_KEY_LENGTH) + throw new Error(`ed25519: secret key must be ${exports.SECRET_KEY_LENGTH} bytes`); + return new Uint8Array(secretKey.subarray(32)); + } + __name(extractPublicKeyFromSecretKey, "extractPublicKeyFromSecretKey"), exports.extractPublicKeyFromSecretKey = extractPublicKeyFromSecretKey; + const L = new Float64Array([ + 237, + 211, + 245, + 92, + 26, + 99, + 18, + 88, + 214, + 156, + 247, + 162, + 222, + 249, + 222, + 20, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 16 + ]); + function modL(r, x2) { + let carry, i, j2, k2; + for (i = 63; i >= 32; --i) { + for (carry = 0, j2 = i - 32, k2 = i - 12; j2 < k2; ++j2) + x2[j2] += carry - 16 * x2[i] * L[j2 - (i - 32)], carry = Math.floor((x2[j2] + 128) / 256), x2[j2] -= carry * 256; + x2[j2] += carry, x2[i] = 0; + } + for (carry = 0, j2 = 0; j2 < 32; j2++) + x2[j2] += carry - (x2[31] >> 4) * L[j2], carry = x2[j2] >> 8, x2[j2] &= 255; + for (j2 = 0; j2 < 32; j2++) + x2[j2] -= carry * L[j2]; + for (i = 0; i < 32; i++) + x2[i + 1] += x2[i] >> 8, r[i] = x2[i] & 255; + } + __name(modL, "modL"); + function reduce(r) { + const x2 = new Float64Array(64); + for (let i = 0; i < 64; i++) + x2[i] = r[i]; + for (let i = 0; i < 64; i++) + r[i] = 0; + modL(r, x2); + } + __name(reduce, "reduce"); + function sign(secretKey, message) { + const x2 = new Float64Array(64), p2 = [gf(), gf(), gf(), gf()], d2 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); + d2[0] &= 248, d2[31] &= 127, d2[31] |= 64; + const signature = new Uint8Array(64); + signature.set(d2.subarray(32), 32); + const hs2 = new sha512_1.SHA512(); + hs2.update(signature.subarray(32)), hs2.update(message); + const r = hs2.digest(); + hs2.clean(), reduce(r), scalarbase(p2, r), pack(signature, p2), hs2.reset(), hs2.update(signature.subarray(0, 32)), hs2.update(secretKey.subarray(32)), hs2.update(message); + const h2 = hs2.digest(); + reduce(h2); + for (let i = 0; i < 32; i++) + x2[i] = r[i]; + for (let i = 0; i < 32; i++) + for (let j2 = 0; j2 < 32; j2++) + x2[i + j2] += h2[i] * d2[j2]; + return modL(signature.subarray(32), x2), signature; + } + __name(sign, "sign"), exports.sign = sign; + function unpackneg(r, p2) { + const t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); + return set25519(r[2], gf1), unpack25519(r[1], p2), square(num, r[1]), mul(den, num, D2), sub(num, num, r[2]), add(den, r[2], den), square(den2, den), square(den4, den2), mul(den6, den4, den2), mul(t, den6, num), mul(t, t, den), pow2523(t, t), mul(t, t, num), mul(t, t, den), mul(t, t, den), mul(r[0], t, den), square(chk, r[0]), mul(chk, chk, den), neq25519(chk, num) && mul(r[0], r[0], I), square(chk, r[0]), mul(chk, chk, den), neq25519(chk, num) ? -1 : (par25519(r[0]) === p2[31] >> 7 && sub(r[0], gf0, r[0]), mul(r[3], r[0], r[1]), 0); + } + __name(unpackneg, "unpackneg"); + function verify(publicKey, message, signature) { + const t = new Uint8Array(32), p2 = [gf(), gf(), gf(), gf()], q2 = [gf(), gf(), gf(), gf()]; + if (signature.length !== exports.SIGNATURE_LENGTH) + throw new Error(`ed25519: signature must be ${exports.SIGNATURE_LENGTH} bytes`); + if (unpackneg(q2, publicKey)) + return !1; + const hs2 = new sha512_1.SHA512(); + hs2.update(signature.subarray(0, 32)), hs2.update(publicKey), hs2.update(message); + const h2 = hs2.digest(); + return reduce(h2), scalarmult(p2, q2, h2), scalarbase(q2, signature.subarray(32)), edadd(p2, q2), pack(t, p2), !verify32(signature, t); + } + __name(verify, "verify"), exports.verify = verify; + function convertPublicKeyToX25519(publicKey) { + let q2 = [gf(), gf(), gf(), gf()]; + if (unpackneg(q2, publicKey)) + throw new Error("Ed25519: invalid public key"); + let a2 = gf(), b2 = gf(), y2 = q2[1]; + add(a2, gf1, y2), sub(b2, gf1, y2), inv25519(b2, b2), mul(a2, a2, b2); + let z2 = new Uint8Array(32); + return pack25519(z2, a2), z2; + } + __name(convertPublicKeyToX25519, "convertPublicKeyToX25519"), exports.convertPublicKeyToX25519 = convertPublicKeyToX25519; + function convertSecretKeyToX25519(secretKey) { + const d2 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); + d2[0] &= 248, d2[31] &= 127, d2[31] |= 64; + const o = new Uint8Array(d2.subarray(0, 32)); + return (0, wipe_1.wipe)(d2), o; + } + __name(convertSecretKeyToX25519, "convertSecretKeyToX25519"), exports.convertSecretKeyToX25519 = convertSecretKeyToX25519; +})(ed25519); +const JWT_IRIDIUM_ALG = "EdDSA", JWT_IRIDIUM_TYP = "JWT", JWT_DELIMITER = ".", JWT_ENCODING = "base64url", JSON_ENCODING = "utf8", DATA_ENCODING = "utf8", DID_DELIMITER = ":", DID_PREFIX = "did", DID_METHOD = "key", MULTICODEC_ED25519_ENCODING = "base58btc", MULTICODEC_ED25519_BASE = "z", MULTICODEC_ED25519_HEADER = "K36", KEY_PAIR_SEED_LENGTH = 32; +function encodeJSON(val) { + return toString(fromString(safeJsonStringify(val), JSON_ENCODING), JWT_ENCODING); +} +__name(encodeJSON, "encodeJSON"); +function encodeIss(publicKey) { + const header = fromString(MULTICODEC_ED25519_HEADER, MULTICODEC_ED25519_ENCODING), multicodec = MULTICODEC_ED25519_BASE + toString(concat([header, publicKey]), MULTICODEC_ED25519_ENCODING); + return [DID_PREFIX, DID_METHOD, multicodec].join(DID_DELIMITER); +} +__name(encodeIss, "encodeIss"); +function encodeSig(bytes) { + return toString(bytes, JWT_ENCODING); +} +__name(encodeSig, "encodeSig"); +function encodeData(params) { + return fromString([encodeJSON(params.header), encodeJSON(params.payload)].join(JWT_DELIMITER), DATA_ENCODING); +} +__name(encodeData, "encodeData"); +function encodeJWT(params) { + return [ + encodeJSON(params.header), + encodeJSON(params.payload), + encodeSig(params.signature) + ].join(JWT_DELIMITER); +} +__name(encodeJWT, "encodeJWT"); +function generateKeyPair(seed = random.randomBytes(KEY_PAIR_SEED_LENGTH)) { + return ed25519.generateKeyPairFromSeed(seed); +} +__name(generateKeyPair, "generateKeyPair"); +async function signJWT(sub, aud, ttl, keyPair, iat = cjs$3.fromMiliseconds(Date.now())) { + const header = { alg: JWT_IRIDIUM_ALG, typ: JWT_IRIDIUM_TYP }, iss = encodeIss(keyPair.publicKey), exp = iat + ttl, payload = { iss, sub, aud, iat, exp }, data = encodeData({ header, payload }), signature = ed25519.sign(keyPair.secretKey, data); + return encodeJWT({ header, payload, signature }); +} +__name(signJWT, "signJWT"); +const PARSE_ERROR = "PARSE_ERROR", INVALID_REQUEST = "INVALID_REQUEST", METHOD_NOT_FOUND = "METHOD_NOT_FOUND", INVALID_PARAMS = "INVALID_PARAMS", INTERNAL_ERROR = "INTERNAL_ERROR", SERVER_ERROR = "SERVER_ERROR", RESERVED_ERROR_CODES = [-32700, -32600, -32601, -32602, -32603], STANDARD_ERROR_MAP = { + [PARSE_ERROR]: { code: -32700, message: "Parse error" }, + [INVALID_REQUEST]: { code: -32600, message: "Invalid Request" }, + [METHOD_NOT_FOUND]: { code: -32601, message: "Method not found" }, + [INVALID_PARAMS]: { code: -32602, message: "Invalid params" }, + [INTERNAL_ERROR]: { code: -32603, message: "Internal error" }, + [SERVER_ERROR]: { code: -32e3, message: "Server error" } +}, DEFAULT_ERROR = SERVER_ERROR; +function isReservedErrorCode(code) { + return RESERVED_ERROR_CODES.includes(code); +} +__name(isReservedErrorCode, "isReservedErrorCode"); +function getError(type) { + return Object.keys(STANDARD_ERROR_MAP).includes(type) ? STANDARD_ERROR_MAP[type] : STANDARD_ERROR_MAP[DEFAULT_ERROR]; +} +__name(getError, "getError"); +function getErrorByCode(code) { + const match = Object.values(STANDARD_ERROR_MAP).find((e) => e.code === code); + return match || STANDARD_ERROR_MAP[DEFAULT_ERROR]; +} +__name(getErrorByCode, "getErrorByCode"); +function parseConnectionError(e, url, type) { + return e.message.includes("getaddrinfo ENOTFOUND") || e.message.includes("connect ECONNREFUSED") ? new Error(`Unavailable ${type} RPC url at ${url}`) : e; +} +__name(parseConnectionError, "parseConnectionError"); +var cjs = {}, crypto$1 = {}, hasRequiredCrypto; +function requireCrypto() { + if (hasRequiredCrypto) + return crypto$1; + hasRequiredCrypto = 1, Object.defineProperty(crypto$1, "__esModule", { value: !0 }), crypto$1.isBrowserCryptoAvailable = crypto$1.getSubtleCrypto = crypto$1.getBrowerCrypto = void 0; + function getBrowerCrypto() { + return (commonjsGlobal === null || commonjsGlobal === void 0 ? void 0 : commonjsGlobal.crypto) || (commonjsGlobal === null || commonjsGlobal === void 0 ? void 0 : commonjsGlobal.msCrypto) || {}; + } + __name(getBrowerCrypto, "getBrowerCrypto"), crypto$1.getBrowerCrypto = getBrowerCrypto; + function getSubtleCrypto() { + const browserCrypto = getBrowerCrypto(); + return browserCrypto.subtle || browserCrypto.webkitSubtle; + } + __name(getSubtleCrypto, "getSubtleCrypto"), crypto$1.getSubtleCrypto = getSubtleCrypto; + function isBrowserCryptoAvailable() { + return !!getBrowerCrypto() && !!getSubtleCrypto(); + } + return __name(isBrowserCryptoAvailable, "isBrowserCryptoAvailable"), crypto$1.isBrowserCryptoAvailable = isBrowserCryptoAvailable, crypto$1; +} +__name(requireCrypto, "requireCrypto"); +var env = {}, hasRequiredEnv; +function requireEnv() { + if (hasRequiredEnv) + return env; + hasRequiredEnv = 1, Object.defineProperty(env, "__esModule", { value: !0 }), env.isBrowser = env.isNode = env.isReactNative = void 0; + function isReactNative() { + return typeof document > "u" && typeof navigator < "u" && navigator.product === "ReactNative"; + } + __name(isReactNative, "isReactNative"), env.isReactNative = isReactNative; + function isNode() { + return typeof process < "u" && typeof process.versions < "u" && typeof process.versions.node < "u"; + } + __name(isNode, "isNode"), env.isNode = isNode; + function isBrowser() { + return !isReactNative() && !isNode(); + } + return __name(isBrowser, "isBrowser"), env.isBrowser = isBrowser, env; +} +__name(requireEnv, "requireEnv"); +(function(exports) { + Object.defineProperty(exports, "__esModule", { value: !0 }); + const tslib_1 = require$$0$1; + tslib_1.__exportStar(requireCrypto(), exports), tslib_1.__exportStar(requireEnv(), exports); +})(cjs); +function payloadId(entropy = 3) { + const date = Date.now() * Math.pow(10, entropy), extra = Math.floor(Math.random() * Math.pow(10, entropy)); + return date + extra; +} +__name(payloadId, "payloadId"); +function getBigIntRpcId(entropy = 6) { + return BigInt(payloadId(entropy)); +} +__name(getBigIntRpcId, "getBigIntRpcId"); +function formatJsonRpcRequest(method, params, id) { + return { + id: id || payloadId(), + jsonrpc: "2.0", + method, + params + }; +} +__name(formatJsonRpcRequest, "formatJsonRpcRequest"); +function formatJsonRpcResult(id, result) { + return { + id, + jsonrpc: "2.0", + result + }; +} +__name(formatJsonRpcResult, "formatJsonRpcResult"); +function formatJsonRpcError(id, error, data) { + return { + id, + jsonrpc: "2.0", + error: formatErrorMessage(error, data) + }; +} +__name(formatJsonRpcError, "formatJsonRpcError"); +function formatErrorMessage(error, data) { + return typeof error > "u" ? getError(INTERNAL_ERROR) : (typeof error == "string" && (error = Object.assign(Object.assign({}, getError(SERVER_ERROR)), { message: error })), typeof data < "u" && (error.data = data), isReservedErrorCode(error.code) && (error = getErrorByCode(error.code)), error); +} +__name(formatErrorMessage, "formatErrorMessage"); +const _IEvents = class _IEvents { +}; +__name(_IEvents, "IEvents"); +let IEvents = _IEvents; +const _IBaseJsonRpcProvider = class _IBaseJsonRpcProvider extends IEvents { + constructor() { + super(); + } +}; +__name(_IBaseJsonRpcProvider, "IBaseJsonRpcProvider"); +let IBaseJsonRpcProvider = _IBaseJsonRpcProvider; +const _IJsonRpcProvider = class _IJsonRpcProvider extends IBaseJsonRpcProvider { + constructor(connection) { + super(); + } +}; +__name(_IJsonRpcProvider, "IJsonRpcProvider"); +let IJsonRpcProvider = _IJsonRpcProvider; +const WS_REGEX = "^wss?:"; +function getUrlProtocol(url) { + const matches = url.match(new RegExp(/^\w+:/, "gi")); + if (!(!matches || !matches.length)) + return matches[0]; +} +__name(getUrlProtocol, "getUrlProtocol"); +function matchRegexProtocol(url, regex) { + const protocol = getUrlProtocol(url); + return typeof protocol > "u" ? !1 : new RegExp(regex).test(protocol); +} +__name(matchRegexProtocol, "matchRegexProtocol"); +function isWsUrl(url) { + return matchRegexProtocol(url, WS_REGEX); +} +__name(isWsUrl, "isWsUrl"); +function isLocalhostUrl(url) { + return new RegExp("wss?://localhost(:d{2,5})?").test(url); +} +__name(isLocalhostUrl, "isLocalhostUrl"); +function isJsonRpcPayload(payload) { + return typeof payload == "object" && "id" in payload && "jsonrpc" in payload && payload.jsonrpc === "2.0"; +} +__name(isJsonRpcPayload, "isJsonRpcPayload"); +function isJsonRpcRequest(payload) { + return isJsonRpcPayload(payload) && "method" in payload; +} +__name(isJsonRpcRequest, "isJsonRpcRequest"); +function isJsonRpcResponse(payload) { + return isJsonRpcPayload(payload) && (isJsonRpcResult(payload) || isJsonRpcError(payload)); +} +__name(isJsonRpcResponse, "isJsonRpcResponse"); +function isJsonRpcResult(payload) { + return "result" in payload; +} +__name(isJsonRpcResult, "isJsonRpcResult"); +function isJsonRpcError(payload) { + return "error" in payload; +} +__name(isJsonRpcError, "isJsonRpcError"); +const _JsonRpcProvider = class _JsonRpcProvider extends IJsonRpcProvider { + constructor(connection) { + super(connection), this.events = new eventsExports.EventEmitter(), this.hasRegisteredEventListeners = !1, this.connection = this.setConnection(connection), this.connection.connected && this.registerEventListeners(); + } + async connect(connection = this.connection) { + await this.open(connection); + } + async disconnect() { + await this.close(); + } + on(event, listener) { + this.events.on(event, listener); + } + once(event, listener) { + this.events.once(event, listener); + } + off(event, listener) { + this.events.off(event, listener); + } + removeListener(event, listener) { + this.events.removeListener(event, listener); + } + async request(request, context) { + return this.requestStrict(formatJsonRpcRequest(request.method, request.params || [], request.id || getBigIntRpcId().toString()), context); + } + async requestStrict(request, context) { + return new Promise(async (resolve, reject) => { + if (!this.connection.connected) + try { + await this.open(); + } catch (e) { + reject(e); + } + this.events.on(`${request.id}`, (response) => { + isJsonRpcError(response) ? reject(response.error) : resolve(response.result); + }); + try { + await this.connection.send(request, context); + } catch (e) { + reject(e); + } + }); + } + setConnection(connection = this.connection) { + return connection; + } + onPayload(payload) { + this.events.emit("payload", payload), isJsonRpcResponse(payload) ? this.events.emit(`${payload.id}`, payload) : this.events.emit("message", { + type: payload.method, + data: payload.params + }); + } + onClose(event) { + event && event.code === 3e3 && this.events.emit("error", new Error(`WebSocket connection closed abnormally with code: ${event.code} ${event.reason ? `(${event.reason})` : ""}`)), this.events.emit("disconnect"); + } + async open(connection = this.connection) { + this.connection === connection && this.connection.connected || (this.connection.connected && this.close(), typeof connection == "string" && (await this.connection.open(connection), connection = this.connection), this.connection = this.setConnection(connection), await this.connection.open(), this.registerEventListeners(), this.events.emit("connect")); + } + async close() { + await this.connection.close(); + } + registerEventListeners() { + this.hasRegisteredEventListeners || (this.connection.on("payload", (payload) => this.onPayload(payload)), this.connection.on("close", (event) => this.onClose(event)), this.connection.on("error", (error) => this.events.emit("error", error)), this.connection.on("register_error", (error) => this.onClose()), this.hasRegisteredEventListeners = !0); + } +}; +__name(_JsonRpcProvider, "JsonRpcProvider"); +let JsonRpcProvider = _JsonRpcProvider; +const w$1 = /* @__PURE__ */ __name(() => typeof WebSocket < "u" ? WebSocket : typeof global < "u" && typeof global.WebSocket < "u" ? global.WebSocket : typeof window < "u" && typeof window.WebSocket < "u" ? window.WebSocket : typeof self < "u" && typeof self.WebSocket < "u" ? self.WebSocket : require("ws"), "w$1"), b = /* @__PURE__ */ __name(() => typeof WebSocket < "u" || typeof global < "u" && typeof global.WebSocket < "u" || typeof window < "u" && typeof window.WebSocket < "u" || typeof self < "u" && typeof self.WebSocket < "u", "b"), a = /* @__PURE__ */ __name((c2) => c2.split("?")[0], "a"), h = 10, S = w$1(), _f = class _f { + constructor(e) { + if (this.url = e, this.events = new eventsExports.EventEmitter(), this.registering = !1, !isWsUrl(e)) + throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`); + this.url = e; + } + get connected() { + return typeof this.socket < "u"; + } + get connecting() { + return this.registering; + } + on(e, t) { + this.events.on(e, t); + } + once(e, t) { + this.events.once(e, t); + } + off(e, t) { + this.events.off(e, t); + } + removeListener(e, t) { + this.events.removeListener(e, t); + } + async open(e = this.url) { + await this.register(e); + } + async close() { + return new Promise((e, t) => { + if (typeof this.socket > "u") { + t(new Error("Connection already closed")); + return; + } + this.socket.onclose = (n2) => { + this.onClose(n2), e(); + }, this.socket.close(); + }); + } + async send(e) { + typeof this.socket > "u" && (this.socket = await this.register()); + try { + this.socket.send(safeJsonStringify(e)); + } catch (t) { + this.onError(e.id, t); + } + } + register(e = this.url) { + if (!isWsUrl(e)) + throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`); + if (this.registering) { + const t = this.events.getMaxListeners(); + return (this.events.listenerCount("register_error") >= t || this.events.listenerCount("open") >= t) && this.events.setMaxListeners(t + 1), new Promise((n2, o) => { + this.events.once("register_error", (s) => { + this.resetMaxListeners(), o(s); + }), this.events.once("open", () => { + if (this.resetMaxListeners(), typeof this.socket > "u") + return o(new Error("WebSocket connection is missing or invalid")); + n2(this.socket); + }); + }); + } + return this.url = e, this.registering = !0, new Promise((t, n2) => { + const o = new URLSearchParams(e).get("origin"), s = cjs.isReactNative() ? { headers: { origin: o } } : { rejectUnauthorized: !isLocalhostUrl(e) }, i = new S(e, [], s); + b() ? i.onerror = (r) => { + const l2 = r; + n2(this.emitError(l2.error)); + } : i.on("error", (r) => { + n2(this.emitError(r)); + }), i.onopen = () => { + this.onOpen(i), t(i); + }; + }); + } + onOpen(e) { + e.onmessage = (t) => this.onPayload(t), e.onclose = (t) => this.onClose(t), this.socket = e, this.registering = !1, this.events.emit("open"); + } + onClose(e) { + this.socket = void 0, this.registering = !1, this.events.emit("close", e); + } + onPayload(e) { + if (typeof e.data > "u") + return; + const t = typeof e.data == "string" ? safeJsonParse(e.data) : e.data; + this.events.emit("payload", t); + } + onError(e, t) { + const n2 = this.parseError(t), o = n2.message || n2.toString(), s = formatJsonRpcError(e, o); + this.events.emit("payload", s); + } + parseError(e, t = this.url) { + return parseConnectionError(e, a(t), "WS"); + } + resetMaxListeners() { + this.events.getMaxListeners() > h && this.events.setMaxListeners(h); + } + emitError(e) { + const t = this.parseError(new Error((e == null ? void 0 : e.message) || `WebSocket connection failed for host: ${a(this.url)}`)); + return this.events.emit("register_error", t), t; + } +}; +__name(_f, "f"); +let f = _f; +var lodash_isequal = { exports: {} }; +lodash_isequal.exports; +(function(module, exports) { + var LARGE_ARRAY_SIZE = 200, HASH_UNDEFINED = "__lodash_hash_undefined__", COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2, MAX_SAFE_INTEGER = 9007199254740991, argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]", reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, reIsUint = /^(?:0|[1-9]\d*)$/, typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = !0, typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = !1; + var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")(), freeExports = exports && !exports.nodeType && exports, freeModule = freeExports && !0 && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, freeProcess = moduleExports && freeGlobal.process, nodeUtil = function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding("util"); + } catch { + } + }(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function arrayFilter(array, predicate) { + for (var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; ++index < length; ) { + var value = array[index]; + predicate(value, index, array) && (result[resIndex++] = value); + } + return result; + } + __name(arrayFilter, "arrayFilter"); + function arrayPush(array, values) { + for (var index = -1, length = values.length, offset = array.length; ++index < length; ) + array[offset + index] = values[index]; + return array; + } + __name(arrayPush, "arrayPush"); + function arraySome(array, predicate) { + for (var index = -1, length = array == null ? 0 : array.length; ++index < length; ) + if (predicate(array[index], index, array)) + return !0; + return !1; + } + __name(arraySome, "arraySome"); + function baseTimes(n2, iteratee) { + for (var index = -1, result = Array(n2); ++index < n2; ) + result[index] = iteratee(index); + return result; + } + __name(baseTimes, "baseTimes"); + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + __name(baseUnary, "baseUnary"); + function cacheHas(cache, key) { + return cache.has(key); + } + __name(cacheHas, "cacheHas"); + function getValue(object, key) { + return object == null ? void 0 : object[key]; + } + __name(getValue, "getValue"); + function mapToArray(map) { + var index = -1, result = Array(map.size); + return map.forEach(function(value, key) { + result[++index] = [key, value]; + }), result; + } + __name(mapToArray, "mapToArray"); + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + __name(overArg, "overArg"); + function setToArray(set2) { + var index = -1, result = Array(set2.size); + return set2.forEach(function(value) { + result[++index] = value; + }), result; + } + __name(setToArray, "setToArray"); + var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype, coreJsData = root["__core-js_shared__"], funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(), nativeObjectToString = objectProto.toString, reIsNative = RegExp( + "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ), Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object), DataView = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create"), dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap), symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; + function Hash(entries) { + var index = -1, length = entries == null ? 0 : entries.length; + for (this.clear(); ++index < length; ) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + __name(Hash, "Hash"); + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0; + } + __name(hashClear, "hashClear"); + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + return this.size -= result ? 1 : 0, result; + } + __name(hashDelete, "hashDelete"); + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? void 0 : result; + } + return hasOwnProperty.call(data, key) ? data[key] : void 0; + } + __name(hashGet, "hashGet"); + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); + } + __name(hashHas, "hashHas"); + function hashSet(key, value) { + var data = this.__data__; + return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value, this; + } + __name(hashSet, "hashSet"), Hash.prototype.clear = hashClear, Hash.prototype.delete = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet; + function ListCache(entries) { + var index = -1, length = entries == null ? 0 : entries.length; + for (this.clear(); ++index < length; ) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + __name(ListCache, "ListCache"); + function listCacheClear() { + this.__data__ = [], this.size = 0; + } + __name(listCacheClear, "listCacheClear"); + function listCacheDelete(key) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) + return !1; + var lastIndex = data.length - 1; + return index == lastIndex ? data.pop() : splice.call(data, index, 1), --this.size, !0; + } + __name(listCacheDelete, "listCacheDelete"); + function listCacheGet(key) { + var data = this.__data__, index = assocIndexOf(data, key); + return index < 0 ? void 0 : data[index][1]; + } + __name(listCacheGet, "listCacheGet"); + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + __name(listCacheHas, "listCacheHas"); + function listCacheSet(key, value) { + var data = this.__data__, index = assocIndexOf(data, key); + return index < 0 ? (++this.size, data.push([key, value])) : data[index][1] = value, this; + } + __name(listCacheSet, "listCacheSet"), ListCache.prototype.clear = listCacheClear, ListCache.prototype.delete = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet; + function MapCache(entries) { + var index = -1, length = entries == null ? 0 : entries.length; + for (this.clear(); ++index < length; ) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + __name(MapCache, "MapCache"); + function mapCacheClear() { + this.size = 0, this.__data__ = { + hash: new Hash(), + map: new (Map2 || ListCache)(), + string: new Hash() + }; + } + __name(mapCacheClear, "mapCacheClear"); + function mapCacheDelete(key) { + var result = getMapData(this, key).delete(key); + return this.size -= result ? 1 : 0, result; + } + __name(mapCacheDelete, "mapCacheDelete"); + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + __name(mapCacheGet, "mapCacheGet"); + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + __name(mapCacheHas, "mapCacheHas"); + function mapCacheSet(key, value) { + var data = getMapData(this, key), size = data.size; + return data.set(key, value), this.size += data.size == size ? 0 : 1, this; + } + __name(mapCacheSet, "mapCacheSet"), MapCache.prototype.clear = mapCacheClear, MapCache.prototype.delete = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet; + function SetCache(values) { + var index = -1, length = values == null ? 0 : values.length; + for (this.__data__ = new MapCache(); ++index < length; ) + this.add(values[index]); + } + __name(SetCache, "SetCache"); + function setCacheAdd(value) { + return this.__data__.set(value, HASH_UNDEFINED), this; + } + __name(setCacheAdd, "setCacheAdd"); + function setCacheHas(value) { + return this.__data__.has(value); + } + __name(setCacheHas, "setCacheHas"), SetCache.prototype.add = SetCache.prototype.push = setCacheAdd, SetCache.prototype.has = setCacheHas; + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + __name(Stack, "Stack"); + function stackClear() { + this.__data__ = new ListCache(), this.size = 0; + } + __name(stackClear, "stackClear"); + function stackDelete(key) { + var data = this.__data__, result = data.delete(key); + return this.size = data.size, result; + } + __name(stackDelete, "stackDelete"); + function stackGet(key) { + return this.__data__.get(key); + } + __name(stackGet, "stackGet"); + function stackHas(key) { + return this.__data__.has(key); + } + __name(stackHas, "stackHas"); + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) + return pairs.push([key, value]), this.size = ++data.size, this; + data = this.__data__ = new MapCache(pairs); + } + return data.set(key, value), this.size = data.size, this; + } + __name(stackSet, "stackSet"), Stack.prototype.clear = stackClear, Stack.prototype.delete = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet; + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; + for (var key in value) + (inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. + (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. + isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. + isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. + isIndex(key, length))) && result.push(key); + return result; + } + __name(arrayLikeKeys, "arrayLikeKeys"); + function assocIndexOf(array, key) { + for (var length = array.length; length--; ) + if (eq(array[length][0], key)) + return length; + return -1; + } + __name(assocIndexOf, "assocIndexOf"); + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + __name(baseGetAllKeys, "baseGetAllKeys"); + function baseGetTag(value) { + return value == null ? value === void 0 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + __name(baseGetTag, "baseGetTag"); + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + __name(baseIsArguments, "baseIsArguments"); + function baseIsEqual(value, other, bitmask, customizer, stack) { + return value === other ? !0 : value == null || other == null || !isObjectLike(value) && !isObjectLike(other) ? value !== value && other !== other : baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + __name(baseIsEqual, "baseIsEqual"); + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); + objTag = objTag == argsTag ? objectTag : objTag, othTag = othTag == argsTag ? objectTag : othTag; + var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) + return !1; + objIsArr = !0, objIsObj = !1; + } + if (isSameTag && !objIsObj) + return stack || (stack = new Stack()), objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; + return stack || (stack = new Stack()), equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + return isSameTag ? (stack || (stack = new Stack()), equalObjects(object, other, bitmask, customizer, equalFunc, stack)) : !1; + } + __name(baseIsEqualDeep, "baseIsEqualDeep"); + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) + return !1; + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + __name(baseIsNative, "baseIsNative"); + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + __name(baseIsTypedArray, "baseIsTypedArray"); + function baseKeys(object) { + if (!isPrototype(object)) + return nativeKeys(object); + var result = []; + for (var key in Object(object)) + hasOwnProperty.call(object, key) && key != "constructor" && result.push(key); + return result; + } + __name(baseKeys, "baseKeys"); + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) + return !1; + var stacked = stack.get(array); + if (stacked && stack.get(other)) + return stacked == other; + var index = -1, result = !0, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0; + for (stack.set(array, other), stack.set(other, array); ++index < arrLength; ) { + var arrValue = array[index], othValue = other[index]; + if (customizer) + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); + if (compared !== void 0) { + if (compared) + continue; + result = !1; + break; + } + if (seen) { + if (!arraySome(other, function(othValue2, othIndex) { + if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) + return seen.push(othIndex); + })) { + result = !1; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + result = !1; + break; + } + } + return stack.delete(array), stack.delete(other), result; + } + __name(equalArrays, "equalArrays"); + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) + return !1; + object = object.buffer, other = other.buffer; + case arrayBufferTag: + return !(object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))); + case boolTag: + case dateTag: + case numberTag: + return eq(+object, +other); + case errorTag: + return object.name == other.name && object.message == other.message; + case regexpTag: + case stringTag: + return object == other + ""; + case mapTag: + var convert = mapToArray; + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + if (convert || (convert = setToArray), object.size != other.size && !isPartial) + return !1; + var stacked = stack.get(object); + if (stacked) + return stacked == other; + bitmask |= COMPARE_UNORDERED_FLAG, stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + return stack.delete(object), result; + case symbolTag: + if (symbolValueOf) + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + return !1; + } + __name(equalByTag, "equalByTag"); + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) + return !1; + for (var index = objLength; index--; ) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) + return !1; + } + var stacked = stack.get(object); + if (stacked && stack.get(other)) + return stacked == other; + var result = !0; + stack.set(object, other), stack.set(other, object); + for (var skipCtor = isPartial; ++index < objLength; ) { + key = objProps[index]; + var objValue = object[key], othValue = other[key]; + if (customizer) + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { + result = !1; + break; + } + skipCtor || (skipCtor = key == "constructor"); + } + if (result && !skipCtor) { + var objCtor = object.constructor, othCtor = other.constructor; + objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor) && (result = !1); + } + return stack.delete(object), stack.delete(other), result; + } + __name(equalObjects, "equalObjects"); + function getAllKeys(object) { + return baseGetAllKeys(object, keys2, getSymbols); + } + __name(getAllKeys, "getAllKeys"); + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + } + __name(getMapData, "getMapData"); + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : void 0; + } + __name(getNative, "getNative"); + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + try { + value[symToStringTag] = void 0; + var unmasked = !0; + } catch { + } + var result = nativeObjectToString.call(value); + return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result; + } + __name(getRawTag, "getRawTag"); + var getSymbols = nativeGetSymbols ? function(object) { + return object == null ? [] : (object = Object(object), arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + })); + } : stubArray, getTag = baseGetTag; + (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) && (getTag = /* @__PURE__ */ __name(function(value) { + var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; + if (ctorString) + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + return result; + }, "getTag")); + function isIndex(value, length) { + return length = length ?? MAX_SAFE_INTEGER, !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; + } + __name(isIndex, "isIndex"); + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; + } + __name(isKeyable, "isKeyable"); + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + __name(isMasked, "isMasked"); + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; + } + __name(isPrototype, "isPrototype"); + function objectToString(value) { + return nativeObjectToString.call(value); + } + __name(objectToString, "objectToString"); + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch { + } + try { + return func + ""; + } catch { + } + } + return ""; + } + __name(toSource, "toSource"); + function eq(value, other) { + return value === other || value !== value && other !== other; + } + __name(eq, "eq"); + var isArguments = baseIsArguments(function() { + return arguments; + }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); + }, isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + __name(isArrayLike, "isArrayLike"); + var isBuffer = nativeIsBuffer || stubFalse; + function isEqual(value, other) { + return baseIsEqual(value, other); + } + __name(isEqual, "isEqual"); + function isFunction(value) { + if (!isObject(value)) + return !1; + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + __name(isFunction, "isFunction"); + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + __name(isLength, "isLength"); + function isObject(value) { + var type = typeof value; + return value != null && (type == "object" || type == "function"); + } + __name(isObject, "isObject"); + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + __name(isObjectLike, "isObjectLike"); + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + function keys2(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + __name(keys2, "keys"); + function stubArray() { + return []; + } + __name(stubArray, "stubArray"); + function stubFalse() { + return !1; + } + __name(stubFalse, "stubFalse"), module.exports = isEqual; +})(lodash_isequal, lodash_isequal.exports); +var lodash_isequalExports = lodash_isequal.exports; +const Bi = /* @__PURE__ */ getDefaultExportFromCjs(lodash_isequalExports); +function Vi(r, e) { + if (r.length >= 255) + throw new TypeError("Alphabet too long"); + for (var t = new Uint8Array(256), i = 0; i < t.length; i++) + t[i] = 255; + for (var s = 0; s < r.length; s++) { + var n2 = r.charAt(s), o = n2.charCodeAt(0); + if (t[o] !== 255) + throw new TypeError(n2 + " is ambiguous"); + t[o] = s; + } + var a2 = r.length, h2 = r.charAt(0), l2 = Math.log(a2) / Math.log(256), d2 = Math.log(256) / Math.log(a2); + function p2(u2) { + if (u2 instanceof Uint8Array || (ArrayBuffer.isView(u2) ? u2 = new Uint8Array(u2.buffer, u2.byteOffset, u2.byteLength) : Array.isArray(u2) && (u2 = Uint8Array.from(u2))), !(u2 instanceof Uint8Array)) + throw new TypeError("Expected Uint8Array"); + if (u2.length === 0) + return ""; + for (var m = 0, z2 = 0, I = 0, _2 = u2.length; I !== _2 && u2[I] === 0; ) + I++, m++; + for (var S2 = (_2 - I) * d2 + 1 >>> 0, b2 = new Uint8Array(S2); I !== _2; ) { + for (var T = u2[I], A = 0, C2 = S2 - 1; (T !== 0 || A < z2) && C2 !== -1; C2--, A++) + T += 256 * b2[C2] >>> 0, b2[C2] = T % a2 >>> 0, T = T / a2 >>> 0; + if (T !== 0) + throw new Error("Non-zero carry"); + z2 = A, I++; + } + for (var x2 = S2 - z2; x2 !== S2 && b2[x2] === 0; ) + x2++; + for (var j2 = h2.repeat(m); x2 < S2; ++x2) + j2 += r.charAt(b2[x2]); + return j2; + } + __name(p2, "p"); + function y2(u2) { + if (typeof u2 != "string") + throw new TypeError("Expected String"); + if (u2.length === 0) + return new Uint8Array(); + var m = 0; + if (u2[m] !== " ") { + for (var z2 = 0, I = 0; u2[m] === h2; ) + z2++, m++; + for (var _2 = (u2.length - m) * l2 + 1 >>> 0, S2 = new Uint8Array(_2); u2[m]; ) { + var b2 = t[u2.charCodeAt(m)]; + if (b2 === 255) + return; + for (var T = 0, A = _2 - 1; (b2 !== 0 || T < I) && A !== -1; A--, T++) + b2 += a2 * S2[A] >>> 0, S2[A] = b2 % 256 >>> 0, b2 = b2 / 256 >>> 0; + if (b2 !== 0) + throw new Error("Non-zero carry"); + I = T, m++; + } + if (u2[m] !== " ") { + for (var C2 = _2 - I; C2 !== _2 && S2[C2] === 0; ) + C2++; + for (var x2 = new Uint8Array(z2 + (_2 - C2)), j2 = z2; C2 !== _2; ) + x2[j2++] = S2[C2++]; + return x2; + } + } + } + __name(y2, "y"); + function M(u2) { + var m = y2(u2); + if (m) + return m; + throw new Error(`Non-${e} character`); + } + return __name(M, "M"), { encode: p2, decodeUnsafe: y2, decode: M }; +} +__name(Vi, "Vi"); +var qi = Vi, ji = qi; +const Ne = /* @__PURE__ */ __name((r) => { + if (r instanceof Uint8Array && r.constructor.name === "Uint8Array") + return r; + if (r instanceof ArrayBuffer) + return new Uint8Array(r); + if (ArrayBuffer.isView(r)) + return new Uint8Array(r.buffer, r.byteOffset, r.byteLength); + throw new Error("Unknown type, must be binary type"); +}, "Ne"), Gi = /* @__PURE__ */ __name((r) => new TextEncoder().encode(r), "Gi"), Yi = /* @__PURE__ */ __name((r) => new TextDecoder().decode(r), "Yi"), _Hi = class _Hi { + constructor(e, t, i) { + this.name = e, this.prefix = t, this.baseEncode = i; + } + encode(e) { + if (e instanceof Uint8Array) + return `${this.prefix}${this.baseEncode(e)}`; + throw Error("Unknown type, must be binary type"); + } +}; +__name(_Hi, "Hi"); +let Hi = _Hi; +const _Ji = class _Ji { + constructor(e, t, i) { + if (this.name = e, this.prefix = t, t.codePointAt(0) === void 0) + throw new Error("Invalid prefix character"); + this.prefixCodePoint = t.codePointAt(0), this.baseDecode = i; + } + decode(e) { + if (typeof e == "string") { + if (e.codePointAt(0) !== this.prefixCodePoint) + throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + return this.baseDecode(e.slice(this.prefix.length)); + } else + throw Error("Can only multibase decode strings"); + } + or(e) { + return Ue(this, e); + } +}; +__name(_Ji, "Ji"); +let Ji = _Ji; +const _Wi = class _Wi { + constructor(e) { + this.decoders = e; + } + or(e) { + return Ue(this, e); + } + decode(e) { + const t = e[0], i = this.decoders[t]; + if (i) + return i.decode(e); + throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } +}; +__name(_Wi, "Wi"); +let Wi = _Wi; +const Ue = /* @__PURE__ */ __name((r, e) => new Wi({ ...r.decoders || { [r.prefix]: r }, ...e.decoders || { [e.prefix]: e } }), "Ue"), _Xi = class _Xi { + constructor(e, t, i, s) { + this.name = e, this.prefix = t, this.baseEncode = i, this.baseDecode = s, this.encoder = new Hi(e, t, i), this.decoder = new Ji(e, t, s); + } + encode(e) { + return this.encoder.encode(e); + } + decode(e) { + return this.decoder.decode(e); + } +}; +__name(_Xi, "Xi"); +let Xi = _Xi; +const X = /* @__PURE__ */ __name(({ name: r, prefix: e, encode: t, decode: i }) => new Xi(r, e, t, i), "X"), B = /* @__PURE__ */ __name(({ prefix: r, name: e, alphabet: t }) => { + const { encode: i, decode: s } = ji(t, e); + return X({ prefix: r, name: e, encode: i, decode: (n2) => Ne(s(n2)) }); +}, "B"), Qi = /* @__PURE__ */ __name((r, e, t, i) => { + const s = {}; + for (let d2 = 0; d2 < e.length; ++d2) + s[e[d2]] = d2; + let n2 = r.length; + for (; r[n2 - 1] === "="; ) + --n2; + const o = new Uint8Array(n2 * t / 8 | 0); + let a2 = 0, h2 = 0, l2 = 0; + for (let d2 = 0; d2 < n2; ++d2) { + const p2 = s[r[d2]]; + if (p2 === void 0) + throw new SyntaxError(`Non-${i} character`); + h2 = h2 << t | p2, a2 += t, a2 >= 8 && (a2 -= 8, o[l2++] = 255 & h2 >> a2); + } + if (a2 >= t || 255 & h2 << 8 - a2) + throw new SyntaxError("Unexpected end of data"); + return o; +}, "Qi"), Zi = /* @__PURE__ */ __name((r, e, t) => { + const i = e[e.length - 1] === "=", s = (1 << t) - 1; + let n2 = "", o = 0, a2 = 0; + for (let h2 = 0; h2 < r.length; ++h2) + for (a2 = a2 << 8 | r[h2], o += 8; o > t; ) + o -= t, n2 += e[s & a2 >> o]; + if (o && (n2 += e[s & a2 << t - o]), i) + for (; n2.length * t & 7; ) + n2 += "="; + return n2; +}, "Zi"), g = /* @__PURE__ */ __name(({ name: r, prefix: e, bitsPerChar: t, alphabet: i }) => X({ prefix: e, name: r, encode(s) { + return Zi(s, i, t); +}, decode(s) { + return Qi(s, i, t, r); +} }), "g"), es = X({ prefix: "\0", name: "identity", encode: (r) => Yi(r), decode: (r) => Gi(r) }); +var ts = Object.freeze({ __proto__: null, identity: es }); +const is = g({ prefix: "0", name: "base2", alphabet: "01", bitsPerChar: 1 }); +var ss = Object.freeze({ __proto__: null, base2: is }); +const rs = g({ prefix: "7", name: "base8", alphabet: "01234567", bitsPerChar: 3 }); +var ns = Object.freeze({ __proto__: null, base8: rs }); +const os = B({ prefix: "9", name: "base10", alphabet: "0123456789" }); +var as = Object.freeze({ __proto__: null, base10: os }); +const hs = g({ prefix: "f", name: "base16", alphabet: "0123456789abcdef", bitsPerChar: 4 }), cs = g({ prefix: "F", name: "base16upper", alphabet: "0123456789ABCDEF", bitsPerChar: 4 }); +var us = Object.freeze({ __proto__: null, base16: hs, base16upper: cs }); +const ls = g({ prefix: "b", name: "base32", alphabet: "abcdefghijklmnopqrstuvwxyz234567", bitsPerChar: 5 }), ds = g({ prefix: "B", name: "base32upper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", bitsPerChar: 5 }), gs = g({ prefix: "c", name: "base32pad", alphabet: "abcdefghijklmnopqrstuvwxyz234567=", bitsPerChar: 5 }), ps = g({ prefix: "C", name: "base32padupper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", bitsPerChar: 5 }), Ds = g({ prefix: "v", name: "base32hex", alphabet: "0123456789abcdefghijklmnopqrstuv", bitsPerChar: 5 }), ys = g({ prefix: "V", name: "base32hexupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", bitsPerChar: 5 }), ms = g({ prefix: "t", name: "base32hexpad", alphabet: "0123456789abcdefghijklmnopqrstuv=", bitsPerChar: 5 }), bs = g({ prefix: "T", name: "base32hexpadupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", bitsPerChar: 5 }), fs = g({ prefix: "h", name: "base32z", alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", bitsPerChar: 5 }); +var Es = Object.freeze({ __proto__: null, base32: ls, base32upper: ds, base32pad: gs, base32padupper: ps, base32hex: Ds, base32hexupper: ys, base32hexpad: ms, base32hexpadupper: bs, base32z: fs }); +const ws = B({ prefix: "k", name: "base36", alphabet: "0123456789abcdefghijklmnopqrstuvwxyz" }), vs = B({ prefix: "K", name: "base36upper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }); +var Is = Object.freeze({ __proto__: null, base36: ws, base36upper: vs }); +const Cs = B({ name: "base58btc", prefix: "z", alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" }), Rs = B({ name: "base58flickr", prefix: "Z", alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" }); +var _s = Object.freeze({ __proto__: null, base58btc: Cs, base58flickr: Rs }); +const Ss = g({ prefix: "m", name: "base64", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", bitsPerChar: 6 }), Ts = g({ prefix: "M", name: "base64pad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", bitsPerChar: 6 }), Ps = g({ prefix: "u", name: "base64url", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", bitsPerChar: 6 }), xs = g({ prefix: "U", name: "base64urlpad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=", bitsPerChar: 6 }); +var Os = Object.freeze({ __proto__: null, base64: Ss, base64pad: Ts, base64url: Ps, base64urlpad: xs }); +const Le = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"), As = Le.reduce((r, e, t) => (r[t] = e, r), []), zs = Le.reduce((r, e, t) => (r[e.codePointAt(0)] = t, r), []); +function Ns(r) { + return r.reduce((e, t) => (e += As[t], e), ""); +} +__name(Ns, "Ns"); +function Us(r) { + const e = []; + for (const t of r) { + const i = zs[t.codePointAt(0)]; + if (i === void 0) + throw new Error(`Non-base256emoji character: ${t}`); + e.push(i); + } + return new Uint8Array(e); +} +__name(Us, "Us"); +const Ls = X({ prefix: "🚀", name: "base256emoji", encode: Ns, decode: Us }); +var Fs = Object.freeze({ __proto__: null, base256emoji: Ls }), $s = $e, Fe = 128, Ms = 127, ks = ~Ms, Ks = Math.pow(2, 31); +function $e(r, e, t) { + e = e || [], t = t || 0; + for (var i = t; r >= Ks; ) + e[t++] = r & 255 | Fe, r /= 128; + for (; r & ks; ) + e[t++] = r & 255 | Fe, r >>>= 7; + return e[t] = r | 0, $e.bytes = t - i + 1, e; +} +__name($e, "$e"); +var Bs = he, Vs = 128, Me = 127; +function he(r, i) { + var t = 0, i = i || 0, s = 0, n2 = i, o, a2 = r.length; + do { + if (n2 >= a2) + throw he.bytes = 0, new RangeError("Could not decode varint"); + o = r[n2++], t += s < 28 ? (o & Me) << s : (o & Me) * Math.pow(2, s), s += 7; + } while (o >= Vs); + return he.bytes = n2 - i, t; +} +__name(he, "he"); +var qs = Math.pow(2, 7), js = Math.pow(2, 14), Gs = Math.pow(2, 21), Ys = Math.pow(2, 28), Hs = Math.pow(2, 35), Js = Math.pow(2, 42), Ws = Math.pow(2, 49), Xs = Math.pow(2, 56), Qs = Math.pow(2, 63), Zs = /* @__PURE__ */ __name(function(r) { + return r < qs ? 1 : r < js ? 2 : r < Gs ? 3 : r < Ys ? 4 : r < Hs ? 5 : r < Js ? 6 : r < Ws ? 7 : r < Xs ? 8 : r < Qs ? 9 : 10; +}, "Zs"), er = { encode: $s, decode: Bs, encodingLength: Zs }, ke = er; +const Ke = /* @__PURE__ */ __name((r, e, t = 0) => (ke.encode(r, e, t), e), "Ke"), Be = /* @__PURE__ */ __name((r) => ke.encodingLength(r), "Be"), ce = /* @__PURE__ */ __name((r, e) => { + const t = e.byteLength, i = Be(r), s = i + Be(t), n2 = new Uint8Array(s + t); + return Ke(r, n2, 0), Ke(t, n2, i), n2.set(e, s), new tr(r, t, e, n2); +}, "ce"), _tr = class _tr { + constructor(e, t, i, s) { + this.code = e, this.size = t, this.digest = i, this.bytes = s; + } +}; +__name(_tr, "tr"); +let tr = _tr; +const Ve = /* @__PURE__ */ __name(({ name: r, code: e, encode: t }) => new ir(r, e, t), "Ve"), _ir = class _ir { + constructor(e, t, i) { + this.name = e, this.code = t, this.encode = i; + } + digest(e) { + if (e instanceof Uint8Array) { + const t = this.encode(e); + return t instanceof Uint8Array ? ce(this.code, t) : t.then((i) => ce(this.code, i)); + } else + throw Error("Unknown type, must be binary type"); + } +}; +__name(_ir, "ir"); +let ir = _ir; +const qe = /* @__PURE__ */ __name((r) => async (e) => new Uint8Array(await crypto.subtle.digest(r, e)), "qe"), sr = Ve({ name: "sha2-256", code: 18, encode: qe("SHA-256") }), rr = Ve({ name: "sha2-512", code: 19, encode: qe("SHA-512") }); +var nr = Object.freeze({ __proto__: null, sha256: sr, sha512: rr }); +const je = 0, or = "identity", Ge = Ne, ar = /* @__PURE__ */ __name((r) => ce(je, Ge(r)), "ar"), hr = { code: je, name: or, encode: Ge, digest: ar }; +var cr = Object.freeze({ __proto__: null, identity: hr }); +new TextEncoder(), new TextDecoder(); +const Ye = { ...ts, ...ss, ...ns, ...as, ...us, ...Es, ...Is, ..._s, ...Os, ...Fs }; +({ ...nr, ...cr }); +function He(r) { + return globalThis.Buffer != null ? new Uint8Array(r.buffer, r.byteOffset, r.byteLength) : r; +} +__name(He, "He"); +function ur(r = 0) { + return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? He(globalThis.Buffer.allocUnsafe(r)) : new Uint8Array(r); +} +__name(ur, "ur"); +function Je(r, e, t, i) { + return { name: r, prefix: e, encoder: { name: r, prefix: e, encode: t }, decoder: { decode: i } }; +} +__name(Je, "Je"); +const We = Je("utf8", "u", (r) => "u" + new TextDecoder("utf8").decode(r), (r) => new TextEncoder().encode(r.substring(1))), ue = Je("ascii", "a", (r) => { + let e = "a"; + for (let t = 0; t < r.length; t++) + e += String.fromCharCode(r[t]); + return e; +}, (r) => { + r = r.substring(1); + const e = ur(r.length); + for (let t = 0; t < r.length; t++) + e[t] = r.charCodeAt(t); + return e; +}), lr = { utf8: We, "utf-8": We, hex: Ye.base16, latin1: ue, ascii: ue, binary: ue, ...Ye }; +function dr(r, e = "utf8") { + const t = lr[e]; + if (!t) + throw new Error(`Unsupported encoding "${e}"`); + return (e === "utf8" || e === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? He(globalThis.Buffer.from(r, "utf-8")) : t.decoder.decode(`${t.prefix}${r}`); +} +__name(dr, "dr"); +const le = "wc", Xe = 2, Q = "core", O = `${le}@2:${Q}:`, Qe = { name: Q, logger: "error" }, Ze = { database: ":memory:" }, et = "crypto", de = "client_ed25519_seed", tt = cjs$3.ONE_DAY, it = "keychain", st = "0.3", rt = "messages", nt = "0.3", ot = cjs$3.SIX_HOURS, at = "publisher", ht = "irn", ct = "error", ge = "wss://relay.walletconnect.com", pe = "wss://relay.walletconnect.org", ut = "relayer", D = { message: "relayer_message", message_ack: "relayer_message_ack", connect: "relayer_connect", disconnect: "relayer_disconnect", error: "relayer_error", connection_stalled: "relayer_connection_stalled", transport_closed: "relayer_transport_closed", publish: "relayer_publish" }, lt = "_subscription", P = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, dt = cjs$3.ONE_SECOND, gr = { database: ":memory:" }, gt = "2.10.6", pt = 1e4, Dt = "0.3", yt = "WALLETCONNECT_CLIENT_ID", w = { created: "subscription_created", deleted: "subscription_deleted", expired: "subscription_expired", disabled: "subscription_disabled", sync: "subscription_sync", resubscribed: "subscription_resubscribed" }, pr = cjs$3.THIRTY_DAYS, mt = "subscription", bt = "0.3", ft = cjs$3.FIVE_SECONDS * 1e3, Et = "pairing", wt = "0.3", Dr = cjs$3.THIRTY_DAYS, F = { wc_pairingDelete: { req: { ttl: cjs$3.ONE_DAY, prompt: !1, tag: 1e3 }, res: { ttl: cjs$3.ONE_DAY, prompt: !1, tag: 1001 } }, wc_pairingPing: { req: { ttl: cjs$3.THIRTY_SECONDS, prompt: !1, tag: 1002 }, res: { ttl: cjs$3.THIRTY_SECONDS, prompt: !1, tag: 1003 } }, unregistered_method: { req: { ttl: cjs$3.ONE_DAY, prompt: !1, tag: 0 }, res: { ttl: cjs$3.ONE_DAY, prompt: !1, tag: 0 } } }, V = { create: "pairing_create", expire: "pairing_expire", delete: "pairing_delete", ping: "pairing_ping" }, R = { created: "history_created", updated: "history_updated", deleted: "history_deleted", sync: "history_sync" }, vt = "history", It = "0.3", Ct = "expirer", v = { created: "expirer_created", deleted: "expirer_deleted", expired: "expirer_expired", sync: "expirer_sync" }, Rt = "0.3", yr = cjs$3.ONE_DAY, Z = "verify-api", $ = "https://verify.walletconnect.com", ee = "https://verify.walletconnect.org", _t = [$, ee], _St = class _St { + constructor(e, t) { + this.core = e, this.logger = t, this.keychain = /* @__PURE__ */ new Map(), this.name = it, this.version = st, this.initialized = !1, this.storagePrefix = O, this.init = async () => { + if (!this.initialized) { + const i = await this.getKeyChain(); + typeof i < "u" && (this.keychain = i), this.initialized = !0; + } + }, this.has = (i) => (this.isInitialized(), this.keychain.has(i)), this.set = async (i, s) => { + this.isInitialized(), this.keychain.set(i, s), await this.persist(); + }, this.get = (i) => { + this.isInitialized(); + const s = this.keychain.get(i); + if (typeof s > "u") { + const { message: n2 } = N$1("NO_MATCHING_KEY", `${this.name}: ${i}`); + throw new Error(n2); + } + return s; + }, this.del = async (i) => { + this.isInitialized(), this.keychain.delete(i), await this.persist(); + }, this.core = e, this.logger = cjs$1.generateChildLogger(t, this.name); + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + get storageKey() { + return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; + } + async setKeyChain(e) { + await this.core.storage.setItem(this.storageKey, rt$1(e)); + } + async getKeyChain() { + const e = await this.core.storage.getItem(this.storageKey); + return typeof e < "u" ? ot$1(e) : void 0; + } + async persist() { + await this.setKeyChain(this.keychain); + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } +}; +__name(_St, "St"); +let St = _St; +const _Tt = class _Tt { + constructor(e, t, i) { + this.core = e, this.logger = t, this.name = et, this.initialized = !1, this.init = async () => { + this.initialized || (await this.keychain.init(), this.initialized = !0); + }, this.hasKeys = (s) => (this.isInitialized(), this.keychain.has(s)), this.getClientId = async () => { + this.isInitialized(); + const s = await this.getClientSeed(), n2 = generateKeyPair(s); + return encodeIss(n2.publicKey); + }, this.generateKeyPair = () => { + this.isInitialized(); + const s = kn(); + return this.setPrivateKey(s.publicKey, s.privateKey); + }, this.signJWT = async (s) => { + this.isInitialized(); + const n2 = await this.getClientSeed(), o = generateKeyPair(n2), a2 = Vn(); + return await signJWT(a2, s, tt, o); + }, this.generateSharedKey = (s, n2, o) => { + this.isInitialized(); + const a2 = this.getPrivateKey(s), h2 = Mn(a2, n2); + return this.setSymKey(h2, o); + }, this.setSymKey = async (s, n2) => { + this.isInitialized(); + const o = n2 || Kn(s); + return await this.keychain.set(o, s), o; + }, this.deleteKeyPair = async (s) => { + this.isInitialized(), await this.keychain.del(s); + }, this.deleteSymKey = async (s) => { + this.isInitialized(), await this.keychain.del(s); + }, this.encode = async (s, n2, o) => { + this.isInitialized(); + const a2 = Te(o), h2 = safeJsonStringify(n2); + if (qn(a2)) { + const y2 = a2.senderPublicKey, M = a2.receiverPublicKey; + s = await this.generateSharedKey(y2, M); + } + const l2 = this.getSymKey(s), { type: d2, senderPublicKey: p2 } = a2; + return xn({ type: d2, symKey: l2, message: h2, senderPublicKey: p2 }); + }, this.decode = async (s, n2, o) => { + this.isInitialized(); + const a2 = Hn(n2, o); + if (qn(a2)) { + const h2 = a2.receiverPublicKey, l2 = a2.senderPublicKey; + s = await this.generateSharedKey(h2, l2); + } + try { + const h2 = this.getSymKey(s), l2 = Fn({ symKey: h2, encoded: n2 }); + return safeJsonParse(l2); + } catch (h2) { + this.logger.error(`Failed to decode message from topic: '${s}', clientId: '${await this.getClientId()}'`), this.logger.error(h2); + } + }, this.getPayloadType = (s) => { + const n2 = ee$1(s); + return $$1(n2.type); + }, this.getPayloadSenderPublicKey = (s) => { + const n2 = ee$1(s); + return n2.senderPublicKey ? toString(n2.senderPublicKey, p$1) : void 0; + }, this.core = e, this.logger = cjs$1.generateChildLogger(t, this.name), this.keychain = i || new St(this.core, this.logger); + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + async setPrivateKey(e, t) { + return await this.keychain.set(e, t), e; + } + getPrivateKey(e) { + return this.keychain.get(e); + } + async getClientSeed() { + let e = ""; + try { + e = this.keychain.get(de); + } catch { + e = Vn(), await this.keychain.set(de, e); + } + return dr(e, "base16"); + } + getSymKey(e) { + return this.keychain.get(e); + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } +}; +__name(_Tt, "Tt"); +let Tt = _Tt; +const _Pt = class _Pt extends a$1 { + constructor(e, t) { + super(e, t), this.logger = e, this.core = t, this.messages = /* @__PURE__ */ new Map(), this.name = rt, this.version = nt, this.initialized = !1, this.storagePrefix = O, this.init = async () => { + if (!this.initialized) { + this.logger.trace("Initialized"); + try { + const i = await this.getRelayerMessages(); + typeof i < "u" && (this.messages = i), this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({ type: "method", method: "restore", size: this.messages.size }); + } catch (i) { + this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(i); + } finally { + this.initialized = !0; + } + } + }, this.set = async (i, s) => { + this.isInitialized(); + const n2 = Ln(s); + let o = this.messages.get(i); + return typeof o > "u" && (o = {}), typeof o[n2] < "u" || (o[n2] = s, this.messages.set(i, o), await this.persist()), n2; + }, this.get = (i) => { + this.isInitialized(); + let s = this.messages.get(i); + return typeof s > "u" && (s = {}), s; + }, this.has = (i, s) => { + this.isInitialized(); + const n2 = this.get(i), o = Ln(s); + return typeof n2[o] < "u"; + }, this.del = async (i) => { + this.isInitialized(), this.messages.delete(i), await this.persist(); + }, this.logger = cjs$1.generateChildLogger(e, this.name), this.core = t; + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + get storageKey() { + return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; + } + async setRelayerMessages(e) { + await this.core.storage.setItem(this.storageKey, rt$1(e)); + } + async getRelayerMessages() { + const e = await this.core.storage.getItem(this.storageKey); + return typeof e < "u" ? ot$1(e) : void 0; + } + async persist() { + await this.setRelayerMessages(this.messages); + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } +}; +__name(_Pt, "Pt"); +let Pt = _Pt; +const _mr = class _mr extends u { + constructor(e, t) { + super(e, t), this.relayer = e, this.logger = t, this.events = new eventsExports.EventEmitter(), this.name = at, this.queue = /* @__PURE__ */ new Map(), this.publishTimeout = cjs$3.toMiliseconds(cjs$3.TEN_SECONDS), this.needsTransportRestart = !1, this.publish = async (i, s, n2) => { + var o; + this.logger.debug("Publishing Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i, message: s, opts: n2 } }); + try { + const a2 = (n2 == null ? void 0 : n2.ttl) || ot, h2 = vt$1(n2), l2 = (n2 == null ? void 0 : n2.prompt) || !1, d2 = (n2 == null ? void 0 : n2.tag) || 0, p2 = (n2 == null ? void 0 : n2.id) || getBigIntRpcId().toString(), y2 = { topic: i, message: s, opts: { ttl: a2, relay: h2, prompt: l2, tag: d2, id: p2 } }, M = setTimeout(() => this.queue.set(p2, y2), this.publishTimeout); + try { + await await ut$1(this.rpcPublish(i, s, a2, h2, l2, d2, p2), this.publishTimeout, "Failed to publish payload, please try again."), this.removeRequestFromQueue(p2), this.relayer.events.emit(D.publish, y2); + } catch (u2) { + if (this.logger.debug("Publishing Payload stalled"), this.needsTransportRestart = !0, (o = n2 == null ? void 0 : n2.internal) != null && o.throwOnFailedPublish) + throw this.removeRequestFromQueue(p2), u2; + return; + } finally { + clearTimeout(M); + } + this.logger.debug("Successfully Published Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i, message: s, opts: n2 } }); + } catch (a2) { + throw this.logger.debug("Failed to Publish Payload"), this.logger.error(a2), a2; + } + }, this.on = (i, s) => { + this.events.on(i, s); + }, this.once = (i, s) => { + this.events.once(i, s); + }, this.off = (i, s) => { + this.events.off(i, s); + }, this.removeListener = (i, s) => { + this.events.removeListener(i, s); + }, this.relayer = e, this.logger = cjs$1.generateChildLogger(t, this.name), this.registerEventListeners(); + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + rpcPublish(e, t, i, s, n2, o, a2) { + var h2, l2, d2, p2; + const y2 = { method: Et$1(s.protocol).publish, params: { topic: e, message: t, ttl: i, prompt: n2, tag: o }, id: a2 }; + return w$2((h2 = y2.params) == null ? void 0 : h2.prompt) && ((l2 = y2.params) == null || delete l2.prompt), w$2((d2 = y2.params) == null ? void 0 : d2.tag) && ((p2 = y2.params) == null || delete p2.tag), this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "message", direction: "outgoing", request: y2 }), this.relayer.request(y2); + } + removeRequestFromQueue(e) { + this.queue.delete(e); + } + checkQueue() { + this.queue.forEach(async (e) => { + const { topic: t, message: i, opts: s } = e; + await this.publish(t, i, s); + }); + } + registerEventListeners() { + this.relayer.core.heartbeat.on(cjs$2.HEARTBEAT_EVENTS.pulse, () => { + if (this.needsTransportRestart) { + this.needsTransportRestart = !1, this.relayer.events.emit(D.connection_stalled); + return; + } + this.checkQueue(); + }), this.relayer.on(D.message_ack, (e) => { + this.removeRequestFromQueue(e.id.toString()); + }); + } +}; +__name(_mr, "mr"); +let mr = _mr; +const _br = class _br { + constructor() { + this.map = /* @__PURE__ */ new Map(), this.set = (e, t) => { + const i = this.get(e); + this.exists(e, t) || this.map.set(e, [...i, t]); + }, this.get = (e) => this.map.get(e) || [], this.exists = (e, t) => this.get(e).includes(t), this.delete = (e, t) => { + if (typeof t > "u") { + this.map.delete(e); + return; + } + if (!this.map.has(e)) + return; + const i = this.get(e); + if (!this.exists(e, t)) + return; + const s = i.filter((n2) => n2 !== t); + if (!s.length) { + this.map.delete(e); + return; + } + this.map.set(e, s); + }, this.clear = () => { + this.map.clear(); + }; + } + get topics() { + return Array.from(this.map.keys()); + } +}; +__name(_br, "br"); +let br = _br; +var fr = Object.defineProperty, Er = Object.defineProperties, wr = Object.getOwnPropertyDescriptors, xt = Object.getOwnPropertySymbols, vr = Object.prototype.hasOwnProperty, Ir = Object.prototype.propertyIsEnumerable, Ot = /* @__PURE__ */ __name((r, e, t) => e in r ? fr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, "Ot"), q = /* @__PURE__ */ __name((r, e) => { + for (var t in e || (e = {})) + vr.call(e, t) && Ot(r, t, e[t]); + if (xt) + for (var t of xt(e)) + Ir.call(e, t) && Ot(r, t, e[t]); + return r; +}, "q"), De = /* @__PURE__ */ __name((r, e) => Er(r, wr(e)), "De"); +const _At = class _At extends d { + constructor(e, t) { + super(e, t), this.relayer = e, this.logger = t, this.subscriptions = /* @__PURE__ */ new Map(), this.topicMap = new br(), this.events = new eventsExports.EventEmitter(), this.name = mt, this.version = bt, this.pending = /* @__PURE__ */ new Map(), this.cached = [], this.initialized = !1, this.pendingSubscriptionWatchLabel = "pending_sub_watch_label", this.pollingInterval = 20, this.storagePrefix = O, this.subscribeTimeout = 1e4, this.restartInProgress = !1, this.batchSubscribeTopicsLimit = 500, this.init = async () => { + this.initialized || (this.logger.trace("Initialized"), this.registerEventListeners(), this.clientId = await this.relayer.core.crypto.getClientId()); + }, this.subscribe = async (i, s) => { + await this.restartToComplete(), this.isInitialized(), this.logger.debug("Subscribing Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: i, opts: s } }); + try { + const n2 = vt$1(s), o = { topic: i, relay: n2 }; + this.pending.set(i, o); + const a2 = await this.rpcSubscribe(i, n2); + return this.onSubscribe(a2, o), this.logger.debug("Successfully Subscribed Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: i, opts: s } }), a2; + } catch (n2) { + throw this.logger.debug("Failed to Subscribe Topic"), this.logger.error(n2), n2; + } + }, this.unsubscribe = async (i, s) => { + await this.restartToComplete(), this.isInitialized(), typeof (s == null ? void 0 : s.id) < "u" ? await this.unsubscribeById(i, s.id, s) : await this.unsubscribeByTopic(i, s); + }, this.isSubscribed = async (i) => this.topics.includes(i) ? !0 : await new Promise((s, n2) => { + const o = new cjs$3.Watch(); + o.start(this.pendingSubscriptionWatchLabel); + const a2 = setInterval(() => { + !this.pending.has(i) && this.topics.includes(i) && (clearInterval(a2), o.stop(this.pendingSubscriptionWatchLabel), s(!0)), o.elapsed(this.pendingSubscriptionWatchLabel) >= ft && (clearInterval(a2), o.stop(this.pendingSubscriptionWatchLabel), n2(new Error("Subscription resolution timeout"))); + }, this.pollingInterval); + }).catch(() => !1), this.on = (i, s) => { + this.events.on(i, s); + }, this.once = (i, s) => { + this.events.once(i, s); + }, this.off = (i, s) => { + this.events.off(i, s); + }, this.removeListener = (i, s) => { + this.events.removeListener(i, s); + }, this.restart = async () => { + this.restartInProgress = !0, await this.restore(), await this.reset(), this.restartInProgress = !1; + }, this.relayer = e, this.logger = cjs$1.generateChildLogger(t, this.name), this.clientId = ""; + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + get storageKey() { + return this.storagePrefix + this.version + this.relayer.core.customStoragePrefix + "//" + this.name; + } + get length() { + return this.subscriptions.size; + } + get ids() { + return Array.from(this.subscriptions.keys()); + } + get values() { + return Array.from(this.subscriptions.values()); + } + get topics() { + return this.topicMap.topics; + } + hasSubscription(e, t) { + let i = !1; + try { + i = this.getSubscription(e).topic === t; + } catch { + } + return i; + } + onEnable() { + this.cached = [], this.initialized = !0; + } + onDisable() { + this.cached = this.values, this.subscriptions.clear(), this.topicMap.clear(); + } + async unsubscribeByTopic(e, t) { + const i = this.topicMap.get(e); + await Promise.all(i.map(async (s) => await this.unsubscribeById(e, s, t))); + } + async unsubscribeById(e, t, i) { + this.logger.debug("Unsubscribing Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e, id: t, opts: i } }); + try { + const s = vt$1(i); + await this.rpcUnsubscribe(e, t, s); + const n2 = U("USER_DISCONNECTED", `${this.name}, ${e}`); + await this.onUnsubscribe(e, t, n2), this.logger.debug("Successfully Unsubscribed Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e, id: t, opts: i } }); + } catch (s) { + throw this.logger.debug("Failed to Unsubscribe Topic"), this.logger.error(s), s; + } + } + async rpcSubscribe(e, t) { + const i = { method: Et$1(t.protocol).subscribe, params: { topic: e } }; + this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i }); + try { + await await ut$1(this.relayer.request(i), this.subscribeTimeout); + } catch { + this.logger.debug("Outgoing Relay Subscribe Payload stalled"), this.relayer.events.emit(D.connection_stalled); + } + return Ln(e + this.clientId); + } + async rpcBatchSubscribe(e) { + if (!e.length) + return; + const t = e[0].relay, i = { method: Et$1(t.protocol).batchSubscribe, params: { topics: e.map((s) => s.topic) } }; + this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i }); + try { + return await await ut$1(this.relayer.request(i), this.subscribeTimeout); + } catch { + this.logger.debug("Outgoing Relay Payload stalled"), this.relayer.events.emit(D.connection_stalled); + } + } + rpcUnsubscribe(e, t, i) { + const s = { method: Et$1(i.protocol).unsubscribe, params: { topic: e, id: t } }; + return this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: s }), this.relayer.request(s); + } + onSubscribe(e, t) { + this.setSubscription(e, De(q({}, t), { id: e })), this.pending.delete(t.topic); + } + onBatchSubscribe(e) { + e.length && e.forEach((t) => { + this.setSubscription(t.id, q({}, t)), this.pending.delete(t.topic); + }); + } + async onUnsubscribe(e, t, i) { + this.events.removeAllListeners(t), this.hasSubscription(t, e) && this.deleteSubscription(t, i), await this.relayer.messages.del(e); + } + async setRelayerSubscriptions(e) { + await this.relayer.core.storage.setItem(this.storageKey, e); + } + async getRelayerSubscriptions() { + return await this.relayer.core.storage.getItem(this.storageKey); + } + setSubscription(e, t) { + this.subscriptions.has(e) || (this.logger.debug("Setting subscription"), this.logger.trace({ type: "method", method: "setSubscription", id: e, subscription: t }), this.addSubscription(e, t)); + } + addSubscription(e, t) { + this.subscriptions.set(e, q({}, t)), this.topicMap.set(t.topic, e), this.events.emit(w.created, t); + } + getSubscription(e) { + this.logger.debug("Getting subscription"), this.logger.trace({ type: "method", method: "getSubscription", id: e }); + const t = this.subscriptions.get(e); + if (!t) { + const { message: i } = N$1("NO_MATCHING_KEY", `${this.name}: ${e}`); + throw new Error(i); + } + return t; + } + deleteSubscription(e, t) { + this.logger.debug("Deleting subscription"), this.logger.trace({ type: "method", method: "deleteSubscription", id: e, reason: t }); + const i = this.getSubscription(e); + this.subscriptions.delete(e), this.topicMap.delete(i.topic, e), this.events.emit(w.deleted, De(q({}, i), { reason: t })); + } + async persist() { + await this.setRelayerSubscriptions(this.values), this.events.emit(w.sync); + } + async reset() { + if (this.cached.length) { + const e = Math.ceil(this.cached.length / this.batchSubscribeTopicsLimit); + for (let t = 0; t < e; t++) { + const i = this.cached.splice(0, this.batchSubscribeTopicsLimit); + await this.batchSubscribe(i); + } + } + this.events.emit(w.resubscribed); + } + async restore() { + try { + const e = await this.getRelayerSubscriptions(); + if (typeof e > "u" || !e.length) + return; + if (this.subscriptions.size) { + const { message: t } = N$1("RESTORE_WILL_OVERRIDE", this.name); + throw this.logger.error(t), this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`), new Error(t); + } + this.cached = e, this.logger.debug(`Successfully Restored subscriptions for ${this.name}`), this.logger.trace({ type: "method", method: "restore", subscriptions: this.values }); + } catch (e) { + this.logger.debug(`Failed to Restore subscriptions for ${this.name}`), this.logger.error(e); + } + } + async batchSubscribe(e) { + if (!e.length) + return; + const t = await this.rpcBatchSubscribe(e); + k$1(t) && this.onBatchSubscribe(t.map((i, s) => De(q({}, e[s]), { id: i }))); + } + async onConnect() { + this.restartInProgress || (await this.restart(), this.onEnable()); + } + onDisconnect() { + this.onDisable(); + } + async checkPending() { + if (!this.initialized || this.relayer.transportExplicitlyClosed) + return; + const e = []; + this.pending.forEach((t) => { + e.push(t); + }), await this.batchSubscribe(e); + } + registerEventListeners() { + this.relayer.core.heartbeat.on(cjs$2.HEARTBEAT_EVENTS.pulse, async () => { + await this.checkPending(); + }), this.relayer.on(D.connect, async () => { + await this.onConnect(); + }), this.relayer.on(D.disconnect, () => { + this.onDisconnect(); + }), this.events.on(w.created, async (e) => { + const t = w.created; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), await this.persist(); + }), this.events.on(w.deleted, async (e) => { + const t = w.deleted; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), await this.persist(); + }); + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } + async restartToComplete() { + this.restartInProgress && await new Promise((e) => { + const t = setInterval(() => { + this.restartInProgress || (clearInterval(t), e()); + }, this.pollingInterval); + }); + } +}; +__name(_At, "At"); +let At = _At; +var Cr = Object.defineProperty, zt = Object.getOwnPropertySymbols, Rr = Object.prototype.hasOwnProperty, _r = Object.prototype.propertyIsEnumerable, Nt = /* @__PURE__ */ __name((r, e, t) => e in r ? Cr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, "Nt"), Sr = /* @__PURE__ */ __name((r, e) => { + for (var t in e || (e = {})) + Rr.call(e, t) && Nt(r, t, e[t]); + if (zt) + for (var t of zt(e)) + _r.call(e, t) && Nt(r, t, e[t]); + return r; +}, "Sr"); +const _Ut = class _Ut extends g$1 { + constructor(e) { + super(e), this.protocol = "wc", this.version = 2, this.events = new eventsExports.EventEmitter(), this.name = ut, this.transportExplicitlyClosed = !1, this.initialized = !1, this.connectionAttemptInProgress = !1, this.connectionStatusPollingInterval = 20, this.staleConnectionErrors = ["socket hang up", "socket stalled"], this.hasExperiencedNetworkDisruption = !1, this.request = async (t) => { + this.logger.debug("Publishing Request Payload"); + try { + return await this.toEstablishConnection(), await this.provider.request(t); + } catch (i) { + throw this.logger.debug("Failed to Publish Request"), this.logger.error(i), i; + } + }, this.onPayloadHandler = (t) => { + this.onProviderPayload(t); + }, this.onConnectHandler = () => { + this.events.emit(D.connect); + }, this.onDisconnectHandler = () => { + this.onProviderDisconnect(); + }, this.onProviderErrorHandler = (t) => { + this.logger.error(t), this.events.emit(D.error, t), this.logger.info("Fatal socket error received, closing transport"), this.transportClose(); + }, this.registerProviderListeners = () => { + this.provider.on(P.payload, this.onPayloadHandler), this.provider.on(P.connect, this.onConnectHandler), this.provider.on(P.disconnect, this.onDisconnectHandler), this.provider.on(P.error, this.onProviderErrorHandler); + }, this.core = e.core, this.logger = typeof e.logger < "u" && typeof e.logger != "string" ? cjs$1.generateChildLogger(e.logger, this.name) : cjs$1.pino(cjs$1.getDefaultLoggerOptions({ level: e.logger || ct })), this.messages = new Pt(this.logger, e.core), this.subscriber = new At(this, this.logger), this.publisher = new mr(this, this.logger), this.relayUrl = (e == null ? void 0 : e.relayUrl) || ge, this.projectId = e.projectId, this.bundleId = Jn(), this.provider = {}; + } + async init() { + this.logger.trace("Initialized"), this.registerEventListeners(), await this.createProvider(), await Promise.all([this.messages.init(), this.subscriber.init()]); + try { + await this.transportOpen(); + } catch { + this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${pe}...`), await this.restartTransport(pe); + } + this.initialized = !0, setTimeout(async () => { + this.subscriber.topics.length === 0 && (this.logger.info("No topics subscribed to after init, closing transport"), await this.transportClose(), this.transportExplicitlyClosed = !1); + }, pt); + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + get connected() { + return this.provider.connection.connected; + } + get connecting() { + return this.provider.connection.connecting; + } + async publish(e, t, i) { + this.isInitialized(), await this.publisher.publish(e, t, i), await this.recordMessageEvent({ topic: e, message: t, publishedAt: Date.now() }); + } + async subscribe(e, t) { + var i; + this.isInitialized(); + let s = ((i = this.subscriber.topicMap.get(e)) == null ? void 0 : i[0]) || ""; + if (s) + return s; + let n2; + const o = /* @__PURE__ */ __name((a2) => { + a2.topic === e && (this.subscriber.off(w.created, o), n2()); + }, "o"); + return await Promise.all([new Promise((a2) => { + n2 = a2, this.subscriber.on(w.created, o); + }), new Promise(async (a2) => { + s = await this.subscriber.subscribe(e, t), a2(); + })]), s; + } + async unsubscribe(e, t) { + this.isInitialized(), await this.subscriber.unsubscribe(e, t); + } + on(e, t) { + this.events.on(e, t); + } + once(e, t) { + this.events.once(e, t); + } + off(e, t) { + this.events.off(e, t); + } + removeListener(e, t) { + this.events.removeListener(e, t); + } + async transportClose() { + this.transportExplicitlyClosed = !0, this.hasExperiencedNetworkDisruption && this.connected ? await ut$1(this.provider.disconnect(), 1e3, "provider.disconnect()").catch(() => this.onProviderDisconnect()) : this.connected && await this.provider.disconnect(); + } + async transportOpen(e) { + if (this.transportExplicitlyClosed = !1, await this.confirmOnlineStateOrThrow(), !this.connectionAttemptInProgress) { + e && e !== this.relayUrl && (this.relayUrl = e, await this.transportClose(), await this.createProvider()), this.connectionAttemptInProgress = !0; + try { + await Promise.all([new Promise((t) => { + if (!this.initialized) + return t(); + this.subscriber.once(w.resubscribed, () => { + t(); + }); + }), new Promise(async (t, i) => { + try { + await ut$1(this.provider.connect(), 1e4, `Socket stalled when trying to connect to ${this.relayUrl}`); + } catch (s) { + i(s); + return; + } + t(); + })]); + } catch (t) { + this.logger.error(t); + const i = t; + if (!this.isConnectionStalled(i.message)) + throw t; + this.provider.events.emit(P.disconnect); + } finally { + this.connectionAttemptInProgress = !1, this.hasExperiencedNetworkDisruption = !1; + } + } + } + async restartTransport(e) { + await this.confirmOnlineStateOrThrow(), !this.connectionAttemptInProgress && (this.relayUrl = e || this.relayUrl, await this.transportClose(), await this.createProvider(), await this.transportOpen()); + } + async confirmOnlineStateOrThrow() { + if (!await er$1()) + throw new Error("No internet connection detected. Please restart your network and try again."); + } + isConnectionStalled(e) { + return this.staleConnectionErrors.some((t) => e.includes(t)); + } + async createProvider() { + this.provider.connection && this.unregisterProviderListeners(); + const e = await this.core.crypto.signJWT(this.relayUrl); + this.provider = new JsonRpcProvider(new f(Xn({ sdkVersion: gt, protocol: this.protocol, version: this.version, relayUrl: this.relayUrl, projectId: this.projectId, auth: e, useOnCloseEvent: !0, bundleId: this.bundleId }))), this.registerProviderListeners(); + } + async recordMessageEvent(e) { + const { topic: t, message: i } = e; + await this.messages.set(t, i); + } + async shouldIgnoreMessageEvent(e) { + const { topic: t, message: i } = e; + if (!i || i.length === 0) + return this.logger.debug(`Ignoring invalid/empty message: ${i}`), !0; + if (!await this.subscriber.isSubscribed(t)) + return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`), !0; + const s = this.messages.has(t, i); + return s && this.logger.debug(`Ignoring duplicate message: ${i}`), s; + } + async onProviderPayload(e) { + if (this.logger.debug("Incoming Relay Payload"), this.logger.trace({ type: "payload", direction: "incoming", payload: e }), isJsonRpcRequest(e)) { + if (!e.method.endsWith(lt)) + return; + const t = e.params, { topic: i, message: s, publishedAt: n2 } = t.data, o = { topic: i, message: s, publishedAt: n2 }; + this.logger.debug("Emitting Relayer Payload"), this.logger.trace(Sr({ type: "event", event: t.id }, o)), this.events.emit(t.id, o), await this.acknowledgePayload(e), await this.onMessageEvent(o); + } else + isJsonRpcResponse(e) && this.events.emit(D.message_ack, e); + } + async onMessageEvent(e) { + await this.shouldIgnoreMessageEvent(e) || (this.events.emit(D.message, e), await this.recordMessageEvent(e)); + } + async acknowledgePayload(e) { + const t = formatJsonRpcResult(e.id, !0); + await this.provider.connection.send(t); + } + unregisterProviderListeners() { + this.provider.off(P.payload, this.onPayloadHandler), this.provider.off(P.connect, this.onConnectHandler), this.provider.off(P.disconnect, this.onDisconnectHandler), this.provider.off(P.error, this.onProviderErrorHandler); + } + async registerEventListeners() { + this.events.on(D.connection_stalled, () => { + this.restartTransport().catch((t) => this.logger.error(t)); + }); + let e = await er$1(); + nr$1(async (t) => { + this.initialized && e !== t && (e = t, t ? await this.restartTransport().catch((i) => this.logger.error(i)) : (this.hasExperiencedNetworkDisruption = !0, await this.transportClose().catch((i) => this.logger.error(i)))); + }); + } + onProviderDisconnect() { + this.events.emit(D.disconnect), this.attemptToReconnect(); + } + attemptToReconnect() { + this.transportExplicitlyClosed || (this.logger.info("attemptToReconnect called. Connecting..."), setTimeout(async () => { + await this.restartTransport().catch((e) => this.logger.error(e)); + }, cjs$3.toMiliseconds(dt))); + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } + async toEstablishConnection() { + if (await this.confirmOnlineStateOrThrow(), !this.connected) { + if (this.connectionAttemptInProgress) + return await new Promise((e) => { + const t = setInterval(() => { + this.connected && (clearInterval(t), e()); + }, this.connectionStatusPollingInterval); + }); + await this.restartTransport(); + } + } +}; +__name(_Ut, "Ut"); +let Ut = _Ut; +var Tr = Object.defineProperty, Lt = Object.getOwnPropertySymbols, Pr = Object.prototype.hasOwnProperty, xr = Object.prototype.propertyIsEnumerable, Ft = /* @__PURE__ */ __name((r, e, t) => e in r ? Tr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, "Ft"), $t = /* @__PURE__ */ __name((r, e) => { + for (var t in e || (e = {})) + Pr.call(e, t) && Ft(r, t, e[t]); + if (Lt) + for (var t of Lt(e)) + xr.call(e, t) && Ft(r, t, e[t]); + return r; +}, "$t"); +const _Mt = class _Mt extends p { + constructor(e, t, i, s = O, n2 = void 0) { + super(e, t, i, s), this.core = e, this.logger = t, this.name = i, this.map = /* @__PURE__ */ new Map(), this.version = Dt, this.cached = [], this.initialized = !1, this.storagePrefix = O, this.init = async () => { + this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((o) => { + this.getKey && o !== null && !w$2(o) ? this.map.set(this.getKey(o), o) : Vt$1(o) ? this.map.set(o.id, o) : Mt$1(o) && this.map.set(o.topic, o); + }), this.cached = [], this.initialized = !0); + }, this.set = async (o, a2) => { + this.isInitialized(), this.map.has(o) ? await this.update(o, a2) : (this.logger.debug("Setting value"), this.logger.trace({ type: "method", method: "set", key: o, value: a2 }), this.map.set(o, a2), await this.persist()); + }, this.get = (o) => (this.isInitialized(), this.logger.debug("Getting value"), this.logger.trace({ type: "method", method: "get", key: o }), this.getData(o)), this.getAll = (o) => (this.isInitialized(), o ? this.values.filter((a2) => Object.keys(o).every((h2) => Bi(a2[h2], o[h2]))) : this.values), this.update = async (o, a2) => { + this.isInitialized(), this.logger.debug("Updating value"), this.logger.trace({ type: "method", method: "update", key: o, update: a2 }); + const h2 = $t($t({}, this.getData(o)), a2); + this.map.set(o, h2), await this.persist(); + }, this.delete = async (o, a2) => { + this.isInitialized(), this.map.has(o) && (this.logger.debug("Deleting value"), this.logger.trace({ type: "method", method: "delete", key: o, reason: a2 }), this.map.delete(o), await this.persist()); + }, this.logger = cjs$1.generateChildLogger(t, this.name), this.storagePrefix = s, this.getKey = n2; + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + get storageKey() { + return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; + } + get length() { + return this.map.size; + } + get keys() { + return Array.from(this.map.keys()); + } + get values() { + return Array.from(this.map.values()); + } + async setDataStore(e) { + await this.core.storage.setItem(this.storageKey, e); + } + async getDataStore() { + return await this.core.storage.getItem(this.storageKey); + } + getData(e) { + const t = this.map.get(e); + if (!t) { + const { message: i } = N$1("NO_MATCHING_KEY", `${this.name}: ${e}`); + throw this.logger.error(i), new Error(i); + } + return t; + } + async persist() { + await this.setDataStore(this.values); + } + async restore() { + try { + const e = await this.getDataStore(); + if (typeof e > "u" || !e.length) + return; + if (this.map.size) { + const { message: t } = N$1("RESTORE_WILL_OVERRIDE", this.name); + throw this.logger.error(t), new Error(t); + } + this.cached = e, this.logger.debug(`Successfully Restored value for ${this.name}`), this.logger.trace({ type: "method", method: "restore", value: this.values }); + } catch (e) { + this.logger.debug(`Failed to Restore value for ${this.name}`), this.logger.error(e); + } + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } +}; +__name(_Mt, "Mt"); +let Mt = _Mt; +const _kt = class _kt { + constructor(e, t) { + this.core = e, this.logger = t, this.name = Et, this.version = wt, this.events = new Ye$1(), this.initialized = !1, this.storagePrefix = O, this.ignoredPayloadTypes = [_$1], this.registeredMethods = [], this.init = async () => { + this.initialized || (await this.pairings.init(), await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.initialized = !0, this.logger.trace("Initialized")); + }, this.register = ({ methods: i }) => { + this.isInitialized(), this.registeredMethods = [.../* @__PURE__ */ new Set([...this.registeredMethods, ...i])]; + }, this.create = async () => { + this.isInitialized(); + const i = Vn(), s = await this.core.crypto.setSymKey(i), n2 = pt$1(cjs$3.FIVE_MINUTES), o = { protocol: ht }, a2 = { topic: s, expiry: n2, relay: o, active: !1 }, h2 = It$1({ protocol: this.core.protocol, version: this.core.version, topic: s, symKey: i, relay: o }); + return await this.pairings.set(s, a2), await this.core.relayer.subscribe(s), this.core.expirer.set(s, n2), { topic: s, uri: h2 }; + }, this.pair = async (i) => { + this.isInitialized(), this.isValidPair(i); + const { topic: s, symKey: n2, relay: o } = wt$1(i.uri); + let a2; + if (this.pairings.keys.includes(s) && (a2 = this.pairings.get(s), a2.active)) + throw new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`); + const h2 = pt$1(cjs$3.FIVE_MINUTES), l2 = { topic: s, relay: o, expiry: h2, active: !1 }; + return await this.pairings.set(s, l2), this.core.expirer.set(s, h2), i.activatePairing && await this.activate({ topic: s }), this.events.emit(V.create, l2), this.core.crypto.keychain.has(s) || (await this.core.crypto.setSymKey(n2, s), await this.core.relayer.subscribe(s, { relay: o })), l2; + }, this.activate = async ({ topic: i }) => { + this.isInitialized(); + const s = pt$1(cjs$3.THIRTY_DAYS); + await this.pairings.update(i, { active: !0, expiry: s }), this.core.expirer.set(i, s); + }, this.ping = async (i) => { + this.isInitialized(), await this.isValidPing(i); + const { topic: s } = i; + if (this.pairings.keys.includes(s)) { + const n2 = await this.sendRequest(s, "wc_pairingPing", {}), { done: o, resolve: a2, reject: h2 } = at$1(); + this.events.once(yt$1("pairing_ping", n2), ({ error: l2 }) => { + l2 ? h2(l2) : a2(); + }), await o(); + } + }, this.updateExpiry = async ({ topic: i, expiry: s }) => { + this.isInitialized(), await this.pairings.update(i, { expiry: s }); + }, this.updateMetadata = async ({ topic: i, metadata: s }) => { + this.isInitialized(), await this.pairings.update(i, { peerMetadata: s }); + }, this.getPairings = () => (this.isInitialized(), this.pairings.values), this.disconnect = async (i) => { + this.isInitialized(), await this.isValidDisconnect(i); + const { topic: s } = i; + this.pairings.keys.includes(s) && (await this.sendRequest(s, "wc_pairingDelete", U("USER_DISCONNECTED")), await this.deletePairing(s)); + }, this.sendRequest = async (i, s, n2) => { + const o = formatJsonRpcRequest(s, n2), a2 = await this.core.crypto.encode(i, o), h2 = F[s].req; + return this.core.history.set(i, o), this.core.relayer.publish(i, a2, h2), o.id; + }, this.sendResult = async (i, s, n2) => { + const o = formatJsonRpcResult(i, n2), a2 = await this.core.crypto.encode(s, o), h2 = await this.core.history.get(s, i), l2 = F[h2.request.method].res; + await this.core.relayer.publish(s, a2, l2), await this.core.history.resolve(o); + }, this.sendError = async (i, s, n2) => { + const o = formatJsonRpcError(i, n2), a2 = await this.core.crypto.encode(s, o), h2 = await this.core.history.get(s, i), l2 = F[h2.request.method] ? F[h2.request.method].res : F.unregistered_method.res; + await this.core.relayer.publish(s, a2, l2), await this.core.history.resolve(o); + }, this.deletePairing = async (i, s) => { + await this.core.relayer.unsubscribe(i), await Promise.all([this.pairings.delete(i, U("USER_DISCONNECTED")), this.core.crypto.deleteSymKey(i), s ? Promise.resolve() : this.core.expirer.del(i)]); + }, this.cleanup = async () => { + const i = this.pairings.getAll().filter((s) => mt$1(s.expiry)); + await Promise.all(i.map((s) => this.deletePairing(s.topic))); + }, this.onRelayEventRequest = (i) => { + const { topic: s, payload: n2 } = i; + switch (n2.method) { + case "wc_pairingPing": + return this.onPairingPingRequest(s, n2); + case "wc_pairingDelete": + return this.onPairingDeleteRequest(s, n2); + default: + return this.onUnknownRpcMethodRequest(s, n2); + } + }, this.onRelayEventResponse = async (i) => { + const { topic: s, payload: n2 } = i, o = (await this.core.history.get(s, n2.id)).request.method; + switch (o) { + case "wc_pairingPing": + return this.onPairingPingResponse(s, n2); + default: + return this.onUnknownRpcMethodResponse(o); + } + }, this.onPairingPingRequest = async (i, s) => { + const { id: n2 } = s; + try { + this.isValidPing({ topic: i }), await this.sendResult(n2, i, !0), this.events.emit(V.ping, { id: n2, topic: i }); + } catch (o) { + await this.sendError(n2, i, o), this.logger.error(o); + } + }, this.onPairingPingResponse = (i, s) => { + const { id: n2 } = s; + setTimeout(() => { + isJsonRpcResult(s) ? this.events.emit(yt$1("pairing_ping", n2), {}) : isJsonRpcError(s) && this.events.emit(yt$1("pairing_ping", n2), { error: s.error }); + }, 500); + }, this.onPairingDeleteRequest = async (i, s) => { + const { id: n2 } = s; + try { + this.isValidDisconnect({ topic: i }), await this.deletePairing(i), this.events.emit(V.delete, { id: n2, topic: i }); + } catch (o) { + await this.sendError(n2, i, o), this.logger.error(o); + } + }, this.onUnknownRpcMethodRequest = async (i, s) => { + const { id: n2, method: o } = s; + try { + if (this.registeredMethods.includes(o)) + return; + const a2 = U("WC_METHOD_UNSUPPORTED", o); + await this.sendError(n2, i, a2), this.logger.error(a2); + } catch (a2) { + await this.sendError(n2, i, a2), this.logger.error(a2); + } + }, this.onUnknownRpcMethodResponse = (i) => { + this.registeredMethods.includes(i) || this.logger.error(U("WC_METHOD_UNSUPPORTED", i)); + }, this.isValidPair = (i) => { + var s; + if (!Ht(i)) { + const { message: o } = N$1("MISSING_OR_INVALID", `pair() params: ${i}`); + throw new Error(o); + } + if (!kt$1(i.uri)) { + const { message: o } = N$1("MISSING_OR_INVALID", `pair() uri: ${i.uri}`); + throw new Error(o); + } + const n2 = wt$1(i.uri); + if (!((s = n2 == null ? void 0 : n2.relay) != null && s.protocol)) { + const { message: o } = N$1("MISSING_OR_INVALID", "pair() uri#relay-protocol"); + throw new Error(o); + } + if (!(n2 != null && n2.symKey)) { + const { message: o } = N$1("MISSING_OR_INVALID", "pair() uri#symKey"); + throw new Error(o); + } + }, this.isValidPing = async (i) => { + if (!Ht(i)) { + const { message: n2 } = N$1("MISSING_OR_INVALID", `ping() params: ${i}`); + throw new Error(n2); + } + const { topic: s } = i; + await this.isValidPairingTopic(s); + }, this.isValidDisconnect = async (i) => { + if (!Ht(i)) { + const { message: n2 } = N$1("MISSING_OR_INVALID", `disconnect() params: ${i}`); + throw new Error(n2); + } + const { topic: s } = i; + await this.isValidPairingTopic(s); + }, this.isValidPairingTopic = async (i) => { + if (!h$3(i, !1)) { + const { message: s } = N$1("MISSING_OR_INVALID", `pairing topic should be a string: ${i}`); + throw new Error(s); + } + if (!this.pairings.keys.includes(i)) { + const { message: s } = N$1("NO_MATCHING_KEY", `pairing topic doesn't exist: ${i}`); + throw new Error(s); + } + if (mt$1(this.pairings.get(i).expiry)) { + await this.deletePairing(i); + const { message: s } = N$1("EXPIRED", `pairing topic: ${i}`); + throw new Error(s); + } + }, this.core = e, this.logger = cjs$1.generateChildLogger(t, this.name), this.pairings = new Mt(this.core, this.logger, this.name, this.storagePrefix); + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } + registerRelayerEvents() { + this.core.relayer.on(D.message, async (e) => { + const { topic: t, message: i } = e; + if (!this.pairings.keys.includes(t) || this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i))) + return; + const s = await this.core.crypto.decode(t, i); + try { + isJsonRpcRequest(s) ? (this.core.history.set(t, s), this.onRelayEventRequest({ topic: t, payload: s })) : isJsonRpcResponse(s) && (await this.core.history.resolve(s), await this.onRelayEventResponse({ topic: t, payload: s }), this.core.history.delete(t, s.id)); + } catch (n2) { + this.logger.error(n2); + } + }); + } + registerExpirerEvents() { + this.core.expirer.on(v.expired, async (e) => { + const { topic: t } = ft$1(e.target); + t && this.pairings.keys.includes(t) && (await this.deletePairing(t, !0), this.events.emit(V.expire, { topic: t })); + }); + } +}; +__name(_kt, "kt"); +let kt = _kt; +const _Kt = class _Kt extends h$1 { + constructor(e, t) { + super(e, t), this.core = e, this.logger = t, this.records = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = vt, this.version = It, this.cached = [], this.initialized = !1, this.storagePrefix = O, this.init = async () => { + this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((i) => this.records.set(i.id, i)), this.cached = [], this.registerEventListeners(), this.initialized = !0); + }, this.set = (i, s, n2) => { + if (this.isInitialized(), this.logger.debug("Setting JSON-RPC request history record"), this.logger.trace({ type: "method", method: "set", topic: i, request: s, chainId: n2 }), this.records.has(s.id)) + return; + const o = { id: s.id, topic: i, request: { method: s.method, params: s.params || null }, chainId: n2, expiry: pt$1(cjs$3.THIRTY_DAYS) }; + this.records.set(o.id, o), this.events.emit(R.created, o); + }, this.resolve = async (i) => { + if (this.isInitialized(), this.logger.debug("Updating JSON-RPC response history record"), this.logger.trace({ type: "method", method: "update", response: i }), !this.records.has(i.id)) + return; + const s = await this.getRecord(i.id); + typeof s.response > "u" && (s.response = isJsonRpcError(i) ? { error: i.error } : { result: i.result }, this.records.set(s.id, s), this.events.emit(R.updated, s)); + }, this.get = async (i, s) => (this.isInitialized(), this.logger.debug("Getting record"), this.logger.trace({ type: "method", method: "get", topic: i, id: s }), await this.getRecord(s)), this.delete = (i, s) => { + this.isInitialized(), this.logger.debug("Deleting record"), this.logger.trace({ type: "method", method: "delete", id: s }), this.values.forEach((n2) => { + if (n2.topic === i) { + if (typeof s < "u" && n2.id !== s) + return; + this.records.delete(n2.id), this.events.emit(R.deleted, n2); + } + }); + }, this.exists = async (i, s) => (this.isInitialized(), this.records.has(s) ? (await this.getRecord(s)).topic === i : !1), this.on = (i, s) => { + this.events.on(i, s); + }, this.once = (i, s) => { + this.events.once(i, s); + }, this.off = (i, s) => { + this.events.off(i, s); + }, this.removeListener = (i, s) => { + this.events.removeListener(i, s); + }, this.logger = cjs$1.generateChildLogger(t, this.name); + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + get storageKey() { + return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; + } + get size() { + return this.records.size; + } + get keys() { + return Array.from(this.records.keys()); + } + get values() { + return Array.from(this.records.values()); + } + get pending() { + const e = []; + return this.values.forEach((t) => { + if (typeof t.response < "u") + return; + const i = { topic: t.topic, request: formatJsonRpcRequest(t.request.method, t.request.params, t.id), chainId: t.chainId }; + return e.push(i); + }), e; + } + async setJsonRpcRecords(e) { + await this.core.storage.setItem(this.storageKey, e); + } + async getJsonRpcRecords() { + return await this.core.storage.getItem(this.storageKey); + } + getRecord(e) { + this.isInitialized(); + const t = this.records.get(e); + if (!t) { + const { message: i } = N$1("NO_MATCHING_KEY", `${this.name}: ${e}`); + throw new Error(i); + } + return t; + } + async persist() { + await this.setJsonRpcRecords(this.values), this.events.emit(R.sync); + } + async restore() { + try { + const e = await this.getJsonRpcRecords(); + if (typeof e > "u" || !e.length) + return; + if (this.records.size) { + const { message: t } = N$1("RESTORE_WILL_OVERRIDE", this.name); + throw this.logger.error(t), new Error(t); + } + this.cached = e, this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({ type: "method", method: "restore", records: this.values }); + } catch (e) { + this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(e); + } + } + registerEventListeners() { + this.events.on(R.created, (e) => { + const t = R.created; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e }), this.persist(); + }), this.events.on(R.updated, (e) => { + const t = R.updated; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e }), this.persist(); + }), this.events.on(R.deleted, (e) => { + const t = R.deleted; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e }), this.persist(); + }), this.core.heartbeat.on(cjs$2.HEARTBEAT_EVENTS.pulse, () => { + this.cleanup(); + }); + } + cleanup() { + try { + this.records.forEach((e) => { + cjs$3.toMiliseconds(e.expiry || 0) - Date.now() <= 0 && (this.logger.info(`Deleting expired history log: ${e.id}`), this.delete(e.topic, e.id)); + }); + } catch (e) { + this.logger.warn(e); + } + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } +}; +__name(_Kt, "Kt"); +let Kt = _Kt; +const _Bt = class _Bt extends E { + constructor(e, t) { + super(e, t), this.core = e, this.logger = t, this.expirations = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = Ct, this.version = Rt, this.cached = [], this.initialized = !1, this.storagePrefix = O, this.init = async () => { + this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((i) => this.expirations.set(i.target, i)), this.cached = [], this.registerEventListeners(), this.initialized = !0); + }, this.has = (i) => { + try { + const s = this.formatTarget(i); + return typeof this.getExpiration(s) < "u"; + } catch { + return !1; + } + }, this.set = (i, s) => { + this.isInitialized(); + const n2 = this.formatTarget(i), o = { target: n2, expiry: s }; + this.expirations.set(n2, o), this.checkExpiry(n2, o), this.events.emit(v.created, { target: n2, expiration: o }); + }, this.get = (i) => { + this.isInitialized(); + const s = this.formatTarget(i); + return this.getExpiration(s); + }, this.del = (i) => { + if (this.isInitialized(), this.has(i)) { + const s = this.formatTarget(i), n2 = this.getExpiration(s); + this.expirations.delete(s), this.events.emit(v.deleted, { target: s, expiration: n2 }); + } + }, this.on = (i, s) => { + this.events.on(i, s); + }, this.once = (i, s) => { + this.events.once(i, s); + }, this.off = (i, s) => { + this.events.off(i, s); + }, this.removeListener = (i, s) => { + this.events.removeListener(i, s); + }, this.logger = cjs$1.generateChildLogger(t, this.name); + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + get storageKey() { + return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; + } + get length() { + return this.expirations.size; + } + get keys() { + return Array.from(this.expirations.keys()); + } + get values() { + return Array.from(this.expirations.values()); + } + formatTarget(e) { + if (typeof e == "string") + return lt$1(e); + if (typeof e == "number") + return dt$1(e); + const { message: t } = N$1("UNKNOWN_TYPE", `Target type: ${typeof e}`); + throw new Error(t); + } + async setExpirations(e) { + await this.core.storage.setItem(this.storageKey, e); + } + async getExpirations() { + return await this.core.storage.getItem(this.storageKey); + } + async persist() { + await this.setExpirations(this.values), this.events.emit(v.sync); + } + async restore() { + try { + const e = await this.getExpirations(); + if (typeof e > "u" || !e.length) + return; + if (this.expirations.size) { + const { message: t } = N$1("RESTORE_WILL_OVERRIDE", this.name); + throw this.logger.error(t), new Error(t); + } + this.cached = e, this.logger.debug(`Successfully Restored expirations for ${this.name}`), this.logger.trace({ type: "method", method: "restore", expirations: this.values }); + } catch (e) { + this.logger.debug(`Failed to Restore expirations for ${this.name}`), this.logger.error(e); + } + } + getExpiration(e) { + const t = this.expirations.get(e); + if (!t) { + const { message: i } = N$1("NO_MATCHING_KEY", `${this.name}: ${e}`); + throw this.logger.error(i), new Error(i); + } + return t; + } + checkExpiry(e, t) { + const { expiry: i } = t; + cjs$3.toMiliseconds(i) - Date.now() <= 0 && this.expire(e, t); + } + expire(e, t) { + this.expirations.delete(e), this.events.emit(v.expired, { target: e, expiration: t }); + } + checkExpirations() { + this.core.relayer.connected && this.expirations.forEach((e, t) => this.checkExpiry(t, e)); + } + registerEventListeners() { + this.core.heartbeat.on(cjs$2.HEARTBEAT_EVENTS.pulse, () => this.checkExpirations()), this.events.on(v.created, (e) => { + const t = v.created; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), this.persist(); + }), this.events.on(v.expired, (e) => { + const t = v.expired; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), this.persist(); + }), this.events.on(v.deleted, (e) => { + const t = v.deleted; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), this.persist(); + }); + } + isInitialized() { + if (!this.initialized) { + const { message: e } = N$1("NOT_INITIALIZED", this.name); + throw new Error(e); + } + } +}; +__name(_Bt, "Bt"); +let Bt = _Bt; +const _Vt = class _Vt extends y { + constructor(e, t) { + super(e, t), this.projectId = e, this.logger = t, this.name = Z, this.initialized = !1, this.queue = [], this.verifyDisabled = !1, this.init = async (i) => { + if (this.verifyDisabled || C() || !D$2()) + return; + const s = this.getVerifyUrl(i == null ? void 0 : i.verifyUrl); + this.verifyUrl !== s && this.removeIframe(), this.verifyUrl = s; + try { + await this.createIframe(); + } catch (n2) { + this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(n2); + } + if (!this.initialized) { + this.removeIframe(), this.verifyUrl = ee; + try { + await this.createIframe(); + } catch (n2) { + this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(n2), this.verifyDisabled = !0; + } + } + }, this.register = async (i) => { + this.initialized ? this.sendPost(i.attestationId) : (this.addToQueue(i.attestationId), await this.init()); + }, this.resolve = async (i) => { + if (this.isDevEnv) + return ""; + const s = this.getVerifyUrl(i == null ? void 0 : i.verifyUrl); + let n2; + try { + n2 = await this.fetchAttestation(i.attestationId, s); + } catch (o) { + this.logger.info(`failed to resolve attestation: ${i.attestationId} from url: ${s}`), this.logger.info(o), n2 = await this.fetchAttestation(i.attestationId, ee); + } + return n2; + }, this.fetchAttestation = async (i, s) => { + this.logger.info(`resolving attestation: ${i} from url: ${s}`); + const n2 = this.startAbortTimer(cjs$3.ONE_SECOND * 2), o = await fetch(`${s}/attestation/${i}`, { signal: this.abortController.signal }); + return clearTimeout(n2), o.status === 200 ? await o.json() : void 0; + }, this.addToQueue = (i) => { + this.queue.push(i); + }, this.processQueue = () => { + this.queue.length !== 0 && (this.queue.forEach((i) => this.sendPost(i)), this.queue = []); + }, this.sendPost = (i) => { + var s; + try { + if (!this.iframe) + return; + (s = this.iframe.contentWindow) == null || s.postMessage(i, "*"), this.logger.info(`postMessage sent: ${i} ${this.verifyUrl}`); + } catch { + } + }, this.createIframe = async () => { + let i; + const s = /* @__PURE__ */ __name((n2) => { + n2.data === "verify_ready" && (this.initialized = !0, this.processQueue(), window.removeEventListener("message", s), i()); + }, "s"); + await Promise.race([new Promise((n2) => { + if (document.getElementById(Z)) + return n2(); + window.addEventListener("message", s); + const o = document.createElement("iframe"); + o.id = Z, o.src = `${this.verifyUrl}/${this.projectId}`, o.style.display = "none", document.body.append(o), this.iframe = o, i = n2; + }), new Promise((n2, o) => setTimeout(() => { + window.removeEventListener("message", s), o("verify iframe load timeout"); + }, cjs$3.toMiliseconds(cjs$3.FIVE_SECONDS)))]); + }, this.removeIframe = () => { + this.iframe && (this.iframe.remove(), this.iframe = void 0, this.initialized = !1); + }, this.getVerifyUrl = (i) => { + let s = i || $; + return _t.includes(s) || (this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${$}`), s = $), s; + }, this.logger = cjs$1.generateChildLogger(t, this.name), this.verifyUrl = $, this.abortController = new AbortController(), this.isDevEnv = te$1() && {}.IS_VITEST; + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + startAbortTimer(e) { + return this.abortController = new AbortController(), setTimeout(() => this.abortController.abort(), cjs$3.toMiliseconds(e)); + } +}; +__name(_Vt, "Vt"); +let Vt = _Vt; +var Or = Object.defineProperty, qt = Object.getOwnPropertySymbols, Ar = Object.prototype.hasOwnProperty, zr = Object.prototype.propertyIsEnumerable, jt = /* @__PURE__ */ __name((r, e, t) => e in r ? Or(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, "jt"), Gt = /* @__PURE__ */ __name((r, e) => { + for (var t in e || (e = {})) + Ar.call(e, t) && jt(r, t, e[t]); + if (qt) + for (var t of qt(e)) + zr.call(e, t) && jt(r, t, e[t]); + return r; +}, "Gt"); +const _te = class _te extends n { + constructor(e) { + super(e), this.protocol = le, this.version = Xe, this.name = Q, this.events = new eventsExports.EventEmitter(), this.initialized = !1, this.on = (i, s) => this.events.on(i, s), this.once = (i, s) => this.events.once(i, s), this.off = (i, s) => this.events.off(i, s), this.removeListener = (i, s) => this.events.removeListener(i, s), this.projectId = e == null ? void 0 : e.projectId, this.relayUrl = (e == null ? void 0 : e.relayUrl) || ge, this.customStoragePrefix = e != null && e.customStoragePrefix ? `:${e.customStoragePrefix}` : ""; + const t = typeof (e == null ? void 0 : e.logger) < "u" && typeof (e == null ? void 0 : e.logger) != "string" ? e.logger : cjs$1.pino(cjs$1.getDefaultLoggerOptions({ level: (e == null ? void 0 : e.logger) || Qe.logger })); + this.logger = cjs$1.generateChildLogger(t, this.name), this.heartbeat = new cjs$2.HeartBeat(), this.crypto = new Tt(this, this.logger, e == null ? void 0 : e.keychain), this.history = new Kt(this, this.logger), this.expirer = new Bt(this, this.logger), this.storage = e != null && e.storage ? e.storage : new h$2(Gt(Gt({}, Ze), e == null ? void 0 : e.storageOptions)), this.relayer = new Ut({ core: this, logger: this.logger, relayUrl: this.relayUrl, projectId: this.projectId }), this.pairing = new kt(this, this.logger), this.verify = new Vt(this.projectId || "", this.logger); + } + static async init(e) { + const t = new _te(e); + await t.initialize(); + const i = await t.crypto.getClientId(); + return await t.storage.setItem(yt, i), t; + } + get context() { + return cjs$1.getLoggerContext(this.logger); + } + async start() { + this.initialized || await this.initialize(); + } + async initialize() { + this.logger.trace("Initialized"); + try { + await this.crypto.init(), await this.history.init(), await this.expirer.init(), await this.relayer.init(), await this.heartbeat.init(), await this.pairing.init(), this.initialized = !0, this.logger.info("Core Initialization Success"); + } catch (e) { + throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`, e), this.logger.error(e.message), e; + } + } +}; +__name(_te, "te"); +let te = _te; +const Nr = te, index_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + CORE_CONTEXT: Q, + CORE_DEFAULT: Qe, + CORE_PROTOCOL: le, + CORE_STORAGE_OPTIONS: Ze, + CORE_STORAGE_PREFIX: O, + CORE_VERSION: Xe, + CRYPTO_CLIENT_SEED: de, + CRYPTO_CONTEXT: et, + CRYPTO_JWT_TTL: tt, + Core: Nr, + Crypto: Tt, + EXPIRER_CONTEXT: Ct, + EXPIRER_DEFAULT_TTL: yr, + EXPIRER_EVENTS: v, + EXPIRER_STORAGE_VERSION: Rt, + Expirer: Bt, + HISTORY_CONTEXT: vt, + HISTORY_EVENTS: R, + HISTORY_STORAGE_VERSION: It, + JsonRpcHistory: Kt, + KEYCHAIN_CONTEXT: it, + KEYCHAIN_STORAGE_VERSION: st, + KeyChain: St, + MESSAGES_CONTEXT: rt, + MESSAGES_STORAGE_VERSION: nt, + MessageTracker: Pt, + PAIRING_CONTEXT: Et, + PAIRING_DEFAULT_TTL: Dr, + PAIRING_EVENTS: V, + PAIRING_RPC_OPTS: F, + PAIRING_STORAGE_VERSION: wt, + PENDING_SUB_RESOLUTION_TIMEOUT: ft, + PUBLISHER_CONTEXT: at, + PUBLISHER_DEFAULT_TTL: ot, + Pairing: kt, + RELAYER_CONTEXT: ut, + RELAYER_DEFAULT_LOGGER: ct, + RELAYER_DEFAULT_PROTOCOL: ht, + RELAYER_DEFAULT_RELAY_URL: ge, + RELAYER_EVENTS: D, + RELAYER_FAILOVER_RELAY_URL: pe, + RELAYER_PROVIDER_EVENTS: P, + RELAYER_RECONNECT_TIMEOUT: dt, + RELAYER_SDK_VERSION: gt, + RELAYER_STORAGE_OPTIONS: gr, + RELAYER_SUBSCRIBER_SUFFIX: lt, + RELAYER_TRANSPORT_CUTOFF: pt, + Relayer: Ut, + STORE_STORAGE_VERSION: Dt, + SUBSCRIBER_CONTEXT: mt, + SUBSCRIBER_DEFAULT_TTL: pr, + SUBSCRIBER_EVENTS: w, + SUBSCRIBER_STORAGE_VERSION: bt, + Store: Mt, + Subscriber: At, + TRUSTED_VERIFY_URLS: _t, + VERIFY_CONTEXT: Z, + VERIFY_FALLBACK_SERVER: ee, + VERIFY_SERVER: $, + Verify: Vt, + WALLETCONNECT_CLIENT_ID: yt, + default: te +}, Symbol.toStringTag, { value: "Module" })); +export { + $, + D, + Mt as M, + Nr as N, + S$1 as S, + V, + Ye$1 as Y, + isJsonRpcError as a, + isJsonRpcRequest as b, + cjs$1 as c, + isJsonRpcResponse as d, + eventsExports as e, + formatJsonRpcError as f, + formatJsonRpcRequest as g, + formatJsonRpcResult as h, + isJsonRpcResult as i, + b$1 as j, + ht as k, + index_es as l, + payloadId as p, + v +}; diff --git a/frontends/web/build/assets/index.es2.js b/frontends/web/build/assets/index.es2.js new file mode 100644 index 0000000000..fc8a984647 --- /dev/null +++ b/frontends/web/build/assets/index.es2.js @@ -0,0 +1,6030 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 }); +import { e as eventsExports, c as cjs, N as Nr$1, M as Mt$1, f as formatJsonRpcError, i as isJsonRpcResult, a as isJsonRpcError, D as D$2, b as isJsonRpcRequest, d as isJsonRpcResponse, V as V$2, g as formatJsonRpcRequest, h as formatJsonRpcResult, j as b$2, S as S$2, Y as Ye, k as ht$1, $ as $$1, v, p as payloadId } from "./index.es.js"; +import { c as commonjsGlobal, g as getDefaultExportFromCjs, r as require$$0$1, a as getAugmentedNamespace, K as Kn, D as D$1, N, b as cjs$1, k as kt$1, X as Xt$1, s as sha256, _ as _$1, Q as Qn, d as at$1, y as yt$1, p as pt$1, B as B$1, j as jt$1, U as U$3, e as gt$1, h as ht$2, f as Dt$1, L as Ln, m as mt$1, t as tr$1, H as Ht$1, w as w$1, x as xt$1, i as Lt$1, u as un, l as dn, n as h, q as qt$1, o as ln, v as Kt$1, z as zt$1, A as Bt$1, Y as Yt$1, G as Gt$1, W as Wt$1, J as Jt$1, C as ft$1, F as Ft$1 } from "./index.js"; +var sha3$1 = { exports: {} }; +/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.8.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */ +(function(module) { + (function() { + var INPUT_ERROR = "input is invalid type", FINALIZE_ERROR = "finalize already called", WINDOW = typeof window == "object", root = WINDOW ? window : {}; + root.JS_SHA3_NO_WINDOW && (WINDOW = !1); + var WEB_WORKER = !WINDOW && typeof self == "object", NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node; + NODE_JS ? root = commonjsGlobal : WEB_WORKER && (root = self); + var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && !0 && module.exports, ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", HEX_CHARS = "0123456789abcdef".split(""), SHAKE_PADDING = [31, 7936, 2031616, 520093696], CSHAKE_PADDING = [4, 1024, 262144, 67108864], KECCAK_PADDING = [1, 256, 65536, 16777216], PADDING = [6, 1536, 393216, 100663296], SHIFT = [0, 8, 16, 24], RC = [ + 1, + 0, + 32898, + 0, + 32906, + 2147483648, + 2147516416, + 2147483648, + 32907, + 0, + 2147483649, + 0, + 2147516545, + 2147483648, + 32777, + 2147483648, + 138, + 0, + 136, + 0, + 2147516425, + 0, + 2147483658, + 0, + 2147516555, + 0, + 139, + 2147483648, + 32905, + 2147483648, + 32771, + 2147483648, + 32770, + 2147483648, + 128, + 2147483648, + 32778, + 0, + 2147483658, + 2147483648, + 2147516545, + 2147483648, + 32896, + 2147483648, + 2147483649, + 0, + 2147516424, + 2147483648 + ], BITS = [224, 256, 384, 512], SHAKE_BITS = [128, 256], OUTPUT_TYPES = ["hex", "buffer", "arrayBuffer", "array", "digest"], CSHAKE_BYTEPAD = { + 128: 168, + 256: 136 + }; + (root.JS_SHA3_NO_NODE_JS || !Array.isArray) && (Array.isArray = function(obj) { + return Object.prototype.toString.call(obj) === "[object Array]"; + }), ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(obj) { + return typeof obj == "object" && obj.buffer && obj.buffer.constructor === ArrayBuffer; + }); + for (var createOutputMethod = /* @__PURE__ */ __name(function(bits2, padding, outputType) { + return function(message) { + return new Keccak(bits2, padding, bits2).update(message)[outputType](); + }; + }, "createOutputMethod"), createShakeOutputMethod = /* @__PURE__ */ __name(function(bits2, padding, outputType) { + return function(message, outputBits) { + return new Keccak(bits2, padding, outputBits).update(message)[outputType](); + }; + }, "createShakeOutputMethod"), createCshakeOutputMethod = /* @__PURE__ */ __name(function(bits2, padding, outputType) { + return function(message, outputBits, n, s2) { + return methods["cshake" + bits2].update(message, outputBits, n, s2)[outputType](); + }; + }, "createCshakeOutputMethod"), createKmacOutputMethod = /* @__PURE__ */ __name(function(bits2, padding, outputType) { + return function(key2, message, outputBits, s2) { + return methods["kmac" + bits2].update(key2, message, outputBits, s2)[outputType](); + }; + }, "createKmacOutputMethod"), createOutputMethods = /* @__PURE__ */ __name(function(method, createMethod2, bits2, padding) { + for (var i2 = 0; i2 < OUTPUT_TYPES.length; ++i2) { + var type = OUTPUT_TYPES[i2]; + method[type] = createMethod2(bits2, padding, type); + } + return method; + }, "createOutputMethods"), createMethod = /* @__PURE__ */ __name(function(bits2, padding) { + var method = createOutputMethod(bits2, padding, "hex"); + return method.create = function() { + return new Keccak(bits2, padding, bits2); + }, method.update = function(message) { + return method.create().update(message); + }, createOutputMethods(method, createOutputMethod, bits2, padding); + }, "createMethod"), createShakeMethod = /* @__PURE__ */ __name(function(bits2, padding) { + var method = createShakeOutputMethod(bits2, padding, "hex"); + return method.create = function(outputBits) { + return new Keccak(bits2, padding, outputBits); + }, method.update = function(message, outputBits) { + return method.create(outputBits).update(message); + }, createOutputMethods(method, createShakeOutputMethod, bits2, padding); + }, "createShakeMethod"), createCshakeMethod = /* @__PURE__ */ __name(function(bits2, padding) { + var w2 = CSHAKE_BYTEPAD[bits2], method = createCshakeOutputMethod(bits2, padding, "hex"); + return method.create = function(outputBits, n, s2) { + return !n && !s2 ? methods["shake" + bits2].create(outputBits) : new Keccak(bits2, padding, outputBits).bytepad([n, s2], w2); + }, method.update = function(message, outputBits, n, s2) { + return method.create(outputBits, n, s2).update(message); + }, createOutputMethods(method, createCshakeOutputMethod, bits2, padding); + }, "createCshakeMethod"), createKmacMethod = /* @__PURE__ */ __name(function(bits2, padding) { + var w2 = CSHAKE_BYTEPAD[bits2], method = createKmacOutputMethod(bits2, padding, "hex"); + return method.create = function(key2, outputBits, s2) { + return new Kmac(bits2, padding, outputBits).bytepad(["KMAC", s2], w2).bytepad([key2], w2); + }, method.update = function(key2, message, outputBits, s2) { + return method.create(key2, outputBits, s2).update(message); + }, createOutputMethods(method, createKmacOutputMethod, bits2, padding); + }, "createKmacMethod"), algorithms = [ + { name: "keccak", padding: KECCAK_PADDING, bits: BITS, createMethod }, + { name: "sha3", padding: PADDING, bits: BITS, createMethod }, + { name: "shake", padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod }, + { name: "cshake", padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod }, + { name: "kmac", padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod } + ], methods = {}, methodNames = [], i = 0; i < algorithms.length; ++i) + for (var algorithm = algorithms[i], bits = algorithm.bits, j2 = 0; j2 < bits.length; ++j2) { + var methodName = algorithm.name + "_" + bits[j2]; + if (methodNames.push(methodName), methods[methodName] = algorithm.createMethod(bits[j2], algorithm.padding), algorithm.name !== "sha3") { + var newMethodName = algorithm.name + bits[j2]; + methodNames.push(newMethodName), methods[newMethodName] = methods[methodName]; + } + } + function Keccak(bits2, padding, outputBits) { + this.blocks = [], this.s = [], this.padding = padding, this.outputBits = outputBits, this.reset = !0, this.finalized = !1, this.block = 0, this.start = 0, this.blockCount = 1600 - (bits2 << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = outputBits >> 5, this.extraBytes = (outputBits & 31) >> 3; + for (var i2 = 0; i2 < 50; ++i2) + this.s[i2] = 0; + } + __name(Keccak, "Keccak"), Keccak.prototype.update = function(message) { + if (this.finalized) + throw new Error(FINALIZE_ERROR); + var notString, type = typeof message; + if (type !== "string") { + if (type === "object") { + if (message === null) + throw new Error(INPUT_ERROR); + if (ARRAY_BUFFER && message.constructor === ArrayBuffer) + message = new Uint8Array(message); + else if (!Array.isArray(message) && (!ARRAY_BUFFER || !ArrayBuffer.isView(message))) + throw new Error(INPUT_ERROR); + } else + throw new Error(INPUT_ERROR); + notString = !0; + } + for (var blocks = this.blocks, byteCount = this.byteCount, length = message.length, blockCount = this.blockCount, index = 0, s2 = this.s, i2, code; index < length; ) { + if (this.reset) + for (this.reset = !1, blocks[0] = this.block, i2 = 1; i2 < blockCount + 1; ++i2) + blocks[i2] = 0; + if (notString) + for (i2 = this.start; index < length && i2 < byteCount; ++index) + blocks[i2 >> 2] |= message[index] << SHIFT[i2++ & 3]; + else + for (i2 = this.start; index < length && i2 < byteCount; ++index) + code = message.charCodeAt(index), code < 128 ? blocks[i2 >> 2] |= code << SHIFT[i2++ & 3] : code < 2048 ? (blocks[i2 >> 2] |= (192 | code >> 6) << SHIFT[i2++ & 3], blocks[i2 >> 2] |= (128 | code & 63) << SHIFT[i2++ & 3]) : code < 55296 || code >= 57344 ? (blocks[i2 >> 2] |= (224 | code >> 12) << SHIFT[i2++ & 3], blocks[i2 >> 2] |= (128 | code >> 6 & 63) << SHIFT[i2++ & 3], blocks[i2 >> 2] |= (128 | code & 63) << SHIFT[i2++ & 3]) : (code = 65536 + ((code & 1023) << 10 | message.charCodeAt(++index) & 1023), blocks[i2 >> 2] |= (240 | code >> 18) << SHIFT[i2++ & 3], blocks[i2 >> 2] |= (128 | code >> 12 & 63) << SHIFT[i2++ & 3], blocks[i2 >> 2] |= (128 | code >> 6 & 63) << SHIFT[i2++ & 3], blocks[i2 >> 2] |= (128 | code & 63) << SHIFT[i2++ & 3]); + if (this.lastByteIndex = i2, i2 >= byteCount) { + for (this.start = i2 - byteCount, this.block = blocks[blockCount], i2 = 0; i2 < blockCount; ++i2) + s2[i2] ^= blocks[i2]; + f2(s2), this.reset = !0; + } else + this.start = i2; + } + return this; + }, Keccak.prototype.encode = function(x2, right) { + var o2 = x2 & 255, n = 1, bytes = [o2]; + for (x2 = x2 >> 8, o2 = x2 & 255; o2 > 0; ) + bytes.unshift(o2), x2 = x2 >> 8, o2 = x2 & 255, ++n; + return right ? bytes.push(n) : bytes.unshift(n), this.update(bytes), bytes.length; + }, Keccak.prototype.encodeString = function(str) { + var notString, type = typeof str; + if (type !== "string") { + if (type === "object") { + if (str === null) + throw new Error(INPUT_ERROR); + if (ARRAY_BUFFER && str.constructor === ArrayBuffer) + str = new Uint8Array(str); + else if (!Array.isArray(str) && (!ARRAY_BUFFER || !ArrayBuffer.isView(str))) + throw new Error(INPUT_ERROR); + } else + throw new Error(INPUT_ERROR); + notString = !0; + } + var bytes = 0, length = str.length; + if (notString) + bytes = length; + else + for (var i2 = 0; i2 < str.length; ++i2) { + var code = str.charCodeAt(i2); + code < 128 ? bytes += 1 : code < 2048 ? bytes += 2 : code < 55296 || code >= 57344 ? bytes += 3 : (code = 65536 + ((code & 1023) << 10 | str.charCodeAt(++i2) & 1023), bytes += 4); + } + return bytes += this.encode(bytes * 8), this.update(str), bytes; + }, Keccak.prototype.bytepad = function(strs, w2) { + for (var bytes = this.encode(w2), i2 = 0; i2 < strs.length; ++i2) + bytes += this.encodeString(strs[i2]); + var paddingBytes = w2 - bytes % w2, zeros = []; + return zeros.length = paddingBytes, this.update(zeros), this; + }, Keccak.prototype.finalize = function() { + if (!this.finalized) { + this.finalized = !0; + var blocks = this.blocks, i2 = this.lastByteIndex, blockCount = this.blockCount, s2 = this.s; + if (blocks[i2 >> 2] |= this.padding[i2 & 3], this.lastByteIndex === this.byteCount) + for (blocks[0] = blocks[blockCount], i2 = 1; i2 < blockCount + 1; ++i2) + blocks[i2] = 0; + for (blocks[blockCount - 1] |= 2147483648, i2 = 0; i2 < blockCount; ++i2) + s2[i2] ^= blocks[i2]; + f2(s2); + } + }, Keccak.prototype.toString = Keccak.prototype.hex = function() { + this.finalize(); + for (var blockCount = this.blockCount, s2 = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i2 = 0, j3 = 0, hex = "", block; j3 < outputBlocks; ) { + for (i2 = 0; i2 < blockCount && j3 < outputBlocks; ++i2, ++j3) + block = s2[i2], hex += HEX_CHARS[block >> 4 & 15] + HEX_CHARS[block & 15] + HEX_CHARS[block >> 12 & 15] + HEX_CHARS[block >> 8 & 15] + HEX_CHARS[block >> 20 & 15] + HEX_CHARS[block >> 16 & 15] + HEX_CHARS[block >> 28 & 15] + HEX_CHARS[block >> 24 & 15]; + j3 % blockCount === 0 && (f2(s2), i2 = 0); + } + return extraBytes && (block = s2[i2], hex += HEX_CHARS[block >> 4 & 15] + HEX_CHARS[block & 15], extraBytes > 1 && (hex += HEX_CHARS[block >> 12 & 15] + HEX_CHARS[block >> 8 & 15]), extraBytes > 2 && (hex += HEX_CHARS[block >> 20 & 15] + HEX_CHARS[block >> 16 & 15])), hex; + }, Keccak.prototype.arrayBuffer = function() { + this.finalize(); + var blockCount = this.blockCount, s2 = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i2 = 0, j3 = 0, bytes = this.outputBits >> 3, buffer; + extraBytes ? buffer = new ArrayBuffer(outputBlocks + 1 << 2) : buffer = new ArrayBuffer(bytes); + for (var array = new Uint32Array(buffer); j3 < outputBlocks; ) { + for (i2 = 0; i2 < blockCount && j3 < outputBlocks; ++i2, ++j3) + array[j3] = s2[i2]; + j3 % blockCount === 0 && f2(s2); + } + return extraBytes && (array[i2] = s2[i2], buffer = buffer.slice(0, bytes)), buffer; + }, Keccak.prototype.buffer = Keccak.prototype.arrayBuffer, Keccak.prototype.digest = Keccak.prototype.array = function() { + this.finalize(); + for (var blockCount = this.blockCount, s2 = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i2 = 0, j3 = 0, array = [], offset, block; j3 < outputBlocks; ) { + for (i2 = 0; i2 < blockCount && j3 < outputBlocks; ++i2, ++j3) + offset = j3 << 2, block = s2[i2], array[offset] = block & 255, array[offset + 1] = block >> 8 & 255, array[offset + 2] = block >> 16 & 255, array[offset + 3] = block >> 24 & 255; + j3 % blockCount === 0 && f2(s2); + } + return extraBytes && (offset = j3 << 2, block = s2[i2], array[offset] = block & 255, extraBytes > 1 && (array[offset + 1] = block >> 8 & 255), extraBytes > 2 && (array[offset + 2] = block >> 16 & 255)), array; + }; + function Kmac(bits2, padding, outputBits) { + Keccak.call(this, bits2, padding, outputBits); + } + __name(Kmac, "Kmac"), Kmac.prototype = new Keccak(), Kmac.prototype.finalize = function() { + return this.encode(this.outputBits, !0), Keccak.prototype.finalize.call(this); + }; + var f2 = /* @__PURE__ */ __name(function(s2) { + var h2, l2, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49; + for (n = 0; n < 48; n += 2) + c0 = s2[0] ^ s2[10] ^ s2[20] ^ s2[30] ^ s2[40], c1 = s2[1] ^ s2[11] ^ s2[21] ^ s2[31] ^ s2[41], c2 = s2[2] ^ s2[12] ^ s2[22] ^ s2[32] ^ s2[42], c3 = s2[3] ^ s2[13] ^ s2[23] ^ s2[33] ^ s2[43], c4 = s2[4] ^ s2[14] ^ s2[24] ^ s2[34] ^ s2[44], c5 = s2[5] ^ s2[15] ^ s2[25] ^ s2[35] ^ s2[45], c6 = s2[6] ^ s2[16] ^ s2[26] ^ s2[36] ^ s2[46], c7 = s2[7] ^ s2[17] ^ s2[27] ^ s2[37] ^ s2[47], c8 = s2[8] ^ s2[18] ^ s2[28] ^ s2[38] ^ s2[48], c9 = s2[9] ^ s2[19] ^ s2[29] ^ s2[39] ^ s2[49], h2 = c8 ^ (c2 << 1 | c3 >>> 31), l2 = c9 ^ (c3 << 1 | c2 >>> 31), s2[0] ^= h2, s2[1] ^= l2, s2[10] ^= h2, s2[11] ^= l2, s2[20] ^= h2, s2[21] ^= l2, s2[30] ^= h2, s2[31] ^= l2, s2[40] ^= h2, s2[41] ^= l2, h2 = c0 ^ (c4 << 1 | c5 >>> 31), l2 = c1 ^ (c5 << 1 | c4 >>> 31), s2[2] ^= h2, s2[3] ^= l2, s2[12] ^= h2, s2[13] ^= l2, s2[22] ^= h2, s2[23] ^= l2, s2[32] ^= h2, s2[33] ^= l2, s2[42] ^= h2, s2[43] ^= l2, h2 = c2 ^ (c6 << 1 | c7 >>> 31), l2 = c3 ^ (c7 << 1 | c6 >>> 31), s2[4] ^= h2, s2[5] ^= l2, s2[14] ^= h2, s2[15] ^= l2, s2[24] ^= h2, s2[25] ^= l2, s2[34] ^= h2, s2[35] ^= l2, s2[44] ^= h2, s2[45] ^= l2, h2 = c4 ^ (c8 << 1 | c9 >>> 31), l2 = c5 ^ (c9 << 1 | c8 >>> 31), s2[6] ^= h2, s2[7] ^= l2, s2[16] ^= h2, s2[17] ^= l2, s2[26] ^= h2, s2[27] ^= l2, s2[36] ^= h2, s2[37] ^= l2, s2[46] ^= h2, s2[47] ^= l2, h2 = c6 ^ (c0 << 1 | c1 >>> 31), l2 = c7 ^ (c1 << 1 | c0 >>> 31), s2[8] ^= h2, s2[9] ^= l2, s2[18] ^= h2, s2[19] ^= l2, s2[28] ^= h2, s2[29] ^= l2, s2[38] ^= h2, s2[39] ^= l2, s2[48] ^= h2, s2[49] ^= l2, b0 = s2[0], b1 = s2[1], b32 = s2[11] << 4 | s2[10] >>> 28, b33 = s2[10] << 4 | s2[11] >>> 28, b14 = s2[20] << 3 | s2[21] >>> 29, b15 = s2[21] << 3 | s2[20] >>> 29, b46 = s2[31] << 9 | s2[30] >>> 23, b47 = s2[30] << 9 | s2[31] >>> 23, b28 = s2[40] << 18 | s2[41] >>> 14, b29 = s2[41] << 18 | s2[40] >>> 14, b20 = s2[2] << 1 | s2[3] >>> 31, b21 = s2[3] << 1 | s2[2] >>> 31, b2 = s2[13] << 12 | s2[12] >>> 20, b3 = s2[12] << 12 | s2[13] >>> 20, b34 = s2[22] << 10 | s2[23] >>> 22, b35 = s2[23] << 10 | s2[22] >>> 22, b16 = s2[33] << 13 | s2[32] >>> 19, b17 = s2[32] << 13 | s2[33] >>> 19, b48 = s2[42] << 2 | s2[43] >>> 30, b49 = s2[43] << 2 | s2[42] >>> 30, b40 = s2[5] << 30 | s2[4] >>> 2, b41 = s2[4] << 30 | s2[5] >>> 2, b22 = s2[14] << 6 | s2[15] >>> 26, b23 = s2[15] << 6 | s2[14] >>> 26, b4 = s2[25] << 11 | s2[24] >>> 21, b5 = s2[24] << 11 | s2[25] >>> 21, b36 = s2[34] << 15 | s2[35] >>> 17, b37 = s2[35] << 15 | s2[34] >>> 17, b18 = s2[45] << 29 | s2[44] >>> 3, b19 = s2[44] << 29 | s2[45] >>> 3, b10 = s2[6] << 28 | s2[7] >>> 4, b11 = s2[7] << 28 | s2[6] >>> 4, b42 = s2[17] << 23 | s2[16] >>> 9, b43 = s2[16] << 23 | s2[17] >>> 9, b24 = s2[26] << 25 | s2[27] >>> 7, b25 = s2[27] << 25 | s2[26] >>> 7, b6 = s2[36] << 21 | s2[37] >>> 11, b7 = s2[37] << 21 | s2[36] >>> 11, b38 = s2[47] << 24 | s2[46] >>> 8, b39 = s2[46] << 24 | s2[47] >>> 8, b30 = s2[8] << 27 | s2[9] >>> 5, b31 = s2[9] << 27 | s2[8] >>> 5, b12 = s2[18] << 20 | s2[19] >>> 12, b13 = s2[19] << 20 | s2[18] >>> 12, b44 = s2[29] << 7 | s2[28] >>> 25, b45 = s2[28] << 7 | s2[29] >>> 25, b26 = s2[38] << 8 | s2[39] >>> 24, b27 = s2[39] << 8 | s2[38] >>> 24, b8 = s2[48] << 14 | s2[49] >>> 18, b9 = s2[49] << 14 | s2[48] >>> 18, s2[0] = b0 ^ ~b2 & b4, s2[1] = b1 ^ ~b3 & b5, s2[10] = b10 ^ ~b12 & b14, s2[11] = b11 ^ ~b13 & b15, s2[20] = b20 ^ ~b22 & b24, s2[21] = b21 ^ ~b23 & b25, s2[30] = b30 ^ ~b32 & b34, s2[31] = b31 ^ ~b33 & b35, s2[40] = b40 ^ ~b42 & b44, s2[41] = b41 ^ ~b43 & b45, s2[2] = b2 ^ ~b4 & b6, s2[3] = b3 ^ ~b5 & b7, s2[12] = b12 ^ ~b14 & b16, s2[13] = b13 ^ ~b15 & b17, s2[22] = b22 ^ ~b24 & b26, s2[23] = b23 ^ ~b25 & b27, s2[32] = b32 ^ ~b34 & b36, s2[33] = b33 ^ ~b35 & b37, s2[42] = b42 ^ ~b44 & b46, s2[43] = b43 ^ ~b45 & b47, s2[4] = b4 ^ ~b6 & b8, s2[5] = b5 ^ ~b7 & b9, s2[14] = b14 ^ ~b16 & b18, s2[15] = b15 ^ ~b17 & b19, s2[24] = b24 ^ ~b26 & b28, s2[25] = b25 ^ ~b27 & b29, s2[34] = b34 ^ ~b36 & b38, s2[35] = b35 ^ ~b37 & b39, s2[44] = b44 ^ ~b46 & b48, s2[45] = b45 ^ ~b47 & b49, s2[6] = b6 ^ ~b8 & b0, s2[7] = b7 ^ ~b9 & b1, s2[16] = b16 ^ ~b18 & b10, s2[17] = b17 ^ ~b19 & b11, s2[26] = b26 ^ ~b28 & b20, s2[27] = b27 ^ ~b29 & b21, s2[36] = b36 ^ ~b38 & b30, s2[37] = b37 ^ ~b39 & b31, s2[46] = b46 ^ ~b48 & b40, s2[47] = b47 ^ ~b49 & b41, s2[8] = b8 ^ ~b0 & b2, s2[9] = b9 ^ ~b1 & b3, s2[18] = b18 ^ ~b10 & b12, s2[19] = b19 ^ ~b11 & b13, s2[28] = b28 ^ ~b20 & b22, s2[29] = b29 ^ ~b21 & b23, s2[38] = b38 ^ ~b30 & b32, s2[39] = b39 ^ ~b31 & b33, s2[48] = b48 ^ ~b40 & b42, s2[49] = b49 ^ ~b41 & b43, s2[0] ^= RC[n], s2[1] ^= RC[n + 1]; + }, "f"); + if (COMMON_JS) + module.exports = methods; + else + for (i = 0; i < methodNames.length; ++i) + root[methodNames[i]] = methods[methodNames[i]]; + })(); +})(sha3$1); +var sha3Exports = sha3$1.exports; +const sha3 = /* @__PURE__ */ getDefaultExportFromCjs(sha3Exports), version$4 = "logger/5.7.0"; +let _permanentCensorErrors = !1, _censorErrors = !1; +const LogLevels = { debug: 1, default: 2, info: 2, warning: 3, error: 4, off: 5 }; +let _logLevel = LogLevels.default, _globalLogger = null; +function _checkNormalize() { + try { + const missing = []; + if (["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { + try { + if ("test".normalize(form) !== "test") + throw new Error("bad normalize"); + } catch { + missing.push(form); + } + }), missing.length) + throw new Error("missing " + missing.join(", ")); + if (String.fromCharCode(233).normalize("NFD") !== String.fromCharCode(101, 769)) + throw new Error("broken implementation"); + } catch (error) { + return error.message; + } + return null; +} +__name(_checkNormalize, "_checkNormalize"); +const _normalizeError = _checkNormalize(); +var LogLevel; +(function(LogLevel2) { + LogLevel2.DEBUG = "DEBUG", LogLevel2.INFO = "INFO", LogLevel2.WARNING = "WARNING", LogLevel2.ERROR = "ERROR", LogLevel2.OFF = "OFF"; +})(LogLevel || (LogLevel = {})); +var ErrorCode; +(function(ErrorCode2) { + ErrorCode2.UNKNOWN_ERROR = "UNKNOWN_ERROR", ErrorCode2.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", ErrorCode2.UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", ErrorCode2.NETWORK_ERROR = "NETWORK_ERROR", ErrorCode2.SERVER_ERROR = "SERVER_ERROR", ErrorCode2.TIMEOUT = "TIMEOUT", ErrorCode2.BUFFER_OVERRUN = "BUFFER_OVERRUN", ErrorCode2.NUMERIC_FAULT = "NUMERIC_FAULT", ErrorCode2.MISSING_NEW = "MISSING_NEW", ErrorCode2.INVALID_ARGUMENT = "INVALID_ARGUMENT", ErrorCode2.MISSING_ARGUMENT = "MISSING_ARGUMENT", ErrorCode2.UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", ErrorCode2.CALL_EXCEPTION = "CALL_EXCEPTION", ErrorCode2.INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", ErrorCode2.NONCE_EXPIRED = "NONCE_EXPIRED", ErrorCode2.REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", ErrorCode2.UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT", ErrorCode2.TRANSACTION_REPLACED = "TRANSACTION_REPLACED", ErrorCode2.ACTION_REJECTED = "ACTION_REJECTED"; +})(ErrorCode || (ErrorCode = {})); +const HEX = "0123456789abcdef", _Logger = class _Logger { + constructor(version2) { + Object.defineProperty(this, "version", { + enumerable: !0, + value: version2, + writable: !1 + }); + } + _log(logLevel, args) { + const level = logLevel.toLowerCase(); + LogLevels[level] == null && this.throwArgumentError("invalid log level name", "logLevel", logLevel), !(_logLevel > LogLevels[level]) && console.log.apply(console, args); + } + debug(...args) { + this._log(_Logger.levels.DEBUG, args); + } + info(...args) { + this._log(_Logger.levels.INFO, args); + } + warn(...args) { + this._log(_Logger.levels.WARNING, args); + } + makeError(message, code, params) { + if (_censorErrors) + return this.makeError("censored error", code, {}); + code || (code = _Logger.errors.UNKNOWN_ERROR), params || (params = {}); + const messageDetails = []; + Object.keys(params).forEach((key2) => { + const value = params[key2]; + try { + if (value instanceof Uint8Array) { + let hex = ""; + for (let i = 0; i < value.length; i++) + hex += HEX[value[i] >> 4], hex += HEX[value[i] & 15]; + messageDetails.push(key2 + "=Uint8Array(0x" + hex + ")"); + } else + messageDetails.push(key2 + "=" + JSON.stringify(value)); + } catch { + messageDetails.push(key2 + "=" + JSON.stringify(params[key2].toString())); + } + }), messageDetails.push(`code=${code}`), messageDetails.push(`version=${this.version}`); + const reason = message; + let url = ""; + switch (code) { + case ErrorCode.NUMERIC_FAULT: { + url = "NUMERIC_FAULT"; + const fault = message; + switch (fault) { + case "overflow": + case "underflow": + case "division-by-zero": + url += "-" + fault; + break; + case "negative-power": + case "negative-width": + url += "-unsupported"; + break; + case "unbound-bitwise-result": + url += "-unbound-result"; + break; + } + break; + } + case ErrorCode.CALL_EXCEPTION: + case ErrorCode.INSUFFICIENT_FUNDS: + case ErrorCode.MISSING_NEW: + case ErrorCode.NONCE_EXPIRED: + case ErrorCode.REPLACEMENT_UNDERPRICED: + case ErrorCode.TRANSACTION_REPLACED: + case ErrorCode.UNPREDICTABLE_GAS_LIMIT: + url = code; + break; + } + url && (message += " [ See: https://links.ethers.org/v5-errors-" + url + " ]"), messageDetails.length && (message += " (" + messageDetails.join(", ") + ")"); + const error = new Error(message); + return error.reason = reason, error.code = code, Object.keys(params).forEach(function(key2) { + error[key2] = params[key2]; + }), error; + } + throwError(message, code, params) { + throw this.makeError(message, code, params); + } + throwArgumentError(message, name, value) { + return this.throwError(message, _Logger.errors.INVALID_ARGUMENT, { + argument: name, + value + }); + } + assert(condition, message, code, params) { + condition || this.throwError(message, code, params); + } + assertArgument(condition, message, name, value) { + condition || this.throwArgumentError(message, name, value); + } + checkNormalize(message) { + _normalizeError && this.throwError("platform missing String.prototype.normalize", _Logger.errors.UNSUPPORTED_OPERATION, { + operation: "String.prototype.normalize", + form: _normalizeError + }); + } + checkSafeUint53(value, message) { + typeof value == "number" && (message == null && (message = "value not safe"), (value < 0 || value >= 9007199254740991) && this.throwError(message, _Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "out-of-safe-range", + value + }), value % 1 && this.throwError(message, _Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "non-integer", + value + })); + } + checkArgumentCount(count, expectedCount, message) { + message ? message = ": " + message : message = "", count < expectedCount && this.throwError("missing argument" + message, _Logger.errors.MISSING_ARGUMENT, { + count, + expectedCount + }), count > expectedCount && this.throwError("too many arguments" + message, _Logger.errors.UNEXPECTED_ARGUMENT, { + count, + expectedCount + }); + } + checkNew(target, kind) { + (target === Object || target == null) && this.throwError("missing new", _Logger.errors.MISSING_NEW, { name: kind.name }); + } + checkAbstract(target, kind) { + target === kind ? this.throwError("cannot instantiate abstract class " + JSON.stringify(kind.name) + " directly; use a sub-class", _Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }) : (target === Object || target == null) && this.throwError("missing new", _Logger.errors.MISSING_NEW, { name: kind.name }); + } + static globalLogger() { + return _globalLogger || (_globalLogger = new _Logger(version$4)), _globalLogger; + } + static setCensorship(censorship, permanent) { + if (!censorship && permanent && this.globalLogger().throwError("cannot permanently disable censorship", _Logger.errors.UNSUPPORTED_OPERATION, { + operation: "setCensorship" + }), _permanentCensorErrors) { + if (!censorship) + return; + this.globalLogger().throwError("error censorship permanent", _Logger.errors.UNSUPPORTED_OPERATION, { + operation: "setCensorship" + }); + } + _censorErrors = !!censorship, _permanentCensorErrors = !!permanent; + } + static setLogLevel(logLevel) { + const level = LogLevels[logLevel.toLowerCase()]; + if (level == null) { + _Logger.globalLogger().warn("invalid log level - " + logLevel); + return; + } + _logLevel = level; + } + static from(version2) { + return new _Logger(version2); + } +}; +__name(_Logger, "Logger"); +let Logger = _Logger; +Logger.errors = ErrorCode; +Logger.levels = LogLevel; +const version$3 = "bytes/5.7.0", logger$3 = new Logger(version$3); +function isHexable(value) { + return !!value.toHexString; +} +__name(isHexable, "isHexable"); +function addSlice(array) { + return array.slice || (array.slice = function() { + const args = Array.prototype.slice.call(arguments); + return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); + }), array; +} +__name(addSlice, "addSlice"); +function isBytesLike(value) { + return isHexString(value) && !(value.length % 2) || isBytes(value); +} +__name(isBytesLike, "isBytesLike"); +function isInteger(value) { + return typeof value == "number" && value == value && value % 1 === 0; +} +__name(isInteger, "isInteger"); +function isBytes(value) { + if (value == null) + return !1; + if (value.constructor === Uint8Array) + return !0; + if (typeof value == "string" || !isInteger(value.length) || value.length < 0) + return !1; + for (let i = 0; i < value.length; i++) { + const v2 = value[i]; + if (!isInteger(v2) || v2 < 0 || v2 >= 256) + return !1; + } + return !0; +} +__name(isBytes, "isBytes"); +function arrayify(value, options) { + if (options || (options = {}), typeof value == "number") { + logger$3.checkSafeUint53(value, "invalid arrayify value"); + const result = []; + for (; value; ) + result.unshift(value & 255), value = parseInt(String(value / 256)); + return result.length === 0 && result.push(0), addSlice(new Uint8Array(result)); + } + if (options.allowMissingPrefix && typeof value == "string" && value.substring(0, 2) !== "0x" && (value = "0x" + value), isHexable(value) && (value = value.toHexString()), isHexString(value)) { + let hex = value.substring(2); + hex.length % 2 && (options.hexPad === "left" ? hex = "0" + hex : options.hexPad === "right" ? hex += "0" : logger$3.throwArgumentError("hex data is odd-length", "value", value)); + const result = []; + for (let i = 0; i < hex.length; i += 2) + result.push(parseInt(hex.substring(i, i + 2), 16)); + return addSlice(new Uint8Array(result)); + } + return isBytes(value) ? addSlice(new Uint8Array(value)) : logger$3.throwArgumentError("invalid arrayify value", "value", value); +} +__name(arrayify, "arrayify"); +function concat(items) { + const objects = items.map((item) => arrayify(item)), length = objects.reduce((accum, item) => accum + item.length, 0), result = new Uint8Array(length); + return objects.reduce((offset, object) => (result.set(object, offset), offset + object.length), 0), addSlice(result); +} +__name(concat, "concat"); +function zeroPad(value, length) { + value = arrayify(value), value.length > length && logger$3.throwArgumentError("value out of range", "value", arguments[0]); + const result = new Uint8Array(length); + return result.set(value, length - value.length), addSlice(result); +} +__name(zeroPad, "zeroPad"); +function isHexString(value, length) { + return !(typeof value != "string" || !value.match(/^0x[0-9A-Fa-f]*$/) || length && value.length !== 2 + 2 * length); +} +__name(isHexString, "isHexString"); +const HexCharacters = "0123456789abcdef"; +function hexlify(value, options) { + if (options || (options = {}), typeof value == "number") { + logger$3.checkSafeUint53(value, "invalid hexlify value"); + let hex = ""; + for (; value; ) + hex = HexCharacters[value & 15] + hex, value = Math.floor(value / 16); + return hex.length ? (hex.length % 2 && (hex = "0" + hex), "0x" + hex) : "0x00"; + } + if (typeof value == "bigint") + return value = value.toString(16), value.length % 2 ? "0x0" + value : "0x" + value; + if (options.allowMissingPrefix && typeof value == "string" && value.substring(0, 2) !== "0x" && (value = "0x" + value), isHexable(value)) + return value.toHexString(); + if (isHexString(value)) + return value.length % 2 && (options.hexPad === "left" ? value = "0x0" + value.substring(2) : options.hexPad === "right" ? value += "0" : logger$3.throwArgumentError("hex data is odd-length", "value", value)), value.toLowerCase(); + if (isBytes(value)) { + let result = "0x"; + for (let i = 0; i < value.length; i++) { + let v2 = value[i]; + result += HexCharacters[(v2 & 240) >> 4] + HexCharacters[v2 & 15]; + } + return result; + } + return logger$3.throwArgumentError("invalid hexlify value", "value", value); +} +__name(hexlify, "hexlify"); +function hexDataLength(data) { + if (typeof data != "string") + data = hexlify(data); + else if (!isHexString(data) || data.length % 2) + return null; + return (data.length - 2) / 2; +} +__name(hexDataLength, "hexDataLength"); +function hexDataSlice(data, offset, endOffset) { + return typeof data != "string" ? data = hexlify(data) : (!isHexString(data) || data.length % 2) && logger$3.throwArgumentError("invalid hexData", "value", data), offset = 2 + 2 * offset, endOffset != null ? "0x" + data.substring(offset, 2 + 2 * endOffset) : "0x" + data.substring(offset); +} +__name(hexDataSlice, "hexDataSlice"); +function hexZeroPad(value, length) { + for (typeof value != "string" ? value = hexlify(value) : isHexString(value) || logger$3.throwArgumentError("invalid hex string", "value", value), value.length > 2 * length + 2 && logger$3.throwArgumentError("value out of range", "value", arguments[1]); value.length < 2 * length + 2; ) + value = "0x0" + value.substring(2); + return value; +} +__name(hexZeroPad, "hexZeroPad"); +function splitSignature(signature2) { + const result = { + r: "0x", + s: "0x", + _vs: "0x", + recoveryParam: 0, + v: 0, + yParityAndS: "0x", + compact: "0x" + }; + if (isBytesLike(signature2)) { + let bytes = arrayify(signature2); + bytes.length === 64 ? (result.v = 27 + (bytes[32] >> 7), bytes[32] &= 127, result.r = hexlify(bytes.slice(0, 32)), result.s = hexlify(bytes.slice(32, 64))) : bytes.length === 65 ? (result.r = hexlify(bytes.slice(0, 32)), result.s = hexlify(bytes.slice(32, 64)), result.v = bytes[64]) : logger$3.throwArgumentError("invalid signature string", "signature", signature2), result.v < 27 && (result.v === 0 || result.v === 1 ? result.v += 27 : logger$3.throwArgumentError("signature invalid v byte", "signature", signature2)), result.recoveryParam = 1 - result.v % 2, result.recoveryParam && (bytes[32] |= 128), result._vs = hexlify(bytes.slice(32, 64)); + } else { + if (result.r = signature2.r, result.s = signature2.s, result.v = signature2.v, result.recoveryParam = signature2.recoveryParam, result._vs = signature2._vs, result._vs != null) { + const vs2 = zeroPad(arrayify(result._vs), 32); + result._vs = hexlify(vs2); + const recoveryParam = vs2[0] >= 128 ? 1 : 0; + result.recoveryParam == null ? result.recoveryParam = recoveryParam : result.recoveryParam !== recoveryParam && logger$3.throwArgumentError("signature recoveryParam mismatch _vs", "signature", signature2), vs2[0] &= 127; + const s2 = hexlify(vs2); + result.s == null ? result.s = s2 : result.s !== s2 && logger$3.throwArgumentError("signature v mismatch _vs", "signature", signature2); + } + if (result.recoveryParam == null) + result.v == null ? logger$3.throwArgumentError("signature missing v and recoveryParam", "signature", signature2) : result.v === 0 || result.v === 1 ? result.recoveryParam = result.v : result.recoveryParam = 1 - result.v % 2; + else if (result.v == null) + result.v = 27 + result.recoveryParam; + else { + const recId = result.v === 0 || result.v === 1 ? result.v : 1 - result.v % 2; + result.recoveryParam !== recId && logger$3.throwArgumentError("signature recoveryParam mismatch v", "signature", signature2); + } + result.r == null || !isHexString(result.r) ? logger$3.throwArgumentError("signature missing or invalid r", "signature", signature2) : result.r = hexZeroPad(result.r, 32), result.s == null || !isHexString(result.s) ? logger$3.throwArgumentError("signature missing or invalid s", "signature", signature2) : result.s = hexZeroPad(result.s, 32); + const vs = arrayify(result.s); + vs[0] >= 128 && logger$3.throwArgumentError("signature s out of range", "signature", signature2), result.recoveryParam && (vs[0] |= 128); + const _vs = hexlify(vs); + result._vs && (isHexString(result._vs) || logger$3.throwArgumentError("signature invalid _vs", "signature", signature2), result._vs = hexZeroPad(result._vs, 32)), result._vs == null ? result._vs = _vs : result._vs !== _vs && logger$3.throwArgumentError("signature _vs mismatch v and s", "signature", signature2); + } + return result.yParityAndS = result._vs, result.compact = result.r + result.yParityAndS.substring(2), result; +} +__name(splitSignature, "splitSignature"); +function keccak256(data) { + return "0x" + sha3.keccak_256(arrayify(data)); +} +__name(keccak256, "keccak256"); +var bn = { exports: {} }; +bn.exports; +(function(module) { + (function(module2, exports) { + function assert2(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + __name(assert2, "assert"); + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = /* @__PURE__ */ __name(function() { + }, "TempCtor"); + TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor(), ctor.prototype.constructor = ctor; + } + __name(inherits2, "inherits"); + function BN2(number, base2, endian) { + if (BN2.isBN(number)) + return number; + this.negative = 0, this.words = null, this.length = 0, this.red = null, number !== null && ((base2 === "le" || base2 === "be") && (endian = base2, base2 = 10), this._init(number || 0, base2 || 10, endian || "be")); + } + __name(BN2, "BN"), typeof module2 == "object" ? module2.exports = BN2 : exports.BN = BN2, BN2.BN = BN2, BN2.wordSize = 26; + var Buffer2; + try { + typeof window < "u" && typeof window.Buffer < "u" ? Buffer2 = window.Buffer : Buffer2 = require$$0$1.Buffer; + } catch { + } + BN2.isBN = /* @__PURE__ */ __name(function(num) { + return num instanceof BN2 ? !0 : num !== null && typeof num == "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words); + }, "isBN"), BN2.max = /* @__PURE__ */ __name(function(left, right) { + return left.cmp(right) > 0 ? left : right; + }, "max"), BN2.min = /* @__PURE__ */ __name(function(left, right) { + return left.cmp(right) < 0 ? left : right; + }, "min"), BN2.prototype._init = /* @__PURE__ */ __name(function(number, base2, endian) { + if (typeof number == "number") + return this._initNumber(number, base2, endian); + if (typeof number == "object") + return this._initArray(number, base2, endian); + base2 === "hex" && (base2 = 16), assert2(base2 === (base2 | 0) && base2 >= 2 && base2 <= 36), number = number.toString().replace(/\s+/g, ""); + var start = 0; + number[0] === "-" && (start++, this.negative = 1), start < number.length && (base2 === 16 ? this._parseHex(number, start, endian) : (this._parseBase(number, base2, start), endian === "le" && this._initArray(this.toArray(), base2, endian))); + }, "init"), BN2.prototype._initNumber = /* @__PURE__ */ __name(function(number, base2, endian) { + number < 0 && (this.negative = 1, number = -number), number < 67108864 ? (this.words = [number & 67108863], this.length = 1) : number < 4503599627370496 ? (this.words = [ + number & 67108863, + number / 67108864 & 67108863 + ], this.length = 2) : (assert2(number < 9007199254740992), this.words = [ + number & 67108863, + number / 67108864 & 67108863, + 1 + ], this.length = 3), endian === "le" && this._initArray(this.toArray(), base2, endian); + }, "_initNumber"), BN2.prototype._initArray = /* @__PURE__ */ __name(function(number, base2, endian) { + if (assert2(typeof number.length == "number"), number.length <= 0) + return this.words = [0], this.length = 1, this; + this.length = Math.ceil(number.length / 3), this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) + this.words[i] = 0; + var j2, w2, off = 0; + if (endian === "be") + for (i = number.length - 1, j2 = 0; i >= 0; i -= 3) + w2 = number[i] | number[i - 1] << 8 | number[i - 2] << 16, this.words[j2] |= w2 << off & 67108863, this.words[j2 + 1] = w2 >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j2++); + else if (endian === "le") + for (i = 0, j2 = 0; i < number.length; i += 3) + w2 = number[i] | number[i + 1] << 8 | number[i + 2] << 16, this.words[j2] |= w2 << off & 67108863, this.words[j2 + 1] = w2 >>> 26 - off & 67108863, off += 24, off >= 26 && (off -= 26, j2++); + return this._strip(); + }, "_initArray"); + function parseHex4Bits(string, index) { + var c = string.charCodeAt(index); + if (c >= 48 && c <= 57) + return c - 48; + if (c >= 65 && c <= 70) + return c - 55; + if (c >= 97 && c <= 102) + return c - 87; + assert2(!1, "Invalid character in " + string); + } + __name(parseHex4Bits, "parseHex4Bits"); + function parseHexByte(string, lowerBound, index) { + var r2 = parseHex4Bits(string, index); + return index - 1 >= lowerBound && (r2 |= parseHex4Bits(string, index - 1) << 4), r2; + } + __name(parseHexByte, "parseHexByte"), BN2.prototype._parseHex = /* @__PURE__ */ __name(function(number, start, endian) { + this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) + this.words[i] = 0; + var off = 0, j2 = 0, w2; + if (endian === "be") + for (i = number.length - 1; i >= start; i -= 2) + w2 = parseHexByte(number, start, i) << off, this.words[j2] |= w2 & 67108863, off >= 18 ? (off -= 18, j2 += 1, this.words[j2] |= w2 >>> 26) : off += 8; + else { + var parseLength = number.length - start; + for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) + w2 = parseHexByte(number, start, i) << off, this.words[j2] |= w2 & 67108863, off >= 18 ? (off -= 18, j2 += 1, this.words[j2] |= w2 >>> 26) : off += 8; + } + this._strip(); + }, "_parseHex"); + function parseBase(str, start, end, mul3) { + for (var r2 = 0, b2 = 0, len = Math.min(str.length, end), i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; + r2 *= mul3, c >= 49 ? b2 = c - 49 + 10 : c >= 17 ? b2 = c - 17 + 10 : b2 = c, assert2(c >= 0 && b2 < mul3, "Invalid character"), r2 += b2; + } + return r2; + } + __name(parseBase, "parseBase"), BN2.prototype._parseBase = /* @__PURE__ */ __name(function(number, base2, start) { + this.words = [0], this.length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base2) + limbLen++; + limbLen--, limbPow = limbPow / base2 | 0; + for (var total = number.length - start, mod = total % limbLen, end = Math.min(total, total - mod) + start, word = 0, i = start; i < end; i += limbLen) + word = parseBase(number, i, i + limbLen, base2), this.imuln(limbPow), this.words[0] + word < 67108864 ? this.words[0] += word : this._iaddn(word); + if (mod !== 0) { + var pow = 1; + for (word = parseBase(number, i, number.length, base2), i = 0; i < mod; i++) + pow *= base2; + this.imuln(pow), this.words[0] + word < 67108864 ? this.words[0] += word : this._iaddn(word); + } + this._strip(); + }, "_parseBase"), BN2.prototype.copy = /* @__PURE__ */ __name(function(dest) { + dest.words = new Array(this.length); + for (var i = 0; i < this.length; i++) + dest.words[i] = this.words[i]; + dest.length = this.length, dest.negative = this.negative, dest.red = this.red; + }, "copy"); + function move(dest, src) { + dest.words = src.words, dest.length = src.length, dest.negative = src.negative, dest.red = src.red; + } + if (__name(move, "move"), BN2.prototype._move = /* @__PURE__ */ __name(function(dest) { + move(dest, this); + }, "_move"), BN2.prototype.clone = /* @__PURE__ */ __name(function() { + var r2 = new BN2(null); + return this.copy(r2), r2; + }, "clone"), BN2.prototype._expand = /* @__PURE__ */ __name(function(size) { + for (; this.length < size; ) + this.words[this.length++] = 0; + return this; + }, "_expand"), BN2.prototype._strip = /* @__PURE__ */ __name(function() { + for (; this.length > 1 && this.words[this.length - 1] === 0; ) + this.length--; + return this._normSign(); + }, "strip"), BN2.prototype._normSign = /* @__PURE__ */ __name(function() { + return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this; + }, "_normSign"), typeof Symbol < "u" && typeof Symbol.for == "function") + try { + BN2.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect4; + } catch { + BN2.prototype.inspect = inspect4; + } + else + BN2.prototype.inspect = inspect4; + function inspect4() { + return (this.red ? ""; + } + __name(inspect4, "inspect"); + var zeros = [ + "", + "0", + "00", + "000", + "0000", + "00000", + "000000", + "0000000", + "00000000", + "000000000", + "0000000000", + "00000000000", + "000000000000", + "0000000000000", + "00000000000000", + "000000000000000", + "0000000000000000", + "00000000000000000", + "000000000000000000", + "0000000000000000000", + "00000000000000000000", + "000000000000000000000", + "0000000000000000000000", + "00000000000000000000000", + "000000000000000000000000", + "0000000000000000000000000" + ], groupSizes = [ + 0, + 0, + 25, + 16, + 12, + 11, + 10, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5 + ], groupBases = [ + 0, + 0, + 33554432, + 43046721, + 16777216, + 48828125, + 60466176, + 40353607, + 16777216, + 43046721, + 1e7, + 19487171, + 35831808, + 62748517, + 7529536, + 11390625, + 16777216, + 24137569, + 34012224, + 47045881, + 64e6, + 4084101, + 5153632, + 6436343, + 7962624, + 9765625, + 11881376, + 14348907, + 17210368, + 20511149, + 243e5, + 28629151, + 33554432, + 39135393, + 45435424, + 52521875, + 60466176 + ]; + BN2.prototype.toString = /* @__PURE__ */ __name(function(base2, padding) { + base2 = base2 || 10, padding = padding | 0 || 1; + var out; + if (base2 === 16 || base2 === "hex") { + out = ""; + for (var off = 0, carry = 0, i = 0; i < this.length; i++) { + var w2 = this.words[i], word = ((w2 << off | carry) & 16777215).toString(16); + carry = w2 >>> 24 - off & 16777215, off += 2, off >= 26 && (off -= 26, i--), carry !== 0 || i !== this.length - 1 ? out = zeros[6 - word.length] + word + out : out = word + out; + } + for (carry !== 0 && (out = carry.toString(16) + out); out.length % padding !== 0; ) + out = "0" + out; + return this.negative !== 0 && (out = "-" + out), out; + } + if (base2 === (base2 | 0) && base2 >= 2 && base2 <= 36) { + var groupSize = groupSizes[base2], groupBase = groupBases[base2]; + out = ""; + var c = this.clone(); + for (c.negative = 0; !c.isZero(); ) { + var r2 = c.modrn(groupBase).toString(base2); + c = c.idivn(groupBase), c.isZero() ? out = r2 + out : out = zeros[groupSize - r2.length] + r2 + out; + } + for (this.isZero() && (out = "0" + out); out.length % padding !== 0; ) + out = "0" + out; + return this.negative !== 0 && (out = "-" + out), out; + } + assert2(!1, "Base should be between 2 and 36"); + }, "toString"), BN2.prototype.toNumber = /* @__PURE__ */ __name(function() { + var ret = this.words[0]; + return this.length === 2 ? ret += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? ret += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && assert2(!1, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -ret : ret; + }, "toNumber"), BN2.prototype.toJSON = /* @__PURE__ */ __name(function() { + return this.toString(16, 2); + }, "toJSON"), Buffer2 && (BN2.prototype.toBuffer = /* @__PURE__ */ __name(function(endian, length) { + return this.toArrayLike(Buffer2, endian, length); + }, "toBuffer")), BN2.prototype.toArray = /* @__PURE__ */ __name(function(endian, length) { + return this.toArrayLike(Array, endian, length); + }, "toArray"); + var allocate = /* @__PURE__ */ __name(function(ArrayType, size) { + return ArrayType.allocUnsafe ? ArrayType.allocUnsafe(size) : new ArrayType(size); + }, "allocate"); + BN2.prototype.toArrayLike = /* @__PURE__ */ __name(function(ArrayType, endian, length) { + this._strip(); + var byteLength = this.byteLength(), reqLength = length || Math.max(1, byteLength); + assert2(byteLength <= reqLength, "byte array longer than desired length"), assert2(reqLength > 0, "Requested array length <= 0"); + var res = allocate(ArrayType, reqLength), postfix = endian === "le" ? "LE" : "BE"; + return this["_toArrayLike" + postfix](res, byteLength), res; + }, "toArrayLike"), BN2.prototype._toArrayLikeLE = /* @__PURE__ */ __name(function(res, byteLength) { + for (var position = 0, carry = 0, i = 0, shift = 0; i < this.length; i++) { + var word = this.words[i] << shift | carry; + res[position++] = word & 255, position < res.length && (res[position++] = word >> 8 & 255), position < res.length && (res[position++] = word >> 16 & 255), shift === 6 ? (position < res.length && (res[position++] = word >> 24 & 255), carry = 0, shift = 0) : (carry = word >>> 24, shift += 2); + } + if (position < res.length) + for (res[position++] = carry; position < res.length; ) + res[position++] = 0; + }, "_toArrayLikeLE"), BN2.prototype._toArrayLikeBE = /* @__PURE__ */ __name(function(res, byteLength) { + for (var position = res.length - 1, carry = 0, i = 0, shift = 0; i < this.length; i++) { + var word = this.words[i] << shift | carry; + res[position--] = word & 255, position >= 0 && (res[position--] = word >> 8 & 255), position >= 0 && (res[position--] = word >> 16 & 255), shift === 6 ? (position >= 0 && (res[position--] = word >> 24 & 255), carry = 0, shift = 0) : (carry = word >>> 24, shift += 2); + } + if (position >= 0) + for (res[position--] = carry; position >= 0; ) + res[position--] = 0; + }, "_toArrayLikeBE"), Math.clz32 ? BN2.prototype._countBits = /* @__PURE__ */ __name(function(w2) { + return 32 - Math.clz32(w2); + }, "_countBits") : BN2.prototype._countBits = /* @__PURE__ */ __name(function(w2) { + var t = w2, r2 = 0; + return t >= 4096 && (r2 += 13, t >>>= 13), t >= 64 && (r2 += 7, t >>>= 7), t >= 8 && (r2 += 4, t >>>= 4), t >= 2 && (r2 += 2, t >>>= 2), r2 + t; + }, "_countBits"), BN2.prototype._zeroBits = /* @__PURE__ */ __name(function(w2) { + if (w2 === 0) + return 26; + var t = w2, r2 = 0; + return t & 8191 || (r2 += 13, t >>>= 13), t & 127 || (r2 += 7, t >>>= 7), t & 15 || (r2 += 4, t >>>= 4), t & 3 || (r2 += 2, t >>>= 2), t & 1 || r2++, r2; + }, "_zeroBits"), BN2.prototype.bitLength = /* @__PURE__ */ __name(function() { + var w2 = this.words[this.length - 1], hi = this._countBits(w2); + return (this.length - 1) * 26 + hi; + }, "bitLength"); + function toBitArray(num) { + for (var w2 = new Array(num.bitLength()), bit = 0; bit < w2.length; bit++) { + var off = bit / 26 | 0, wbit = bit % 26; + w2[bit] = num.words[off] >>> wbit & 1; + } + return w2; + } + __name(toBitArray, "toBitArray"), BN2.prototype.zeroBits = /* @__PURE__ */ __name(function() { + if (this.isZero()) + return 0; + for (var r2 = 0, i = 0; i < this.length; i++) { + var b2 = this._zeroBits(this.words[i]); + if (r2 += b2, b2 !== 26) + break; + } + return r2; + }, "zeroBits"), BN2.prototype.byteLength = /* @__PURE__ */ __name(function() { + return Math.ceil(this.bitLength() / 8); + }, "byteLength"), BN2.prototype.toTwos = /* @__PURE__ */ __name(function(width) { + return this.negative !== 0 ? this.abs().inotn(width).iaddn(1) : this.clone(); + }, "toTwos"), BN2.prototype.fromTwos = /* @__PURE__ */ __name(function(width) { + return this.testn(width - 1) ? this.notn(width).iaddn(1).ineg() : this.clone(); + }, "fromTwos"), BN2.prototype.isNeg = /* @__PURE__ */ __name(function() { + return this.negative !== 0; + }, "isNeg"), BN2.prototype.neg = /* @__PURE__ */ __name(function() { + return this.clone().ineg(); + }, "neg"), BN2.prototype.ineg = /* @__PURE__ */ __name(function() { + return this.isZero() || (this.negative ^= 1), this; + }, "ineg"), BN2.prototype.iuor = /* @__PURE__ */ __name(function(num) { + for (; this.length < num.length; ) + this.words[this.length++] = 0; + for (var i = 0; i < num.length; i++) + this.words[i] = this.words[i] | num.words[i]; + return this._strip(); + }, "iuor"), BN2.prototype.ior = /* @__PURE__ */ __name(function(num) { + return assert2((this.negative | num.negative) === 0), this.iuor(num); + }, "ior"), BN2.prototype.or = /* @__PURE__ */ __name(function(num) { + return this.length > num.length ? this.clone().ior(num) : num.clone().ior(this); + }, "or"), BN2.prototype.uor = /* @__PURE__ */ __name(function(num) { + return this.length > num.length ? this.clone().iuor(num) : num.clone().iuor(this); + }, "uor"), BN2.prototype.iuand = /* @__PURE__ */ __name(function(num) { + var b2; + this.length > num.length ? b2 = num : b2 = this; + for (var i = 0; i < b2.length; i++) + this.words[i] = this.words[i] & num.words[i]; + return this.length = b2.length, this._strip(); + }, "iuand"), BN2.prototype.iand = /* @__PURE__ */ __name(function(num) { + return assert2((this.negative | num.negative) === 0), this.iuand(num); + }, "iand"), BN2.prototype.and = /* @__PURE__ */ __name(function(num) { + return this.length > num.length ? this.clone().iand(num) : num.clone().iand(this); + }, "and"), BN2.prototype.uand = /* @__PURE__ */ __name(function(num) { + return this.length > num.length ? this.clone().iuand(num) : num.clone().iuand(this); + }, "uand"), BN2.prototype.iuxor = /* @__PURE__ */ __name(function(num) { + var a, b2; + this.length > num.length ? (a = this, b2 = num) : (a = num, b2 = this); + for (var i = 0; i < b2.length; i++) + this.words[i] = a.words[i] ^ b2.words[i]; + if (this !== a) + for (; i < a.length; i++) + this.words[i] = a.words[i]; + return this.length = a.length, this._strip(); + }, "iuxor"), BN2.prototype.ixor = /* @__PURE__ */ __name(function(num) { + return assert2((this.negative | num.negative) === 0), this.iuxor(num); + }, "ixor"), BN2.prototype.xor = /* @__PURE__ */ __name(function(num) { + return this.length > num.length ? this.clone().ixor(num) : num.clone().ixor(this); + }, "xor"), BN2.prototype.uxor = /* @__PURE__ */ __name(function(num) { + return this.length > num.length ? this.clone().iuxor(num) : num.clone().iuxor(this); + }, "uxor"), BN2.prototype.inotn = /* @__PURE__ */ __name(function(width) { + assert2(typeof width == "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0, bitsLeft = width % 26; + this._expand(bytesNeeded), bitsLeft > 0 && bytesNeeded--; + for (var i = 0; i < bytesNeeded; i++) + this.words[i] = ~this.words[i] & 67108863; + return bitsLeft > 0 && (this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft), this._strip(); + }, "inotn"), BN2.prototype.notn = /* @__PURE__ */ __name(function(width) { + return this.clone().inotn(width); + }, "notn"), BN2.prototype.setn = /* @__PURE__ */ __name(function(bit, val) { + assert2(typeof bit == "number" && bit >= 0); + var off = bit / 26 | 0, wbit = bit % 26; + return this._expand(off + 1), val ? this.words[off] = this.words[off] | 1 << wbit : this.words[off] = this.words[off] & ~(1 << wbit), this._strip(); + }, "setn"), BN2.prototype.iadd = /* @__PURE__ */ __name(function(num) { + var r2; + if (this.negative !== 0 && num.negative === 0) + return this.negative = 0, r2 = this.isub(num), this.negative ^= 1, this._normSign(); + if (this.negative === 0 && num.negative !== 0) + return num.negative = 0, r2 = this.isub(num), num.negative = 1, r2._normSign(); + var a, b2; + this.length > num.length ? (a = this, b2 = num) : (a = num, b2 = this); + for (var carry = 0, i = 0; i < b2.length; i++) + r2 = (a.words[i] | 0) + (b2.words[i] | 0) + carry, this.words[i] = r2 & 67108863, carry = r2 >>> 26; + for (; carry !== 0 && i < a.length; i++) + r2 = (a.words[i] | 0) + carry, this.words[i] = r2 & 67108863, carry = r2 >>> 26; + if (this.length = a.length, carry !== 0) + this.words[this.length] = carry, this.length++; + else if (a !== this) + for (; i < a.length; i++) + this.words[i] = a.words[i]; + return this; + }, "iadd"), BN2.prototype.add = /* @__PURE__ */ __name(function(num) { + var res; + return num.negative !== 0 && this.negative === 0 ? (num.negative = 0, res = this.sub(num), num.negative ^= 1, res) : num.negative === 0 && this.negative !== 0 ? (this.negative = 0, res = num.sub(this), this.negative = 1, res) : this.length > num.length ? this.clone().iadd(num) : num.clone().iadd(this); + }, "add"), BN2.prototype.isub = /* @__PURE__ */ __name(function(num) { + if (num.negative !== 0) { + num.negative = 0; + var r2 = this.iadd(num); + return num.negative = 1, r2._normSign(); + } else if (this.negative !== 0) + return this.negative = 0, this.iadd(num), this.negative = 1, this._normSign(); + var cmp = this.cmp(num); + if (cmp === 0) + return this.negative = 0, this.length = 1, this.words[0] = 0, this; + var a, b2; + cmp > 0 ? (a = this, b2 = num) : (a = num, b2 = this); + for (var carry = 0, i = 0; i < b2.length; i++) + r2 = (a.words[i] | 0) - (b2.words[i] | 0) + carry, carry = r2 >> 26, this.words[i] = r2 & 67108863; + for (; carry !== 0 && i < a.length; i++) + r2 = (a.words[i] | 0) + carry, carry = r2 >> 26, this.words[i] = r2 & 67108863; + if (carry === 0 && i < a.length && a !== this) + for (; i < a.length; i++) + this.words[i] = a.words[i]; + return this.length = Math.max(this.length, i), a !== this && (this.negative = 1), this._strip(); + }, "isub"), BN2.prototype.sub = /* @__PURE__ */ __name(function(num) { + return this.clone().isub(num); + }, "sub"); + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len, len = len - 1 | 0; + var a = self2.words[0] | 0, b2 = num.words[0] | 0, r2 = a * b2, lo = r2 & 67108863, carry = r2 / 67108864 | 0; + out.words[0] = lo; + for (var k2 = 1; k2 < len; k2++) { + for (var ncarry = carry >>> 26, rword = carry & 67108863, maxJ = Math.min(k2, num.length - 1), j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { + var i = k2 - j2 | 0; + a = self2.words[i] | 0, b2 = num.words[j2] | 0, r2 = a * b2 + rword, ncarry += r2 / 67108864 | 0, rword = r2 & 67108863; + } + out.words[k2] = rword | 0, carry = ncarry | 0; + } + return carry !== 0 ? out.words[k2] = carry | 0 : out.length--, out._strip(); + } + __name(smallMulTo, "smallMulTo"); + var comb10MulTo = /* @__PURE__ */ __name(function(self2, num, out) { + var a = self2.words, b2 = num.words, o2 = out.words, c = 0, lo, mid, hi, a0 = a[0] | 0, al0 = a0 & 8191, ah0 = a0 >>> 13, a1 = a[1] | 0, al1 = a1 & 8191, ah1 = a1 >>> 13, a2 = a[2] | 0, al2 = a2 & 8191, ah2 = a2 >>> 13, a3 = a[3] | 0, al3 = a3 & 8191, ah3 = a3 >>> 13, a4 = a[4] | 0, al4 = a4 & 8191, ah4 = a4 >>> 13, a5 = a[5] | 0, al5 = a5 & 8191, ah5 = a5 >>> 13, a6 = a[6] | 0, al6 = a6 & 8191, ah6 = a6 >>> 13, a7 = a[7] | 0, al7 = a7 & 8191, ah7 = a7 >>> 13, a8 = a[8] | 0, al8 = a8 & 8191, ah8 = a8 >>> 13, a9 = a[9] | 0, al9 = a9 & 8191, ah9 = a9 >>> 13, b0 = b2[0] | 0, bl0 = b0 & 8191, bh0 = b0 >>> 13, b1 = b2[1] | 0, bl1 = b1 & 8191, bh1 = b1 >>> 13, b22 = b2[2] | 0, bl2 = b22 & 8191, bh2 = b22 >>> 13, b3 = b2[3] | 0, bl3 = b3 & 8191, bh3 = b3 >>> 13, b4 = b2[4] | 0, bl4 = b4 & 8191, bh4 = b4 >>> 13, b5 = b2[5] | 0, bl5 = b5 & 8191, bh5 = b5 >>> 13, b6 = b2[6] | 0, bl6 = b6 & 8191, bh6 = b6 >>> 13, b7 = b2[7] | 0, bl7 = b7 & 8191, bh7 = b7 >>> 13, b8 = b2[8] | 0, bl8 = b8 & 8191, bh8 = b8 >>> 13, b9 = b2[9] | 0, bl9 = b9 & 8191, bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative, out.length = 19, lo = Math.imul(al0, bl0), mid = Math.imul(al0, bh0), mid = mid + Math.imul(ah0, bl0) | 0, hi = Math.imul(ah0, bh0); + var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0, w0 &= 67108863, lo = Math.imul(al1, bl0), mid = Math.imul(al1, bh0), mid = mid + Math.imul(ah1, bl0) | 0, hi = Math.imul(ah1, bh0), lo = lo + Math.imul(al0, bl1) | 0, mid = mid + Math.imul(al0, bh1) | 0, mid = mid + Math.imul(ah0, bl1) | 0, hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0, w1 &= 67108863, lo = Math.imul(al2, bl0), mid = Math.imul(al2, bh0), mid = mid + Math.imul(ah2, bl0) | 0, hi = Math.imul(ah2, bh0), lo = lo + Math.imul(al1, bl1) | 0, mid = mid + Math.imul(al1, bh1) | 0, mid = mid + Math.imul(ah1, bl1) | 0, hi = hi + Math.imul(ah1, bh1) | 0, lo = lo + Math.imul(al0, bl2) | 0, mid = mid + Math.imul(al0, bh2) | 0, mid = mid + Math.imul(ah0, bl2) | 0, hi = hi + Math.imul(ah0, bh2) | 0; + var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0, w2 &= 67108863, lo = Math.imul(al3, bl0), mid = Math.imul(al3, bh0), mid = mid + Math.imul(ah3, bl0) | 0, hi = Math.imul(ah3, bh0), lo = lo + Math.imul(al2, bl1) | 0, mid = mid + Math.imul(al2, bh1) | 0, mid = mid + Math.imul(ah2, bl1) | 0, hi = hi + Math.imul(ah2, bh1) | 0, lo = lo + Math.imul(al1, bl2) | 0, mid = mid + Math.imul(al1, bh2) | 0, mid = mid + Math.imul(ah1, bl2) | 0, hi = hi + Math.imul(ah1, bh2) | 0, lo = lo + Math.imul(al0, bl3) | 0, mid = mid + Math.imul(al0, bh3) | 0, mid = mid + Math.imul(ah0, bl3) | 0, hi = hi + Math.imul(ah0, bh3) | 0; + var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0, w3 &= 67108863, lo = Math.imul(al4, bl0), mid = Math.imul(al4, bh0), mid = mid + Math.imul(ah4, bl0) | 0, hi = Math.imul(ah4, bh0), lo = lo + Math.imul(al3, bl1) | 0, mid = mid + Math.imul(al3, bh1) | 0, mid = mid + Math.imul(ah3, bl1) | 0, hi = hi + Math.imul(ah3, bh1) | 0, lo = lo + Math.imul(al2, bl2) | 0, mid = mid + Math.imul(al2, bh2) | 0, mid = mid + Math.imul(ah2, bl2) | 0, hi = hi + Math.imul(ah2, bh2) | 0, lo = lo + Math.imul(al1, bl3) | 0, mid = mid + Math.imul(al1, bh3) | 0, mid = mid + Math.imul(ah1, bl3) | 0, hi = hi + Math.imul(ah1, bh3) | 0, lo = lo + Math.imul(al0, bl4) | 0, mid = mid + Math.imul(al0, bh4) | 0, mid = mid + Math.imul(ah0, bl4) | 0, hi = hi + Math.imul(ah0, bh4) | 0; + var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0, w4 &= 67108863, lo = Math.imul(al5, bl0), mid = Math.imul(al5, bh0), mid = mid + Math.imul(ah5, bl0) | 0, hi = Math.imul(ah5, bh0), lo = lo + Math.imul(al4, bl1) | 0, mid = mid + Math.imul(al4, bh1) | 0, mid = mid + Math.imul(ah4, bl1) | 0, hi = hi + Math.imul(ah4, bh1) | 0, lo = lo + Math.imul(al3, bl2) | 0, mid = mid + Math.imul(al3, bh2) | 0, mid = mid + Math.imul(ah3, bl2) | 0, hi = hi + Math.imul(ah3, bh2) | 0, lo = lo + Math.imul(al2, bl3) | 0, mid = mid + Math.imul(al2, bh3) | 0, mid = mid + Math.imul(ah2, bl3) | 0, hi = hi + Math.imul(ah2, bh3) | 0, lo = lo + Math.imul(al1, bl4) | 0, mid = mid + Math.imul(al1, bh4) | 0, mid = mid + Math.imul(ah1, bl4) | 0, hi = hi + Math.imul(ah1, bh4) | 0, lo = lo + Math.imul(al0, bl5) | 0, mid = mid + Math.imul(al0, bh5) | 0, mid = mid + Math.imul(ah0, bl5) | 0, hi = hi + Math.imul(ah0, bh5) | 0; + var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0, w5 &= 67108863, lo = Math.imul(al6, bl0), mid = Math.imul(al6, bh0), mid = mid + Math.imul(ah6, bl0) | 0, hi = Math.imul(ah6, bh0), lo = lo + Math.imul(al5, bl1) | 0, mid = mid + Math.imul(al5, bh1) | 0, mid = mid + Math.imul(ah5, bl1) | 0, hi = hi + Math.imul(ah5, bh1) | 0, lo = lo + Math.imul(al4, bl2) | 0, mid = mid + Math.imul(al4, bh2) | 0, mid = mid + Math.imul(ah4, bl2) | 0, hi = hi + Math.imul(ah4, bh2) | 0, lo = lo + Math.imul(al3, bl3) | 0, mid = mid + Math.imul(al3, bh3) | 0, mid = mid + Math.imul(ah3, bl3) | 0, hi = hi + Math.imul(ah3, bh3) | 0, lo = lo + Math.imul(al2, bl4) | 0, mid = mid + Math.imul(al2, bh4) | 0, mid = mid + Math.imul(ah2, bl4) | 0, hi = hi + Math.imul(ah2, bh4) | 0, lo = lo + Math.imul(al1, bl5) | 0, mid = mid + Math.imul(al1, bh5) | 0, mid = mid + Math.imul(ah1, bl5) | 0, hi = hi + Math.imul(ah1, bh5) | 0, lo = lo + Math.imul(al0, bl6) | 0, mid = mid + Math.imul(al0, bh6) | 0, mid = mid + Math.imul(ah0, bl6) | 0, hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0, w6 &= 67108863, lo = Math.imul(al7, bl0), mid = Math.imul(al7, bh0), mid = mid + Math.imul(ah7, bl0) | 0, hi = Math.imul(ah7, bh0), lo = lo + Math.imul(al6, bl1) | 0, mid = mid + Math.imul(al6, bh1) | 0, mid = mid + Math.imul(ah6, bl1) | 0, hi = hi + Math.imul(ah6, bh1) | 0, lo = lo + Math.imul(al5, bl2) | 0, mid = mid + Math.imul(al5, bh2) | 0, mid = mid + Math.imul(ah5, bl2) | 0, hi = hi + Math.imul(ah5, bh2) | 0, lo = lo + Math.imul(al4, bl3) | 0, mid = mid + Math.imul(al4, bh3) | 0, mid = mid + Math.imul(ah4, bl3) | 0, hi = hi + Math.imul(ah4, bh3) | 0, lo = lo + Math.imul(al3, bl4) | 0, mid = mid + Math.imul(al3, bh4) | 0, mid = mid + Math.imul(ah3, bl4) | 0, hi = hi + Math.imul(ah3, bh4) | 0, lo = lo + Math.imul(al2, bl5) | 0, mid = mid + Math.imul(al2, bh5) | 0, mid = mid + Math.imul(ah2, bl5) | 0, hi = hi + Math.imul(ah2, bh5) | 0, lo = lo + Math.imul(al1, bl6) | 0, mid = mid + Math.imul(al1, bh6) | 0, mid = mid + Math.imul(ah1, bl6) | 0, hi = hi + Math.imul(ah1, bh6) | 0, lo = lo + Math.imul(al0, bl7) | 0, mid = mid + Math.imul(al0, bh7) | 0, mid = mid + Math.imul(ah0, bl7) | 0, hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0, w7 &= 67108863, lo = Math.imul(al8, bl0), mid = Math.imul(al8, bh0), mid = mid + Math.imul(ah8, bl0) | 0, hi = Math.imul(ah8, bh0), lo = lo + Math.imul(al7, bl1) | 0, mid = mid + Math.imul(al7, bh1) | 0, mid = mid + Math.imul(ah7, bl1) | 0, hi = hi + Math.imul(ah7, bh1) | 0, lo = lo + Math.imul(al6, bl2) | 0, mid = mid + Math.imul(al6, bh2) | 0, mid = mid + Math.imul(ah6, bl2) | 0, hi = hi + Math.imul(ah6, bh2) | 0, lo = lo + Math.imul(al5, bl3) | 0, mid = mid + Math.imul(al5, bh3) | 0, mid = mid + Math.imul(ah5, bl3) | 0, hi = hi + Math.imul(ah5, bh3) | 0, lo = lo + Math.imul(al4, bl4) | 0, mid = mid + Math.imul(al4, bh4) | 0, mid = mid + Math.imul(ah4, bl4) | 0, hi = hi + Math.imul(ah4, bh4) | 0, lo = lo + Math.imul(al3, bl5) | 0, mid = mid + Math.imul(al3, bh5) | 0, mid = mid + Math.imul(ah3, bl5) | 0, hi = hi + Math.imul(ah3, bh5) | 0, lo = lo + Math.imul(al2, bl6) | 0, mid = mid + Math.imul(al2, bh6) | 0, mid = mid + Math.imul(ah2, bl6) | 0, hi = hi + Math.imul(ah2, bh6) | 0, lo = lo + Math.imul(al1, bl7) | 0, mid = mid + Math.imul(al1, bh7) | 0, mid = mid + Math.imul(ah1, bl7) | 0, hi = hi + Math.imul(ah1, bh7) | 0, lo = lo + Math.imul(al0, bl8) | 0, mid = mid + Math.imul(al0, bh8) | 0, mid = mid + Math.imul(ah0, bl8) | 0, hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0, w8 &= 67108863, lo = Math.imul(al9, bl0), mid = Math.imul(al9, bh0), mid = mid + Math.imul(ah9, bl0) | 0, hi = Math.imul(ah9, bh0), lo = lo + Math.imul(al8, bl1) | 0, mid = mid + Math.imul(al8, bh1) | 0, mid = mid + Math.imul(ah8, bl1) | 0, hi = hi + Math.imul(ah8, bh1) | 0, lo = lo + Math.imul(al7, bl2) | 0, mid = mid + Math.imul(al7, bh2) | 0, mid = mid + Math.imul(ah7, bl2) | 0, hi = hi + Math.imul(ah7, bh2) | 0, lo = lo + Math.imul(al6, bl3) | 0, mid = mid + Math.imul(al6, bh3) | 0, mid = mid + Math.imul(ah6, bl3) | 0, hi = hi + Math.imul(ah6, bh3) | 0, lo = lo + Math.imul(al5, bl4) | 0, mid = mid + Math.imul(al5, bh4) | 0, mid = mid + Math.imul(ah5, bl4) | 0, hi = hi + Math.imul(ah5, bh4) | 0, lo = lo + Math.imul(al4, bl5) | 0, mid = mid + Math.imul(al4, bh5) | 0, mid = mid + Math.imul(ah4, bl5) | 0, hi = hi + Math.imul(ah4, bh5) | 0, lo = lo + Math.imul(al3, bl6) | 0, mid = mid + Math.imul(al3, bh6) | 0, mid = mid + Math.imul(ah3, bl6) | 0, hi = hi + Math.imul(ah3, bh6) | 0, lo = lo + Math.imul(al2, bl7) | 0, mid = mid + Math.imul(al2, bh7) | 0, mid = mid + Math.imul(ah2, bl7) | 0, hi = hi + Math.imul(ah2, bh7) | 0, lo = lo + Math.imul(al1, bl8) | 0, mid = mid + Math.imul(al1, bh8) | 0, mid = mid + Math.imul(ah1, bl8) | 0, hi = hi + Math.imul(ah1, bh8) | 0, lo = lo + Math.imul(al0, bl9) | 0, mid = mid + Math.imul(al0, bh9) | 0, mid = mid + Math.imul(ah0, bl9) | 0, hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0, w9 &= 67108863, lo = Math.imul(al9, bl1), mid = Math.imul(al9, bh1), mid = mid + Math.imul(ah9, bl1) | 0, hi = Math.imul(ah9, bh1), lo = lo + Math.imul(al8, bl2) | 0, mid = mid + Math.imul(al8, bh2) | 0, mid = mid + Math.imul(ah8, bl2) | 0, hi = hi + Math.imul(ah8, bh2) | 0, lo = lo + Math.imul(al7, bl3) | 0, mid = mid + Math.imul(al7, bh3) | 0, mid = mid + Math.imul(ah7, bl3) | 0, hi = hi + Math.imul(ah7, bh3) | 0, lo = lo + Math.imul(al6, bl4) | 0, mid = mid + Math.imul(al6, bh4) | 0, mid = mid + Math.imul(ah6, bl4) | 0, hi = hi + Math.imul(ah6, bh4) | 0, lo = lo + Math.imul(al5, bl5) | 0, mid = mid + Math.imul(al5, bh5) | 0, mid = mid + Math.imul(ah5, bl5) | 0, hi = hi + Math.imul(ah5, bh5) | 0, lo = lo + Math.imul(al4, bl6) | 0, mid = mid + Math.imul(al4, bh6) | 0, mid = mid + Math.imul(ah4, bl6) | 0, hi = hi + Math.imul(ah4, bh6) | 0, lo = lo + Math.imul(al3, bl7) | 0, mid = mid + Math.imul(al3, bh7) | 0, mid = mid + Math.imul(ah3, bl7) | 0, hi = hi + Math.imul(ah3, bh7) | 0, lo = lo + Math.imul(al2, bl8) | 0, mid = mid + Math.imul(al2, bh8) | 0, mid = mid + Math.imul(ah2, bl8) | 0, hi = hi + Math.imul(ah2, bh8) | 0, lo = lo + Math.imul(al1, bl9) | 0, mid = mid + Math.imul(al1, bh9) | 0, mid = mid + Math.imul(ah1, bl9) | 0, hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0, w10 &= 67108863, lo = Math.imul(al9, bl2), mid = Math.imul(al9, bh2), mid = mid + Math.imul(ah9, bl2) | 0, hi = Math.imul(ah9, bh2), lo = lo + Math.imul(al8, bl3) | 0, mid = mid + Math.imul(al8, bh3) | 0, mid = mid + Math.imul(ah8, bl3) | 0, hi = hi + Math.imul(ah8, bh3) | 0, lo = lo + Math.imul(al7, bl4) | 0, mid = mid + Math.imul(al7, bh4) | 0, mid = mid + Math.imul(ah7, bl4) | 0, hi = hi + Math.imul(ah7, bh4) | 0, lo = lo + Math.imul(al6, bl5) | 0, mid = mid + Math.imul(al6, bh5) | 0, mid = mid + Math.imul(ah6, bl5) | 0, hi = hi + Math.imul(ah6, bh5) | 0, lo = lo + Math.imul(al5, bl6) | 0, mid = mid + Math.imul(al5, bh6) | 0, mid = mid + Math.imul(ah5, bl6) | 0, hi = hi + Math.imul(ah5, bh6) | 0, lo = lo + Math.imul(al4, bl7) | 0, mid = mid + Math.imul(al4, bh7) | 0, mid = mid + Math.imul(ah4, bl7) | 0, hi = hi + Math.imul(ah4, bh7) | 0, lo = lo + Math.imul(al3, bl8) | 0, mid = mid + Math.imul(al3, bh8) | 0, mid = mid + Math.imul(ah3, bl8) | 0, hi = hi + Math.imul(ah3, bh8) | 0, lo = lo + Math.imul(al2, bl9) | 0, mid = mid + Math.imul(al2, bh9) | 0, mid = mid + Math.imul(ah2, bl9) | 0, hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0, w11 &= 67108863, lo = Math.imul(al9, bl3), mid = Math.imul(al9, bh3), mid = mid + Math.imul(ah9, bl3) | 0, hi = Math.imul(ah9, bh3), lo = lo + Math.imul(al8, bl4) | 0, mid = mid + Math.imul(al8, bh4) | 0, mid = mid + Math.imul(ah8, bl4) | 0, hi = hi + Math.imul(ah8, bh4) | 0, lo = lo + Math.imul(al7, bl5) | 0, mid = mid + Math.imul(al7, bh5) | 0, mid = mid + Math.imul(ah7, bl5) | 0, hi = hi + Math.imul(ah7, bh5) | 0, lo = lo + Math.imul(al6, bl6) | 0, mid = mid + Math.imul(al6, bh6) | 0, mid = mid + Math.imul(ah6, bl6) | 0, hi = hi + Math.imul(ah6, bh6) | 0, lo = lo + Math.imul(al5, bl7) | 0, mid = mid + Math.imul(al5, bh7) | 0, mid = mid + Math.imul(ah5, bl7) | 0, hi = hi + Math.imul(ah5, bh7) | 0, lo = lo + Math.imul(al4, bl8) | 0, mid = mid + Math.imul(al4, bh8) | 0, mid = mid + Math.imul(ah4, bl8) | 0, hi = hi + Math.imul(ah4, bh8) | 0, lo = lo + Math.imul(al3, bl9) | 0, mid = mid + Math.imul(al3, bh9) | 0, mid = mid + Math.imul(ah3, bl9) | 0, hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0, w12 &= 67108863, lo = Math.imul(al9, bl4), mid = Math.imul(al9, bh4), mid = mid + Math.imul(ah9, bl4) | 0, hi = Math.imul(ah9, bh4), lo = lo + Math.imul(al8, bl5) | 0, mid = mid + Math.imul(al8, bh5) | 0, mid = mid + Math.imul(ah8, bl5) | 0, hi = hi + Math.imul(ah8, bh5) | 0, lo = lo + Math.imul(al7, bl6) | 0, mid = mid + Math.imul(al7, bh6) | 0, mid = mid + Math.imul(ah7, bl6) | 0, hi = hi + Math.imul(ah7, bh6) | 0, lo = lo + Math.imul(al6, bl7) | 0, mid = mid + Math.imul(al6, bh7) | 0, mid = mid + Math.imul(ah6, bl7) | 0, hi = hi + Math.imul(ah6, bh7) | 0, lo = lo + Math.imul(al5, bl8) | 0, mid = mid + Math.imul(al5, bh8) | 0, mid = mid + Math.imul(ah5, bl8) | 0, hi = hi + Math.imul(ah5, bh8) | 0, lo = lo + Math.imul(al4, bl9) | 0, mid = mid + Math.imul(al4, bh9) | 0, mid = mid + Math.imul(ah4, bl9) | 0, hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0, w13 &= 67108863, lo = Math.imul(al9, bl5), mid = Math.imul(al9, bh5), mid = mid + Math.imul(ah9, bl5) | 0, hi = Math.imul(ah9, bh5), lo = lo + Math.imul(al8, bl6) | 0, mid = mid + Math.imul(al8, bh6) | 0, mid = mid + Math.imul(ah8, bl6) | 0, hi = hi + Math.imul(ah8, bh6) | 0, lo = lo + Math.imul(al7, bl7) | 0, mid = mid + Math.imul(al7, bh7) | 0, mid = mid + Math.imul(ah7, bl7) | 0, hi = hi + Math.imul(ah7, bh7) | 0, lo = lo + Math.imul(al6, bl8) | 0, mid = mid + Math.imul(al6, bh8) | 0, mid = mid + Math.imul(ah6, bl8) | 0, hi = hi + Math.imul(ah6, bh8) | 0, lo = lo + Math.imul(al5, bl9) | 0, mid = mid + Math.imul(al5, bh9) | 0, mid = mid + Math.imul(ah5, bl9) | 0, hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0, w14 &= 67108863, lo = Math.imul(al9, bl6), mid = Math.imul(al9, bh6), mid = mid + Math.imul(ah9, bl6) | 0, hi = Math.imul(ah9, bh6), lo = lo + Math.imul(al8, bl7) | 0, mid = mid + Math.imul(al8, bh7) | 0, mid = mid + Math.imul(ah8, bl7) | 0, hi = hi + Math.imul(ah8, bh7) | 0, lo = lo + Math.imul(al7, bl8) | 0, mid = mid + Math.imul(al7, bh8) | 0, mid = mid + Math.imul(ah7, bl8) | 0, hi = hi + Math.imul(ah7, bh8) | 0, lo = lo + Math.imul(al6, bl9) | 0, mid = mid + Math.imul(al6, bh9) | 0, mid = mid + Math.imul(ah6, bl9) | 0, hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0, w15 &= 67108863, lo = Math.imul(al9, bl7), mid = Math.imul(al9, bh7), mid = mid + Math.imul(ah9, bl7) | 0, hi = Math.imul(ah9, bh7), lo = lo + Math.imul(al8, bl8) | 0, mid = mid + Math.imul(al8, bh8) | 0, mid = mid + Math.imul(ah8, bl8) | 0, hi = hi + Math.imul(ah8, bh8) | 0, lo = lo + Math.imul(al7, bl9) | 0, mid = mid + Math.imul(al7, bh9) | 0, mid = mid + Math.imul(ah7, bl9) | 0, hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0, w16 &= 67108863, lo = Math.imul(al9, bl8), mid = Math.imul(al9, bh8), mid = mid + Math.imul(ah9, bl8) | 0, hi = Math.imul(ah9, bh8), lo = lo + Math.imul(al8, bl9) | 0, mid = mid + Math.imul(al8, bh9) | 0, mid = mid + Math.imul(ah8, bl9) | 0, hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0, w17 &= 67108863, lo = Math.imul(al9, bl9), mid = Math.imul(al9, bh9), mid = mid + Math.imul(ah9, bl9) | 0, hi = Math.imul(ah9, bh9); + var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0; + return c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0, w18 &= 67108863, o2[0] = w0, o2[1] = w1, o2[2] = w2, o2[3] = w3, o2[4] = w4, o2[5] = w5, o2[6] = w6, o2[7] = w7, o2[8] = w8, o2[9] = w9, o2[10] = w10, o2[11] = w11, o2[12] = w12, o2[13] = w13, o2[14] = w14, o2[15] = w15, o2[16] = w16, o2[17] = w17, o2[18] = w18, c !== 0 && (o2[19] = c, out.length++), out; + }, "comb10MulTo"); + Math.imul || (comb10MulTo = smallMulTo); + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative, out.length = self2.length + num.length; + for (var carry = 0, hncarry = 0, k2 = 0; k2 < out.length - 1; k2++) { + var ncarry = hncarry; + hncarry = 0; + for (var rword = carry & 67108863, maxJ = Math.min(k2, num.length - 1), j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { + var i = k2 - j2, a = self2.words[i] | 0, b2 = num.words[j2] | 0, r2 = a * b2, lo = r2 & 67108863; + ncarry = ncarry + (r2 / 67108864 | 0) | 0, lo = lo + rword | 0, rword = lo & 67108863, ncarry = ncarry + (lo >>> 26) | 0, hncarry += ncarry >>> 26, ncarry &= 67108863; + } + out.words[k2] = rword, carry = ncarry, ncarry = hncarry; + } + return carry !== 0 ? out.words[k2] = carry : out.length--, out._strip(); + } + __name(bigMulTo, "bigMulTo"); + function jumboMulTo(self2, num, out) { + return bigMulTo(self2, num, out); + } + __name(jumboMulTo, "jumboMulTo"), BN2.prototype.mulTo = /* @__PURE__ */ __name(function(num, out) { + var res, len = this.length + num.length; + return this.length === 10 && num.length === 10 ? res = comb10MulTo(this, num, out) : len < 63 ? res = smallMulTo(this, num, out) : len < 1024 ? res = bigMulTo(this, num, out) : res = jumboMulTo(this, num, out), res; + }, "mulTo"), BN2.prototype.mul = /* @__PURE__ */ __name(function(num) { + var out = new BN2(null); + return out.words = new Array(this.length + num.length), this.mulTo(num, out); + }, "mul"), BN2.prototype.mulf = /* @__PURE__ */ __name(function(num) { + var out = new BN2(null); + return out.words = new Array(this.length + num.length), jumboMulTo(this, num, out); + }, "mulf"), BN2.prototype.imul = /* @__PURE__ */ __name(function(num) { + return this.clone().mulTo(num, this); + }, "imul"), BN2.prototype.imuln = /* @__PURE__ */ __name(function(num) { + var isNegNum = num < 0; + isNegNum && (num = -num), assert2(typeof num == "number"), assert2(num < 67108864); + for (var carry = 0, i = 0; i < this.length; i++) { + var w2 = (this.words[i] | 0) * num, lo = (w2 & 67108863) + (carry & 67108863); + carry >>= 26, carry += w2 / 67108864 | 0, carry += lo >>> 26, this.words[i] = lo & 67108863; + } + return carry !== 0 && (this.words[i] = carry, this.length++), isNegNum ? this.ineg() : this; + }, "imuln"), BN2.prototype.muln = /* @__PURE__ */ __name(function(num) { + return this.clone().imuln(num); + }, "muln"), BN2.prototype.sqr = /* @__PURE__ */ __name(function() { + return this.mul(this); + }, "sqr"), BN2.prototype.isqr = /* @__PURE__ */ __name(function() { + return this.imul(this.clone()); + }, "isqr"), BN2.prototype.pow = /* @__PURE__ */ __name(function(num) { + var w2 = toBitArray(num); + if (w2.length === 0) + return new BN2(1); + for (var res = this, i = 0; i < w2.length && w2[i] === 0; i++, res = res.sqr()) + ; + if (++i < w2.length) + for (var q = res.sqr(); i < w2.length; i++, q = q.sqr()) + w2[i] !== 0 && (res = res.mul(q)); + return res; + }, "pow"), BN2.prototype.iushln = /* @__PURE__ */ __name(function(bits) { + assert2(typeof bits == "number" && bits >= 0); + var r2 = bits % 26, s2 = (bits - r2) / 26, carryMask = 67108863 >>> 26 - r2 << 26 - r2, i; + if (r2 !== 0) { + var carry = 0; + for (i = 0; i < this.length; i++) { + var newCarry = this.words[i] & carryMask, c = (this.words[i] | 0) - newCarry << r2; + this.words[i] = c | carry, carry = newCarry >>> 26 - r2; + } + carry && (this.words[i] = carry, this.length++); + } + if (s2 !== 0) { + for (i = this.length - 1; i >= 0; i--) + this.words[i + s2] = this.words[i]; + for (i = 0; i < s2; i++) + this.words[i] = 0; + this.length += s2; + } + return this._strip(); + }, "iushln"), BN2.prototype.ishln = /* @__PURE__ */ __name(function(bits) { + return assert2(this.negative === 0), this.iushln(bits); + }, "ishln"), BN2.prototype.iushrn = /* @__PURE__ */ __name(function(bits, hint, extended) { + assert2(typeof bits == "number" && bits >= 0); + var h2; + hint ? h2 = (hint - hint % 26) / 26 : h2 = 0; + var r2 = bits % 26, s2 = Math.min((bits - r2) / 26, this.length), mask = 67108863 ^ 67108863 >>> r2 << r2, maskedWords = extended; + if (h2 -= s2, h2 = Math.max(0, h2), maskedWords) { + for (var i = 0; i < s2; i++) + maskedWords.words[i] = this.words[i]; + maskedWords.length = s2; + } + if (s2 !== 0) + if (this.length > s2) + for (this.length -= s2, i = 0; i < this.length; i++) + this.words[i] = this.words[i + s2]; + else + this.words[0] = 0, this.length = 1; + var carry = 0; + for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h2); i--) { + var word = this.words[i] | 0; + this.words[i] = carry << 26 - r2 | word >>> r2, carry = word & mask; + } + return maskedWords && carry !== 0 && (maskedWords.words[maskedWords.length++] = carry), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip(); + }, "iushrn"), BN2.prototype.ishrn = /* @__PURE__ */ __name(function(bits, hint, extended) { + return assert2(this.negative === 0), this.iushrn(bits, hint, extended); + }, "ishrn"), BN2.prototype.shln = /* @__PURE__ */ __name(function(bits) { + return this.clone().ishln(bits); + }, "shln"), BN2.prototype.ushln = /* @__PURE__ */ __name(function(bits) { + return this.clone().iushln(bits); + }, "ushln"), BN2.prototype.shrn = /* @__PURE__ */ __name(function(bits) { + return this.clone().ishrn(bits); + }, "shrn"), BN2.prototype.ushrn = /* @__PURE__ */ __name(function(bits) { + return this.clone().iushrn(bits); + }, "ushrn"), BN2.prototype.testn = /* @__PURE__ */ __name(function(bit) { + assert2(typeof bit == "number" && bit >= 0); + var r2 = bit % 26, s2 = (bit - r2) / 26, q = 1 << r2; + if (this.length <= s2) + return !1; + var w2 = this.words[s2]; + return !!(w2 & q); + }, "testn"), BN2.prototype.imaskn = /* @__PURE__ */ __name(function(bits) { + assert2(typeof bits == "number" && bits >= 0); + var r2 = bits % 26, s2 = (bits - r2) / 26; + if (assert2(this.negative === 0, "imaskn works only with positive numbers"), this.length <= s2) + return this; + if (r2 !== 0 && s2++, this.length = Math.min(s2, this.length), r2 !== 0) { + var mask = 67108863 ^ 67108863 >>> r2 << r2; + this.words[this.length - 1] &= mask; + } + return this._strip(); + }, "imaskn"), BN2.prototype.maskn = /* @__PURE__ */ __name(function(bits) { + return this.clone().imaskn(bits); + }, "maskn"), BN2.prototype.iaddn = /* @__PURE__ */ __name(function(num) { + return assert2(typeof num == "number"), assert2(num < 67108864), num < 0 ? this.isubn(-num) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= num ? (this.words[0] = num - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(num), this.negative = 1, this) : this._iaddn(num); + }, "iaddn"), BN2.prototype._iaddn = /* @__PURE__ */ __name(function(num) { + this.words[0] += num; + for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) + this.words[i] -= 67108864, i === this.length - 1 ? this.words[i + 1] = 1 : this.words[i + 1]++; + return this.length = Math.max(this.length, i + 1), this; + }, "_iaddn"), BN2.prototype.isubn = /* @__PURE__ */ __name(function(num) { + if (assert2(typeof num == "number"), assert2(num < 67108864), num < 0) + return this.iaddn(-num); + if (this.negative !== 0) + return this.negative = 0, this.iaddn(num), this.negative = 1, this; + if (this.words[0] -= num, this.length === 1 && this.words[0] < 0) + this.words[0] = -this.words[0], this.negative = 1; + else + for (var i = 0; i < this.length && this.words[i] < 0; i++) + this.words[i] += 67108864, this.words[i + 1] -= 1; + return this._strip(); + }, "isubn"), BN2.prototype.addn = /* @__PURE__ */ __name(function(num) { + return this.clone().iaddn(num); + }, "addn"), BN2.prototype.subn = /* @__PURE__ */ __name(function(num) { + return this.clone().isubn(num); + }, "subn"), BN2.prototype.iabs = /* @__PURE__ */ __name(function() { + return this.negative = 0, this; + }, "iabs"), BN2.prototype.abs = /* @__PURE__ */ __name(function() { + return this.clone().iabs(); + }, "abs"), BN2.prototype._ishlnsubmul = /* @__PURE__ */ __name(function(num, mul3, shift) { + var len = num.length + shift, i; + this._expand(len); + var w2, carry = 0; + for (i = 0; i < num.length; i++) { + w2 = (this.words[i + shift] | 0) + carry; + var right = (num.words[i] | 0) * mul3; + w2 -= right & 67108863, carry = (w2 >> 26) - (right / 67108864 | 0), this.words[i + shift] = w2 & 67108863; + } + for (; i < this.length - shift; i++) + w2 = (this.words[i + shift] | 0) + carry, carry = w2 >> 26, this.words[i + shift] = w2 & 67108863; + if (carry === 0) + return this._strip(); + for (assert2(carry === -1), carry = 0, i = 0; i < this.length; i++) + w2 = -(this.words[i] | 0) + carry, carry = w2 >> 26, this.words[i] = w2 & 67108863; + return this.negative = 1, this._strip(); + }, "_ishlnsubmul"), BN2.prototype._wordDiv = /* @__PURE__ */ __name(function(num, mode) { + var shift = this.length - num.length, a = this.clone(), b2 = num, bhi = b2.words[b2.length - 1] | 0, bhiBits = this._countBits(bhi); + shift = 26 - bhiBits, shift !== 0 && (b2 = b2.ushln(shift), a.iushln(shift), bhi = b2.words[b2.length - 1] | 0); + var m2 = a.length - b2.length, q; + if (mode !== "mod") { + q = new BN2(null), q.length = m2 + 1, q.words = new Array(q.length); + for (var i = 0; i < q.length; i++) + q.words[i] = 0; + } + var diff = a.clone()._ishlnsubmul(b2, 1, m2); + diff.negative === 0 && (a = diff, q && (q.words[m2] = 1)); + for (var j2 = m2 - 1; j2 >= 0; j2--) { + var qj = (a.words[b2.length + j2] | 0) * 67108864 + (a.words[b2.length + j2 - 1] | 0); + for (qj = Math.min(qj / bhi | 0, 67108863), a._ishlnsubmul(b2, qj, j2); a.negative !== 0; ) + qj--, a.negative = 0, a._ishlnsubmul(b2, 1, j2), a.isZero() || (a.negative ^= 1); + q && (q.words[j2] = qj); + } + return q && q._strip(), a._strip(), mode !== "div" && shift !== 0 && a.iushrn(shift), { + div: q || null, + mod: a + }; + }, "_wordDiv"), BN2.prototype.divmod = /* @__PURE__ */ __name(function(num, mode, positive) { + if (assert2(!num.isZero()), this.isZero()) + return { + div: new BN2(0), + mod: new BN2(0) + }; + var div, mod, res; + return this.negative !== 0 && num.negative === 0 ? (res = this.neg().divmod(num, mode), mode !== "mod" && (div = res.div.neg()), mode !== "div" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.iadd(num)), { + div, + mod + }) : this.negative === 0 && num.negative !== 0 ? (res = this.divmod(num.neg(), mode), mode !== "mod" && (div = res.div.neg()), { + div, + mod: res.mod + }) : this.negative & num.negative ? (res = this.neg().divmod(num.neg(), mode), mode !== "div" && (mod = res.mod.neg(), positive && mod.negative !== 0 && mod.isub(num)), { + div: res.div, + mod + }) : num.length > this.length || this.cmp(num) < 0 ? { + div: new BN2(0), + mod: this + } : num.length === 1 ? mode === "div" ? { + div: this.divn(num.words[0]), + mod: null + } : mode === "mod" ? { + div: null, + mod: new BN2(this.modrn(num.words[0])) + } : { + div: this.divn(num.words[0]), + mod: new BN2(this.modrn(num.words[0])) + } : this._wordDiv(num, mode); + }, "divmod"), BN2.prototype.div = /* @__PURE__ */ __name(function(num) { + return this.divmod(num, "div", !1).div; + }, "div"), BN2.prototype.mod = /* @__PURE__ */ __name(function(num) { + return this.divmod(num, "mod", !1).mod; + }, "mod"), BN2.prototype.umod = /* @__PURE__ */ __name(function(num) { + return this.divmod(num, "mod", !0).mod; + }, "umod"), BN2.prototype.divRound = /* @__PURE__ */ __name(function(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod, half = num.ushrn(1), r2 = num.andln(1), cmp = mod.cmp(half); + return cmp < 0 || r2 === 1 && cmp === 0 ? dm.div : dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }, "divRound"), BN2.prototype.modrn = /* @__PURE__ */ __name(function(num) { + var isNegNum = num < 0; + isNegNum && (num = -num), assert2(num <= 67108863); + for (var p2 = (1 << 26) % num, acc = 0, i = this.length - 1; i >= 0; i--) + acc = (p2 * acc + (this.words[i] | 0)) % num; + return isNegNum ? -acc : acc; + }, "modrn"), BN2.prototype.modn = /* @__PURE__ */ __name(function(num) { + return this.modrn(num); + }, "modn"), BN2.prototype.idivn = /* @__PURE__ */ __name(function(num) { + var isNegNum = num < 0; + isNegNum && (num = -num), assert2(num <= 67108863); + for (var carry = 0, i = this.length - 1; i >= 0; i--) { + var w2 = (this.words[i] | 0) + carry * 67108864; + this.words[i] = w2 / num | 0, carry = w2 % num; + } + return this._strip(), isNegNum ? this.ineg() : this; + }, "idivn"), BN2.prototype.divn = /* @__PURE__ */ __name(function(num) { + return this.clone().idivn(num); + }, "divn"), BN2.prototype.egcd = /* @__PURE__ */ __name(function(p2) { + assert2(p2.negative === 0), assert2(!p2.isZero()); + var x2 = this, y2 = p2.clone(); + x2.negative !== 0 ? x2 = x2.umod(p2) : x2 = x2.clone(); + for (var A2 = new BN2(1), B2 = new BN2(0), C2 = new BN2(0), D2 = new BN2(1), g2 = 0; x2.isEven() && y2.isEven(); ) + x2.iushrn(1), y2.iushrn(1), ++g2; + for (var yp = y2.clone(), xp = x2.clone(); !x2.isZero(); ) { + for (var i = 0, im = 1; !(x2.words[0] & im) && i < 26; ++i, im <<= 1) + ; + if (i > 0) + for (x2.iushrn(i); i-- > 0; ) + (A2.isOdd() || B2.isOdd()) && (A2.iadd(yp), B2.isub(xp)), A2.iushrn(1), B2.iushrn(1); + for (var j2 = 0, jm = 1; !(y2.words[0] & jm) && j2 < 26; ++j2, jm <<= 1) + ; + if (j2 > 0) + for (y2.iushrn(j2); j2-- > 0; ) + (C2.isOdd() || D2.isOdd()) && (C2.iadd(yp), D2.isub(xp)), C2.iushrn(1), D2.iushrn(1); + x2.cmp(y2) >= 0 ? (x2.isub(y2), A2.isub(C2), B2.isub(D2)) : (y2.isub(x2), C2.isub(A2), D2.isub(B2)); + } + return { + a: C2, + b: D2, + gcd: y2.iushln(g2) + }; + }, "egcd"), BN2.prototype._invmp = /* @__PURE__ */ __name(function(p2) { + assert2(p2.negative === 0), assert2(!p2.isZero()); + var a = this, b2 = p2.clone(); + a.negative !== 0 ? a = a.umod(p2) : a = a.clone(); + for (var x1 = new BN2(1), x2 = new BN2(0), delta = b2.clone(); a.cmpn(1) > 0 && b2.cmpn(1) > 0; ) { + for (var i = 0, im = 1; !(a.words[0] & im) && i < 26; ++i, im <<= 1) + ; + if (i > 0) + for (a.iushrn(i); i-- > 0; ) + x1.isOdd() && x1.iadd(delta), x1.iushrn(1); + for (var j2 = 0, jm = 1; !(b2.words[0] & jm) && j2 < 26; ++j2, jm <<= 1) + ; + if (j2 > 0) + for (b2.iushrn(j2); j2-- > 0; ) + x2.isOdd() && x2.iadd(delta), x2.iushrn(1); + a.cmp(b2) >= 0 ? (a.isub(b2), x1.isub(x2)) : (b2.isub(a), x2.isub(x1)); + } + var res; + return a.cmpn(1) === 0 ? res = x1 : res = x2, res.cmpn(0) < 0 && res.iadd(p2), res; + }, "_invmp"), BN2.prototype.gcd = /* @__PURE__ */ __name(function(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a = this.clone(), b2 = num.clone(); + a.negative = 0, b2.negative = 0; + for (var shift = 0; a.isEven() && b2.isEven(); shift++) + a.iushrn(1), b2.iushrn(1); + do { + for (; a.isEven(); ) + a.iushrn(1); + for (; b2.isEven(); ) + b2.iushrn(1); + var r2 = a.cmp(b2); + if (r2 < 0) { + var t = a; + a = b2, b2 = t; + } else if (r2 === 0 || b2.cmpn(1) === 0) + break; + a.isub(b2); + } while (!0); + return b2.iushln(shift); + }, "gcd"), BN2.prototype.invm = /* @__PURE__ */ __name(function(num) { + return this.egcd(num).a.umod(num); + }, "invm"), BN2.prototype.isEven = /* @__PURE__ */ __name(function() { + return (this.words[0] & 1) === 0; + }, "isEven"), BN2.prototype.isOdd = /* @__PURE__ */ __name(function() { + return (this.words[0] & 1) === 1; + }, "isOdd"), BN2.prototype.andln = /* @__PURE__ */ __name(function(num) { + return this.words[0] & num; + }, "andln"), BN2.prototype.bincn = /* @__PURE__ */ __name(function(bit) { + assert2(typeof bit == "number"); + var r2 = bit % 26, s2 = (bit - r2) / 26, q = 1 << r2; + if (this.length <= s2) + return this._expand(s2 + 1), this.words[s2] |= q, this; + for (var carry = q, i = s2; carry !== 0 && i < this.length; i++) { + var w2 = this.words[i] | 0; + w2 += carry, carry = w2 >>> 26, w2 &= 67108863, this.words[i] = w2; + } + return carry !== 0 && (this.words[i] = carry, this.length++), this; + }, "bincn"), BN2.prototype.isZero = /* @__PURE__ */ __name(function() { + return this.length === 1 && this.words[0] === 0; + }, "isZero"), BN2.prototype.cmpn = /* @__PURE__ */ __name(function(num) { + var negative = num < 0; + if (this.negative !== 0 && !negative) + return -1; + if (this.negative === 0 && negative) + return 1; + this._strip(); + var res; + if (this.length > 1) + res = 1; + else { + negative && (num = -num), assert2(num <= 67108863, "Number is too big"); + var w2 = this.words[0] | 0; + res = w2 === num ? 0 : w2 < num ? -1 : 1; + } + return this.negative !== 0 ? -res | 0 : res; + }, "cmpn"), BN2.prototype.cmp = /* @__PURE__ */ __name(function(num) { + if (this.negative !== 0 && num.negative === 0) + return -1; + if (this.negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + return this.negative !== 0 ? -res | 0 : res; + }, "cmp"), BN2.prototype.ucmp = /* @__PURE__ */ __name(function(num) { + if (this.length > num.length) + return 1; + if (this.length < num.length) + return -1; + for (var res = 0, i = this.length - 1; i >= 0; i--) { + var a = this.words[i] | 0, b2 = num.words[i] | 0; + if (a !== b2) { + a < b2 ? res = -1 : a > b2 && (res = 1); + break; + } + } + return res; + }, "ucmp"), BN2.prototype.gtn = /* @__PURE__ */ __name(function(num) { + return this.cmpn(num) === 1; + }, "gtn"), BN2.prototype.gt = /* @__PURE__ */ __name(function(num) { + return this.cmp(num) === 1; + }, "gt"), BN2.prototype.gten = /* @__PURE__ */ __name(function(num) { + return this.cmpn(num) >= 0; + }, "gten"), BN2.prototype.gte = /* @__PURE__ */ __name(function(num) { + return this.cmp(num) >= 0; + }, "gte"), BN2.prototype.ltn = /* @__PURE__ */ __name(function(num) { + return this.cmpn(num) === -1; + }, "ltn"), BN2.prototype.lt = /* @__PURE__ */ __name(function(num) { + return this.cmp(num) === -1; + }, "lt"), BN2.prototype.lten = /* @__PURE__ */ __name(function(num) { + return this.cmpn(num) <= 0; + }, "lten"), BN2.prototype.lte = /* @__PURE__ */ __name(function(num) { + return this.cmp(num) <= 0; + }, "lte"), BN2.prototype.eqn = /* @__PURE__ */ __name(function(num) { + return this.cmpn(num) === 0; + }, "eqn"), BN2.prototype.eq = /* @__PURE__ */ __name(function(num) { + return this.cmp(num) === 0; + }, "eq"), BN2.red = /* @__PURE__ */ __name(function(num) { + return new Red(num); + }, "red"), BN2.prototype.toRed = /* @__PURE__ */ __name(function(ctx) { + return assert2(!this.red, "Already a number in reduction context"), assert2(this.negative === 0, "red works only with positives"), ctx.convertTo(this)._forceRed(ctx); + }, "toRed"), BN2.prototype.fromRed = /* @__PURE__ */ __name(function() { + return assert2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); + }, "fromRed"), BN2.prototype._forceRed = /* @__PURE__ */ __name(function(ctx) { + return this.red = ctx, this; + }, "_forceRed"), BN2.prototype.forceRed = /* @__PURE__ */ __name(function(ctx) { + return assert2(!this.red, "Already a number in reduction context"), this._forceRed(ctx); + }, "forceRed"), BN2.prototype.redAdd = /* @__PURE__ */ __name(function(num) { + return assert2(this.red, "redAdd works only with red numbers"), this.red.add(this, num); + }, "redAdd"), BN2.prototype.redIAdd = /* @__PURE__ */ __name(function(num) { + return assert2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, num); + }, "redIAdd"), BN2.prototype.redSub = /* @__PURE__ */ __name(function(num) { + return assert2(this.red, "redSub works only with red numbers"), this.red.sub(this, num); + }, "redSub"), BN2.prototype.redISub = /* @__PURE__ */ __name(function(num) { + return assert2(this.red, "redISub works only with red numbers"), this.red.isub(this, num); + }, "redISub"), BN2.prototype.redShl = /* @__PURE__ */ __name(function(num) { + return assert2(this.red, "redShl works only with red numbers"), this.red.shl(this, num); + }, "redShl"), BN2.prototype.redMul = /* @__PURE__ */ __name(function(num) { + return assert2(this.red, "redMul works only with red numbers"), this.red._verify2(this, num), this.red.mul(this, num); + }, "redMul"), BN2.prototype.redIMul = /* @__PURE__ */ __name(function(num) { + return assert2(this.red, "redMul works only with red numbers"), this.red._verify2(this, num), this.red.imul(this, num); + }, "redIMul"), BN2.prototype.redSqr = /* @__PURE__ */ __name(function() { + return assert2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); + }, "redSqr"), BN2.prototype.redISqr = /* @__PURE__ */ __name(function() { + return assert2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); + }, "redISqr"), BN2.prototype.redSqrt = /* @__PURE__ */ __name(function() { + return assert2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); + }, "redSqrt"), BN2.prototype.redInvm = /* @__PURE__ */ __name(function() { + return assert2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); + }, "redInvm"), BN2.prototype.redNeg = /* @__PURE__ */ __name(function() { + return assert2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); + }, "redNeg"), BN2.prototype.redPow = /* @__PURE__ */ __name(function(num) { + return assert2(this.red && !num.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, num); + }, "redPow"); + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name, p2) { + this.name = name, this.p = new BN2(p2, 16), this.n = this.p.bitLength(), this.k = new BN2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); + } + __name(MPrime, "MPrime"), MPrime.prototype._tmp = /* @__PURE__ */ __name(function() { + var tmp = new BN2(null); + return tmp.words = new Array(Math.ceil(this.n / 13)), tmp; + }, "_tmp"), MPrime.prototype.ireduce = /* @__PURE__ */ __name(function(num) { + var r2 = num, rlen; + do + this.split(r2, this.tmp), r2 = this.imulK(r2), r2 = r2.iadd(this.tmp), rlen = r2.bitLength(); + while (rlen > this.n); + var cmp = rlen < this.n ? -1 : r2.ucmp(this.p); + return cmp === 0 ? (r2.words[0] = 0, r2.length = 1) : cmp > 0 ? r2.isub(this.p) : r2.strip !== void 0 ? r2.strip() : r2._strip(), r2; + }, "ireduce"), MPrime.prototype.split = /* @__PURE__ */ __name(function(input, out) { + input.iushrn(this.n, 0, out); + }, "split"), MPrime.prototype.imulK = /* @__PURE__ */ __name(function(num) { + return num.imul(this.k); + }, "imulK"); + function K256() { + MPrime.call( + this, + "k256", + "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f" + ); + } + __name(K256, "K256"), inherits2(K256, MPrime), K256.prototype.split = /* @__PURE__ */ __name(function(input, output) { + for (var mask = 4194303, outLen = Math.min(input.length, 9), i = 0; i < outLen; i++) + output.words[i] = input.words[i]; + if (output.length = outLen, input.length <= 9) { + input.words[0] = 0, input.length = 1; + return; + } + var prev = input.words[9]; + for (output.words[output.length++] = prev & mask, i = 10; i < input.length; i++) { + var next = input.words[i] | 0; + input.words[i - 10] = (next & mask) << 4 | prev >>> 22, prev = next; + } + prev >>>= 22, input.words[i - 10] = prev, prev === 0 && input.length > 10 ? input.length -= 10 : input.length -= 9; + }, "split"), K256.prototype.imulK = /* @__PURE__ */ __name(function(num) { + num.words[num.length] = 0, num.words[num.length + 1] = 0, num.length += 2; + for (var lo = 0, i = 0; i < num.length; i++) { + var w2 = num.words[i] | 0; + lo += w2 * 977, num.words[i] = lo & 67108863, lo = w2 * 64 + (lo / 67108864 | 0); + } + return num.words[num.length - 1] === 0 && (num.length--, num.words[num.length - 1] === 0 && num.length--), num; + }, "imulK"); + function P224() { + MPrime.call( + this, + "p224", + "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001" + ); + } + __name(P224, "P224"), inherits2(P224, MPrime); + function P192() { + MPrime.call( + this, + "p192", + "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff" + ); + } + __name(P192, "P192"), inherits2(P192, MPrime); + function P25519() { + MPrime.call( + this, + "25519", + "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed" + ); + } + __name(P25519, "P25519"), inherits2(P25519, MPrime), P25519.prototype.imulK = /* @__PURE__ */ __name(function(num) { + for (var carry = 0, i = 0; i < num.length; i++) { + var hi = (num.words[i] | 0) * 19 + carry, lo = hi & 67108863; + hi >>>= 26, num.words[i] = lo, carry = hi; + } + return carry !== 0 && (num.words[num.length++] = carry), num; + }, "imulK"), BN2._prime = /* @__PURE__ */ __name(function(name) { + if (primes[name]) + return primes[name]; + var prime2; + if (name === "k256") + prime2 = new K256(); + else if (name === "p224") + prime2 = new P224(); + else if (name === "p192") + prime2 = new P192(); + else if (name === "p25519") + prime2 = new P25519(); + else + throw new Error("Unknown prime " + name); + return primes[name] = prime2, prime2; + }, "prime"); + function Red(m2) { + if (typeof m2 == "string") { + var prime = BN2._prime(m2); + this.m = prime.p, this.prime = prime; + } else + assert2(m2.gtn(1), "modulus must be greater than 1"), this.m = m2, this.prime = null; + } + __name(Red, "Red"), Red.prototype._verify1 = /* @__PURE__ */ __name(function(a) { + assert2(a.negative === 0, "red works only with positives"), assert2(a.red, "red works only with red numbers"); + }, "_verify1"), Red.prototype._verify2 = /* @__PURE__ */ __name(function(a, b2) { + assert2((a.negative | b2.negative) === 0, "red works only with positives"), assert2( + a.red && a.red === b2.red, + "red works only with red numbers" + ); + }, "_verify2"), Red.prototype.imod = /* @__PURE__ */ __name(function(a) { + return this.prime ? this.prime.ireduce(a)._forceRed(this) : (move(a, a.umod(this.m)._forceRed(this)), a); + }, "imod"), Red.prototype.neg = /* @__PURE__ */ __name(function(a) { + return a.isZero() ? a.clone() : this.m.sub(a)._forceRed(this); + }, "neg"), Red.prototype.add = /* @__PURE__ */ __name(function(a, b2) { + this._verify2(a, b2); + var res = a.add(b2); + return res.cmp(this.m) >= 0 && res.isub(this.m), res._forceRed(this); + }, "add"), Red.prototype.iadd = /* @__PURE__ */ __name(function(a, b2) { + this._verify2(a, b2); + var res = a.iadd(b2); + return res.cmp(this.m) >= 0 && res.isub(this.m), res; + }, "iadd"), Red.prototype.sub = /* @__PURE__ */ __name(function(a, b2) { + this._verify2(a, b2); + var res = a.sub(b2); + return res.cmpn(0) < 0 && res.iadd(this.m), res._forceRed(this); + }, "sub"), Red.prototype.isub = /* @__PURE__ */ __name(function(a, b2) { + this._verify2(a, b2); + var res = a.isub(b2); + return res.cmpn(0) < 0 && res.iadd(this.m), res; + }, "isub"), Red.prototype.shl = /* @__PURE__ */ __name(function(a, num) { + return this._verify1(a), this.imod(a.ushln(num)); + }, "shl"), Red.prototype.imul = /* @__PURE__ */ __name(function(a, b2) { + return this._verify2(a, b2), this.imod(a.imul(b2)); + }, "imul"), Red.prototype.mul = /* @__PURE__ */ __name(function(a, b2) { + return this._verify2(a, b2), this.imod(a.mul(b2)); + }, "mul"), Red.prototype.isqr = /* @__PURE__ */ __name(function(a) { + return this.imul(a, a.clone()); + }, "isqr"), Red.prototype.sqr = /* @__PURE__ */ __name(function(a) { + return this.mul(a, a); + }, "sqr"), Red.prototype.sqrt = /* @__PURE__ */ __name(function(a) { + if (a.isZero()) + return a.clone(); + var mod3 = this.m.andln(3); + if (assert2(mod3 % 2 === 1), mod3 === 3) { + var pow = this.m.add(new BN2(1)).iushrn(2); + return this.pow(a, pow); + } + for (var q = this.m.subn(1), s2 = 0; !q.isZero() && q.andln(1) === 0; ) + s2++, q.iushrn(1); + assert2(!q.isZero()); + var one = new BN2(1).toRed(this), nOne = one.redNeg(), lpow = this.m.subn(1).iushrn(1), z2 = this.m.bitLength(); + for (z2 = new BN2(2 * z2 * z2).toRed(this); this.pow(z2, lpow).cmp(nOne) !== 0; ) + z2.redIAdd(nOne); + for (var c = this.pow(z2, q), r2 = this.pow(a, q.addn(1).iushrn(1)), t = this.pow(a, q), m2 = s2; t.cmp(one) !== 0; ) { + for (var tmp = t, i = 0; tmp.cmp(one) !== 0; i++) + tmp = tmp.redSqr(); + assert2(i < m2); + var b2 = this.pow(c, new BN2(1).iushln(m2 - i - 1)); + r2 = r2.redMul(b2), c = b2.redSqr(), t = t.redMul(c), m2 = i; + } + return r2; + }, "sqrt"), Red.prototype.invm = /* @__PURE__ */ __name(function(a) { + var inv = a._invmp(this.m); + return inv.negative !== 0 ? (inv.negative = 0, this.imod(inv).redNeg()) : this.imod(inv); + }, "invm"), Red.prototype.pow = /* @__PURE__ */ __name(function(a, num) { + if (num.isZero()) + return new BN2(1).toRed(this); + if (num.cmpn(1) === 0) + return a.clone(); + var windowSize = 4, wnd = new Array(1 << windowSize); + wnd[0] = new BN2(1).toRed(this), wnd[1] = a; + for (var i = 2; i < wnd.length; i++) + wnd[i] = this.mul(wnd[i - 1], a); + var res = wnd[0], current = 0, currentLen = 0, start = num.bitLength() % 26; + for (start === 0 && (start = 26), i = num.length - 1; i >= 0; i--) { + for (var word = num.words[i], j2 = start - 1; j2 >= 0; j2--) { + var bit = word >> j2 & 1; + if (res !== wnd[0] && (res = this.sqr(res)), bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1, current |= bit, currentLen++, !(currentLen !== windowSize && (i !== 0 || j2 !== 0)) && (res = this.mul(res, wnd[current]), currentLen = 0, current = 0); + } + start = 26; + } + return res; + }, "pow"), Red.prototype.convertTo = /* @__PURE__ */ __name(function(num) { + var r2 = num.umod(this.m); + return r2 === num ? r2.clone() : r2; + }, "convertTo"), Red.prototype.convertFrom = /* @__PURE__ */ __name(function(num) { + var res = num.clone(); + return res.red = null, res; + }, "convertFrom"), BN2.mont = /* @__PURE__ */ __name(function(num) { + return new Mont(num); + }, "mont"); + function Mont(m2) { + Red.call(this, m2), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new BN2(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv); + } + __name(Mont, "Mont"), inherits2(Mont, Red), Mont.prototype.convertTo = /* @__PURE__ */ __name(function(num) { + return this.imod(num.ushln(this.shift)); + }, "convertTo"), Mont.prototype.convertFrom = /* @__PURE__ */ __name(function(num) { + var r2 = this.imod(num.mul(this.rinv)); + return r2.red = null, r2; + }, "convertFrom"), Mont.prototype.imul = /* @__PURE__ */ __name(function(a, b2) { + if (a.isZero() || b2.isZero()) + return a.words[0] = 0, a.length = 1, a; + var t = a.imul(b2), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u2 = t.isub(c).iushrn(this.shift), res = u2; + return u2.cmp(this.m) >= 0 ? res = u2.isub(this.m) : u2.cmpn(0) < 0 && (res = u2.iadd(this.m)), res._forceRed(this); + }, "imul"), Mont.prototype.mul = /* @__PURE__ */ __name(function(a, b2) { + if (a.isZero() || b2.isZero()) + return new BN2(0)._forceRed(this); + var t = a.mul(b2), c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), u2 = t.isub(c).iushrn(this.shift), res = u2; + return u2.cmp(this.m) >= 0 ? res = u2.isub(this.m) : u2.cmpn(0) < 0 && (res = u2.iadd(this.m)), res._forceRed(this); + }, "mul"), Mont.prototype.invm = /* @__PURE__ */ __name(function(a) { + var res = this.imod(a._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }, "invm"); + })(module, commonjsGlobal); +})(bn); +var bnExports = bn.exports; +const BN$1 = /* @__PURE__ */ getDefaultExportFromCjs(bnExports); +var BN = BN$1.BN; +function _base36To16(value) { + return new BN(value, 36).toString(16); +} +__name(_base36To16, "_base36To16"); +const version$2 = "strings/5.7.0", logger$2 = new Logger(version$2); +var UnicodeNormalizationForm; +(function(UnicodeNormalizationForm2) { + UnicodeNormalizationForm2.current = "", UnicodeNormalizationForm2.NFC = "NFC", UnicodeNormalizationForm2.NFD = "NFD", UnicodeNormalizationForm2.NFKC = "NFKC", UnicodeNormalizationForm2.NFKD = "NFKD"; +})(UnicodeNormalizationForm || (UnicodeNormalizationForm = {})); +var Utf8ErrorReason; +(function(Utf8ErrorReason2) { + Utf8ErrorReason2.UNEXPECTED_CONTINUE = "unexpected continuation byte", Utf8ErrorReason2.BAD_PREFIX = "bad codepoint prefix", Utf8ErrorReason2.OVERRUN = "string overrun", Utf8ErrorReason2.MISSING_CONTINUE = "missing continuation byte", Utf8ErrorReason2.OUT_OF_RANGE = "out of UTF-8 range", Utf8ErrorReason2.UTF16_SURROGATE = "UTF-16 surrogate", Utf8ErrorReason2.OVERLONG = "overlong representation"; +})(Utf8ErrorReason || (Utf8ErrorReason = {})); +function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) { + form != UnicodeNormalizationForm.current && (logger$2.checkNormalize(), str = str.normalize(form)); + let result = []; + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c < 128) + result.push(c); + else if (c < 2048) + result.push(c >> 6 | 192), result.push(c & 63 | 128); + else if ((c & 64512) == 55296) { + i++; + const c2 = str.charCodeAt(i); + if (i >= str.length || (c2 & 64512) !== 56320) + throw new Error("invalid utf-8 string"); + const pair = 65536 + ((c & 1023) << 10) + (c2 & 1023); + result.push(pair >> 18 | 240), result.push(pair >> 12 & 63 | 128), result.push(pair >> 6 & 63 | 128), result.push(pair & 63 | 128); + } else + result.push(c >> 12 | 224), result.push(c >> 6 & 63 | 128), result.push(c & 63 | 128); + } + return arrayify(result); +} +__name(toUtf8Bytes, "toUtf8Bytes"); +const messagePrefix = `Ethereum Signed Message: +`; +function hashMessage(message) { + return typeof message == "string" && (message = toUtf8Bytes(message)), keccak256(concat([ + toUtf8Bytes(messagePrefix), + toUtf8Bytes(String(message.length)), + message + ])); +} +__name(hashMessage, "hashMessage"); +const version$1 = "address/5.7.0", logger$1 = new Logger(version$1); +function getChecksumAddress(address) { + isHexString(address, 20) || logger$1.throwArgumentError("invalid address", "address", address), address = address.toLowerCase(); + const chars = address.substring(2).split(""), expanded = new Uint8Array(40); + for (let i = 0; i < 40; i++) + expanded[i] = chars[i].charCodeAt(0); + const hashed = arrayify(keccak256(expanded)); + for (let i = 0; i < 40; i += 2) + hashed[i >> 1] >> 4 >= 8 && (chars[i] = chars[i].toUpperCase()), (hashed[i >> 1] & 15) >= 8 && (chars[i + 1] = chars[i + 1].toUpperCase()); + return "0x" + chars.join(""); +} +__name(getChecksumAddress, "getChecksumAddress"); +const MAX_SAFE_INTEGER = 9007199254740991; +function log10(x2) { + return Math.log10 ? Math.log10(x2) : Math.log(x2) / Math.LN10; +} +__name(log10, "log10"); +const ibanLookup = {}; +for (let i = 0; i < 10; i++) + ibanLookup[String(i)] = String(i); +for (let i = 0; i < 26; i++) + ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); +const safeDigits = Math.floor(log10(MAX_SAFE_INTEGER)); +function ibanChecksum(address) { + address = address.toUpperCase(), address = address.substring(4) + address.substring(0, 2) + "00"; + let expanded = address.split("").map((c) => ibanLookup[c]).join(""); + for (; expanded.length >= safeDigits; ) { + let block = expanded.substring(0, safeDigits); + expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); + } + let checksum = String(98 - parseInt(expanded, 10) % 97); + for (; checksum.length < 2; ) + checksum = "0" + checksum; + return checksum; +} +__name(ibanChecksum, "ibanChecksum"); +function getAddress(address) { + let result = null; + if (typeof address != "string" && logger$1.throwArgumentError("invalid address", "address", address), address.match(/^(0x)?[0-9a-fA-F]{40}$/)) + address.substring(0, 2) !== "0x" && (address = "0x" + address), result = getChecksumAddress(address), address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address && logger$1.throwArgumentError("bad address checksum", "address", address); + else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { + for (address.substring(2, 4) !== ibanChecksum(address) && logger$1.throwArgumentError("bad icap checksum", "address", address), result = _base36To16(address.substring(4)); result.length < 40; ) + result = "0" + result; + result = getChecksumAddress("0x" + result); + } else + logger$1.throwArgumentError("invalid address", "address", address); + return result; +} +__name(getAddress, "getAddress"); +globalThis && globalThis.__awaiter; +function defineReadOnly(object, name, value) { + Object.defineProperty(object, name, { + enumerable: !0, + value, + writable: !1 + }); +} +__name(defineReadOnly, "defineReadOnly"); +var hash$1 = {}, utils$9 = {}, minimalisticAssert$1 = assert$b; +function assert$b(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); +} +__name(assert$b, "assert$b"); +assert$b.equal = /* @__PURE__ */ __name(function(l2, r2, msg) { + if (l2 != r2) + throw new Error(msg || "Assertion failed: " + l2 + " != " + r2); +}, "assertEqual"); +var inherits_browser$1 = { exports: {} }; +typeof Object.create == "function" ? inherits_browser$1.exports = /* @__PURE__ */ __name(function(ctor, superCtor) { + superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: !1, + writable: !0, + configurable: !0 + } + })); +}, "inherits") : inherits_browser$1.exports = /* @__PURE__ */ __name(function(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = /* @__PURE__ */ __name(function() { + }, "TempCtor"); + TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor(), ctor.prototype.constructor = ctor; + } +}, "inherits"); +var inherits_browserExports = inherits_browser$1.exports, assert$a = minimalisticAssert$1, inherits = inherits_browserExports; +utils$9.inherits = inherits; +function isSurrogatePair(msg, i) { + return (msg.charCodeAt(i) & 64512) !== 55296 || i < 0 || i + 1 >= msg.length ? !1 : (msg.charCodeAt(i + 1) & 64512) === 56320; +} +__name(isSurrogatePair, "isSurrogatePair"); +function toArray(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg == "string") + if (enc) { + if (enc === "hex") + for (msg = msg.replace(/[^a-z0-9]+/ig, ""), msg.length % 2 !== 0 && (msg = "0" + msg), i = 0; i < msg.length; i += 2) + res.push(parseInt(msg[i] + msg[i + 1], 16)); + } else + for (var p2 = 0, i = 0; i < msg.length; i++) { + var c = msg.charCodeAt(i); + c < 128 ? res[p2++] = c : c < 2048 ? (res[p2++] = c >> 6 | 192, res[p2++] = c & 63 | 128) : isSurrogatePair(msg, i) ? (c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023), res[p2++] = c >> 18 | 240, res[p2++] = c >> 12 & 63 | 128, res[p2++] = c >> 6 & 63 | 128, res[p2++] = c & 63 | 128) : (res[p2++] = c >> 12 | 224, res[p2++] = c >> 6 & 63 | 128, res[p2++] = c & 63 | 128); + } + else + for (i = 0; i < msg.length; i++) + res[i] = msg[i] | 0; + return res; +} +__name(toArray, "toArray"); +utils$9.toArray = toArray; +function toHex(msg) { + for (var res = "", i = 0; i < msg.length; i++) + res += zero2(msg[i].toString(16)); + return res; +} +__name(toHex, "toHex"); +utils$9.toHex = toHex; +function htonl(w2) { + var res = w2 >>> 24 | w2 >>> 8 & 65280 | w2 << 8 & 16711680 | (w2 & 255) << 24; + return res >>> 0; +} +__name(htonl, "htonl"); +utils$9.htonl = htonl; +function toHex32(msg, endian) { + for (var res = "", i = 0; i < msg.length; i++) { + var w2 = msg[i]; + endian === "little" && (w2 = htonl(w2)), res += zero8(w2.toString(16)); + } + return res; +} +__name(toHex32, "toHex32"); +utils$9.toHex32 = toHex32; +function zero2(word) { + return word.length === 1 ? "0" + word : word; +} +__name(zero2, "zero2"); +utils$9.zero2 = zero2; +function zero8(word) { + return word.length === 7 ? "0" + word : word.length === 6 ? "00" + word : word.length === 5 ? "000" + word : word.length === 4 ? "0000" + word : word.length === 3 ? "00000" + word : word.length === 2 ? "000000" + word : word.length === 1 ? "0000000" + word : word; +} +__name(zero8, "zero8"); +utils$9.zero8 = zero8; +function join32(msg, start, end, endian) { + var len = end - start; + assert$a(len % 4 === 0); + for (var res = new Array(len / 4), i = 0, k2 = start; i < res.length; i++, k2 += 4) { + var w2; + endian === "big" ? w2 = msg[k2] << 24 | msg[k2 + 1] << 16 | msg[k2 + 2] << 8 | msg[k2 + 3] : w2 = msg[k2 + 3] << 24 | msg[k2 + 2] << 16 | msg[k2 + 1] << 8 | msg[k2], res[i] = w2 >>> 0; + } + return res; +} +__name(join32, "join32"); +utils$9.join32 = join32; +function split32(msg, endian) { + for (var res = new Array(msg.length * 4), i = 0, k2 = 0; i < msg.length; i++, k2 += 4) { + var m2 = msg[i]; + endian === "big" ? (res[k2] = m2 >>> 24, res[k2 + 1] = m2 >>> 16 & 255, res[k2 + 2] = m2 >>> 8 & 255, res[k2 + 3] = m2 & 255) : (res[k2 + 3] = m2 >>> 24, res[k2 + 2] = m2 >>> 16 & 255, res[k2 + 1] = m2 >>> 8 & 255, res[k2] = m2 & 255); + } + return res; +} +__name(split32, "split32"); +utils$9.split32 = split32; +function rotr32$1(w2, b2) { + return w2 >>> b2 | w2 << 32 - b2; +} +__name(rotr32$1, "rotr32$1"); +utils$9.rotr32 = rotr32$1; +function rotl32$2(w2, b2) { + return w2 << b2 | w2 >>> 32 - b2; +} +__name(rotl32$2, "rotl32$2"); +utils$9.rotl32 = rotl32$2; +function sum32$3(a, b2) { + return a + b2 >>> 0; +} +__name(sum32$3, "sum32$3"); +utils$9.sum32 = sum32$3; +function sum32_3$1(a, b2, c) { + return a + b2 + c >>> 0; +} +__name(sum32_3$1, "sum32_3$1"); +utils$9.sum32_3 = sum32_3$1; +function sum32_4$2(a, b2, c, d2) { + return a + b2 + c + d2 >>> 0; +} +__name(sum32_4$2, "sum32_4$2"); +utils$9.sum32_4 = sum32_4$2; +function sum32_5$2(a, b2, c, d2, e) { + return a + b2 + c + d2 + e >>> 0; +} +__name(sum32_5$2, "sum32_5$2"); +utils$9.sum32_5 = sum32_5$2; +function sum64$1(buf, pos, ah, al) { + var bh = buf[pos], bl = buf[pos + 1], lo = al + bl >>> 0, hi = (lo < al ? 1 : 0) + ah + bh; + buf[pos] = hi >>> 0, buf[pos + 1] = lo; +} +__name(sum64$1, "sum64$1"); +utils$9.sum64 = sum64$1; +function sum64_hi$1(ah, al, bh, bl) { + var lo = al + bl >>> 0, hi = (lo < al ? 1 : 0) + ah + bh; + return hi >>> 0; +} +__name(sum64_hi$1, "sum64_hi$1"); +utils$9.sum64_hi = sum64_hi$1; +function sum64_lo$1(ah, al, bh, bl) { + var lo = al + bl; + return lo >>> 0; +} +__name(sum64_lo$1, "sum64_lo$1"); +utils$9.sum64_lo = sum64_lo$1; +function sum64_4_hi$1(ah, al, bh, bl, ch, cl, dh, dl) { + var carry = 0, lo = al; + lo = lo + bl >>> 0, carry += lo < al ? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl ? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl ? 1 : 0; + var hi = ah + bh + ch + dh + carry; + return hi >>> 0; +} +__name(sum64_4_hi$1, "sum64_4_hi$1"); +utils$9.sum64_4_hi = sum64_4_hi$1; +function sum64_4_lo$1(ah, al, bh, bl, ch, cl, dh, dl) { + var lo = al + bl + cl + dl; + return lo >>> 0; +} +__name(sum64_4_lo$1, "sum64_4_lo$1"); +utils$9.sum64_4_lo = sum64_4_lo$1; +function sum64_5_hi$1(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var carry = 0, lo = al; + lo = lo + bl >>> 0, carry += lo < al ? 1 : 0, lo = lo + cl >>> 0, carry += lo < cl ? 1 : 0, lo = lo + dl >>> 0, carry += lo < dl ? 1 : 0, lo = lo + el >>> 0, carry += lo < el ? 1 : 0; + var hi = ah + bh + ch + dh + eh + carry; + return hi >>> 0; +} +__name(sum64_5_hi$1, "sum64_5_hi$1"); +utils$9.sum64_5_hi = sum64_5_hi$1; +function sum64_5_lo$1(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var lo = al + bl + cl + dl + el; + return lo >>> 0; +} +__name(sum64_5_lo$1, "sum64_5_lo$1"); +utils$9.sum64_5_lo = sum64_5_lo$1; +function rotr64_hi$1(ah, al, num) { + var r2 = al << 32 - num | ah >>> num; + return r2 >>> 0; +} +__name(rotr64_hi$1, "rotr64_hi$1"); +utils$9.rotr64_hi = rotr64_hi$1; +function rotr64_lo$1(ah, al, num) { + var r2 = ah << 32 - num | al >>> num; + return r2 >>> 0; +} +__name(rotr64_lo$1, "rotr64_lo$1"); +utils$9.rotr64_lo = rotr64_lo$1; +function shr64_hi$1(ah, al, num) { + return ah >>> num; +} +__name(shr64_hi$1, "shr64_hi$1"); +utils$9.shr64_hi = shr64_hi$1; +function shr64_lo$1(ah, al, num) { + var r2 = ah << 32 - num | al >>> num; + return r2 >>> 0; +} +__name(shr64_lo$1, "shr64_lo$1"); +utils$9.shr64_lo = shr64_lo$1; +var common$5 = {}, utils$8 = utils$9, assert$9 = minimalisticAssert$1; +function BlockHash$4() { + this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = "big", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32; +} +__name(BlockHash$4, "BlockHash$4"); +common$5.BlockHash = BlockHash$4; +BlockHash$4.prototype.update = /* @__PURE__ */ __name(function(msg, enc) { + if (msg = utils$8.toArray(msg, enc), this.pending ? this.pending = this.pending.concat(msg) : this.pending = msg, this.pendingTotal += msg.length, this.pending.length >= this._delta8) { + msg = this.pending; + var r2 = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r2, msg.length), this.pending.length === 0 && (this.pending = null), msg = utils$8.join32(msg, 0, msg.length - r2, this.endian); + for (var i = 0; i < msg.length; i += this._delta32) + this._update(msg, i, i + this._delta32); + } + return this; +}, "update"); +BlockHash$4.prototype.digest = /* @__PURE__ */ __name(function(enc) { + return this.update(this._pad()), assert$9(this.pending === null), this._digest(enc); +}, "digest"); +BlockHash$4.prototype._pad = /* @__PURE__ */ __name(function() { + var len = this.pendingTotal, bytes = this._delta8, k2 = bytes - (len + this.padLength) % bytes, res = new Array(k2 + this.padLength); + res[0] = 128; + for (var i = 1; i < k2; i++) + res[i] = 0; + if (len <<= 3, this.endian === "big") { + for (var t = 8; t < this.padLength; t++) + res[i++] = 0; + res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = len >>> 24 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 8 & 255, res[i++] = len & 255; + } else + for (res[i++] = len & 255, res[i++] = len >>> 8 & 255, res[i++] = len >>> 16 & 255, res[i++] = len >>> 24 & 255, res[i++] = 0, res[i++] = 0, res[i++] = 0, res[i++] = 0, t = 8; t < this.padLength; t++) + res[i++] = 0; + return res; +}, "pad"); +var sha = {}, common$4 = {}, utils$7 = utils$9, rotr32 = utils$7.rotr32; +function ft_1$1(s2, x2, y2, z2) { + if (s2 === 0) + return ch32$1(x2, y2, z2); + if (s2 === 1 || s2 === 3) + return p32(x2, y2, z2); + if (s2 === 2) + return maj32$1(x2, y2, z2); +} +__name(ft_1$1, "ft_1$1"); +common$4.ft_1 = ft_1$1; +function ch32$1(x2, y2, z2) { + return x2 & y2 ^ ~x2 & z2; +} +__name(ch32$1, "ch32$1"); +common$4.ch32 = ch32$1; +function maj32$1(x2, y2, z2) { + return x2 & y2 ^ x2 & z2 ^ y2 & z2; +} +__name(maj32$1, "maj32$1"); +common$4.maj32 = maj32$1; +function p32(x2, y2, z2) { + return x2 ^ y2 ^ z2; +} +__name(p32, "p32"); +common$4.p32 = p32; +function s0_256$1(x2) { + return rotr32(x2, 2) ^ rotr32(x2, 13) ^ rotr32(x2, 22); +} +__name(s0_256$1, "s0_256$1"); +common$4.s0_256 = s0_256$1; +function s1_256$1(x2) { + return rotr32(x2, 6) ^ rotr32(x2, 11) ^ rotr32(x2, 25); +} +__name(s1_256$1, "s1_256$1"); +common$4.s1_256 = s1_256$1; +function g0_256$1(x2) { + return rotr32(x2, 7) ^ rotr32(x2, 18) ^ x2 >>> 3; +} +__name(g0_256$1, "g0_256$1"); +common$4.g0_256 = g0_256$1; +function g1_256$1(x2) { + return rotr32(x2, 17) ^ rotr32(x2, 19) ^ x2 >>> 10; +} +__name(g1_256$1, "g1_256$1"); +common$4.g1_256 = g1_256$1; +var utils$6 = utils$9, common$3 = common$5, shaCommon$1 = common$4, rotl32$1 = utils$6.rotl32, sum32$2 = utils$6.sum32, sum32_5$1 = utils$6.sum32_5, ft_1 = shaCommon$1.ft_1, BlockHash$3 = common$3.BlockHash, sha1_K = [ + 1518500249, + 1859775393, + 2400959708, + 3395469782 +]; +function SHA1() { + if (!(this instanceof SHA1)) + return new SHA1(); + BlockHash$3.call(this), this.h = [ + 1732584193, + 4023233417, + 2562383102, + 271733878, + 3285377520 + ], this.W = new Array(80); +} +__name(SHA1, "SHA1"); +utils$6.inherits(SHA1, BlockHash$3); +var _1 = SHA1; +SHA1.blockSize = 512; +SHA1.outSize = 160; +SHA1.hmacStrength = 80; +SHA1.padLength = 64; +SHA1.prototype._update = /* @__PURE__ */ __name(function(msg, start) { + for (var W2 = this.W, i = 0; i < 16; i++) + W2[i] = msg[start + i]; + for (; i < W2.length; i++) + W2[i] = rotl32$1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16], 1); + var a = this.h[0], b2 = this.h[1], c = this.h[2], d2 = this.h[3], e = this.h[4]; + for (i = 0; i < W2.length; i++) { + var s2 = ~~(i / 20), t = sum32_5$1(rotl32$1(a, 5), ft_1(s2, b2, c, d2), e, W2[i], sha1_K[s2]); + e = d2, d2 = c, c = rotl32$1(b2, 30), b2 = a, a = t; + } + this.h[0] = sum32$2(this.h[0], a), this.h[1] = sum32$2(this.h[1], b2), this.h[2] = sum32$2(this.h[2], c), this.h[3] = sum32$2(this.h[3], d2), this.h[4] = sum32$2(this.h[4], e); +}, "_update"); +SHA1.prototype._digest = /* @__PURE__ */ __name(function(enc) { + return enc === "hex" ? utils$6.toHex32(this.h, "big") : utils$6.split32(this.h, "big"); +}, "digest"); +var utils$5 = utils$9, common$2 = common$5, shaCommon = common$4, assert$8 = minimalisticAssert$1, sum32$1 = utils$5.sum32, sum32_4$1 = utils$5.sum32_4, sum32_5 = utils$5.sum32_5, ch32 = shaCommon.ch32, maj32 = shaCommon.maj32, s0_256 = shaCommon.s0_256, s1_256 = shaCommon.s1_256, g0_256 = shaCommon.g0_256, g1_256 = shaCommon.g1_256, BlockHash$2 = common$2.BlockHash, sha256_K = [ + 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 +]; +function SHA256$1() { + if (!(this instanceof SHA256$1)) + return new SHA256$1(); + BlockHash$2.call(this), this.h = [ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ], this.k = sha256_K, this.W = new Array(64); +} +__name(SHA256$1, "SHA256$1"); +utils$5.inherits(SHA256$1, BlockHash$2); +var _256 = SHA256$1; +SHA256$1.blockSize = 512; +SHA256$1.outSize = 256; +SHA256$1.hmacStrength = 192; +SHA256$1.padLength = 64; +SHA256$1.prototype._update = /* @__PURE__ */ __name(function(msg, start) { + for (var W2 = this.W, i = 0; i < 16; i++) + W2[i] = msg[start + i]; + for (; i < W2.length; i++) + W2[i] = sum32_4$1(g1_256(W2[i - 2]), W2[i - 7], g0_256(W2[i - 15]), W2[i - 16]); + var a = this.h[0], b2 = this.h[1], c = this.h[2], d2 = this.h[3], e = this.h[4], f2 = this.h[5], g2 = this.h[6], h2 = this.h[7]; + for (assert$8(this.k.length === W2.length), i = 0; i < W2.length; i++) { + var T1 = sum32_5(h2, s1_256(e), ch32(e, f2, g2), this.k[i], W2[i]), T2 = sum32$1(s0_256(a), maj32(a, b2, c)); + h2 = g2, g2 = f2, f2 = e, e = sum32$1(d2, T1), d2 = c, c = b2, b2 = a, a = sum32$1(T1, T2); + } + this.h[0] = sum32$1(this.h[0], a), this.h[1] = sum32$1(this.h[1], b2), this.h[2] = sum32$1(this.h[2], c), this.h[3] = sum32$1(this.h[3], d2), this.h[4] = sum32$1(this.h[4], e), this.h[5] = sum32$1(this.h[5], f2), this.h[6] = sum32$1(this.h[6], g2), this.h[7] = sum32$1(this.h[7], h2); +}, "_update"); +SHA256$1.prototype._digest = /* @__PURE__ */ __name(function(enc) { + return enc === "hex" ? utils$5.toHex32(this.h, "big") : utils$5.split32(this.h, "big"); +}, "digest"); +var utils$4 = utils$9, SHA256 = _256; +function SHA224() { + if (!(this instanceof SHA224)) + return new SHA224(); + SHA256.call(this), this.h = [ + 3238371032, + 914150663, + 812702999, + 4144912697, + 4290775857, + 1750603025, + 1694076839, + 3204075428 + ]; +} +__name(SHA224, "SHA224"); +utils$4.inherits(SHA224, SHA256); +var _224 = SHA224; +SHA224.blockSize = 512; +SHA224.outSize = 224; +SHA224.hmacStrength = 192; +SHA224.padLength = 64; +SHA224.prototype._digest = /* @__PURE__ */ __name(function(enc) { + return enc === "hex" ? utils$4.toHex32(this.h.slice(0, 7), "big") : utils$4.split32(this.h.slice(0, 7), "big"); +}, "digest"); +var utils$3 = utils$9, common$1 = common$5, assert$7 = minimalisticAssert$1, rotr64_hi = utils$3.rotr64_hi, rotr64_lo = utils$3.rotr64_lo, shr64_hi = utils$3.shr64_hi, shr64_lo = utils$3.shr64_lo, sum64 = utils$3.sum64, sum64_hi = utils$3.sum64_hi, sum64_lo = utils$3.sum64_lo, sum64_4_hi = utils$3.sum64_4_hi, sum64_4_lo = utils$3.sum64_4_lo, sum64_5_hi = utils$3.sum64_5_hi, sum64_5_lo = utils$3.sum64_5_lo, BlockHash$1 = common$1.BlockHash, sha512_K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 +]; +function SHA512$1() { + if (!(this instanceof SHA512$1)) + return new SHA512$1(); + BlockHash$1.call(this), this.h = [ + 1779033703, + 4089235720, + 3144134277, + 2227873595, + 1013904242, + 4271175723, + 2773480762, + 1595750129, + 1359893119, + 2917565137, + 2600822924, + 725511199, + 528734635, + 4215389547, + 1541459225, + 327033209 + ], this.k = sha512_K, this.W = new Array(160); +} +__name(SHA512$1, "SHA512$1"); +utils$3.inherits(SHA512$1, BlockHash$1); +var _512 = SHA512$1; +SHA512$1.blockSize = 1024; +SHA512$1.outSize = 512; +SHA512$1.hmacStrength = 192; +SHA512$1.padLength = 128; +SHA512$1.prototype._prepareBlock = /* @__PURE__ */ __name(function(msg, start) { + for (var W2 = this.W, i = 0; i < 32; i++) + W2[i] = msg[start + i]; + for (; i < W2.length; i += 2) { + var c0_hi = g1_512_hi(W2[i - 4], W2[i - 3]), c0_lo = g1_512_lo(W2[i - 4], W2[i - 3]), c1_hi = W2[i - 14], c1_lo = W2[i - 13], c2_hi = g0_512_hi(W2[i - 30], W2[i - 29]), c2_lo = g0_512_lo(W2[i - 30], W2[i - 29]), c3_hi = W2[i - 32], c3_lo = W2[i - 31]; + W2[i] = sum64_4_hi( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo + ), W2[i + 1] = sum64_4_lo( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo + ); + } +}, "_prepareBlock"); +SHA512$1.prototype._update = /* @__PURE__ */ __name(function(msg, start) { + this._prepareBlock(msg, start); + var W2 = this.W, ah = this.h[0], al = this.h[1], bh = this.h[2], bl = this.h[3], ch = this.h[4], cl = this.h[5], dh = this.h[6], dl = this.h[7], eh = this.h[8], el = this.h[9], fh = this.h[10], fl = this.h[11], gh = this.h[12], gl = this.h[13], hh = this.h[14], hl = this.h[15]; + assert$7(this.k.length === W2.length); + for (var i = 0; i < W2.length; i += 2) { + var c0_hi = hh, c0_lo = hl, c1_hi = s1_512_hi(eh, el), c1_lo = s1_512_lo(eh, el), c2_hi = ch64_hi(eh, el, fh, fl, gh), c2_lo = ch64_lo(eh, el, fh, fl, gh, gl), c3_hi = this.k[i], c3_lo = this.k[i + 1], c4_hi = W2[i], c4_lo = W2[i + 1], T1_hi = sum64_5_hi( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo, + c4_hi, + c4_lo + ), T1_lo = sum64_5_lo( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo, + c4_hi, + c4_lo + ); + c0_hi = s0_512_hi(ah, al), c0_lo = s0_512_lo(ah, al), c1_hi = maj64_hi(ah, al, bh, bl, ch), c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); + var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo), T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); + hh = gh, hl = gl, gh = fh, gl = fl, fh = eh, fl = el, eh = sum64_hi(dh, dl, T1_hi, T1_lo), el = sum64_lo(dl, dl, T1_hi, T1_lo), dh = ch, dl = cl, ch = bh, cl = bl, bh = ah, bl = al, ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo), al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); + } + sum64(this.h, 0, ah, al), sum64(this.h, 2, bh, bl), sum64(this.h, 4, ch, cl), sum64(this.h, 6, dh, dl), sum64(this.h, 8, eh, el), sum64(this.h, 10, fh, fl), sum64(this.h, 12, gh, gl), sum64(this.h, 14, hh, hl); +}, "_update"); +SHA512$1.prototype._digest = /* @__PURE__ */ __name(function(enc) { + return enc === "hex" ? utils$3.toHex32(this.h, "big") : utils$3.split32(this.h, "big"); +}, "digest"); +function ch64_hi(xh, xl, yh, yl, zh) { + var r2 = xh & yh ^ ~xh & zh; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(ch64_hi, "ch64_hi"); +function ch64_lo(xh, xl, yh, yl, zh, zl) { + var r2 = xl & yl ^ ~xl & zl; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(ch64_lo, "ch64_lo"); +function maj64_hi(xh, xl, yh, yl, zh) { + var r2 = xh & yh ^ xh & zh ^ yh & zh; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(maj64_hi, "maj64_hi"); +function maj64_lo(xh, xl, yh, yl, zh, zl) { + var r2 = xl & yl ^ xl & zl ^ yl & zl; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(maj64_lo, "maj64_lo"); +function s0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 28), c1_hi = rotr64_hi(xl, xh, 2), c2_hi = rotr64_hi(xl, xh, 7), r2 = c0_hi ^ c1_hi ^ c2_hi; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(s0_512_hi, "s0_512_hi"); +function s0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 28), c1_lo = rotr64_lo(xl, xh, 2), c2_lo = rotr64_lo(xl, xh, 7), r2 = c0_lo ^ c1_lo ^ c2_lo; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(s0_512_lo, "s0_512_lo"); +function s1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 14), c1_hi = rotr64_hi(xh, xl, 18), c2_hi = rotr64_hi(xl, xh, 9), r2 = c0_hi ^ c1_hi ^ c2_hi; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(s1_512_hi, "s1_512_hi"); +function s1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 14), c1_lo = rotr64_lo(xh, xl, 18), c2_lo = rotr64_lo(xl, xh, 9), r2 = c0_lo ^ c1_lo ^ c2_lo; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(s1_512_lo, "s1_512_lo"); +function g0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 1), c1_hi = rotr64_hi(xh, xl, 8), c2_hi = shr64_hi(xh, xl, 7), r2 = c0_hi ^ c1_hi ^ c2_hi; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(g0_512_hi, "g0_512_hi"); +function g0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 1), c1_lo = rotr64_lo(xh, xl, 8), c2_lo = shr64_lo(xh, xl, 7), r2 = c0_lo ^ c1_lo ^ c2_lo; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(g0_512_lo, "g0_512_lo"); +function g1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 19), c1_hi = rotr64_hi(xl, xh, 29), c2_hi = shr64_hi(xh, xl, 6), r2 = c0_hi ^ c1_hi ^ c2_hi; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(g1_512_hi, "g1_512_hi"); +function g1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 19), c1_lo = rotr64_lo(xl, xh, 29), c2_lo = shr64_lo(xh, xl, 6), r2 = c0_lo ^ c1_lo ^ c2_lo; + return r2 < 0 && (r2 += 4294967296), r2; +} +__name(g1_512_lo, "g1_512_lo"); +var utils$2 = utils$9, SHA512 = _512; +function SHA384() { + if (!(this instanceof SHA384)) + return new SHA384(); + SHA512.call(this), this.h = [ + 3418070365, + 3238371032, + 1654270250, + 914150663, + 2438529370, + 812702999, + 355462360, + 4144912697, + 1731405415, + 4290775857, + 2394180231, + 1750603025, + 3675008525, + 1694076839, + 1203062813, + 3204075428 + ]; +} +__name(SHA384, "SHA384"); +utils$2.inherits(SHA384, SHA512); +var _384 = SHA384; +SHA384.blockSize = 1024; +SHA384.outSize = 384; +SHA384.hmacStrength = 192; +SHA384.padLength = 128; +SHA384.prototype._digest = /* @__PURE__ */ __name(function(enc) { + return enc === "hex" ? utils$2.toHex32(this.h.slice(0, 12), "big") : utils$2.split32(this.h.slice(0, 12), "big"); +}, "digest"); +sha.sha1 = _1; +sha.sha224 = _224; +sha.sha256 = _256; +sha.sha384 = _384; +sha.sha512 = _512; +var ripemd = {}, utils$1 = utils$9, common = common$5, rotl32 = utils$1.rotl32, sum32 = utils$1.sum32, sum32_3 = utils$1.sum32_3, sum32_4 = utils$1.sum32_4, BlockHash = common.BlockHash; +function RIPEMD160() { + if (!(this instanceof RIPEMD160)) + return new RIPEMD160(); + BlockHash.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"; +} +__name(RIPEMD160, "RIPEMD160"); +utils$1.inherits(RIPEMD160, BlockHash); +ripemd.ripemd160 = RIPEMD160; +RIPEMD160.blockSize = 512; +RIPEMD160.outSize = 160; +RIPEMD160.hmacStrength = 192; +RIPEMD160.padLength = 64; +RIPEMD160.prototype._update = /* @__PURE__ */ __name(function(msg, start) { + for (var A2 = this.h[0], B2 = this.h[1], C2 = this.h[2], D2 = this.h[3], E2 = this.h[4], Ah = A2, Bh = B2, Ch = C2, Dh = D2, Eh = E2, j2 = 0; j2 < 80; j2++) { + var T2 = sum32( + rotl32( + sum32_4(A2, f$1(j2, B2, C2, D2), msg[r[j2] + start], K$2(j2)), + s[j2] + ), + E2 + ); + A2 = E2, E2 = D2, D2 = rotl32(C2, 10), C2 = B2, B2 = T2, T2 = sum32( + rotl32( + sum32_4(Ah, f$1(79 - j2, Bh, Ch, Dh), msg[rh[j2] + start], Kh(j2)), + sh[j2] + ), + Eh + ), Ah = Eh, Eh = Dh, Dh = rotl32(Ch, 10), Ch = Bh, Bh = T2; + } + T2 = sum32_3(this.h[1], C2, Dh), this.h[1] = sum32_3(this.h[2], D2, Eh), this.h[2] = sum32_3(this.h[3], E2, Ah), this.h[3] = sum32_3(this.h[4], A2, Bh), this.h[4] = sum32_3(this.h[0], B2, Ch), this.h[0] = T2; +}, "update"); +RIPEMD160.prototype._digest = /* @__PURE__ */ __name(function(enc) { + return enc === "hex" ? utils$1.toHex32(this.h, "little") : utils$1.split32(this.h, "little"); +}, "digest"); +function f$1(j2, x2, y2, z2) { + return j2 <= 15 ? x2 ^ y2 ^ z2 : j2 <= 31 ? x2 & y2 | ~x2 & z2 : j2 <= 47 ? (x2 | ~y2) ^ z2 : j2 <= 63 ? x2 & z2 | y2 & ~z2 : x2 ^ (y2 | ~z2); +} +__name(f$1, "f$1"); +function K$2(j2) { + return j2 <= 15 ? 0 : j2 <= 31 ? 1518500249 : j2 <= 47 ? 1859775393 : j2 <= 63 ? 2400959708 : 2840853838; +} +__name(K$2, "K$2"); +function Kh(j2) { + return j2 <= 15 ? 1352829926 : j2 <= 31 ? 1548603684 : j2 <= 47 ? 1836072691 : j2 <= 63 ? 2053994217 : 0; +} +__name(Kh, "Kh"); +var r = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 7, + 4, + 13, + 1, + 10, + 6, + 15, + 3, + 12, + 0, + 9, + 5, + 2, + 14, + 11, + 8, + 3, + 10, + 14, + 4, + 9, + 15, + 8, + 1, + 2, + 7, + 0, + 6, + 13, + 11, + 5, + 12, + 1, + 9, + 11, + 10, + 0, + 8, + 12, + 4, + 13, + 3, + 7, + 15, + 14, + 5, + 6, + 2, + 4, + 0, + 5, + 9, + 7, + 12, + 2, + 10, + 14, + 1, + 3, + 8, + 11, + 6, + 15, + 13 +], rh = [ + 5, + 14, + 7, + 0, + 9, + 2, + 11, + 4, + 13, + 6, + 15, + 8, + 1, + 10, + 3, + 12, + 6, + 11, + 3, + 7, + 0, + 13, + 5, + 10, + 14, + 15, + 8, + 12, + 4, + 9, + 1, + 2, + 15, + 5, + 1, + 3, + 7, + 14, + 6, + 9, + 11, + 8, + 12, + 2, + 10, + 0, + 4, + 13, + 8, + 6, + 4, + 1, + 3, + 11, + 15, + 0, + 5, + 12, + 2, + 13, + 9, + 7, + 10, + 14, + 12, + 15, + 10, + 4, + 1, + 5, + 8, + 7, + 6, + 2, + 13, + 14, + 0, + 3, + 9, + 11 +], s = [ + 11, + 14, + 15, + 12, + 5, + 8, + 7, + 9, + 11, + 13, + 14, + 15, + 6, + 7, + 9, + 8, + 7, + 6, + 8, + 13, + 11, + 9, + 7, + 15, + 7, + 12, + 15, + 9, + 11, + 7, + 13, + 12, + 11, + 13, + 6, + 7, + 14, + 9, + 13, + 15, + 14, + 8, + 13, + 6, + 5, + 12, + 7, + 5, + 11, + 12, + 14, + 15, + 14, + 15, + 9, + 8, + 9, + 14, + 5, + 6, + 8, + 6, + 5, + 12, + 9, + 15, + 5, + 11, + 6, + 8, + 13, + 12, + 5, + 12, + 13, + 14, + 11, + 8, + 5, + 6 +], sh = [ + 8, + 9, + 9, + 11, + 13, + 15, + 15, + 5, + 7, + 7, + 8, + 11, + 14, + 14, + 12, + 6, + 9, + 13, + 15, + 7, + 12, + 8, + 9, + 11, + 7, + 7, + 12, + 7, + 6, + 15, + 13, + 11, + 9, + 7, + 15, + 11, + 8, + 6, + 6, + 14, + 12, + 13, + 5, + 14, + 13, + 13, + 7, + 5, + 15, + 5, + 8, + 11, + 14, + 14, + 6, + 14, + 6, + 9, + 12, + 9, + 12, + 5, + 15, + 8, + 8, + 5, + 12, + 9, + 12, + 5, + 14, + 6, + 8, + 13, + 6, + 5, + 15, + 13, + 11, + 11 +], utils = utils$9, assert$6 = minimalisticAssert$1; +function Hmac(hash2, key2, enc) { + if (!(this instanceof Hmac)) + return new Hmac(hash2, key2, enc); + this.Hash = hash2, this.blockSize = hash2.blockSize / 8, this.outSize = hash2.outSize / 8, this.inner = null, this.outer = null, this._init(utils.toArray(key2, enc)); +} +__name(Hmac, "Hmac"); +var hmac = Hmac; +Hmac.prototype._init = /* @__PURE__ */ __name(function(key2) { + key2.length > this.blockSize && (key2 = new this.Hash().update(key2).digest()), assert$6(key2.length <= this.blockSize); + for (var i = key2.length; i < this.blockSize; i++) + key2.push(0); + for (i = 0; i < key2.length; i++) + key2[i] ^= 54; + for (this.inner = new this.Hash().update(key2), i = 0; i < key2.length; i++) + key2[i] ^= 106; + this.outer = new this.Hash().update(key2); +}, "init"); +Hmac.prototype.update = /* @__PURE__ */ __name(function(msg, enc) { + return this.inner.update(msg, enc), this; +}, "update"); +Hmac.prototype.digest = /* @__PURE__ */ __name(function(enc) { + return this.outer.update(this.inner.digest()), this.outer.digest(enc); +}, "digest"); +(function(exports) { + var hash2 = exports; + hash2.utils = utils$9, hash2.common = common$5, hash2.sha = sha, hash2.ripemd = ripemd, hash2.hmac = hmac, hash2.sha1 = hash2.sha.sha1, hash2.sha256 = hash2.sha.sha256, hash2.sha224 = hash2.sha.sha224, hash2.sha384 = hash2.sha.sha384, hash2.sha512 = hash2.sha.sha512, hash2.ripemd160 = hash2.ripemd.ripemd160; +})(hash$1); +const hash = /* @__PURE__ */ getDefaultExportFromCjs(hash$1); +function createCommonjsModule(fn, basedir, module) { + return module = { + path: basedir, + exports: {}, + require: function(path, base2) { + return commonjsRequire(path, base2 ?? module.path); + } + }, fn(module, module.exports), module.exports; +} +__name(createCommonjsModule, "createCommonjsModule"); +function commonjsRequire() { + throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs"); +} +__name(commonjsRequire, "commonjsRequire"); +var minimalisticAssert = assert; +function assert(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); +} +__name(assert, "assert"); +assert.equal = /* @__PURE__ */ __name(function(l2, r2, msg) { + if (l2 != r2) + throw new Error(msg || "Assertion failed: " + l2 + " != " + r2); +}, "assertEqual"); +var utils_1 = createCommonjsModule(function(module, exports) { + var utils2 = exports; + function toArray2(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg != "string") { + for (var i = 0; i < msg.length; i++) + res[i] = msg[i] | 0; + return res; + } + if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""), msg.length % 2 !== 0 && (msg = "0" + msg); + for (var i = 0; i < msg.length; i += 2) + res.push(parseInt(msg[i] + msg[i + 1], 16)); + } else + for (var i = 0; i < msg.length; i++) { + var c = msg.charCodeAt(i), hi = c >> 8, lo = c & 255; + hi ? res.push(hi, lo) : res.push(lo); + } + return res; + } + __name(toArray2, "toArray"), utils2.toArray = toArray2; + function zero22(word) { + return word.length === 1 ? "0" + word : word; + } + __name(zero22, "zero2"), utils2.zero2 = zero22; + function toHex2(msg) { + for (var res = "", i = 0; i < msg.length; i++) + res += zero22(msg[i].toString(16)); + return res; + } + __name(toHex2, "toHex"), utils2.toHex = toHex2, utils2.encode = /* @__PURE__ */ __name(function(arr, enc) { + return enc === "hex" ? toHex2(arr) : arr; + }, "encode"); +}), utils_1$1 = createCommonjsModule(function(module, exports) { + var utils2 = exports; + utils2.assert = minimalisticAssert, utils2.toArray = utils_1.toArray, utils2.zero2 = utils_1.zero2, utils2.toHex = utils_1.toHex, utils2.encode = utils_1.encode; + function getNAF2(num, w2, bits) { + var naf = new Array(Math.max(num.bitLength(), bits) + 1); + naf.fill(0); + for (var ws = 1 << w2 + 1, k2 = num.clone(), i = 0; i < naf.length; i++) { + var z2, mod = k2.andln(ws - 1); + k2.isOdd() ? (mod > (ws >> 1) - 1 ? z2 = (ws >> 1) - mod : z2 = mod, k2.isubn(z2)) : z2 = 0, naf[i] = z2, k2.iushrn(1); + } + return naf; + } + __name(getNAF2, "getNAF"), utils2.getNAF = getNAF2; + function getJSF2(k1, k2) { + var jsf = [ + [], + [] + ]; + k1 = k1.clone(), k2 = k2.clone(); + for (var d1 = 0, d2 = 0, m8; k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0; ) { + var m14 = k1.andln(3) + d1 & 3, m24 = k2.andln(3) + d2 & 3; + m14 === 3 && (m14 = -1), m24 === 3 && (m24 = -1); + var u1; + m14 & 1 ? (m8 = k1.andln(7) + d1 & 7, (m8 === 3 || m8 === 5) && m24 === 2 ? u1 = -m14 : u1 = m14) : u1 = 0, jsf[0].push(u1); + var u2; + m24 & 1 ? (m8 = k2.andln(7) + d2 & 7, (m8 === 3 || m8 === 5) && m14 === 2 ? u2 = -m24 : u2 = m24) : u2 = 0, jsf[1].push(u2), 2 * d1 === u1 + 1 && (d1 = 1 - d1), 2 * d2 === u2 + 1 && (d2 = 1 - d2), k1.iushrn(1), k2.iushrn(1); + } + return jsf; + } + __name(getJSF2, "getJSF"), utils2.getJSF = getJSF2; + function cachedProperty(obj, name, computer) { + var key2 = "_" + name; + obj.prototype[name] = /* @__PURE__ */ __name(function() { + return this[key2] !== void 0 ? this[key2] : this[key2] = computer.call(this); + }, "cachedProperty"); + } + __name(cachedProperty, "cachedProperty"), utils2.cachedProperty = cachedProperty; + function parseBytes(bytes) { + return typeof bytes == "string" ? utils2.toArray(bytes, "hex") : bytes; + } + __name(parseBytes, "parseBytes"), utils2.parseBytes = parseBytes; + function intFromLE(bytes) { + return new BN$1(bytes, "hex", "le"); + } + __name(intFromLE, "intFromLE"), utils2.intFromLE = intFromLE; +}), getNAF = utils_1$1.getNAF, getJSF = utils_1$1.getJSF, assert$1 = utils_1$1.assert; +function BaseCurve(type, conf) { + this.type = type, this.p = new BN$1(conf.p, 16), this.red = conf.prime ? BN$1.red(conf.prime) : BN$1.mont(this.p), this.zero = new BN$1(0).toRed(this.red), this.one = new BN$1(1).toRed(this.red), this.two = new BN$1(2).toRed(this.red), this.n = conf.n && new BN$1(conf.n, 16), this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n ? this.n.bitLength() : 0; + var adjustCount = this.n && this.p.div(this.n); + !adjustCount || adjustCount.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red)); +} +__name(BaseCurve, "BaseCurve"); +var base = BaseCurve; +BaseCurve.prototype.point = /* @__PURE__ */ __name(function() { + throw new Error("Not implemented"); +}, "point"); +BaseCurve.prototype.validate = /* @__PURE__ */ __name(function() { + throw new Error("Not implemented"); +}, "validate"); +BaseCurve.prototype._fixedNafMul = /* @__PURE__ */ __name(function(p2, k2) { + assert$1(p2.precomputed); + var doubles = p2._getDoubles(), naf = getNAF(k2, 1, this._bitLength), I2 = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1); + I2 /= 3; + var repr = [], j2, nafW; + for (j2 = 0; j2 < naf.length; j2 += doubles.step) { + nafW = 0; + for (var l2 = j2 + doubles.step - 1; l2 >= j2; l2--) + nafW = (nafW << 1) + naf[l2]; + repr.push(nafW); + } + for (var a = this.jpoint(null, null, null), b2 = this.jpoint(null, null, null), i = I2; i > 0; i--) { + for (j2 = 0; j2 < repr.length; j2++) + nafW = repr[j2], nafW === i ? b2 = b2.mixedAdd(doubles.points[j2]) : nafW === -i && (b2 = b2.mixedAdd(doubles.points[j2].neg())); + a = a.add(b2); + } + return a.toP(); +}, "_fixedNafMul"); +BaseCurve.prototype._wnafMul = /* @__PURE__ */ __name(function(p2, k2) { + var w2 = 4, nafPoints = p2._getNAFPoints(w2); + w2 = nafPoints.wnd; + for (var wnd = nafPoints.points, naf = getNAF(k2, w2, this._bitLength), acc = this.jpoint(null, null, null), i = naf.length - 1; i >= 0; i--) { + for (var l2 = 0; i >= 0 && naf[i] === 0; i--) + l2++; + if (i >= 0 && l2++, acc = acc.dblp(l2), i < 0) + break; + var z2 = naf[i]; + assert$1(z2 !== 0), p2.type === "affine" ? z2 > 0 ? acc = acc.mixedAdd(wnd[z2 - 1 >> 1]) : acc = acc.mixedAdd(wnd[-z2 - 1 >> 1].neg()) : z2 > 0 ? acc = acc.add(wnd[z2 - 1 >> 1]) : acc = acc.add(wnd[-z2 - 1 >> 1].neg()); + } + return p2.type === "affine" ? acc.toP() : acc; +}, "_wnafMul"); +BaseCurve.prototype._wnafMulAdd = /* @__PURE__ */ __name(function(defW, points, coeffs, len, jacobianResult) { + var wndWidth = this._wnafT1, wnd = this._wnafT2, naf = this._wnafT3, max = 0, i, j2, p2; + for (i = 0; i < len; i++) { + p2 = points[i]; + var nafPoints = p2._getNAFPoints(defW); + wndWidth[i] = nafPoints.wnd, wnd[i] = nafPoints.points; + } + for (i = len - 1; i >= 1; i -= 2) { + var a = i - 1, b2 = i; + if (wndWidth[a] !== 1 || wndWidth[b2] !== 1) { + naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength), naf[b2] = getNAF(coeffs[b2], wndWidth[b2], this._bitLength), max = Math.max(naf[a].length, max), max = Math.max(naf[b2].length, max); + continue; + } + var comb = [ + points[a], + /* 1 */ + null, + /* 3 */ + null, + /* 5 */ + points[b2] + /* 7 */ + ]; + points[a].y.cmp(points[b2].y) === 0 ? (comb[1] = points[a].add(points[b2]), comb[2] = points[a].toJ().mixedAdd(points[b2].neg())) : points[a].y.cmp(points[b2].y.redNeg()) === 0 ? (comb[1] = points[a].toJ().mixedAdd(points[b2]), comb[2] = points[a].add(points[b2].neg())) : (comb[1] = points[a].toJ().mixedAdd(points[b2]), comb[2] = points[a].toJ().mixedAdd(points[b2].neg())); + var index = [ + -3, + /* -1 -1 */ + -1, + /* -1 0 */ + -5, + /* -1 1 */ + -7, + /* 0 -1 */ + 0, + /* 0 0 */ + 7, + /* 0 1 */ + 5, + /* 1 -1 */ + 1, + /* 1 0 */ + 3 + /* 1 1 */ + ], jsf = getJSF(coeffs[a], coeffs[b2]); + for (max = Math.max(jsf[0].length, max), naf[a] = new Array(max), naf[b2] = new Array(max), j2 = 0; j2 < max; j2++) { + var ja = jsf[0][j2] | 0, jb = jsf[1][j2] | 0; + naf[a][j2] = index[(ja + 1) * 3 + (jb + 1)], naf[b2][j2] = 0, wnd[a] = comb; + } + } + var acc = this.jpoint(null, null, null), tmp = this._wnafT4; + for (i = max; i >= 0; i--) { + for (var k2 = 0; i >= 0; ) { + var zero = !0; + for (j2 = 0; j2 < len; j2++) + tmp[j2] = naf[j2][i] | 0, tmp[j2] !== 0 && (zero = !1); + if (!zero) + break; + k2++, i--; + } + if (i >= 0 && k2++, acc = acc.dblp(k2), i < 0) + break; + for (j2 = 0; j2 < len; j2++) { + var z2 = tmp[j2]; + z2 !== 0 && (z2 > 0 ? p2 = wnd[j2][z2 - 1 >> 1] : z2 < 0 && (p2 = wnd[j2][-z2 - 1 >> 1].neg()), p2.type === "affine" ? acc = acc.mixedAdd(p2) : acc = acc.add(p2)); + } + } + for (i = 0; i < len; i++) + wnd[i] = null; + return jacobianResult ? acc : acc.toP(); +}, "_wnafMulAdd"); +function BasePoint(curve, type) { + this.curve = curve, this.type = type, this.precomputed = null; +} +__name(BasePoint, "BasePoint"); +BaseCurve.BasePoint = BasePoint; +BasePoint.prototype.eq = /* @__PURE__ */ __name(function() { + throw new Error("Not implemented"); +}, "eq"); +BasePoint.prototype.validate = /* @__PURE__ */ __name(function() { + return this.curve.validate(this); +}, "validate"); +BaseCurve.prototype.decodePoint = /* @__PURE__ */ __name(function(bytes, enc) { + bytes = utils_1$1.toArray(bytes, enc); + var len = this.p.byteLength(); + if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) { + bytes[0] === 6 ? assert$1(bytes[bytes.length - 1] % 2 === 0) : bytes[0] === 7 && assert$1(bytes[bytes.length - 1] % 2 === 1); + var res = this.point( + bytes.slice(1, 1 + len), + bytes.slice(1 + len, 1 + 2 * len) + ); + return res; + } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3); + throw new Error("Unknown point format"); +}, "decodePoint"); +BasePoint.prototype.encodeCompressed = /* @__PURE__ */ __name(function(enc) { + return this.encode(enc, !0); +}, "encodeCompressed"); +BasePoint.prototype._encode = /* @__PURE__ */ __name(function(compact) { + var len = this.curve.p.byteLength(), x2 = this.getX().toArray("be", len); + return compact ? [this.getY().isEven() ? 2 : 3].concat(x2) : [4].concat(x2, this.getY().toArray("be", len)); +}, "_encode"); +BasePoint.prototype.encode = /* @__PURE__ */ __name(function(enc, compact) { + return utils_1$1.encode(this._encode(compact), enc); +}, "encode"); +BasePoint.prototype.precompute = /* @__PURE__ */ __name(function(power) { + if (this.precomputed) + return this; + var precomputed = { + doubles: null, + naf: null, + beta: null + }; + return precomputed.naf = this._getNAFPoints(8), precomputed.doubles = this._getDoubles(4, power), precomputed.beta = this._getBeta(), this.precomputed = precomputed, this; +}, "precompute"); +BasePoint.prototype._hasDoubles = /* @__PURE__ */ __name(function(k2) { + if (!this.precomputed) + return !1; + var doubles = this.precomputed.doubles; + return doubles ? doubles.points.length >= Math.ceil((k2.bitLength() + 1) / doubles.step) : !1; +}, "_hasDoubles"); +BasePoint.prototype._getDoubles = /* @__PURE__ */ __name(function(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + for (var doubles = [this], acc = this, i = 0; i < power; i += step) { + for (var j2 = 0; j2 < step; j2++) + acc = acc.dbl(); + doubles.push(acc); + } + return { + step, + points: doubles + }; +}, "_getDoubles"); +BasePoint.prototype._getNAFPoints = /* @__PURE__ */ __name(function(wnd) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + for (var res = [this], max = (1 << wnd) - 1, dbl3 = max === 1 ? null : this.dbl(), i = 1; i < max; i++) + res[i] = res[i - 1].add(dbl3); + return { + wnd, + points: res + }; +}, "_getNAFPoints"); +BasePoint.prototype._getBeta = /* @__PURE__ */ __name(function() { + return null; +}, "_getBeta"); +BasePoint.prototype.dblp = /* @__PURE__ */ __name(function(k2) { + for (var r2 = this, i = 0; i < k2; i++) + r2 = r2.dbl(); + return r2; +}, "dblp"); +var inherits_browser = createCommonjsModule(function(module) { + typeof Object.create == "function" ? module.exports = /* @__PURE__ */ __name(function(ctor, superCtor) { + superCtor && (ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: !1, + writable: !0, + configurable: !0 + } + })); + }, "inherits") : module.exports = /* @__PURE__ */ __name(function(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = /* @__PURE__ */ __name(function() { + }, "TempCtor"); + TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor(), ctor.prototype.constructor = ctor; + } + }, "inherits"); +}), assert$2 = utils_1$1.assert; +function ShortCurve(conf) { + base.call(this, "short", conf), this.a = new BN$1(conf.a, 16).toRed(this.red), this.b = new BN$1(conf.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(conf), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4); +} +__name(ShortCurve, "ShortCurve"); +inherits_browser(ShortCurve, base); +var short_1 = ShortCurve; +ShortCurve.prototype._getEndomorphism = /* @__PURE__ */ __name(function(conf) { + if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) { + var beta, lambda; + if (conf.beta) + beta = new BN$1(conf.beta, 16).toRed(this.red); + else { + var betas = this._getEndoRoots(this.p); + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1], beta = beta.toRed(this.red); + } + if (conf.lambda) + lambda = new BN$1(conf.lambda, 16); + else { + var lambdas = this._getEndoRoots(this.n); + this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0 ? lambda = lambdas[0] : (lambda = lambdas[1], assert$2(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0)); + } + var basis; + return conf.basis ? basis = conf.basis.map(function(vec) { + return { + a: new BN$1(vec.a, 16), + b: new BN$1(vec.b, 16) + }; + }) : basis = this._getEndoBasis(lambda), { + beta, + lambda, + basis + }; + } +}, "_getEndomorphism"); +ShortCurve.prototype._getEndoRoots = /* @__PURE__ */ __name(function(num) { + var red = num === this.p ? this.red : BN$1.mont(num), tinv = new BN$1(2).toRed(red).redInvm(), ntinv = tinv.redNeg(), s2 = new BN$1(3).toRed(red).redNeg().redSqrt().redMul(tinv), l1 = ntinv.redAdd(s2).fromRed(), l2 = ntinv.redSub(s2).fromRed(); + return [l1, l2]; +}, "_getEndoRoots"); +ShortCurve.prototype._getEndoBasis = /* @__PURE__ */ __name(function(lambda) { + for (var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), u2 = lambda, v2 = this.n.clone(), x1 = new BN$1(1), y1 = new BN$1(0), x2 = new BN$1(0), y2 = new BN$1(1), a0, b0, a1, b1, a2, b2, prevR, i = 0, r2, x3; u2.cmpn(0) !== 0; ) { + var q = v2.div(u2); + r2 = v2.sub(q.mul(u2)), x3 = x2.sub(q.mul(x1)); + var y3 = y2.sub(q.mul(y1)); + if (!a1 && r2.cmp(aprxSqrt) < 0) + a0 = prevR.neg(), b0 = x1, a1 = r2.neg(), b1 = x3; + else if (a1 && ++i === 2) + break; + prevR = r2, v2 = u2, u2 = r2, x2 = x1, x1 = x3, y2 = y1, y1 = y3; + } + a2 = r2.neg(), b2 = x3; + var len1 = a1.sqr().add(b1.sqr()), len2 = a2.sqr().add(b2.sqr()); + return len2.cmp(len1) >= 0 && (a2 = a0, b2 = b0), a1.negative && (a1 = a1.neg(), b1 = b1.neg()), a2.negative && (a2 = a2.neg(), b2 = b2.neg()), [ + { a: a1, b: b1 }, + { a: a2, b: b2 } + ]; +}, "_getEndoBasis"); +ShortCurve.prototype._endoSplit = /* @__PURE__ */ __name(function(k2) { + var basis = this.endo.basis, v1 = basis[0], v2 = basis[1], c1 = v2.b.mul(k2).divRound(this.n), c2 = v1.b.neg().mul(k2).divRound(this.n), p1 = c1.mul(v1.a), p2 = c2.mul(v2.a), q1 = c1.mul(v1.b), q2 = c2.mul(v2.b), k1 = k2.sub(p1).sub(p2), k22 = q1.add(q2).neg(); + return { k1, k2: k22 }; +}, "_endoSplit"); +ShortCurve.prototype.pointFromX = /* @__PURE__ */ __name(function(x2, odd) { + x2 = new BN$1(x2, 16), x2.red || (x2 = x2.toRed(this.red)); + var y2 = x2.redSqr().redMul(x2).redIAdd(x2.redMul(this.a)).redIAdd(this.b), y3 = y2.redSqrt(); + if (y3.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error("invalid point"); + var isOdd = y3.fromRed().isOdd(); + return (odd && !isOdd || !odd && isOdd) && (y3 = y3.redNeg()), this.point(x2, y3); +}, "pointFromX"); +ShortCurve.prototype.validate = /* @__PURE__ */ __name(function(point3) { + if (point3.inf) + return !0; + var x2 = point3.x, y2 = point3.y, ax = this.a.redMul(x2), rhs = x2.redSqr().redMul(x2).redIAdd(ax).redIAdd(this.b); + return y2.redSqr().redISub(rhs).cmpn(0) === 0; +}, "validate"); +ShortCurve.prototype._endoWnafMulAdd = /* @__PURE__ */ __name(function(points, coeffs, jacobianResult) { + for (var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2, i = 0; i < points.length; i++) { + var split = this._endoSplit(coeffs[i]), p2 = points[i], beta = p2._getBeta(); + split.k1.negative && (split.k1.ineg(), p2 = p2.neg(!0)), split.k2.negative && (split.k2.ineg(), beta = beta.neg(!0)), npoints[i * 2] = p2, npoints[i * 2 + 1] = beta, ncoeffs[i * 2] = split.k1, ncoeffs[i * 2 + 1] = split.k2; + } + for (var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult), j2 = 0; j2 < i * 2; j2++) + npoints[j2] = null, ncoeffs[j2] = null; + return res; +}, "_endoWnafMulAdd"); +function Point(curve, x2, y2, isRed) { + base.BasePoint.call(this, curve, "affine"), x2 === null && y2 === null ? (this.x = null, this.y = null, this.inf = !0) : (this.x = new BN$1(x2, 16), this.y = new BN$1(y2, 16), isRed && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1); +} +__name(Point, "Point"); +inherits_browser(Point, base.BasePoint); +ShortCurve.prototype.point = /* @__PURE__ */ __name(function(x2, y2, isRed) { + return new Point(this, x2, y2, isRed); +}, "point"); +ShortCurve.prototype.pointFromJSON = /* @__PURE__ */ __name(function(obj, red) { + return Point.fromJSON(this, obj, red); +}, "pointFromJSON"); +Point.prototype._getBeta = /* @__PURE__ */ __name(function() { + if (this.curve.endo) { + var pre = this.precomputed; + if (pre && pre.beta) + return pre.beta; + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve, endoMul = /* @__PURE__ */ __name(function(p2) { + return curve.point(p2.x.redMul(curve.endo.beta), p2.y); + }, "endoMul"); + pre.beta = beta, beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul) + } + }; + } + return beta; + } +}, "_getBeta"); +Point.prototype.toJSON = /* @__PURE__ */ __name(function() { + return this.precomputed ? [this.x, this.y, this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1) + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1) + } + }] : [this.x, this.y]; +}, "toJSON"); +Point.fromJSON = /* @__PURE__ */ __name(function(curve, obj, red) { + typeof obj == "string" && (obj = JSON.parse(obj)); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) + return res; + function obj2point(obj2) { + return curve.point(obj2[0], obj2[1], red); + } + __name(obj2point, "obj2point"); + var pre = obj[2]; + return res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [res].concat(pre.doubles.points.map(obj2point)) + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [res].concat(pre.naf.points.map(obj2point)) + } + }, res; +}, "fromJSON"); +Point.prototype.inspect = /* @__PURE__ */ __name(function() { + return this.isInfinity() ? "" : ""; +}, "inspect"); +Point.prototype.isInfinity = /* @__PURE__ */ __name(function() { + return this.inf; +}, "isInfinity"); +Point.prototype.add = /* @__PURE__ */ __name(function(p2) { + if (this.inf) + return p2; + if (p2.inf) + return this; + if (this.eq(p2)) + return this.dbl(); + if (this.neg().eq(p2)) + return this.curve.point(null, null); + if (this.x.cmp(p2.x) === 0) + return this.curve.point(null, null); + var c = this.y.redSub(p2.y); + c.cmpn(0) !== 0 && (c = c.redMul(this.x.redSub(p2.x).redInvm())); + var nx = c.redSqr().redISub(this.x).redISub(p2.x), ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}, "add"); +Point.prototype.dbl = /* @__PURE__ */ __name(function() { + if (this.inf) + return this; + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) + return this.curve.point(null, null); + var a = this.curve.a, x2 = this.x.redSqr(), dyinv = ys1.redInvm(), c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv), nx = c.redSqr().redISub(this.x.redAdd(this.x)), ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}, "dbl"); +Point.prototype.getX = /* @__PURE__ */ __name(function() { + return this.x.fromRed(); +}, "getX"); +Point.prototype.getY = /* @__PURE__ */ __name(function() { + return this.y.fromRed(); +}, "getY"); +Point.prototype.mul = /* @__PURE__ */ __name(function(k2) { + return k2 = new BN$1(k2, 16), this.isInfinity() ? this : this._hasDoubles(k2) ? this.curve._fixedNafMul(this, k2) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [k2]) : this.curve._wnafMul(this, k2); +}, "mul"); +Point.prototype.mulAdd = /* @__PURE__ */ __name(function(k1, p2, k2) { + var points = [this, p2], coeffs = [k1, k2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(points, coeffs) : this.curve._wnafMulAdd(1, points, coeffs, 2); +}, "mulAdd"); +Point.prototype.jmulAdd = /* @__PURE__ */ __name(function(k1, p2, k2) { + var points = [this, p2], coeffs = [k1, k2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(points, coeffs, !0) : this.curve._wnafMulAdd(1, points, coeffs, 2, !0); +}, "jmulAdd"); +Point.prototype.eq = /* @__PURE__ */ __name(function(p2) { + return this === p2 || this.inf === p2.inf && (this.inf || this.x.cmp(p2.x) === 0 && this.y.cmp(p2.y) === 0); +}, "eq"); +Point.prototype.neg = /* @__PURE__ */ __name(function(_precompute) { + if (this.inf) + return this; + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed, negate = /* @__PURE__ */ __name(function(p2) { + return p2.neg(); + }, "negate"); + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate) + } + }; + } + return res; +}, "neg"); +Point.prototype.toJ = /* @__PURE__ */ __name(function() { + if (this.inf) + return this.curve.jpoint(null, null, null); + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; +}, "toJ"); +function JPoint(curve, x2, y2, z2) { + base.BasePoint.call(this, curve, "jacobian"), x2 === null && y2 === null && z2 === null ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new BN$1(0)) : (this.x = new BN$1(x2, 16), this.y = new BN$1(y2, 16), this.z = new BN$1(z2, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; +} +__name(JPoint, "JPoint"); +inherits_browser(JPoint, base.BasePoint); +ShortCurve.prototype.jpoint = /* @__PURE__ */ __name(function(x2, y2, z2) { + return new JPoint(this, x2, y2, z2); +}, "jpoint"); +JPoint.prototype.toP = /* @__PURE__ */ __name(function() { + if (this.isInfinity()) + return this.curve.point(null, null); + var zinv = this.z.redInvm(), zinv2 = zinv.redSqr(), ax = this.x.redMul(zinv2), ay = this.y.redMul(zinv2).redMul(zinv); + return this.curve.point(ax, ay); +}, "toP"); +JPoint.prototype.neg = /* @__PURE__ */ __name(function() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); +}, "neg"); +JPoint.prototype.add = /* @__PURE__ */ __name(function(p2) { + if (this.isInfinity()) + return p2; + if (p2.isInfinity()) + return this; + var pz2 = p2.z.redSqr(), z2 = this.z.redSqr(), u1 = this.x.redMul(pz2), u2 = p2.x.redMul(z2), s1 = this.y.redMul(pz2.redMul(p2.z)), s2 = p2.y.redMul(z2.redMul(this.z)), h2 = u1.redSub(u2), r2 = s1.redSub(s2); + if (h2.cmpn(0) === 0) + return r2.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl(); + var h22 = h2.redSqr(), h3 = h22.redMul(h2), v2 = u1.redMul(h22), nx = r2.redSqr().redIAdd(h3).redISub(v2).redISub(v2), ny = r2.redMul(v2.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(p2.z).redMul(h2); + return this.curve.jpoint(nx, ny, nz); +}, "add"); +JPoint.prototype.mixedAdd = /* @__PURE__ */ __name(function(p2) { + if (this.isInfinity()) + return p2.toJ(); + if (p2.isInfinity()) + return this; + var z2 = this.z.redSqr(), u1 = this.x, u2 = p2.x.redMul(z2), s1 = this.y, s2 = p2.y.redMul(z2).redMul(this.z), h2 = u1.redSub(u2), r2 = s1.redSub(s2); + if (h2.cmpn(0) === 0) + return r2.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl(); + var h22 = h2.redSqr(), h3 = h22.redMul(h2), v2 = u1.redMul(h22), nx = r2.redSqr().redIAdd(h3).redISub(v2).redISub(v2), ny = r2.redMul(v2.redISub(nx)).redISub(s1.redMul(h3)), nz = this.z.redMul(h2); + return this.curve.jpoint(nx, ny, nz); +}, "mixedAdd"); +JPoint.prototype.dblp = /* @__PURE__ */ __name(function(pow) { + if (pow === 0) + return this; + if (this.isInfinity()) + return this; + if (!pow) + return this.dbl(); + var i; + if (this.curve.zeroA || this.curve.threeA) { + var r2 = this; + for (i = 0; i < pow; i++) + r2 = r2.dbl(); + return r2; + } + var a = this.curve.a, tinv = this.curve.tinv, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jyd = jy.redAdd(jy); + for (i = 0; i < pow; i++) { + var jx2 = jx.redSqr(), jyd2 = jyd.redSqr(), jyd4 = jyd2.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), t1 = jx.redMul(jyd2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), dny = c.redMul(t2); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + i + 1 < pow && (jz4 = jz4.redMul(jyd4)), jx = nx, jz = nz, jyd = dny; + } + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); +}, "dblp"); +JPoint.prototype.dbl = /* @__PURE__ */ __name(function() { + return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); +}, "dbl"); +JPoint.prototype._zeroDbl = /* @__PURE__ */ __name(function() { + var nx, ny, nz; + if (this.zOne) { + var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s2 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s2 = s2.redIAdd(s2); + var m2 = xx.redAdd(xx).redIAdd(xx), t = m2.redSqr().redISub(s2).redISub(s2), yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), nx = t, ny = m2.redMul(s2.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y); + } else { + var a = this.x.redSqr(), b2 = this.y.redSqr(), c = b2.redSqr(), d2 = this.x.redAdd(b2).redSqr().redISub(a).redISub(c); + d2 = d2.redIAdd(d2); + var e = a.redAdd(a).redIAdd(a), f2 = e.redSqr(), c8 = c.redIAdd(c); + c8 = c8.redIAdd(c8), c8 = c8.redIAdd(c8), nx = f2.redISub(d2).redISub(d2), ny = e.redMul(d2.redISub(nx)).redISub(c8), nz = this.y.redMul(this.z), nz = nz.redIAdd(nz); + } + return this.curve.jpoint(nx, ny, nz); +}, "_zeroDbl"); +JPoint.prototype._threeDbl = /* @__PURE__ */ __name(function() { + var nx, ny, nz; + if (this.zOne) { + var xx = this.x.redSqr(), yy = this.y.redSqr(), yyyy = yy.redSqr(), s2 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s2 = s2.redIAdd(s2); + var m2 = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a), t = m2.redSqr().redISub(s2).redISub(s2); + nx = t; + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8), yyyy8 = yyyy8.redIAdd(yyyy8), ny = m2.redMul(s2.redISub(t)).redISub(yyyy8), nz = this.y.redAdd(this.y); + } else { + var delta = this.z.redSqr(), gamma = this.y.redSqr(), beta = this.x.redMul(gamma), alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8), nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ggamma8 = ggamma8.redIAdd(ggamma8), ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + return this.curve.jpoint(nx, ny, nz); +}, "_threeDbl"); +JPoint.prototype._dbl = /* @__PURE__ */ __name(function() { + var a = this.curve.a, jx = this.x, jy = this.y, jz = this.z, jz4 = jz.redSqr().redSqr(), jx2 = jx.redSqr(), jy2 = jy.redSqr(), c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)), jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2), nx = c.redSqr().redISub(t1.redAdd(t1)), t2 = t1.redISub(nx), jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8), jyd8 = jyd8.redIAdd(jyd8); + var ny = c.redMul(t2).redISub(jyd8), nz = jy.redAdd(jy).redMul(jz); + return this.curve.jpoint(nx, ny, nz); +}, "_dbl"); +JPoint.prototype.trpl = /* @__PURE__ */ __name(function() { + if (!this.curve.zeroA) + return this.dbl().add(this); + var xx = this.x.redSqr(), yy = this.y.redSqr(), zz = this.z.redSqr(), yyyy = yy.redSqr(), m2 = xx.redAdd(xx).redIAdd(xx), mm = m2.redSqr(), e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e = e.redIAdd(e), e = e.redAdd(e).redIAdd(e), e = e.redISub(mm); + var ee2 = e.redSqr(), t = yyyy.redIAdd(yyyy); + t = t.redIAdd(t), t = t.redIAdd(t), t = t.redIAdd(t); + var u2 = m2.redIAdd(e).redSqr().redISub(mm).redISub(ee2).redISub(t), yyu4 = yy.redMul(u2); + yyu4 = yyu4.redIAdd(yyu4), yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee2).redISub(yyu4); + nx = nx.redIAdd(nx), nx = nx.redIAdd(nx); + var ny = this.y.redMul(u2.redMul(t.redISub(u2)).redISub(e.redMul(ee2))); + ny = ny.redIAdd(ny), ny = ny.redIAdd(ny), ny = ny.redIAdd(ny); + var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee2); + return this.curve.jpoint(nx, ny, nz); +}, "trpl"); +JPoint.prototype.mul = /* @__PURE__ */ __name(function(k2, kbase) { + return k2 = new BN$1(k2, kbase), this.curve._wnafMul(this, k2); +}, "mul"); +JPoint.prototype.eq = /* @__PURE__ */ __name(function(p2) { + if (p2.type === "affine") + return this.eq(p2.toJ()); + if (this === p2) + return !0; + var z2 = this.z.redSqr(), pz2 = p2.z.redSqr(); + if (this.x.redMul(pz2).redISub(p2.x.redMul(z2)).cmpn(0) !== 0) + return !1; + var z3 = z2.redMul(this.z), pz3 = pz2.redMul(p2.z); + return this.y.redMul(pz3).redISub(p2.y.redMul(z3)).cmpn(0) === 0; +}, "eq"); +JPoint.prototype.eqXToP = /* @__PURE__ */ __name(function(x2) { + var zs = this.z.redSqr(), rx = x2.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) + return !0; + for (var xc = x2.clone(), t = this.curve.redN.redMul(zs); ; ) { + if (xc.iadd(this.curve.n), xc.cmp(this.curve.p) >= 0) + return !1; + if (rx.redIAdd(t), this.x.cmp(rx) === 0) + return !0; + } +}, "eqXToP"); +JPoint.prototype.inspect = /* @__PURE__ */ __name(function() { + return this.isInfinity() ? "" : ""; +}, "inspect"); +JPoint.prototype.isInfinity = /* @__PURE__ */ __name(function() { + return this.z.cmpn(0) === 0; +}, "isInfinity"); +var curve_1 = createCommonjsModule(function(module, exports) { + var curve = exports; + curve.base = base, curve.short = short_1, curve.mont = /*RicMoo:ethers:require(./mont)*/ + null, curve.edwards = /*RicMoo:ethers:require(./edwards)*/ + null; +}), curves_1 = createCommonjsModule(function(module, exports) { + var curves = exports, assert2 = utils_1$1.assert; + function PresetCurve(options) { + options.type === "short" ? this.curve = new curve_1.short(options) : options.type === "edwards" ? this.curve = new curve_1.edwards(options) : this.curve = new curve_1.mont(options), this.g = this.curve.g, this.n = this.curve.n, this.hash = options.hash, assert2(this.g.validate(), "Invalid curve"), assert2(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); + } + __name(PresetCurve, "PresetCurve"), curves.PresetCurve = PresetCurve; + function defineCurve(name, options) { + Object.defineProperty(curves, name, { + configurable: !0, + enumerable: !0, + get: function() { + var curve = new PresetCurve(options); + return Object.defineProperty(curves, name, { + configurable: !0, + enumerable: !0, + value: curve + }), curve; + } + }); + } + __name(defineCurve, "defineCurve"), defineCurve("p192", { + type: "short", + prime: "p192", + p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc", + b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", + n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831", + hash: hash.sha256, + gRed: !1, + g: [ + "188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", + "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811" + ] + }), defineCurve("p224", { + type: "short", + prime: "p224", + p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe", + b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4", + n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", + hash: hash.sha256, + gRed: !1, + g: [ + "b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", + "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34" + ] + }), defineCurve("p256", { + type: "short", + prime: null, + p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff", + a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc", + b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b", + n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551", + hash: hash.sha256, + gRed: !1, + g: [ + "6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", + "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5" + ] + }), defineCurve("p384", { + type: "short", + prime: null, + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff", + a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc", + b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", + n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973", + hash: hash.sha384, + gRed: !1, + g: [ + "aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", + "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f" + ] + }), defineCurve("p521", { + type: "short", + prime: null, + p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", + a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc", + b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00", + n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409", + hash: hash.sha512, + gRed: !1, + g: [ + "000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", + "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650" + ] + }), defineCurve("curve25519", { + type: "mont", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "76d06", + b: "1", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: !1, + g: [ + "9" + ] + }), defineCurve("ed25519", { + type: "edwards", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "-1", + c: "1", + // -121665 * (121666^(-1)) (mod P) + d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: !1, + g: [ + "216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", + // 4/5 + "6666666666666666666666666666666666666666666666666666666666666658" + ] + }); + var pre; + try { + pre = /*RicMoo:ethers:require(./precomputed/secp256k1)*/ + null.crash(); + } catch { + pre = void 0; + } + defineCurve("secp256k1", { + type: "short", + prime: "k256", + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f", + a: "0", + b: "7", + n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141", + h: "1", + hash: hash.sha256, + // Precomputed endomorphism + beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", + lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", + basis: [ + { + a: "3086d221a7d46bcde86c90e49284eb15", + b: "-e4437ed6010e88286f547fa90abfe4c3" + }, + { + a: "114ca50f7a8e2f3f657c1108d9d44cfd8", + b: "3086d221a7d46bcde86c90e49284eb15" + } + ], + gRed: !1, + g: [ + "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + pre + ] + }); +}); +function HmacDRBG(options) { + if (!(this instanceof HmacDRBG)) + return new HmacDRBG(options); + this.hash = options.hash, this.predResist = !!options.predResist, this.outLen = this.hash.outSize, this.minEntropy = options.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; + var entropy = utils_1.toArray(options.entropy, options.entropyEnc || "hex"), nonce = utils_1.toArray(options.nonce, options.nonceEnc || "hex"), pers = utils_1.toArray(options.pers, options.persEnc || "hex"); + minimalisticAssert( + entropy.length >= this.minEntropy / 8, + "Not enough entropy. Minimum is: " + this.minEntropy + " bits" + ), this._init(entropy, nonce, pers); +} +__name(HmacDRBG, "HmacDRBG"); +var hmacDrbg = HmacDRBG; +HmacDRBG.prototype._init = /* @__PURE__ */ __name(function(entropy, nonce, pers) { + var seed = entropy.concat(nonce).concat(pers); + this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8); + for (var i = 0; i < this.V.length; i++) + this.K[i] = 0, this.V[i] = 1; + this._update(seed), this._reseed = 1, this.reseedInterval = 281474976710656; +}, "init"); +HmacDRBG.prototype._hmac = /* @__PURE__ */ __name(function() { + return new hash.hmac(this.hash, this.K); +}, "hmac"); +HmacDRBG.prototype._update = /* @__PURE__ */ __name(function(seed) { + var kmac = this._hmac().update(this.V).update([0]); + seed && (kmac = kmac.update(seed)), this.K = kmac.digest(), this.V = this._hmac().update(this.V).digest(), seed && (this.K = this._hmac().update(this.V).update([1]).update(seed).digest(), this.V = this._hmac().update(this.V).digest()); +}, "update"); +HmacDRBG.prototype.reseed = /* @__PURE__ */ __name(function(entropy, entropyEnc, add3, addEnc) { + typeof entropyEnc != "string" && (addEnc = add3, add3 = entropyEnc, entropyEnc = null), entropy = utils_1.toArray(entropy, entropyEnc), add3 = utils_1.toArray(add3, addEnc), minimalisticAssert( + entropy.length >= this.minEntropy / 8, + "Not enough entropy. Minimum is: " + this.minEntropy + " bits" + ), this._update(entropy.concat(add3 || [])), this._reseed = 1; +}, "reseed"); +HmacDRBG.prototype.generate = /* @__PURE__ */ __name(function(len, enc, add3, addEnc) { + if (this._reseed > this.reseedInterval) + throw new Error("Reseed is required"); + typeof enc != "string" && (addEnc = add3, add3 = enc, enc = null), add3 && (add3 = utils_1.toArray(add3, addEnc || "hex"), this._update(add3)); + for (var temp = []; temp.length < len; ) + this.V = this._hmac().update(this.V).digest(), temp = temp.concat(this.V); + var res = temp.slice(0, len); + return this._update(add3), this._reseed++, utils_1.encode(res, enc); +}, "generate"); +var assert$3 = utils_1$1.assert; +function KeyPair(ec2, options) { + this.ec = ec2, this.priv = null, this.pub = null, options.priv && this._importPrivate(options.priv, options.privEnc), options.pub && this._importPublic(options.pub, options.pubEnc); +} +__name(KeyPair, "KeyPair"); +var key = KeyPair; +KeyPair.fromPublic = /* @__PURE__ */ __name(function(ec2, pub, enc) { + return pub instanceof KeyPair ? pub : new KeyPair(ec2, { + pub, + pubEnc: enc + }); +}, "fromPublic"); +KeyPair.fromPrivate = /* @__PURE__ */ __name(function(ec2, priv, enc) { + return priv instanceof KeyPair ? priv : new KeyPair(ec2, { + priv, + privEnc: enc + }); +}, "fromPrivate"); +KeyPair.prototype.validate = /* @__PURE__ */ __name(function() { + var pub = this.getPublic(); + return pub.isInfinity() ? { result: !1, reason: "Invalid public key" } : pub.validate() ? pub.mul(this.ec.curve.n).isInfinity() ? { result: !0, reason: null } : { result: !1, reason: "Public key * N != O" } : { result: !1, reason: "Public key is not a point" }; +}, "validate"); +KeyPair.prototype.getPublic = /* @__PURE__ */ __name(function(compact, enc) { + return typeof compact == "string" && (enc = compact, compact = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), enc ? this.pub.encode(enc, compact) : this.pub; +}, "getPublic"); +KeyPair.prototype.getPrivate = /* @__PURE__ */ __name(function(enc) { + return enc === "hex" ? this.priv.toString(16, 2) : this.priv; +}, "getPrivate"); +KeyPair.prototype._importPrivate = /* @__PURE__ */ __name(function(key2, enc) { + this.priv = new BN$1(key2, enc || 16), this.priv = this.priv.umod(this.ec.curve.n); +}, "_importPrivate"); +KeyPair.prototype._importPublic = /* @__PURE__ */ __name(function(key2, enc) { + if (key2.x || key2.y) { + this.ec.curve.type === "mont" ? assert$3(key2.x, "Need x coordinate") : (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") && assert$3(key2.x && key2.y, "Need both x and y coordinate"), this.pub = this.ec.curve.point(key2.x, key2.y); + return; + } + this.pub = this.ec.curve.decodePoint(key2, enc); +}, "_importPublic"); +KeyPair.prototype.derive = /* @__PURE__ */ __name(function(pub) { + return pub.validate() || assert$3(pub.validate(), "public point not validated"), pub.mul(this.priv).getX(); +}, "derive"); +KeyPair.prototype.sign = /* @__PURE__ */ __name(function(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); +}, "sign"); +KeyPair.prototype.verify = /* @__PURE__ */ __name(function(msg, signature2) { + return this.ec.verify(msg, signature2, this); +}, "verify"); +KeyPair.prototype.inspect = /* @__PURE__ */ __name(function() { + return ""; +}, "inspect"); +var assert$4 = utils_1$1.assert; +function Signature(options, enc) { + if (options instanceof Signature) + return options; + this._importDER(options, enc) || (assert$4(options.r && options.s, "Signature without r or s"), this.r = new BN$1(options.r, 16), this.s = new BN$1(options.s, 16), options.recoveryParam === void 0 ? this.recoveryParam = null : this.recoveryParam = options.recoveryParam); +} +__name(Signature, "Signature"); +var signature = Signature; +function Position() { + this.place = 0; +} +__name(Position, "Position"); +function getLength(buf, p2) { + var initial = buf[p2.place++]; + if (!(initial & 128)) + return initial; + var octetLen = initial & 15; + if (octetLen === 0 || octetLen > 4) + return !1; + for (var val = 0, i = 0, off = p2.place; i < octetLen; i++, off++) + val <<= 8, val |= buf[off], val >>>= 0; + return val <= 127 ? !1 : (p2.place = off, val); +} +__name(getLength, "getLength"); +function rmPadding(buf) { + for (var i = 0, len = buf.length - 1; !buf[i] && !(buf[i + 1] & 128) && i < len; ) + i++; + return i === 0 ? buf : buf.slice(i); +} +__name(rmPadding, "rmPadding"); +Signature.prototype._importDER = /* @__PURE__ */ __name(function(data, enc) { + data = utils_1$1.toArray(data, enc); + var p2 = new Position(); + if (data[p2.place++] !== 48) + return !1; + var len = getLength(data, p2); + if (len === !1 || len + p2.place !== data.length || data[p2.place++] !== 2) + return !1; + var rlen = getLength(data, p2); + if (rlen === !1) + return !1; + var r2 = data.slice(p2.place, rlen + p2.place); + if (p2.place += rlen, data[p2.place++] !== 2) + return !1; + var slen = getLength(data, p2); + if (slen === !1 || data.length !== slen + p2.place) + return !1; + var s2 = data.slice(p2.place, slen + p2.place); + if (r2[0] === 0) + if (r2[1] & 128) + r2 = r2.slice(1); + else + return !1; + if (s2[0] === 0) + if (s2[1] & 128) + s2 = s2.slice(1); + else + return !1; + return this.r = new BN$1(r2), this.s = new BN$1(s2), this.recoveryParam = null, !0; +}, "_importDER"); +function constructLength(arr, len) { + if (len < 128) { + arr.push(len); + return; + } + var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); + for (arr.push(octets | 128); --octets; ) + arr.push(len >>> (octets << 3) & 255); + arr.push(len); +} +__name(constructLength, "constructLength"); +Signature.prototype.toDER = /* @__PURE__ */ __name(function(enc) { + var r2 = this.r.toArray(), s2 = this.s.toArray(); + for (r2[0] & 128 && (r2 = [0].concat(r2)), s2[0] & 128 && (s2 = [0].concat(s2)), r2 = rmPadding(r2), s2 = rmPadding(s2); !s2[0] && !(s2[1] & 128); ) + s2 = s2.slice(1); + var arr = [2]; + constructLength(arr, r2.length), arr = arr.concat(r2), arr.push(2), constructLength(arr, s2.length); + var backHalf = arr.concat(s2), res = [48]; + return constructLength(res, backHalf.length), res = res.concat(backHalf), utils_1$1.encode(res, enc); +}, "toDER"); +var rand = ( + /*RicMoo:ethers:require(brorand)*/ + /* @__PURE__ */ __name(function() { + throw new Error("unsupported"); + }, "rand") +), assert$5 = utils_1$1.assert; +function EC(options) { + if (!(this instanceof EC)) + return new EC(options); + typeof options == "string" && (assert$5( + Object.prototype.hasOwnProperty.call(curves_1, options), + "Unknown curve " + options + ), options = curves_1[options]), options instanceof curves_1.PresetCurve && (options = { curve: options }), this.curve = options.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = options.curve.g, this.g.precompute(options.curve.n.bitLength() + 1), this.hash = options.hash || options.curve.hash; +} +__name(EC, "EC"); +var ec = EC; +EC.prototype.keyPair = /* @__PURE__ */ __name(function(options) { + return new key(this, options); +}, "keyPair"); +EC.prototype.keyFromPrivate = /* @__PURE__ */ __name(function(priv, enc) { + return key.fromPrivate(this, priv, enc); +}, "keyFromPrivate"); +EC.prototype.keyFromPublic = /* @__PURE__ */ __name(function(pub, enc) { + return key.fromPublic(this, pub, enc); +}, "keyFromPublic"); +EC.prototype.genKeyPair = /* @__PURE__ */ __name(function(options) { + options || (options = {}); + for (var drbg = new hmacDrbg({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || "utf8", + entropy: options.entropy || rand(this.hash.hmacStrength), + entropyEnc: options.entropy && options.entropyEnc || "utf8", + nonce: this.n.toArray() + }), bytes = this.n.byteLength(), ns2 = this.n.sub(new BN$1(2)); ; ) { + var priv = new BN$1(drbg.generate(bytes)); + if (!(priv.cmp(ns2) > 0)) + return priv.iaddn(1), this.keyFromPrivate(priv); + } +}, "genKeyPair"); +EC.prototype._truncateToN = /* @__PURE__ */ __name(function(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + return delta > 0 && (msg = msg.ushrn(delta)), !truncOnly && msg.cmp(this.n) >= 0 ? msg.sub(this.n) : msg; +}, "_truncateToN"); +EC.prototype.sign = /* @__PURE__ */ __name(function(msg, key2, enc, options) { + typeof enc == "object" && (options = enc, enc = null), options || (options = {}), key2 = this.keyFromPrivate(key2, enc), msg = this._truncateToN(new BN$1(msg, 16)); + for (var bytes = this.n.byteLength(), bkey = key2.getPrivate().toArray("be", bytes), nonce = msg.toArray("be", bytes), drbg = new hmacDrbg({ + hash: this.hash, + entropy: bkey, + nonce, + pers: options.pers, + persEnc: options.persEnc || "utf8" + }), ns1 = this.n.sub(new BN$1(1)), iter = 0; ; iter++) { + var k2 = options.k ? options.k(iter) : new BN$1(drbg.generate(this.n.byteLength())); + if (k2 = this._truncateToN(k2, !0), !(k2.cmpn(1) <= 0 || k2.cmp(ns1) >= 0)) { + var kp = this.g.mul(k2); + if (!kp.isInfinity()) { + var kpX = kp.getX(), r2 = kpX.umod(this.n); + if (r2.cmpn(0) !== 0) { + var s2 = k2.invm(this.n).mul(r2.mul(key2.getPrivate()).iadd(msg)); + if (s2 = s2.umod(this.n), s2.cmpn(0) !== 0) { + var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r2) !== 0 ? 2 : 0); + return options.canonical && s2.cmp(this.nh) > 0 && (s2 = this.n.sub(s2), recoveryParam ^= 1), new signature({ r: r2, s: s2, recoveryParam }); + } + } + } + } + } +}, "sign"); +EC.prototype.verify = /* @__PURE__ */ __name(function(msg, signature$1, key2, enc) { + msg = this._truncateToN(new BN$1(msg, 16)), key2 = this.keyFromPublic(key2, enc), signature$1 = new signature(signature$1, "hex"); + var r2 = signature$1.r, s2 = signature$1.s; + if (r2.cmpn(1) < 0 || r2.cmp(this.n) >= 0 || s2.cmpn(1) < 0 || s2.cmp(this.n) >= 0) + return !1; + var sinv = s2.invm(this.n), u1 = sinv.mul(msg).umod(this.n), u2 = sinv.mul(r2).umod(this.n), p2; + return this.curve._maxwellTrick ? (p2 = this.g.jmulAdd(u1, key2.getPublic(), u2), p2.isInfinity() ? !1 : p2.eqXToP(r2)) : (p2 = this.g.mulAdd(u1, key2.getPublic(), u2), p2.isInfinity() ? !1 : p2.getX().umod(this.n).cmp(r2) === 0); +}, "verify"); +EC.prototype.recoverPubKey = function(msg, signature$1, j2, enc) { + assert$5((3 & j2) === j2, "The recovery param is more than two bits"), signature$1 = new signature(signature$1, enc); + var n = this.n, e = new BN$1(msg), r2 = signature$1.r, s2 = signature$1.s, isYOdd = j2 & 1, isSecondKey = j2 >> 1; + if (r2.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error("Unable to find sencond key candinate"); + isSecondKey ? r2 = this.curve.pointFromX(r2.add(this.curve.n), isYOdd) : r2 = this.curve.pointFromX(r2, isYOdd); + var rInv = signature$1.r.invm(n), s1 = n.sub(e).mul(rInv).umod(n), s22 = s2.mul(rInv).umod(n); + return this.g.mulAdd(s1, r2, s22); +}; +EC.prototype.getKeyRecoveryParam = function(e, signature$1, Q2, enc) { + if (signature$1 = new signature(signature$1, enc), signature$1.recoveryParam !== null) + return signature$1.recoveryParam; + for (var i = 0; i < 4; i++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e, signature$1, i); + } catch { + continue; + } + if (Qprime.eq(Q2)) + return i; + } + throw new Error("Unable to find valid recovery factor"); +}; +var elliptic_1 = createCommonjsModule(function(module, exports) { + var elliptic = exports; + elliptic.version = "6.5.4", elliptic.utils = utils_1$1, elliptic.rand = /*RicMoo:ethers:require(brorand)*/ + function() { + throw new Error("unsupported"); + }, elliptic.curve = curve_1, elliptic.curves = curves_1, elliptic.ec = ec, elliptic.eddsa = /*RicMoo:ethers:require(./elliptic/eddsa)*/ + null; +}), EC$1 = elliptic_1.ec; +const version = "signing-key/5.7.0", logger = new Logger(version); +let _curve = null; +function getCurve() { + return _curve || (_curve = new EC$1("secp256k1")), _curve; +} +__name(getCurve, "getCurve"); +const _SigningKey = class _SigningKey { + constructor(privateKey) { + defineReadOnly(this, "curve", "secp256k1"), defineReadOnly(this, "privateKey", hexlify(privateKey)), hexDataLength(this.privateKey) !== 32 && logger.throwArgumentError("invalid private key", "privateKey", "[[ REDACTED ]]"); + const keyPair2 = getCurve().keyFromPrivate(arrayify(this.privateKey)); + defineReadOnly(this, "publicKey", "0x" + keyPair2.getPublic(!1, "hex")), defineReadOnly(this, "compressedPublicKey", "0x" + keyPair2.getPublic(!0, "hex")), defineReadOnly(this, "_isSigningKey", !0); + } + _addPoint(other) { + const p0 = getCurve().keyFromPublic(arrayify(this.publicKey)), p1 = getCurve().keyFromPublic(arrayify(other)); + return "0x" + p0.pub.add(p1.pub).encodeCompressed("hex"); + } + signDigest(digest9) { + const keyPair2 = getCurve().keyFromPrivate(arrayify(this.privateKey)), digestBytes = arrayify(digest9); + digestBytes.length !== 32 && logger.throwArgumentError("bad digest length", "digest", digest9); + const signature2 = keyPair2.sign(digestBytes, { canonical: !0 }); + return splitSignature({ + recoveryParam: signature2.recoveryParam, + r: hexZeroPad("0x" + signature2.r.toString(16), 32), + s: hexZeroPad("0x" + signature2.s.toString(16), 32) + }); + } + computeSharedSecret(otherKey) { + const keyPair2 = getCurve().keyFromPrivate(arrayify(this.privateKey)), otherKeyPair = getCurve().keyFromPublic(arrayify(computePublicKey(otherKey))); + return hexZeroPad("0x" + keyPair2.derive(otherKeyPair.getPublic()).toString(16), 32); + } + static isSigningKey(value) { + return !!(value && value._isSigningKey); + } +}; +__name(_SigningKey, "SigningKey"); +let SigningKey = _SigningKey; +function recoverPublicKey(digest9, signature2) { + const sig = splitSignature(signature2), rs = { r: arrayify(sig.r), s: arrayify(sig.s) }; + return "0x" + getCurve().recoverPubKey(arrayify(digest9), rs, sig.recoveryParam).encode("hex", !1); +} +__name(recoverPublicKey, "recoverPublicKey"); +function computePublicKey(key2, compressed) { + const bytes = arrayify(key2); + if (bytes.length === 32) { + const signingKey = new SigningKey(bytes); + return compressed ? "0x" + getCurve().keyFromPrivate(bytes).getPublic(!0, "hex") : signingKey.publicKey; + } else { + if (bytes.length === 33) + return compressed ? hexlify(bytes) : "0x" + getCurve().keyFromPublic(bytes).getPublic(!1, "hex"); + if (bytes.length === 65) + return compressed ? "0x" + getCurve().keyFromPublic(bytes).getPublic(!0, "hex") : hexlify(bytes); + } + return logger.throwArgumentError("invalid public or private key", "key", "[REDACTED]"); +} +__name(computePublicKey, "computePublicKey"); +var TransactionTypes; +(function(TransactionTypes2) { + TransactionTypes2[TransactionTypes2.legacy = 0] = "legacy", TransactionTypes2[TransactionTypes2.eip2930 = 1] = "eip2930", TransactionTypes2[TransactionTypes2.eip1559 = 2] = "eip1559"; +})(TransactionTypes || (TransactionTypes = {})); +function computeAddress(key2) { + const publicKey = computePublicKey(key2); + return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12)); +} +__name(computeAddress, "computeAddress"); +function recoverAddress(digest9, signature2) { + return computeAddress(recoverPublicKey(arrayify(digest9), signature2)); +} +__name(recoverAddress, "recoverAddress"); +function unfetch_module(e, n) { + return n = n || {}, new Promise(function(t, r2) { + var s2 = new XMLHttpRequest(), o2 = [], u2 = [], i = {}, a = /* @__PURE__ */ __name(function() { + return { ok: (s2.status / 100 | 0) == 2, statusText: s2.statusText, status: s2.status, url: s2.responseURL, text: function() { + return Promise.resolve(s2.responseText); + }, json: function() { + return Promise.resolve(s2.responseText).then(JSON.parse); + }, blob: function() { + return Promise.resolve(new Blob([s2.response])); + }, clone: a, headers: { keys: function() { + return o2; + }, entries: function() { + return u2; + }, get: function(e2) { + return i[e2.toLowerCase()]; + }, has: function(e2) { + return e2.toLowerCase() in i; + } } }; + }, "a"); + for (var l2 in s2.open(n.method || "get", e, !0), s2.onload = function() { + s2.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e2, n2, t2) { + o2.push(n2 = n2.toLowerCase()), u2.push([n2, t2]), i[n2] = i[n2] ? i[n2] + "," + t2 : t2; + }), t(a()); + }, s2.onerror = r2, s2.withCredentials = n.credentials == "include", n.headers) + s2.setRequestHeader(l2, n.headers[l2]); + s2.send(n.body || null); + }); +} +__name(unfetch_module, "unfetch_module"); +const unfetch_module$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + default: unfetch_module +}, Symbol.toStringTag, { value: "Module" })), require$$0 = /* @__PURE__ */ getAugmentedNamespace(unfetch_module$1); +var browser = self.fetch || (self.fetch = require$$0.default || require$$0); +const ke = /* @__PURE__ */ getDefaultExportFromCjs(browser); +var _a; +let G$2 = (_a = class { + constructor(t) { + this.client = t; + } +}, __name(_a, "G"), _a); +var _a2; +let H$1 = (_a2 = class { + constructor(t) { + this.opts = t; + } +}, __name(_a2, "H"), _a2); +const Y = "https://rpc.walletconnect.com/v1", R$1 = { wc_authRequest: { req: { ttl: cjs$1.ONE_DAY, prompt: !0, tag: 3e3 }, res: { ttl: cjs$1.ONE_DAY, prompt: !1, tag: 3001 } } }, U$2 = { min: cjs$1.FIVE_MINUTES, max: cjs$1.SEVEN_DAYS }, $ = "wc", Q$1 = 1, Z = "auth", B = "authClient", F$2 = `${$}@1:${Z}:`, x$1 = `${F$2}:PUB_KEY`; +function z$1(r2) { + return r2 == null ? void 0 : r2.split(":"); +} +__name(z$1, "z$1"); +function Ze(r2) { + const t = r2 && z$1(r2); + if (t) + return t[3]; +} +__name(Ze, "Ze"); +function We(r2) { + const t = r2 && z$1(r2); + if (t) + return t[2] + ":" + t[3]; +} +__name(We, "We"); +function W$2(r2) { + const t = r2 && z$1(r2); + if (t) + return t.pop(); +} +__name(W$2, "W$2"); +async function et(r2, t, e, i, n) { + switch (e.t) { + case "eip191": + return tt(r2, t, e.s); + case "eip1271": + return await rt(r2, t, e.s, i, n); + default: + throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${e.t}`); + } +} +__name(et, "et"); +function tt(r2, t, e) { + return recoverAddress(hashMessage(t), e).toLowerCase() === r2.toLowerCase(); +} +__name(tt, "tt"); +async function rt(r2, t, e, i, n) { + try { + const s2 = "0x1626ba7e", o2 = "0000000000000000000000000000000000000000000000000000000000000040", u2 = "0000000000000000000000000000000000000000000000000000000000000041", a = e.substring(2), c = hashMessage(t).substring(2), h2 = s2 + c + o2 + u2 + a, f2 = await ke(`${Y}/?chainId=${i}&projectId=${n}`, { method: "POST", body: JSON.stringify({ id: it(), jsonrpc: "2.0", method: "eth_call", params: [{ to: r2, data: h2 }, "latest"] }) }), { result: p2 } = await f2.json(); + return p2 ? p2.slice(0, s2.length).toLowerCase() === s2.toLowerCase() : !1; + } catch (s2) { + return console.error("isValidEip1271Signature: ", s2), !1; + } +} +__name(rt, "rt"); +function it() { + return Date.now() + Math.floor(Math.random() * 1e3); +} +__name(it, "it"); +function ee(r2) { + return r2.getAll().filter((t) => "requester" in t); +} +__name(ee, "ee"); +function te(r2, t) { + return ee(r2).find((e) => e.id === t); +} +__name(te, "te"); +function nt(r2) { + const t = kt$1(r2.aud), e = new RegExp(`${r2.domain}`).test(r2.aud), i = !!r2.nonce, n = r2.type ? r2.type === "eip4361" : !0, s2 = r2.expiry; + if (s2 && !Xt$1(s2, U$2)) { + const { message: o2 } = N("MISSING_OR_INVALID", `request() expiry: ${s2}. Expiry must be a number (in seconds) between ${U$2.min} and ${U$2.max}`); + throw new Error(o2); + } + return !!(t && e && i && n); +} +__name(nt, "nt"); +function st(r2, t) { + return !!te(t, r2.id); +} +__name(st, "st"); +function ot(r2 = 0) { + return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? globalThis.Buffer.allocUnsafe(r2) : new Uint8Array(r2); +} +__name(ot, "ot"); +function ut(r2, t) { + if (r2.length >= 255) + throw new TypeError("Alphabet too long"); + for (var e = new Uint8Array(256), i = 0; i < e.length; i++) + e[i] = 255; + for (var n = 0; n < r2.length; n++) { + var s2 = r2.charAt(n), o2 = s2.charCodeAt(0); + if (e[o2] !== 255) + throw new TypeError(s2 + " is ambiguous"); + e[o2] = n; + } + var u2 = r2.length, a = r2.charAt(0), c = Math.log(u2) / Math.log(256), h2 = Math.log(256) / Math.log(u2); + function f2(D2) { + if (D2 instanceof Uint8Array || (ArrayBuffer.isView(D2) ? D2 = new Uint8Array(D2.buffer, D2.byteOffset, D2.byteLength) : Array.isArray(D2) && (D2 = Uint8Array.from(D2))), !(D2 instanceof Uint8Array)) + throw new TypeError("Expected Uint8Array"); + if (D2.length === 0) + return ""; + for (var l2 = 0, m2 = 0, E2 = 0, y2 = D2.length; E2 !== y2 && D2[E2] === 0; ) + E2++, l2++; + for (var w2 = (y2 - E2) * h2 + 1 >>> 0, g2 = new Uint8Array(w2); E2 !== y2; ) { + for (var C2 = D2[E2], _2 = 0, b2 = w2 - 1; (C2 !== 0 || _2 < m2) && b2 !== -1; b2--, _2++) + C2 += 256 * g2[b2] >>> 0, g2[b2] = C2 % u2 >>> 0, C2 = C2 / u2 >>> 0; + if (C2 !== 0) + throw new Error("Non-zero carry"); + m2 = _2, E2++; + } + for (var v2 = w2 - m2; v2 !== w2 && g2[v2] === 0; ) + v2++; + for (var q = a.repeat(l2); v2 < w2; ++v2) + q += r2.charAt(g2[v2]); + return q; + } + __name(f2, "f"); + function p2(D2) { + if (typeof D2 != "string") + throw new TypeError("Expected String"); + if (D2.length === 0) + return new Uint8Array(); + var l2 = 0; + if (D2[l2] !== " ") { + for (var m2 = 0, E2 = 0; D2[l2] === a; ) + m2++, l2++; + for (var y2 = (D2.length - l2) * c + 1 >>> 0, w2 = new Uint8Array(y2); D2[l2]; ) { + var g2 = e[D2.charCodeAt(l2)]; + if (g2 === 255) + return; + for (var C2 = 0, _2 = y2 - 1; (g2 !== 0 || C2 < E2) && _2 !== -1; _2--, C2++) + g2 += u2 * w2[_2] >>> 0, w2[_2] = g2 % 256 >>> 0, g2 = g2 / 256 >>> 0; + if (g2 !== 0) + throw new Error("Non-zero carry"); + E2 = C2, l2++; + } + if (D2[l2] !== " ") { + for (var b2 = y2 - E2; b2 !== y2 && w2[b2] === 0; ) + b2++; + for (var v2 = new Uint8Array(m2 + (y2 - b2)), q = m2; b2 !== y2; ) + v2[q++] = w2[b2++]; + return v2; + } + } + } + __name(p2, "p"); + function A2(D2) { + var l2 = p2(D2); + if (l2) + return l2; + throw new Error(`Non-${t} character`); + } + return __name(A2, "A"), { encode: f2, decodeUnsafe: p2, decode: A2 }; +} +__name(ut, "ut"); +var at = ut, Dt = at; +const re = /* @__PURE__ */ __name((r2) => { + if (r2 instanceof Uint8Array && r2.constructor.name === "Uint8Array") + return r2; + if (r2 instanceof ArrayBuffer) + return new Uint8Array(r2); + if (ArrayBuffer.isView(r2)) + return new Uint8Array(r2.buffer, r2.byteOffset, r2.byteLength); + throw new Error("Unknown type, must be binary type"); +}, "re"), ct = /* @__PURE__ */ __name((r2) => new TextEncoder().encode(r2), "ct"), ht = /* @__PURE__ */ __name((r2) => new TextDecoder().decode(r2), "ht"), _lt = class _lt { + constructor(t, e, i) { + this.name = t, this.prefix = e, this.baseEncode = i; + } + encode(t) { + if (t instanceof Uint8Array) + return `${this.prefix}${this.baseEncode(t)}`; + throw Error("Unknown type, must be binary type"); + } +}; +__name(_lt, "lt"); +let lt = _lt; +const _dt = class _dt { + constructor(t, e, i) { + if (this.name = t, this.prefix = e, e.codePointAt(0) === void 0) + throw new Error("Invalid prefix character"); + this.prefixCodePoint = e.codePointAt(0), this.baseDecode = i; + } + decode(t) { + if (typeof t == "string") { + if (t.codePointAt(0) !== this.prefixCodePoint) + throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + return this.baseDecode(t.slice(this.prefix.length)); + } else + throw Error("Can only multibase decode strings"); + } + or(t) { + return ie(this, t); + } +}; +__name(_dt, "dt"); +let dt = _dt; +const _pt = class _pt { + constructor(t) { + this.decoders = t; + } + or(t) { + return ie(this, t); + } + decode(t) { + const e = t[0], i = this.decoders[e]; + if (i) + return i.decode(t); + throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } +}; +__name(_pt, "pt"); +let pt = _pt; +const ie = /* @__PURE__ */ __name((r2, t) => new pt({ ...r2.decoders || { [r2.prefix]: r2 }, ...t.decoders || { [t.prefix]: t } }), "ie"), _ft = class _ft { + constructor(t, e, i, n) { + this.name = t, this.prefix = e, this.baseEncode = i, this.baseDecode = n, this.encoder = new lt(t, e, i), this.decoder = new dt(t, e, n); + } + encode(t) { + return this.encoder.encode(t); + } + decode(t) { + return this.decoder.decode(t); + } +}; +__name(_ft, "ft"); +let ft = _ft; +const O$1 = /* @__PURE__ */ __name(({ name: r2, prefix: t, encode: e, decode: i }) => new ft(r2, t, e, i), "O$1"), T$1 = /* @__PURE__ */ __name(({ prefix: r2, name: t, alphabet: e }) => { + const { encode: i, decode: n } = Dt(e, t); + return O$1({ prefix: r2, name: t, encode: i, decode: (s2) => re(n(s2)) }); +}, "T$1"), gt = /* @__PURE__ */ __name((r2, t, e, i) => { + const n = {}; + for (let h2 = 0; h2 < t.length; ++h2) + n[t[h2]] = h2; + let s2 = r2.length; + for (; r2[s2 - 1] === "="; ) + --s2; + const o2 = new Uint8Array(s2 * e / 8 | 0); + let u2 = 0, a = 0, c = 0; + for (let h2 = 0; h2 < s2; ++h2) { + const f2 = n[r2[h2]]; + if (f2 === void 0) + throw new SyntaxError(`Non-${i} character`); + a = a << e | f2, u2 += e, u2 >= 8 && (u2 -= 8, o2[c++] = 255 & a >> u2); + } + if (u2 >= e || 255 & a << 8 - u2) + throw new SyntaxError("Unexpected end of data"); + return o2; +}, "gt"), Et = /* @__PURE__ */ __name((r2, t, e) => { + const i = t[t.length - 1] === "=", n = (1 << e) - 1; + let s2 = "", o2 = 0, u2 = 0; + for (let a = 0; a < r2.length; ++a) + for (u2 = u2 << 8 | r2[a], o2 += 8; o2 > e; ) + o2 -= e, s2 += t[n & u2 >> o2]; + if (o2 && (s2 += t[n & u2 << e - o2]), i) + for (; s2.length * e & 7; ) + s2 += "="; + return s2; +}, "Et"), d$1 = /* @__PURE__ */ __name(({ name: r2, prefix: t, bitsPerChar: e, alphabet: i }) => O$1({ prefix: t, name: r2, encode(n) { + return Et(n, i, e); +}, decode(n) { + return gt(n, i, e, r2); +} }), "d$1"), bt = O$1({ prefix: "\0", name: "identity", encode: (r2) => ht(r2), decode: (r2) => ct(r2) }); +var yt = Object.freeze({ __proto__: null, identity: bt }); +const wt = d$1({ prefix: "0", name: "base2", alphabet: "01", bitsPerChar: 1 }); +var Ct = Object.freeze({ __proto__: null, base2: wt }); +const mt = d$1({ prefix: "7", name: "base8", alphabet: "01234567", bitsPerChar: 3 }); +var vt = Object.freeze({ __proto__: null, base8: mt }); +const At = T$1({ prefix: "9", name: "base10", alphabet: "0123456789" }); +var _t = Object.freeze({ __proto__: null, base10: At }); +const xt = d$1({ prefix: "f", name: "base16", alphabet: "0123456789abcdef", bitsPerChar: 4 }), Rt = d$1({ prefix: "F", name: "base16upper", alphabet: "0123456789ABCDEF", bitsPerChar: 4 }); +var Ft = Object.freeze({ __proto__: null, base16: xt, base16upper: Rt }); +const Tt = d$1({ prefix: "b", name: "base32", alphabet: "abcdefghijklmnopqrstuvwxyz234567", bitsPerChar: 5 }), It = d$1({ prefix: "B", name: "base32upper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", bitsPerChar: 5 }), qt = d$1({ prefix: "c", name: "base32pad", alphabet: "abcdefghijklmnopqrstuvwxyz234567=", bitsPerChar: 5 }), Ut = d$1({ prefix: "C", name: "base32padupper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", bitsPerChar: 5 }), Ot = d$1({ prefix: "v", name: "base32hex", alphabet: "0123456789abcdefghijklmnopqrstuv", bitsPerChar: 5 }), St = d$1({ prefix: "V", name: "base32hexupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", bitsPerChar: 5 }), Pt = d$1({ prefix: "t", name: "base32hexpad", alphabet: "0123456789abcdefghijklmnopqrstuv=", bitsPerChar: 5 }), Nt = d$1({ prefix: "T", name: "base32hexpadupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", bitsPerChar: 5 }), $t = d$1({ prefix: "h", name: "base32z", alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", bitsPerChar: 5 }); +var Bt = Object.freeze({ __proto__: null, base32: Tt, base32upper: It, base32pad: qt, base32padupper: Ut, base32hex: Ot, base32hexupper: St, base32hexpad: Pt, base32hexpadupper: Nt, base32z: $t }); +const zt = T$1({ prefix: "k", name: "base36", alphabet: "0123456789abcdefghijklmnopqrstuvwxyz" }), jt = T$1({ prefix: "K", name: "base36upper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }); +var Mt = Object.freeze({ __proto__: null, base36: zt, base36upper: jt }); +const Lt = T$1({ name: "base58btc", prefix: "z", alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" }), Kt = T$1({ name: "base58flickr", prefix: "Z", alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" }); +var Vt = Object.freeze({ __proto__: null, base58btc: Lt, base58flickr: Kt }); +const kt = d$1({ prefix: "m", name: "base64", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", bitsPerChar: 6 }), Jt = d$1({ prefix: "M", name: "base64pad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", bitsPerChar: 6 }), Xt = d$1({ prefix: "u", name: "base64url", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", bitsPerChar: 6 }), Gt = d$1({ prefix: "U", name: "base64urlpad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=", bitsPerChar: 6 }); +var Ht = Object.freeze({ __proto__: null, base64: kt, base64pad: Jt, base64url: Xt, base64urlpad: Gt }); +const ne$1 = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"), Yt = ne$1.reduce((r2, t, e) => (r2[e] = t, r2), []), Qt = ne$1.reduce((r2, t, e) => (r2[t.codePointAt(0)] = e, r2), []); +function Zt(r2) { + return r2.reduce((t, e) => (t += Yt[e], t), ""); +} +__name(Zt, "Zt"); +function Wt(r2) { + const t = []; + for (const e of r2) { + const i = Qt[e.codePointAt(0)]; + if (i === void 0) + throw new Error(`Non-base256emoji character: ${e}`); + t.push(i); + } + return new Uint8Array(t); +} +__name(Wt, "Wt"); +const er = O$1({ prefix: "🚀", name: "base256emoji", encode: Zt, decode: Wt }); +var tr = Object.freeze({ __proto__: null, base256emoji: er }), rr = oe$1, se = 128, ir = 127, nr = ~ir, sr = Math.pow(2, 31); +function oe$1(r2, t, e) { + t = t || [], e = e || 0; + for (var i = e; r2 >= sr; ) + t[e++] = r2 & 255 | se, r2 /= 128; + for (; r2 & nr; ) + t[e++] = r2 & 255 | se, r2 >>>= 7; + return t[e] = r2 | 0, oe$1.bytes = e - i + 1, t; +} +__name(oe$1, "oe$1"); +var or = j$1, ur = 128, ue = 127; +function j$1(r2, i) { + var e = 0, i = i || 0, n = 0, s2 = i, o2, u2 = r2.length; + do { + if (s2 >= u2) + throw j$1.bytes = 0, new RangeError("Could not decode varint"); + o2 = r2[s2++], e += n < 28 ? (o2 & ue) << n : (o2 & ue) * Math.pow(2, n), n += 7; + } while (o2 >= ur); + return j$1.bytes = s2 - i, e; +} +__name(j$1, "j$1"); +var ar = Math.pow(2, 7), Dr = Math.pow(2, 14), cr = Math.pow(2, 21), hr = Math.pow(2, 28), lr = Math.pow(2, 35), dr = Math.pow(2, 42), pr = Math.pow(2, 49), fr = Math.pow(2, 56), gr = Math.pow(2, 63), Er = /* @__PURE__ */ __name(function(r2) { + return r2 < ar ? 1 : r2 < Dr ? 2 : r2 < cr ? 3 : r2 < hr ? 4 : r2 < lr ? 5 : r2 < dr ? 6 : r2 < pr ? 7 : r2 < fr ? 8 : r2 < gr ? 9 : 10; +}, "Er"), br = { encode: rr, decode: or, encodingLength: Er }, ae$1 = br; +const De = /* @__PURE__ */ __name((r2, t, e = 0) => (ae$1.encode(r2, t, e), t), "De"), ce$1 = /* @__PURE__ */ __name((r2) => ae$1.encodingLength(r2), "ce$1"), M$2 = /* @__PURE__ */ __name((r2, t) => { + const e = t.byteLength, i = ce$1(r2), n = i + ce$1(e), s2 = new Uint8Array(n + e); + return De(r2, s2, 0), De(e, s2, i), s2.set(t, n), new yr(r2, e, t, s2); +}, "M$2"), _yr = class _yr { + constructor(t, e, i, n) { + this.code = t, this.size = e, this.digest = i, this.bytes = n; + } +}; +__name(_yr, "yr"); +let yr = _yr; +const he$1 = /* @__PURE__ */ __name(({ name: r2, code: t, encode: e }) => new wr(r2, t, e), "he$1"), _wr = class _wr { + constructor(t, e, i) { + this.name = t, this.code = e, this.encode = i; + } + digest(t) { + if (t instanceof Uint8Array) { + const e = this.encode(t); + return e instanceof Uint8Array ? M$2(this.code, e) : e.then((i) => M$2(this.code, i)); + } else + throw Error("Unknown type, must be binary type"); + } +}; +__name(_wr, "wr"); +let wr = _wr; +const le$1 = /* @__PURE__ */ __name((r2) => async (t) => new Uint8Array(await crypto.subtle.digest(r2, t)), "le$1"), Cr = he$1({ name: "sha2-256", code: 18, encode: le$1("SHA-256") }), mr = he$1({ name: "sha2-512", code: 19, encode: le$1("SHA-512") }); +var vr = Object.freeze({ __proto__: null, sha256: Cr, sha512: mr }); +const de$1 = 0, Ar = "identity", pe$1 = re, _r = /* @__PURE__ */ __name((r2) => M$2(de$1, pe$1(r2)), "_r"), xr = { code: de$1, name: Ar, encode: pe$1, digest: _r }; +var Rr = Object.freeze({ __proto__: null, identity: xr }); +new TextEncoder(), new TextDecoder(); +const fe = { ...yt, ...Ct, ...vt, ..._t, ...Ft, ...Bt, ...Mt, ...Vt, ...Ht, ...tr }; +({ ...vr, ...Rr }); +function ge(r2, t, e, i) { + return { name: r2, prefix: t, encoder: { name: r2, prefix: t, encode: e }, decoder: { decode: i } }; +} +__name(ge, "ge"); +const Ee = ge("utf8", "u", (r2) => "u" + new TextDecoder("utf8").decode(r2), (r2) => new TextEncoder().encode(r2.substring(1))), L$1 = ge("ascii", "a", (r2) => { + let t = "a"; + for (let e = 0; e < r2.length; e++) + t += String.fromCharCode(r2[e]); + return t; +}, (r2) => { + r2 = r2.substring(1); + const t = ot(r2.length); + for (let e = 0; e < r2.length; e++) + t[e] = r2.charCodeAt(e); + return t; +}), be = { utf8: Ee, "utf-8": Ee, hex: fe.base16, latin1: L$1, ascii: L$1, binary: L$1, ...fe }; +function Fr(r2, t = "utf8") { + const e = be[t]; + if (!e) + throw new Error(`Unsupported encoding "${t}"`); + return (t === "utf8" || t === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? globalThis.Buffer.from(r2, "utf8") : e.decoder.decode(`${e.prefix}${r2}`); +} +__name(Fr, "Fr"); +function Tr(r2, t = "utf8") { + const e = be[t]; + if (!e) + throw new Error(`Unsupported encoding "${t}"`); + return (t === "utf8" || t === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? globalThis.Buffer.from(r2.buffer, r2.byteOffset, r2.byteLength).toString("utf8") : e.encoder.encode(r2).substring(1); +} +__name(Tr, "Tr"); +const ye = "base16", we = "utf8"; +function K$1(r2) { + const t = sha256.hash(Fr(r2, we)); + return Tr(t, ye); +} +__name(K$1, "K$1"); +var Or = Object.defineProperty, Sr = Object.defineProperties, Pr = Object.getOwnPropertyDescriptors, Ce = Object.getOwnPropertySymbols, Nr = Object.prototype.hasOwnProperty, $r = Object.prototype.propertyIsEnumerable, me = /* @__PURE__ */ __name((r2, t, e) => t in r2 ? Or(r2, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r2[t] = e, "me"), I$2 = /* @__PURE__ */ __name((r2, t) => { + for (var e in t || (t = {})) + Nr.call(t, e) && me(r2, e, t[e]); + if (Ce) + for (var e of Ce(t)) + $r.call(t, e) && me(r2, e, t[e]); + return r2; +}, "I$2"), V$1 = /* @__PURE__ */ __name((r2, t) => Sr(r2, Pr(t)), "V$1"); +const _Br = class _Br extends G$2 { + constructor(t) { + super(t), this.initialized = !1, this.name = "authEngine", this.init = () => { + this.initialized || (this.registerRelayerEvents(), this.registerPairingEvents(), this.client.core.pairing.register({ methods: Object.keys(R$1) }), this.initialized = !0); + }, this.request = async (e, i) => { + if (this.isInitialized(), !nt(e)) + throw new Error("Invalid request"); + if (i != null && i.topic) + return await this.requestOnKnownPairing(i.topic, e); + const { chainId: n, statement: s2, aud: o2, domain: u2, nonce: a, type: c, exp: h2, nbf: f2 } = e, { topic: p2, uri: A2 } = await this.client.core.pairing.create(); + this.client.logger.info({ message: "Generated new pairing", pairing: { topic: p2, uri: A2 } }); + const D2 = await this.client.core.crypto.generateKeyPair(), l2 = Kn(D2); + await this.client.authKeys.set(x$1, { responseTopic: l2, publicKey: D2 }), await this.client.pairingTopics.set(l2, { topic: l2, pairingTopic: p2 }), await this.client.core.relayer.subscribe(l2), this.client.logger.info(`sending request to new pairing topic: ${p2}`); + const m2 = await this.sendRequest(p2, "wc_authRequest", { payloadParams: { type: c ?? "eip4361", chainId: n, statement: s2, aud: o2, domain: u2, version: "1", nonce: a, iat: (/* @__PURE__ */ new Date()).toISOString(), exp: h2, nbf: f2 }, requester: { publicKey: D2, metadata: this.client.metadata } }, {}, e.expiry); + return this.client.logger.info(`sent request to new pairing topic: ${p2}`), { uri: A2, id: m2 }; + }, this.respond = async (e, i) => { + if (this.isInitialized(), !st(e, this.client.requests)) + throw new Error("Invalid response"); + const n = te(this.client.requests, e.id); + if (!n) + throw new Error(`Could not find pending auth request with id ${e.id}`); + const s2 = n.requester.publicKey, o2 = await this.client.core.crypto.generateKeyPair(), u2 = Kn(s2), a = { type: _$1, receiverPublicKey: s2, senderPublicKey: o2 }; + if ("error" in e) { + await this.sendError(n.id, u2, e, a); + return; + } + const c = { h: { t: "eip4361" }, p: V$1(I$2({}, n.cacaoPayload), { iss: i }), s: e.signature }; + await this.sendResult(n.id, u2, c, a), await this.client.core.pairing.activate({ topic: n.pairingTopic }), await this.client.requests.update(n.id, I$2({}, c)); + }, this.getPendingRequests = () => ee(this.client.requests), this.formatMessage = (e, i) => { + this.client.logger.debug(`formatMessage, cacao is: ${JSON.stringify(e)}`); + const n = `${e.domain} wants you to sign in with your Ethereum account:`, s2 = W$2(i), o2 = e.statement, u2 = `URI: ${e.aud}`, a = `Version: ${e.version}`, c = `Chain ID: ${Ze(i)}`, h2 = `Nonce: ${e.nonce}`, f2 = `Issued At: ${e.iat}`, p2 = e.exp ? `Expiry: ${e.exp}` : void 0, A2 = e.resources && e.resources.length > 0 ? `Resources: +${e.resources.map((D2) => `- ${D2}`).join(` +`)}` : void 0; + return [n, s2, "", o2, "", u2, a, c, h2, f2, p2, A2].filter((D2) => D2 != null).join(` +`); + }, this.setExpiry = async (e, i) => { + this.client.core.pairing.pairings.keys.includes(e) && await this.client.core.pairing.updateExpiry({ topic: e, expiry: i }), this.client.core.expirer.set(e, i); + }, this.sendRequest = async (e, i, n, s2, o2) => { + const u2 = formatJsonRpcRequest(i, n), a = await this.client.core.crypto.encode(e, u2, s2), c = R$1[i].req; + if (o2 && (c.ttl = o2), this.client.core.history.set(e, u2), D$1()) { + const h2 = K$1(JSON.stringify(u2)); + this.client.core.verify.register({ attestationId: h2 }); + } + return await this.client.core.relayer.publish(e, a, V$1(I$2({}, c), { internal: { throwOnFailedPublish: !0 } })), u2.id; + }, this.sendResult = async (e, i, n, s2) => { + const o2 = formatJsonRpcResult(e, n), u2 = await this.client.core.crypto.encode(i, o2, s2), a = await this.client.core.history.get(i, e), c = R$1[a.request.method].res; + return await this.client.core.relayer.publish(i, u2, V$1(I$2({}, c), { internal: { throwOnFailedPublish: !0 } })), await this.client.core.history.resolve(o2), o2.id; + }, this.sendError = async (e, i, n, s2) => { + const o2 = formatJsonRpcError(e, n.error), u2 = await this.client.core.crypto.encode(i, o2, s2), a = await this.client.core.history.get(i, e), c = R$1[a.request.method].res; + return await this.client.core.relayer.publish(i, u2, c), await this.client.core.history.resolve(o2), o2.id; + }, this.requestOnKnownPairing = async (e, i) => { + const n = this.client.core.pairing.pairings.getAll({ active: !0 }).find((A2) => A2.topic === e); + if (!n) + throw new Error(`Could not find pairing for provided topic ${e}`); + const { publicKey: s2 } = this.client.authKeys.get(x$1), { chainId: o2, statement: u2, aud: a, domain: c, nonce: h2, type: f2 } = i, p2 = await this.sendRequest(n.topic, "wc_authRequest", { payloadParams: { type: f2 ?? "eip4361", chainId: o2, statement: u2, aud: a, domain: c, version: "1", nonce: h2, iat: (/* @__PURE__ */ new Date()).toISOString() }, requester: { publicKey: s2, metadata: this.client.metadata } }, {}, i.expiry); + return this.client.logger.info(`sent request to known pairing topic: ${n.topic}`), { id: p2 }; + }, this.onPairingCreated = (e) => { + const i = this.getPendingRequests(); + if (i) { + const n = Object.values(i).find((s2) => s2.pairingTopic === e.topic); + n && this.handleAuthRequest(n); + } + }, this.onRelayEventRequest = (e) => { + const { topic: i, payload: n } = e, s2 = n.method; + switch (s2) { + case "wc_authRequest": + return this.onAuthRequest(i, n); + default: + return this.client.logger.info(`Unsupported request method ${s2}`); + } + }, this.onRelayEventResponse = async (e) => { + const { topic: i, payload: n } = e, s2 = (await this.client.core.history.get(i, n.id)).request.method; + switch (s2) { + case "wc_authRequest": + return this.onAuthResponse(i, n); + default: + return this.client.logger.info(`Unsupported response method ${s2}`); + } + }, this.onAuthRequest = async (e, i) => { + const { requester: n, payloadParams: s2 } = i.params; + this.client.logger.info({ type: "onAuthRequest", topic: e, payload: i }); + const o2 = K$1(JSON.stringify(i)), u2 = await this.getVerifyContext(o2, this.client.metadata), a = { requester: n, pairingTopic: e, id: i.id, cacaoPayload: s2, verifyContext: u2 }; + await this.client.requests.set(i.id, a), this.handleAuthRequest(a); + }, this.handleAuthRequest = async (e) => { + const { id: i, pairingTopic: n, requester: s2, cacaoPayload: o2, verifyContext: u2 } = e; + try { + this.client.emit("auth_request", { id: i, topic: n, params: { requester: s2, cacaoPayload: o2 }, verifyContext: u2 }); + } catch (a) { + await this.sendError(e.id, e.pairingTopic, a), this.client.logger.error(a); + } + }, this.onAuthResponse = async (e, i) => { + const { id: n } = i; + if (this.client.logger.info({ type: "onAuthResponse", topic: e, response: i }), isJsonRpcResult(i)) { + const { pairingTopic: s2 } = this.client.pairingTopics.get(e); + await this.client.core.pairing.activate({ topic: s2 }); + const { s: o2, p: u2 } = i.result; + await this.client.requests.set(n, I$2({ id: n, pairingTopic: s2 }, i.result)); + const a = this.formatMessage(u2, u2.iss); + this.client.logger.debug(`reconstructed message: +`, JSON.stringify(a)), this.client.logger.debug("payload.iss:", u2.iss), this.client.logger.debug("signature:", o2); + const c = W$2(u2.iss), h2 = We(u2.iss); + if (!c) + throw new Error("Could not derive address from `payload.iss`"); + if (!h2) + throw new Error("Could not derive chainId from `payload.iss`"); + this.client.logger.debug("walletAddress extracted from `payload.iss`:", c), await et(c, a, o2, h2, this.client.projectId) ? this.client.emit("auth_response", { id: n, topic: e, params: i }) : this.client.emit("auth_response", { id: n, topic: e, params: { message: "Invalid signature", code: -1 } }); + } else + isJsonRpcError(i) && this.client.emit("auth_response", { id: n, topic: e, params: i }); + }, this.getVerifyContext = async (e, i) => { + const n = { verified: { verifyUrl: i.verifyUrl || "", validation: "UNKNOWN", origin: i.url || "" } }; + try { + const s2 = await this.client.core.verify.resolve({ attestationId: e, verifyUrl: i.verifyUrl }); + s2 && (n.verified.origin = s2.origin, n.verified.isScam = s2.isScam, n.verified.validation = origin === new URL(i.url).origin ? "VALID" : "INVALID"); + } catch (s2) { + this.client.logger.error(s2); + } + return this.client.logger.info(`Verify context: ${JSON.stringify(n)}`), n; + }; + } + isInitialized() { + if (!this.initialized) { + const { message: t } = N("NOT_INITIALIZED", this.name); + throw new Error(t); + } + } + registerRelayerEvents() { + this.client.core.relayer.on(D$2.message, async (t) => { + const { topic: e, message: i } = t, { responseTopic: n, publicKey: s2 } = this.client.authKeys.keys.includes(x$1) ? this.client.authKeys.get(x$1) : { responseTopic: void 0, publicKey: void 0 }; + if (n && e !== n) { + this.client.logger.debug("[Auth] Ignoring message from unknown topic", e); + return; + } + const o2 = await this.client.core.crypto.decode(e, i, { receiverPublicKey: s2 }); + isJsonRpcRequest(o2) ? (this.client.core.history.set(e, o2), this.onRelayEventRequest({ topic: e, payload: o2 })) : isJsonRpcResponse(o2) && (await this.client.core.history.resolve(o2), this.onRelayEventResponse({ topic: e, payload: o2 })); + }); + } + registerPairingEvents() { + this.client.core.pairing.events.on(V$2.create, (t) => this.onPairingCreated(t)); + } +}; +__name(_Br, "Br"); +let Br = _Br; +var _a3; +let S$1 = (_a3 = class extends H$1 { + constructor(t) { + super(t), this.protocol = $, this.version = Q$1, this.name = B, this.events = new eventsExports.EventEmitter(), this.emit = (i, n) => this.events.emit(i, n), this.on = (i, n) => this.events.on(i, n), this.once = (i, n) => this.events.once(i, n), this.off = (i, n) => this.events.off(i, n), this.removeListener = (i, n) => this.events.removeListener(i, n), this.request = async (i, n) => { + try { + return await this.engine.request(i, n); + } catch (s2) { + throw this.logger.error(s2.message), s2; + } + }, this.respond = async (i, n) => { + try { + return await this.engine.respond(i, n); + } catch (s2) { + throw this.logger.error(s2.message), s2; + } + }, this.getPendingRequests = () => { + try { + return this.engine.getPendingRequests(); + } catch (i) { + throw this.logger.error(i.message), i; + } + }, this.formatMessage = (i, n) => { + try { + return this.engine.formatMessage(i, n); + } catch (s2) { + throw this.logger.error(s2.message), s2; + } + }; + const e = typeof t.logger < "u" && typeof t.logger != "string" ? t.logger : cjs.pino(cjs.getDefaultLoggerOptions({ level: t.logger || "error" })); + this.name = (t == null ? void 0 : t.name) || B, this.metadata = t.metadata, this.projectId = t.projectId, this.core = t.core || new Nr$1(t), this.logger = cjs.generateChildLogger(e, this.name), this.authKeys = new Mt$1(this.core, this.logger, "authKeys", F$2, () => x$1), this.pairingTopics = new Mt$1(this.core, this.logger, "pairingTopics", F$2), this.requests = new Mt$1(this.core, this.logger, "requests", F$2, (i) => i.id), this.engine = new Br(this); + } + static async init(t) { + const e = new _a3(t); + return await e.initialize(), e; + } + get context() { + return cjs.getLoggerContext(this.logger); + } + async initialize() { + this.logger.trace("Initialized"); + try { + await this.core.start(), await this.authKeys.init(), await this.requests.init(), await this.pairingTopics.init(), await this.engine.init(), this.logger.info("AuthClient Initialization Success"), this.logger.info({ authClient: this }); + } catch (t) { + throw this.logger.info("AuthClient Initialization Failure"), this.logger.error(t.message), t; + } + } +}, __name(_a3, "S"), _a3); +const zr = S$1, X$1 = "wc", F$1 = 2, H = "client", G$1 = `${X$1}@${F$1}:${H}:`, M$1 = { name: H, logger: "error", controller: !1, relayUrl: "wss://relay.walletconnect.com" }, W$1 = "WALLETCONNECT_DEEPLINK_CHOICE", ne = "proposal", oe = "Proposal expired", ae = "session", A = cjs$1.SEVEN_DAYS, ce = "engine", V = { wc_sessionPropose: { req: { ttl: cjs$1.FIVE_MINUTES, prompt: !0, tag: 1100 }, res: { ttl: cjs$1.FIVE_MINUTES, prompt: !1, tag: 1101 } }, wc_sessionSettle: { req: { ttl: cjs$1.FIVE_MINUTES, prompt: !1, tag: 1102 }, res: { ttl: cjs$1.FIVE_MINUTES, prompt: !1, tag: 1103 } }, wc_sessionUpdate: { req: { ttl: cjs$1.ONE_DAY, prompt: !1, tag: 1104 }, res: { ttl: cjs$1.ONE_DAY, prompt: !1, tag: 1105 } }, wc_sessionExtend: { req: { ttl: cjs$1.ONE_DAY, prompt: !1, tag: 1106 }, res: { ttl: cjs$1.ONE_DAY, prompt: !1, tag: 1107 } }, wc_sessionRequest: { req: { ttl: cjs$1.FIVE_MINUTES, prompt: !0, tag: 1108 }, res: { ttl: cjs$1.FIVE_MINUTES, prompt: !1, tag: 1109 } }, wc_sessionEvent: { req: { ttl: cjs$1.FIVE_MINUTES, prompt: !0, tag: 1110 }, res: { ttl: cjs$1.FIVE_MINUTES, prompt: !1, tag: 1111 } }, wc_sessionDelete: { req: { ttl: cjs$1.ONE_DAY, prompt: !1, tag: 1112 }, res: { ttl: cjs$1.ONE_DAY, prompt: !1, tag: 1113 } }, wc_sessionPing: { req: { ttl: cjs$1.THIRTY_SECONDS, prompt: !1, tag: 1114 }, res: { ttl: cjs$1.THIRTY_SECONDS, prompt: !1, tag: 1115 } } }, U$1 = { min: cjs$1.FIVE_MINUTES, max: cjs$1.SEVEN_DAYS }, I$1 = { idle: "IDLE", active: "ACTIVE" }, le = "request", pe = ["wc_sessionPropose", "wc_sessionRequest", "wc_authRequest"]; +var os = Object.defineProperty, as = Object.defineProperties, cs = Object.getOwnPropertyDescriptors, he = Object.getOwnPropertySymbols, ls = Object.prototype.hasOwnProperty, ps = Object.prototype.propertyIsEnumerable, de = /* @__PURE__ */ __name((m2, r2, e) => r2 in m2 ? os(m2, r2, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m2[r2] = e, "de"), g$1 = /* @__PURE__ */ __name((m2, r2) => { + for (var e in r2 || (r2 = {})) + ls.call(r2, e) && de(m2, e, r2[e]); + if (he) + for (var e of he(r2)) + ps.call(r2, e) && de(m2, e, r2[e]); + return m2; +}, "g$1"), b$1 = /* @__PURE__ */ __name((m2, r2) => as(m2, cs(r2)), "b$1"); +const _hs = class _hs extends S$2 { + constructor(r2) { + super(r2), this.name = ce, this.events = new Ye(), this.initialized = !1, this.ignoredPayloadTypes = [_$1], this.requestQueue = { state: I$1.idle, queue: [] }, this.sessionRequestQueue = { state: I$1.idle, queue: [] }, this.requestQueueDelay = cjs$1.ONE_SECOND, this.init = async () => { + this.initialized || (await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.registerPairingEvents(), this.client.core.pairing.register({ methods: Object.keys(V) }), this.initialized = !0, setTimeout(() => { + this.sessionRequestQueue.queue = this.getPendingSessionRequests(), this.processSessionRequestQueue(); + }, cjs$1.toMiliseconds(this.requestQueueDelay))); + }, this.connect = async (e) => { + await this.isInitialized(); + const s2 = b$1(g$1({}, e), { requiredNamespaces: e.requiredNamespaces || {}, optionalNamespaces: e.optionalNamespaces || {} }); + await this.isValidConnect(s2); + const { pairingTopic: t, requiredNamespaces: i, optionalNamespaces: n, sessionProperties: o2, relays: a } = s2; + let c = t, p2, d2 = !1; + if (c && (d2 = this.client.core.pairing.pairings.get(c).active), !c || !d2) { + const { topic: v2, uri: S2 } = await this.client.core.pairing.create(); + c = v2, p2 = S2; + } + const h2 = await this.client.core.crypto.generateKeyPair(), R2 = g$1({ requiredNamespaces: i, optionalNamespaces: n, relays: a ?? [{ protocol: ht$1 }], proposer: { publicKey: h2, metadata: this.client.metadata } }, o2 && { sessionProperties: o2 }), { reject: w2, resolve: T2, done: K2 } = at$1(cjs$1.FIVE_MINUTES, oe); + if (this.events.once(yt$1("session_connect"), async ({ error: v2, session: S2 }) => { + if (v2) + w2(v2); + else if (S2) { + S2.self.publicKey = h2; + const B2 = b$1(g$1({}, S2), { requiredNamespaces: S2.requiredNamespaces, optionalNamespaces: S2.optionalNamespaces }); + await this.client.session.set(S2.topic, B2), await this.setExpiry(S2.topic, S2.expiry), c && await this.client.core.pairing.updateMetadata({ topic: c, metadata: S2.peer.metadata }), T2(B2); + } + }), !c) { + const { message: v2 } = N("NO_MATCHING_KEY", `connect() pairing topic: ${c}`); + throw new Error(v2); + } + const L2 = await this.sendRequest({ topic: c, method: "wc_sessionPropose", params: R2 }), ue2 = pt$1(cjs$1.FIVE_MINUTES); + return await this.setProposal(L2, g$1({ id: L2, expiry: ue2 }, R2)), { uri: p2, approval: K2 }; + }, this.pair = async (e) => (await this.isInitialized(), await this.client.core.pairing.pair(e)), this.approve = async (e) => { + await this.isInitialized(), await this.isValidApprove(e); + const { id: s2, relayProtocol: t, namespaces: i, sessionProperties: n } = e, o2 = this.client.proposal.get(s2); + let { pairingTopic: a, proposer: c, requiredNamespaces: p2, optionalNamespaces: d2 } = o2; + a = a || "", B$1(p2) || (p2 = jt$1(i, "approve()")); + const h2 = await this.client.core.crypto.generateKeyPair(), R2 = c.publicKey, w2 = await this.client.core.crypto.generateSharedKey(h2, R2); + a && s2 && (await this.client.core.pairing.updateMetadata({ topic: a, metadata: c.metadata }), await this.sendResult({ id: s2, topic: a, result: { relay: { protocol: t ?? "irn" }, responderPublicKey: h2 } }), await this.client.proposal.delete(s2, U$3("USER_DISCONNECTED")), await this.client.core.pairing.activate({ topic: a })); + const T2 = g$1({ relay: { protocol: t ?? "irn" }, namespaces: i, requiredNamespaces: p2, optionalNamespaces: d2, pairingTopic: a, controller: { publicKey: h2, metadata: this.client.metadata }, expiry: pt$1(A) }, n && { sessionProperties: n }); + await this.client.core.relayer.subscribe(w2), await this.sendRequest({ topic: w2, method: "wc_sessionSettle", params: T2, throwOnFailedPublish: !0 }); + const K2 = b$1(g$1({}, T2), { topic: w2, pairingTopic: a, acknowledged: !1, self: T2.controller, peer: { publicKey: c.publicKey, metadata: c.metadata }, controller: h2 }); + return await this.client.session.set(w2, K2), await this.setExpiry(w2, pt$1(A)), { topic: w2, acknowledged: () => new Promise((L2) => setTimeout(() => L2(this.client.session.get(w2)), 500)) }; + }, this.reject = async (e) => { + await this.isInitialized(), await this.isValidReject(e); + const { id: s2, reason: t } = e, { pairingTopic: i } = this.client.proposal.get(s2); + i && (await this.sendError(s2, i, t), await this.client.proposal.delete(s2, U$3("USER_DISCONNECTED"))); + }, this.update = async (e) => { + await this.isInitialized(), await this.isValidUpdate(e); + const { topic: s2, namespaces: t } = e, i = await this.sendRequest({ topic: s2, method: "wc_sessionUpdate", params: { namespaces: t } }), { done: n, resolve: o2, reject: a } = at$1(); + return this.events.once(yt$1("session_update", i), ({ error: c }) => { + c ? a(c) : o2(); + }), await this.client.session.update(s2, { namespaces: t }), { acknowledged: n }; + }, this.extend = async (e) => { + await this.isInitialized(), await this.isValidExtend(e); + const { topic: s2 } = e, t = await this.sendRequest({ topic: s2, method: "wc_sessionExtend", params: {} }), { done: i, resolve: n, reject: o2 } = at$1(); + return this.events.once(yt$1("session_extend", t), ({ error: a }) => { + a ? o2(a) : n(); + }), await this.setExpiry(s2, pt$1(A)), { acknowledged: i }; + }, this.request = async (e) => { + await this.isInitialized(), await this.isValidRequest(e); + const { chainId: s2, request: t, topic: i, expiry: n } = e, o2 = payloadId(), { done: a, resolve: c, reject: p2 } = at$1(n, "Request expired. Please try again."); + return this.events.once(yt$1("session_request", o2), ({ error: d2, result: h2 }) => { + d2 ? p2(d2) : c(h2); + }), await Promise.all([new Promise(async (d2) => { + await this.sendRequest({ clientRpcId: o2, topic: i, method: "wc_sessionRequest", params: { request: t, chainId: s2 }, expiry: n, throwOnFailedPublish: !0 }).catch((h2) => p2(h2)), this.client.events.emit("session_request_sent", { topic: i, request: t, chainId: s2, id: o2 }), d2(); + }), new Promise(async (d2) => { + const h2 = await gt$1(this.client.core.storage, W$1); + ht$2({ id: o2, topic: i, wcDeepLink: h2 }), d2(); + }), a()]).then((d2) => d2[2]); + }, this.respond = async (e) => { + await this.isInitialized(), await this.isValidRespond(e); + const { topic: s2, response: t } = e, { id: i } = t; + isJsonRpcResult(t) ? await this.sendResult({ id: i, topic: s2, result: t.result, throwOnFailedPublish: !0 }) : isJsonRpcError(t) && await this.sendError(i, s2, t.error), this.cleanupAfterResponse(e); + }, this.ping = async (e) => { + await this.isInitialized(), await this.isValidPing(e); + const { topic: s2 } = e; + if (this.client.session.keys.includes(s2)) { + const t = await this.sendRequest({ topic: s2, method: "wc_sessionPing", params: {} }), { done: i, resolve: n, reject: o2 } = at$1(); + this.events.once(yt$1("session_ping", t), ({ error: a }) => { + a ? o2(a) : n(); + }), await i(); + } else + this.client.core.pairing.pairings.keys.includes(s2) && await this.client.core.pairing.ping({ topic: s2 }); + }, this.emit = async (e) => { + await this.isInitialized(), await this.isValidEmit(e); + const { topic: s2, event: t, chainId: i } = e; + await this.sendRequest({ topic: s2, method: "wc_sessionEvent", params: { event: t, chainId: i } }); + }, this.disconnect = async (e) => { + await this.isInitialized(), await this.isValidDisconnect(e); + const { topic: s2 } = e; + this.client.session.keys.includes(s2) ? (await this.sendRequest({ topic: s2, method: "wc_sessionDelete", params: U$3("USER_DISCONNECTED"), throwOnFailedPublish: !0 }), await this.deleteSession(s2)) : await this.client.core.pairing.disconnect({ topic: s2 }); + }, this.find = (e) => (this.isInitialized(), this.client.session.getAll().filter((s2) => Dt$1(s2, e))), this.getPendingSessionRequests = () => (this.isInitialized(), this.client.pendingRequest.getAll()), this.cleanupDuplicatePairings = async (e) => { + if (e.pairingTopic) + try { + const s2 = this.client.core.pairing.pairings.get(e.pairingTopic), t = this.client.core.pairing.pairings.getAll().filter((i) => { + var n, o2; + return ((n = i.peerMetadata) == null ? void 0 : n.url) && ((o2 = i.peerMetadata) == null ? void 0 : o2.url) === e.peer.metadata.url && i.topic && i.topic !== s2.topic; + }); + if (t.length === 0) + return; + this.client.logger.info(`Cleaning up ${t.length} duplicate pairing(s)`), await Promise.all(t.map((i) => this.client.core.pairing.disconnect({ topic: i.topic }))), this.client.logger.info("Duplicate pairings clean up finished"); + } catch (s2) { + this.client.logger.error(s2); + } + }, this.deleteSession = async (e, s2) => { + const { self: t } = this.client.session.get(e); + await this.client.core.relayer.unsubscribe(e), this.client.session.delete(e, U$3("USER_DISCONNECTED")), this.client.core.crypto.keychain.has(t.publicKey) && await this.client.core.crypto.deleteKeyPair(t.publicKey), this.client.core.crypto.keychain.has(e) && await this.client.core.crypto.deleteSymKey(e), s2 || this.client.core.expirer.del(e), this.client.core.storage.removeItem(W$1).catch((i) => this.client.logger.warn(i)); + }, this.deleteProposal = async (e, s2) => { + await Promise.all([this.client.proposal.delete(e, U$3("USER_DISCONNECTED")), s2 ? Promise.resolve() : this.client.core.expirer.del(e)]); + }, this.deletePendingSessionRequest = async (e, s2, t = !1) => { + await Promise.all([this.client.pendingRequest.delete(e, s2), t ? Promise.resolve() : this.client.core.expirer.del(e)]), this.sessionRequestQueue.queue = this.sessionRequestQueue.queue.filter((i) => i.id !== e), t && (this.sessionRequestQueue.state = I$1.idle); + }, this.setExpiry = async (e, s2) => { + this.client.session.keys.includes(e) && await this.client.session.update(e, { expiry: s2 }), this.client.core.expirer.set(e, s2); + }, this.setProposal = async (e, s2) => { + await this.client.proposal.set(e, s2), this.client.core.expirer.set(e, s2.expiry); + }, this.setPendingSessionRequest = async (e) => { + const s2 = V.wc_sessionRequest.req.ttl, { id: t, topic: i, params: n, verifyContext: o2 } = e; + await this.client.pendingRequest.set(t, { id: t, topic: i, params: n, verifyContext: o2 }), s2 && this.client.core.expirer.set(t, pt$1(s2)); + }, this.sendRequest = async (e) => { + const { topic: s2, method: t, params: i, expiry: n, relayRpcId: o2, clientRpcId: a, throwOnFailedPublish: c } = e, p2 = formatJsonRpcRequest(t, i, a); + if (D$1() && pe.includes(t)) { + const R2 = Ln(JSON.stringify(p2)); + this.client.core.verify.register({ attestationId: R2 }); + } + const d2 = await this.client.core.crypto.encode(s2, p2), h2 = V[t].req; + return n && (h2.ttl = n), o2 && (h2.id = o2), this.client.core.history.set(s2, p2), c ? (h2.internal = b$1(g$1({}, h2.internal), { throwOnFailedPublish: !0 }), await this.client.core.relayer.publish(s2, d2, h2)) : this.client.core.relayer.publish(s2, d2, h2).catch((R2) => this.client.logger.error(R2)), p2.id; + }, this.sendResult = async (e) => { + const { id: s2, topic: t, result: i, throwOnFailedPublish: n } = e, o2 = formatJsonRpcResult(s2, i), a = await this.client.core.crypto.encode(t, o2), c = await this.client.core.history.get(t, s2), p2 = V[c.request.method].res; + n ? (p2.internal = b$1(g$1({}, p2.internal), { throwOnFailedPublish: !0 }), await this.client.core.relayer.publish(t, a, p2)) : this.client.core.relayer.publish(t, a, p2).catch((d2) => this.client.logger.error(d2)), await this.client.core.history.resolve(o2); + }, this.sendError = async (e, s2, t) => { + const i = formatJsonRpcError(e, t), n = await this.client.core.crypto.encode(s2, i), o2 = await this.client.core.history.get(s2, e), a = V[o2.request.method].res; + this.client.core.relayer.publish(s2, n, a), await this.client.core.history.resolve(i); + }, this.cleanup = async () => { + const e = [], s2 = []; + this.client.session.getAll().forEach((t) => { + mt$1(t.expiry) && e.push(t.topic); + }), this.client.proposal.getAll().forEach((t) => { + mt$1(t.expiry) && s2.push(t.id); + }), await Promise.all([...e.map((t) => this.deleteSession(t)), ...s2.map((t) => this.deleteProposal(t))]); + }, this.onRelayEventRequest = async (e) => { + this.requestQueue.queue.push(e), await this.processRequestsQueue(); + }, this.processRequestsQueue = async () => { + if (this.requestQueue.state === I$1.active) { + this.client.logger.info("Request queue already active, skipping..."); + return; + } + for (this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`); this.requestQueue.queue.length > 0; ) { + this.requestQueue.state = I$1.active; + const e = this.requestQueue.queue.shift(); + if (e) + try { + this.processRequest(e), await new Promise((s2) => setTimeout(s2, 300)); + } catch (s2) { + this.client.logger.warn(s2); + } + } + this.requestQueue.state = I$1.idle; + }, this.processRequest = (e) => { + const { topic: s2, payload: t } = e, i = t.method; + switch (i) { + case "wc_sessionPropose": + return this.onSessionProposeRequest(s2, t); + case "wc_sessionSettle": + return this.onSessionSettleRequest(s2, t); + case "wc_sessionUpdate": + return this.onSessionUpdateRequest(s2, t); + case "wc_sessionExtend": + return this.onSessionExtendRequest(s2, t); + case "wc_sessionPing": + return this.onSessionPingRequest(s2, t); + case "wc_sessionDelete": + return this.onSessionDeleteRequest(s2, t); + case "wc_sessionRequest": + return this.onSessionRequest(s2, t); + case "wc_sessionEvent": + return this.onSessionEventRequest(s2, t); + default: + return this.client.logger.info(`Unsupported request method ${i}`); + } + }, this.onRelayEventResponse = async (e) => { + const { topic: s2, payload: t } = e, i = (await this.client.core.history.get(s2, t.id)).request.method; + switch (i) { + case "wc_sessionPropose": + return this.onSessionProposeResponse(s2, t); + case "wc_sessionSettle": + return this.onSessionSettleResponse(s2, t); + case "wc_sessionUpdate": + return this.onSessionUpdateResponse(s2, t); + case "wc_sessionExtend": + return this.onSessionExtendResponse(s2, t); + case "wc_sessionPing": + return this.onSessionPingResponse(s2, t); + case "wc_sessionRequest": + return this.onSessionRequestResponse(s2, t); + default: + return this.client.logger.info(`Unsupported response method ${i}`); + } + }, this.onRelayEventUnknownPayload = (e) => { + const { topic: s2 } = e, { message: t } = N("MISSING_OR_INVALID", `Decoded payload on topic ${s2} is not identifiable as a JSON-RPC request or a response.`); + throw new Error(t); + }, this.onSessionProposeRequest = async (e, s2) => { + const { params: t, id: i } = s2; + try { + this.isValidConnect(g$1({}, s2.params)); + const n = pt$1(cjs$1.FIVE_MINUTES), o2 = g$1({ id: i, pairingTopic: e, expiry: n }, t); + await this.setProposal(i, o2); + const a = Ln(JSON.stringify(s2)), c = await this.getVerifyContext(a, o2.proposer.metadata); + this.client.events.emit("session_proposal", { id: i, params: o2, verifyContext: c }); + } catch (n) { + await this.sendError(i, e, n), this.client.logger.error(n); + } + }, this.onSessionProposeResponse = async (e, s2) => { + const { id: t } = s2; + if (isJsonRpcResult(s2)) { + const { result: i } = s2; + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", result: i }); + const n = this.client.proposal.get(t); + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", proposal: n }); + const o2 = n.proposer.publicKey; + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", selfPublicKey: o2 }); + const a = i.responderPublicKey; + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", peerPublicKey: a }); + const c = await this.client.core.crypto.generateSharedKey(o2, a); + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", sessionTopic: c }); + const p2 = await this.client.core.relayer.subscribe(c); + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", subscriptionId: p2 }), await this.client.core.pairing.activate({ topic: e }); + } else + isJsonRpcError(s2) && (await this.client.proposal.delete(t, U$3("USER_DISCONNECTED")), this.events.emit(yt$1("session_connect"), { error: s2.error })); + }, this.onSessionSettleRequest = async (e, s2) => { + const { id: t, params: i } = s2; + try { + this.isValidSessionSettleRequest(i); + const { relay: n, controller: o2, expiry: a, namespaces: c, requiredNamespaces: p2, optionalNamespaces: d2, sessionProperties: h2, pairingTopic: R2 } = s2.params, w2 = g$1({ topic: e, relay: n, expiry: a, namespaces: c, acknowledged: !0, pairingTopic: R2, requiredNamespaces: p2, optionalNamespaces: d2, controller: o2.publicKey, self: { publicKey: "", metadata: this.client.metadata }, peer: { publicKey: o2.publicKey, metadata: o2.metadata } }, h2 && { sessionProperties: h2 }); + await this.sendResult({ id: s2.id, topic: e, result: !0 }), this.events.emit(yt$1("session_connect"), { session: w2 }), this.cleanupDuplicatePairings(w2); + } catch (n) { + await this.sendError(t, e, n), this.client.logger.error(n); + } + }, this.onSessionSettleResponse = async (e, s2) => { + const { id: t } = s2; + isJsonRpcResult(s2) ? (await this.client.session.update(e, { acknowledged: !0 }), this.events.emit(yt$1("session_approve", t), {})) : isJsonRpcError(s2) && (await this.client.session.delete(e, U$3("USER_DISCONNECTED")), this.events.emit(yt$1("session_approve", t), { error: s2.error })); + }, this.onSessionUpdateRequest = async (e, s2) => { + const { params: t, id: i } = s2; + try { + const n = `${e}_session_update`, o2 = tr$1.get(n); + if (o2 && this.isRequestOutOfSync(o2, i)) { + this.client.logger.info(`Discarding out of sync request - ${i}`); + return; + } + this.isValidUpdate(g$1({ topic: e }, t)), await this.client.session.update(e, { namespaces: t.namespaces }), await this.sendResult({ id: i, topic: e, result: !0 }), this.client.events.emit("session_update", { id: i, topic: e, params: t }), tr$1.set(n, i); + } catch (n) { + await this.sendError(i, e, n), this.client.logger.error(n); + } + }, this.isRequestOutOfSync = (e, s2) => parseInt(s2.toString().slice(0, -3)) <= parseInt(e.toString().slice(0, -3)), this.onSessionUpdateResponse = (e, s2) => { + const { id: t } = s2; + isJsonRpcResult(s2) ? this.events.emit(yt$1("session_update", t), {}) : isJsonRpcError(s2) && this.events.emit(yt$1("session_update", t), { error: s2.error }); + }, this.onSessionExtendRequest = async (e, s2) => { + const { id: t } = s2; + try { + this.isValidExtend({ topic: e }), await this.setExpiry(e, pt$1(A)), await this.sendResult({ id: t, topic: e, result: !0 }), this.client.events.emit("session_extend", { id: t, topic: e }); + } catch (i) { + await this.sendError(t, e, i), this.client.logger.error(i); + } + }, this.onSessionExtendResponse = (e, s2) => { + const { id: t } = s2; + isJsonRpcResult(s2) ? this.events.emit(yt$1("session_extend", t), {}) : isJsonRpcError(s2) && this.events.emit(yt$1("session_extend", t), { error: s2.error }); + }, this.onSessionPingRequest = async (e, s2) => { + const { id: t } = s2; + try { + this.isValidPing({ topic: e }), await this.sendResult({ id: t, topic: e, result: !0 }), this.client.events.emit("session_ping", { id: t, topic: e }); + } catch (i) { + await this.sendError(t, e, i), this.client.logger.error(i); + } + }, this.onSessionPingResponse = (e, s2) => { + const { id: t } = s2; + setTimeout(() => { + isJsonRpcResult(s2) ? this.events.emit(yt$1("session_ping", t), {}) : isJsonRpcError(s2) && this.events.emit(yt$1("session_ping", t), { error: s2.error }); + }, 500); + }, this.onSessionDeleteRequest = async (e, s2) => { + const { id: t } = s2; + try { + this.isValidDisconnect({ topic: e, reason: s2.params }), await Promise.all([new Promise((i) => { + this.client.core.relayer.once(D$2.publish, async () => { + i(await this.deleteSession(e)); + }); + }), this.sendResult({ id: t, topic: e, result: !0 })]), this.client.events.emit("session_delete", { id: t, topic: e }); + } catch (i) { + this.client.logger.error(i); + } + }, this.onSessionRequest = async (e, s2) => { + const { id: t, params: i } = s2; + try { + this.isValidRequest(g$1({ topic: e }, i)); + const n = Ln(JSON.stringify(formatJsonRpcRequest("wc_sessionRequest", i, t))), o2 = this.client.session.get(e), a = await this.getVerifyContext(n, o2.peer.metadata), c = { id: t, topic: e, params: i, verifyContext: a }; + await this.setPendingSessionRequest(c), this.addSessionRequestToSessionRequestQueue(c), this.processSessionRequestQueue(); + } catch (n) { + await this.sendError(t, e, n), this.client.logger.error(n); + } + }, this.onSessionRequestResponse = (e, s2) => { + const { id: t } = s2; + isJsonRpcResult(s2) ? this.events.emit(yt$1("session_request", t), { result: s2.result }) : isJsonRpcError(s2) && this.events.emit(yt$1("session_request", t), { error: s2.error }); + }, this.onSessionEventRequest = async (e, s2) => { + const { id: t, params: i } = s2; + try { + const n = `${e}_session_event_${i.event.name}`, o2 = tr$1.get(n); + if (o2 && this.isRequestOutOfSync(o2, t)) { + this.client.logger.info(`Discarding out of sync request - ${t}`); + return; + } + this.isValidEmit(g$1({ topic: e }, i)), this.client.events.emit("session_event", { id: t, topic: e, params: i }), tr$1.set(n, t); + } catch (n) { + await this.sendError(t, e, n), this.client.logger.error(n); + } + }, this.addSessionRequestToSessionRequestQueue = (e) => { + this.sessionRequestQueue.queue.push(e); + }, this.cleanupAfterResponse = (e) => { + this.deletePendingSessionRequest(e.response.id, { message: "fulfilled", code: 0 }), setTimeout(() => { + this.sessionRequestQueue.state = I$1.idle, this.processSessionRequestQueue(); + }, cjs$1.toMiliseconds(this.requestQueueDelay)); + }, this.processSessionRequestQueue = () => { + if (this.sessionRequestQueue.state === I$1.active) { + this.client.logger.info("session request queue is already active."); + return; + } + const e = this.sessionRequestQueue.queue[0]; + if (!e) { + this.client.logger.info("session request queue is empty."); + return; + } + try { + this.sessionRequestQueue.state = I$1.active, this.client.events.emit("session_request", e); + } catch (s2) { + this.client.logger.error(s2); + } + }, this.onPairingCreated = (e) => { + if (e.active) + return; + const s2 = this.client.proposal.getAll().find((t) => t.pairingTopic === e.topic); + s2 && this.onSessionProposeRequest(e.topic, formatJsonRpcRequest("wc_sessionPropose", { requiredNamespaces: s2.requiredNamespaces, optionalNamespaces: s2.optionalNamespaces, relays: s2.relays, proposer: s2.proposer, sessionProperties: s2.sessionProperties }, s2.id)); + }, this.isValidConnect = async (e) => { + if (!Ht$1(e)) { + const { message: a } = N("MISSING_OR_INVALID", `connect() params: ${JSON.stringify(e)}`); + throw new Error(a); + } + const { pairingTopic: s2, requiredNamespaces: t, optionalNamespaces: i, sessionProperties: n, relays: o2 } = e; + if (w$1(s2) || await this.isValidPairingTopic(s2), !xt$1(o2, !0)) { + const { message: a } = N("MISSING_OR_INVALID", `connect() relays: ${o2}`); + throw new Error(a); + } + !w$1(t) && B$1(t) !== 0 && this.validateNamespaces(t, "requiredNamespaces"), !w$1(i) && B$1(i) !== 0 && this.validateNamespaces(i, "optionalNamespaces"), w$1(n) || this.validateSessionProps(n, "sessionProperties"); + }, this.validateNamespaces = (e, s2) => { + const t = Lt$1(e, "connect()", s2); + if (t) + throw new Error(t.message); + }, this.isValidApprove = async (e) => { + if (!Ht$1(e)) + throw new Error(N("MISSING_OR_INVALID", `approve() params: ${e}`).message); + const { id: s2, namespaces: t, relayProtocol: i, sessionProperties: n } = e; + await this.isValidProposalId(s2); + const o2 = this.client.proposal.get(s2), a = un(t, "approve()"); + if (a) + throw new Error(a.message); + const c = dn(o2.requiredNamespaces, t, "approve()"); + if (c) + throw new Error(c.message); + if (!h(i, !0)) { + const { message: p2 } = N("MISSING_OR_INVALID", `approve() relayProtocol: ${i}`); + throw new Error(p2); + } + w$1(n) || this.validateSessionProps(n, "sessionProperties"); + }, this.isValidReject = async (e) => { + if (!Ht$1(e)) { + const { message: i } = N("MISSING_OR_INVALID", `reject() params: ${e}`); + throw new Error(i); + } + const { id: s2, reason: t } = e; + if (await this.isValidProposalId(s2), !qt$1(t)) { + const { message: i } = N("MISSING_OR_INVALID", `reject() reason: ${JSON.stringify(t)}`); + throw new Error(i); + } + }, this.isValidSessionSettleRequest = (e) => { + if (!Ht$1(e)) { + const { message: c } = N("MISSING_OR_INVALID", `onSessionSettleRequest() params: ${e}`); + throw new Error(c); + } + const { relay: s2, controller: t, namespaces: i, expiry: n } = e; + if (!ln(s2)) { + const { message: c } = N("MISSING_OR_INVALID", "onSessionSettleRequest() relay protocol should be a string"); + throw new Error(c); + } + const o2 = Kt$1(t, "onSessionSettleRequest()"); + if (o2) + throw new Error(o2.message); + const a = un(i, "onSessionSettleRequest()"); + if (a) + throw new Error(a.message); + if (mt$1(n)) { + const { message: c } = N("EXPIRED", "onSessionSettleRequest()"); + throw new Error(c); + } + }, this.isValidUpdate = async (e) => { + if (!Ht$1(e)) { + const { message: a } = N("MISSING_OR_INVALID", `update() params: ${e}`); + throw new Error(a); + } + const { topic: s2, namespaces: t } = e; + await this.isValidSessionTopic(s2); + const i = this.client.session.get(s2), n = un(t, "update()"); + if (n) + throw new Error(n.message); + const o2 = dn(i.requiredNamespaces, t, "update()"); + if (o2) + throw new Error(o2.message); + }, this.isValidExtend = async (e) => { + if (!Ht$1(e)) { + const { message: t } = N("MISSING_OR_INVALID", `extend() params: ${e}`); + throw new Error(t); + } + const { topic: s2 } = e; + await this.isValidSessionTopic(s2); + }, this.isValidRequest = async (e) => { + if (!Ht$1(e)) { + const { message: a } = N("MISSING_OR_INVALID", `request() params: ${e}`); + throw new Error(a); + } + const { topic: s2, request: t, chainId: i, expiry: n } = e; + await this.isValidSessionTopic(s2); + const { namespaces: o2 } = this.client.session.get(s2); + if (!zt$1(o2, i)) { + const { message: a } = N("MISSING_OR_INVALID", `request() chainId: ${i}`); + throw new Error(a); + } + if (!Bt$1(t)) { + const { message: a } = N("MISSING_OR_INVALID", `request() ${JSON.stringify(t)}`); + throw new Error(a); + } + if (!Yt$1(o2, i, t.method)) { + const { message: a } = N("MISSING_OR_INVALID", `request() method: ${t.method}`); + throw new Error(a); + } + if (n && !Xt$1(n, U$1)) { + const { message: a } = N("MISSING_OR_INVALID", `request() expiry: ${n}. Expiry must be a number (in seconds) between ${U$1.min} and ${U$1.max}`); + throw new Error(a); + } + }, this.isValidRespond = async (e) => { + if (!Ht$1(e)) { + const { message: i } = N("MISSING_OR_INVALID", `respond() params: ${e}`); + throw new Error(i); + } + const { topic: s2, response: t } = e; + if (await this.isValidSessionTopic(s2), !Gt$1(t)) { + const { message: i } = N("MISSING_OR_INVALID", `respond() response: ${JSON.stringify(t)}`); + throw new Error(i); + } + }, this.isValidPing = async (e) => { + if (!Ht$1(e)) { + const { message: t } = N("MISSING_OR_INVALID", `ping() params: ${e}`); + throw new Error(t); + } + const { topic: s2 } = e; + await this.isValidSessionOrPairingTopic(s2); + }, this.isValidEmit = async (e) => { + if (!Ht$1(e)) { + const { message: o2 } = N("MISSING_OR_INVALID", `emit() params: ${e}`); + throw new Error(o2); + } + const { topic: s2, event: t, chainId: i } = e; + await this.isValidSessionTopic(s2); + const { namespaces: n } = this.client.session.get(s2); + if (!zt$1(n, i)) { + const { message: o2 } = N("MISSING_OR_INVALID", `emit() chainId: ${i}`); + throw new Error(o2); + } + if (!Wt$1(t)) { + const { message: o2 } = N("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t)}`); + throw new Error(o2); + } + if (!Jt$1(n, i, t.name)) { + const { message: o2 } = N("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t)}`); + throw new Error(o2); + } + }, this.isValidDisconnect = async (e) => { + if (!Ht$1(e)) { + const { message: t } = N("MISSING_OR_INVALID", `disconnect() params: ${e}`); + throw new Error(t); + } + const { topic: s2 } = e; + await this.isValidSessionOrPairingTopic(s2); + }, this.getVerifyContext = async (e, s2) => { + const t = { verified: { verifyUrl: s2.verifyUrl || $$1, validation: "UNKNOWN", origin: s2.url || "" } }; + try { + const i = await this.client.core.verify.resolve({ attestationId: e, verifyUrl: s2.verifyUrl }); + i && (t.verified.origin = i.origin, t.verified.isScam = i.isScam, t.verified.validation = i.origin === new URL(s2.url).origin ? "VALID" : "INVALID"); + } catch (i) { + this.client.logger.info(i); + } + return this.client.logger.info(`Verify context: ${JSON.stringify(t)}`), t; + }, this.validateSessionProps = (e, s2) => { + Object.values(e).forEach((t) => { + if (!h(t, !1)) { + const { message: i } = N("MISSING_OR_INVALID", `${s2} must be in Record format. Received: ${JSON.stringify(t)}`); + throw new Error(i); + } + }); + }; + } + async isInitialized() { + if (!this.initialized) { + const { message: r2 } = N("NOT_INITIALIZED", this.name); + throw new Error(r2); + } + await this.client.core.relayer.confirmOnlineStateOrThrow(); + } + registerRelayerEvents() { + this.client.core.relayer.on(D$2.message, async (r2) => { + const { topic: e, message: s2 } = r2; + if (this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(s2))) + return; + const t = await this.client.core.crypto.decode(e, s2); + try { + isJsonRpcRequest(t) ? (this.client.core.history.set(e, t), this.onRelayEventRequest({ topic: e, payload: t })) : isJsonRpcResponse(t) ? (await this.client.core.history.resolve(t), await this.onRelayEventResponse({ topic: e, payload: t }), this.client.core.history.delete(e, t.id)) : this.onRelayEventUnknownPayload({ topic: e, payload: t }); + } catch (i) { + this.client.logger.error(i); + } + }); + } + registerExpirerEvents() { + this.client.core.expirer.on(v.expired, async (r2) => { + const { topic: e, id: s2 } = ft$1(r2.target); + if (s2 && this.client.pendingRequest.keys.includes(s2)) + return await this.deletePendingSessionRequest(s2, N("EXPIRED"), !0); + e ? this.client.session.keys.includes(e) && (await this.deleteSession(e, !0), this.client.events.emit("session_expire", { topic: e })) : s2 && (await this.deleteProposal(s2, !0), this.client.events.emit("proposal_expire", { id: s2 })); + }); + } + registerPairingEvents() { + this.client.core.pairing.events.on(V$2.create, (r2) => this.onPairingCreated(r2)); + } + isValidPairingTopic(r2) { + if (!h(r2, !1)) { + const { message: e } = N("MISSING_OR_INVALID", `pairing topic should be a string: ${r2}`); + throw new Error(e); + } + if (!this.client.core.pairing.pairings.keys.includes(r2)) { + const { message: e } = N("NO_MATCHING_KEY", `pairing topic doesn't exist: ${r2}`); + throw new Error(e); + } + if (mt$1(this.client.core.pairing.pairings.get(r2).expiry)) { + const { message: e } = N("EXPIRED", `pairing topic: ${r2}`); + throw new Error(e); + } + } + async isValidSessionTopic(r2) { + if (!h(r2, !1)) { + const { message: e } = N("MISSING_OR_INVALID", `session topic should be a string: ${r2}`); + throw new Error(e); + } + if (!this.client.session.keys.includes(r2)) { + const { message: e } = N("NO_MATCHING_KEY", `session topic doesn't exist: ${r2}`); + throw new Error(e); + } + if (mt$1(this.client.session.get(r2).expiry)) { + await this.deleteSession(r2); + const { message: e } = N("EXPIRED", `session topic: ${r2}`); + throw new Error(e); + } + } + async isValidSessionOrPairingTopic(r2) { + if (this.client.session.keys.includes(r2)) + await this.isValidSessionTopic(r2); + else if (this.client.core.pairing.pairings.keys.includes(r2)) + this.isValidPairingTopic(r2); + else if (h(r2, !1)) { + const { message: e } = N("NO_MATCHING_KEY", `session or pairing topic doesn't exist: ${r2}`); + throw new Error(e); + } else { + const { message: e } = N("MISSING_OR_INVALID", `session or pairing topic should be a string: ${r2}`); + throw new Error(e); + } + } + async isValidProposalId(r2) { + if (!Ft$1(r2)) { + const { message: e } = N("MISSING_OR_INVALID", `proposal id should be a number: ${r2}`); + throw new Error(e); + } + if (!this.client.proposal.keys.includes(r2)) { + const { message: e } = N("NO_MATCHING_KEY", `proposal id doesn't exist: ${r2}`); + throw new Error(e); + } + if (mt$1(this.client.proposal.get(r2).expiry)) { + await this.deleteProposal(r2); + const { message: e } = N("EXPIRED", `proposal id: ${r2}`); + throw new Error(e); + } + } +}; +__name(_hs, "hs"); +let hs = _hs; +const _ds = class _ds extends Mt$1 { + constructor(r2, e) { + super(r2, e, ne, G$1), this.core = r2, this.logger = e; + } +}; +__name(_ds, "ds"); +let ds = _ds; +const _us = class _us extends Mt$1 { + constructor(r2, e) { + super(r2, e, ae, G$1), this.core = r2, this.logger = e; + } +}; +__name(_us, "us"); +let us = _us; +const _gs = class _gs extends Mt$1 { + constructor(r2, e) { + super(r2, e, le, G$1, (s2) => s2.id), this.core = r2, this.logger = e; + } +}; +__name(_gs, "gs"); +let gs = _gs; +const _Q = class _Q extends b$2 { + constructor(r2) { + super(r2), this.protocol = X$1, this.version = F$1, this.name = M$1.name, this.events = new eventsExports.EventEmitter(), this.on = (s2, t) => this.events.on(s2, t), this.once = (s2, t) => this.events.once(s2, t), this.off = (s2, t) => this.events.off(s2, t), this.removeListener = (s2, t) => this.events.removeListener(s2, t), this.removeAllListeners = (s2) => this.events.removeAllListeners(s2), this.connect = async (s2) => { + try { + return await this.engine.connect(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.pair = async (s2) => { + try { + return await this.engine.pair(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.approve = async (s2) => { + try { + return await this.engine.approve(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.reject = async (s2) => { + try { + return await this.engine.reject(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.update = async (s2) => { + try { + return await this.engine.update(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.extend = async (s2) => { + try { + return await this.engine.extend(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.request = async (s2) => { + try { + return await this.engine.request(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.respond = async (s2) => { + try { + return await this.engine.respond(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.ping = async (s2) => { + try { + return await this.engine.ping(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.emit = async (s2) => { + try { + return await this.engine.emit(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.disconnect = async (s2) => { + try { + return await this.engine.disconnect(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.find = (s2) => { + try { + return this.engine.find(s2); + } catch (t) { + throw this.logger.error(t.message), t; + } + }, this.getPendingSessionRequests = () => { + try { + return this.engine.getPendingSessionRequests(); + } catch (s2) { + throw this.logger.error(s2.message), s2; + } + }, this.name = (r2 == null ? void 0 : r2.name) || M$1.name, this.metadata = (r2 == null ? void 0 : r2.metadata) || Qn(); + const e = typeof (r2 == null ? void 0 : r2.logger) < "u" && typeof (r2 == null ? void 0 : r2.logger) != "string" ? r2.logger : cjs.pino(cjs.getDefaultLoggerOptions({ level: (r2 == null ? void 0 : r2.logger) || M$1.logger })); + this.core = (r2 == null ? void 0 : r2.core) || new Nr$1(r2), this.logger = cjs.generateChildLogger(e, this.name), this.session = new us(this.core, this.logger), this.proposal = new ds(this.core, this.logger), this.pendingRequest = new gs(this.core, this.logger), this.engine = new hs(this); + } + static async init(r2) { + const e = new _Q(r2); + return await e.initialize(), e; + } + get context() { + return cjs.getLoggerContext(this.logger); + } + get pairing() { + return this.core.pairing.pairings; + } + async initialize() { + this.logger.trace("Initialized"); + try { + await this.core.start(), await this.session.init(), await this.proposal.init(), await this.pendingRequest.init(), await this.engine.init(), this.core.verify.init({ verifyUrl: this.metadata.verifyUrl }), this.logger.info("SignClient Initialization Success"); + } catch (r2) { + throw this.logger.info("SignClient Initialization Failure"), this.logger.error(r2.message), r2; + } + } +}; +__name(_Q, "Q"); +let Q = _Q; +const ms = Q; +var l = { exports: {} }, u = typeof Reflect == "object" ? Reflect : null, m = u && typeof u.apply == "function" ? u.apply : function(t, e, n) { + return Function.prototype.apply.call(t, e, n); +}, f; +u && typeof u.ownKeys == "function" ? f = u.ownKeys : Object.getOwnPropertySymbols ? f = /* @__PURE__ */ __name(function(t) { + return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)); +}, "f") : f = /* @__PURE__ */ __name(function(t) { + return Object.getOwnPropertyNames(t); +}, "f"); +function T(s2) { + console && console.warn && console.warn(s2); +} +__name(T, "T"); +var y = Number.isNaN || function(t) { + return t !== t; +}; +function o() { + o.init.call(this); +} +__name(o, "o"); +l.exports = o, l.exports.once = M, o.EventEmitter = o, o.prototype._events = void 0, o.prototype._eventsCount = 0, o.prototype._maxListeners = void 0; +var w = 10; +function g(s2) { + if (typeof s2 != "function") + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof s2); +} +__name(g, "g"); +Object.defineProperty(o, "defaultMaxListeners", { enumerable: !0, get: function() { + return w; +}, set: function(s2) { + if (typeof s2 != "number" || s2 < 0 || y(s2)) + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + s2 + "."); + w = s2; +} }), o.init = function() { + (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; +}, o.prototype.setMaxListeners = function(t) { + if (typeof t != "number" || t < 0 || y(t)) + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + "."); + return this._maxListeners = t, this; +}; +function L(s2) { + return s2._maxListeners === void 0 ? o.defaultMaxListeners : s2._maxListeners; +} +__name(L, "L"); +o.prototype.getMaxListeners = function() { + return L(this); +}, o.prototype.emit = function(t) { + for (var e = [], n = 1; n < arguments.length; n++) + e.push(arguments[n]); + var i = t === "error", a = this._events; + if (a !== void 0) + i = i && a.error === void 0; + else if (!i) + return !1; + if (i) { + var r2; + if (e.length > 0 && (r2 = e[0]), r2 instanceof Error) + throw r2; + var h2 = new Error("Unhandled error." + (r2 ? " (" + r2.message + ")" : "")); + throw h2.context = r2, h2; + } + var c = a[t]; + if (c === void 0) + return !1; + if (typeof c == "function") + m(c, this, e); + else + for (var v2 = c.length, A2 = b(c, v2), n = 0; n < v2; ++n) + m(A2[n], this, e); + return !0; +}; +function _(s2, t, e, n) { + var i, a, r2; + if (g(e), a = s2._events, a === void 0 ? (a = s2._events = /* @__PURE__ */ Object.create(null), s2._eventsCount = 0) : (a.newListener !== void 0 && (s2.emit("newListener", t, e.listener ? e.listener : e), a = s2._events), r2 = a[t]), r2 === void 0) + r2 = a[t] = e, ++s2._eventsCount; + else if (typeof r2 == "function" ? r2 = a[t] = n ? [e, r2] : [r2, e] : n ? r2.unshift(e) : r2.push(e), i = L(s2), i > 0 && r2.length > i && !r2.warned) { + r2.warned = !0; + var h2 = new Error("Possible EventEmitter memory leak detected. " + r2.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit"); + h2.name = "MaxListenersExceededWarning", h2.emitter = s2, h2.type = t, h2.count = r2.length, T(h2); + } + return s2; +} +__name(_, "_"); +o.prototype.addListener = function(t, e) { + return _(this, t, e, !1); +}, o.prototype.on = o.prototype.addListener, o.prototype.prependListener = function(t, e) { + return _(this, t, e, !0); +}; +function j() { + if (!this.fired) + return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); +} +__name(j, "j"); +function S(s2, t, e) { + var n = { fired: !1, wrapFn: void 0, target: s2, type: t, listener: e }, i = j.bind(n); + return i.listener = e, n.wrapFn = i, i; +} +__name(S, "S"); +o.prototype.once = function(t, e) { + return g(e), this.on(t, S(this, t, e)), this; +}, o.prototype.prependOnceListener = function(t, e) { + return g(e), this.prependListener(t, S(this, t, e)), this; +}, o.prototype.removeListener = function(t, e) { + var n, i, a, r2, h2; + if (g(e), i = this._events, i === void 0) + return this; + if (n = i[t], n === void 0) + return this; + if (n === e || n.listener === e) + --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete i[t], i.removeListener && this.emit("removeListener", t, n.listener || e)); + else if (typeof n != "function") { + for (a = -1, r2 = n.length - 1; r2 >= 0; r2--) + if (n[r2] === e || n[r2].listener === e) { + h2 = n[r2].listener, a = r2; + break; + } + if (a < 0) + return this; + a === 0 ? n.shift() : I(n, a), n.length === 1 && (i[t] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", t, h2 || e); + } + return this; +}, o.prototype.off = o.prototype.removeListener, o.prototype.removeAllListeners = function(t) { + var e, n, i; + if (n = this._events, n === void 0) + return this; + if (n.removeListener === void 0) + return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : n[t] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete n[t]), this; + if (arguments.length === 0) { + var a = Object.keys(n), r2; + for (i = 0; i < a.length; ++i) + r2 = a[i], r2 !== "removeListener" && this.removeAllListeners(r2); + return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this; + } + if (e = n[t], typeof e == "function") + this.removeListener(t, e); + else if (e !== void 0) + for (i = e.length - 1; i >= 0; i--) + this.removeListener(t, e[i]); + return this; +}; +function C(s2, t, e) { + var n = s2._events; + if (n === void 0) + return []; + var i = n[t]; + return i === void 0 ? [] : typeof i == "function" ? e ? [i.listener || i] : [i] : e ? W(i) : b(i, i.length); +} +__name(C, "C"); +o.prototype.listeners = function(t) { + return C(this, t, !0); +}, o.prototype.rawListeners = function(t) { + return C(this, t, !1); +}, o.listenerCount = function(s2, t) { + return typeof s2.listenerCount == "function" ? s2.listenerCount(t) : E.call(s2, t); +}, o.prototype.listenerCount = E; +function E(s2) { + var t = this._events; + if (t !== void 0) { + var e = t[s2]; + if (typeof e == "function") + return 1; + if (e !== void 0) + return e.length; + } + return 0; +} +__name(E, "E"); +o.prototype.eventNames = function() { + return this._eventsCount > 0 ? f(this._events) : []; +}; +function b(s2, t) { + for (var e = new Array(t), n = 0; n < t; ++n) + e[n] = s2[n]; + return e; +} +__name(b, "b"); +function I(s2, t) { + for (; t + 1 < s2.length; t++) + s2[t] = s2[t + 1]; + s2.pop(); +} +__name(I, "I"); +function W(s2) { + for (var t = new Array(s2.length), e = 0; e < t.length; ++e) + t[e] = s2[e].listener || s2[e]; + return t; +} +__name(W, "W"); +function M(s2, t) { + return new Promise(function(e, n) { + function i(r2) { + s2.removeListener(t, a), n(r2); + } + __name(i, "i"); + function a() { + typeof s2.removeListener == "function" && s2.removeListener("error", i), e([].slice.call(arguments)); + } + __name(a, "a"), R(s2, t, a, { once: !0 }), t !== "error" && z(s2, i, { once: !0 }); + }); +} +__name(M, "M"); +function z(s2, t, e) { + typeof s2.on == "function" && R(s2, "error", t, e); +} +__name(z, "z"); +function R(s2, t, e, n) { + if (typeof s2.on == "function") + n.once ? s2.once(t, e) : s2.on(t, e); + else if (typeof s2.addEventListener == "function") + s2.addEventListener(t, /* @__PURE__ */ __name(function i(a) { + n.once && s2.removeEventListener(t, i), e(a); + }, "i")); + else + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof s2); +} +__name(R, "R"); +const O = "wc", F = 2, d = "Web3Wallet", K = `${O}@2:${d}:`, k = { database: ":memory:" }, U = "request", _X = class _X extends l.exports { + constructor() { + super(); + } +}; +__name(_X, "X"); +let X = _X; +const _x = class _x { + constructor(t) { + this.opts = t; + } +}; +__name(_x, "x"); +let x = _x; +const _P = class _P { + constructor(t) { + this.client = t; + } +}; +__name(_P, "P"); +let P = _P; +const _D = class _D extends P { + constructor(t) { + super(t), this.init = async () => { + this.signClient = await ms.init({ core: this.client.core, metadata: this.client.metadata }), this.authClient = await zr.init({ core: this.client.core, projectId: "", metadata: this.client.metadata }), this.initializeEventListeners(); + }, this.pair = async (e) => { + await this.client.core.pairing.pair(e); + }, this.approveSession = async (e) => { + const { topic: n, acknowledged: i } = await this.signClient.approve({ id: e.id, namespaces: e.namespaces }); + return await i(), this.signClient.session.get(n); + }, this.rejectSession = async (e) => await this.signClient.reject(e), this.updateSession = async (e) => await (await this.signClient.update(e)).acknowledged(), this.extendSession = async (e) => await (await this.signClient.extend(e)).acknowledged(), this.respondSessionRequest = async (e) => await this.signClient.respond(e), this.disconnectSession = async (e) => await this.signClient.disconnect(e), this.emitSessionEvent = async (e) => await this.signClient.emit(e), this.getActiveSessions = () => this.signClient.session.getAll().reduce((e, n) => (e[n.topic] = n, e), {}), this.getPendingSessionProposals = () => this.signClient.proposal.getAll(), this.getPendingSessionRequests = () => this.signClient.getPendingSessionRequests(), this.respondAuthRequest = async (e, n) => await this.authClient.respond(e, n), this.getPendingAuthRequests = () => this.authClient.requests.getAll().filter((e) => "requester" in e), this.formatMessage = (e, n) => this.authClient.formatMessage(e, n), this.onSessionRequest = (e) => { + this.client.events.emit("session_request", e); + }, this.onSessionProposal = (e) => { + this.client.events.emit("session_proposal", e); + }, this.onSessionDelete = (e) => { + this.client.events.emit("session_delete", e); + }, this.onAuthRequest = (e) => { + this.client.events.emit("auth_request", e); + }, this.initializeEventListeners = () => { + this.signClient.events.on("session_proposal", this.onSessionProposal), this.signClient.events.on("session_request", this.onSessionRequest), this.signClient.events.on("session_delete", this.onSessionDelete), this.authClient.on("auth_request", this.onAuthRequest); + }, this.signClient = {}, this.authClient = {}; + } +}; +__name(_D, "D"); +let D = _D; +const _p = class _p extends x { + constructor(t) { + super(t), this.events = new l.exports(), this.on = (e, n) => this.events.on(e, n), this.once = (e, n) => this.events.once(e, n), this.off = (e, n) => this.events.off(e, n), this.removeListener = (e, n) => this.events.removeListener(e, n), this.pair = async (e) => { + try { + return await this.engine.pair(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.approveSession = async (e) => { + try { + return await this.engine.approveSession(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.rejectSession = async (e) => { + try { + return await this.engine.rejectSession(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.updateSession = async (e) => { + try { + return await this.engine.updateSession(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.extendSession = async (e) => { + try { + return await this.engine.extendSession(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.respondSessionRequest = async (e) => { + try { + return await this.engine.respondSessionRequest(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.disconnectSession = async (e) => { + try { + return await this.engine.disconnectSession(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.emitSessionEvent = async (e) => { + try { + return await this.engine.emitSessionEvent(e); + } catch (n) { + throw this.logger.error(n.message), n; + } + }, this.getActiveSessions = () => { + try { + return this.engine.getActiveSessions(); + } catch (e) { + throw this.logger.error(e.message), e; + } + }, this.getPendingSessionProposals = () => { + try { + return this.engine.getPendingSessionProposals(); + } catch (e) { + throw this.logger.error(e.message), e; + } + }, this.getPendingSessionRequests = () => { + try { + return this.engine.getPendingSessionRequests(); + } catch (e) { + throw this.logger.error(e.message), e; + } + }, this.respondAuthRequest = async (e, n) => { + try { + return await this.engine.respondAuthRequest(e, n); + } catch (i) { + throw this.logger.error(i.message), i; + } + }, this.getPendingAuthRequests = () => { + try { + return this.engine.getPendingAuthRequests(); + } catch (e) { + throw this.logger.error(e.message), e; + } + }, this.formatMessage = (e, n) => { + try { + return this.engine.formatMessage(e, n); + } catch (i) { + throw this.logger.error(i.message), i; + } + }, this.metadata = t.metadata, this.name = t.name || d, this.core = t.core, this.logger = this.core.logger, this.engine = new D(this); + } + static async init(t) { + const e = new _p(t); + return await e.initialize(), e; + } + async initialize() { + this.logger.trace("Initialized"); + try { + await this.engine.init(), this.logger.info("Web3Wallet Initialization Success"); + } catch (t) { + throw this.logger.info("Web3Wallet Initialization Failure"), this.logger.error(t.message), t; + } + } +}; +__name(_p, "p"); +let p = _p; +const G = p; +export { + d as CLIENT_CONTEXT, + k as CLIENT_STORAGE_OPTIONS, + K as CLIENT_STORAGE_PREFIX, + x as IWeb3Wallet, + P as IWeb3WalletEngine, + X as IWeb3WalletEvents, + O as PROTOCOL, + F as PROTOCOL_VERSION, + U as REQUEST_CONTEXT, + G as Web3Wallet, + p as default +}; diff --git a/frontends/web/build/assets/index.js b/frontends/web/build/assets/index.js new file mode 100644 index 0000000000..d487564565 --- /dev/null +++ b/frontends/web/build/assets/index.js @@ -0,0 +1,65653 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value; +var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 }); +var __publicField = (obj, key, value) => (__defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), value); +function _mergeNamespaces(n2, m2) { + for (var i = 0; i < m2.length; i++) { + const e2 = m2[i]; + if (typeof e2 != "string" && !Array.isArray(e2)) { + for (const k2 in e2) + if (k2 !== "default" && !(k2 in n2)) { + const d2 = Object.getOwnPropertyDescriptor(e2, k2); + d2 && Object.defineProperty(n2, k2, d2.get ? d2 : { + enumerable: !0, + get: () => e2[k2] + }); + } + } + } + return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" })); +} +__name(_mergeNamespaces, "_mergeNamespaces"); +var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; +function getDefaultExportFromCjs(x2) { + return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2.default : x2; +} +__name(getDefaultExportFromCjs, "getDefaultExportFromCjs"); +function getAugmentedNamespace(n2) { + if (n2.__esModule) + return n2; + var f2 = n2.default; + if (typeof f2 == "function") { + var a2 = /* @__PURE__ */ __name(function a3() { + return this instanceof a3 ? Reflect.construct(f2, arguments, this.constructor) : f2.apply(this, arguments); + }, "a"); + a2.prototype = f2.prototype; + } else + a2 = {}; + return Object.defineProperty(a2, "__esModule", { value: !0 }), Object.keys(n2).forEach(function(k2) { + var d2 = Object.getOwnPropertyDescriptor(n2, k2); + Object.defineProperty(a2, k2, d2.get ? d2 : { + enumerable: !0, + get: function() { + return n2[k2]; + } + }); + }), a2; +} +__name(getAugmentedNamespace, "getAugmentedNamespace"); +var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {}, react = { exports: {} }, react_production_min = {}; +/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var l$3 = Symbol.for("react.element"), n$2 = Symbol.for("react.portal"), p$5 = Symbol.for("react.fragment"), q$3 = Symbol.for("react.strict_mode"), r$2 = Symbol.for("react.profiler"), t$2 = Symbol.for("react.provider"), u$1 = Symbol.for("react.context"), v$3 = Symbol.for("react.forward_ref"), w$4 = Symbol.for("react.suspense"), x$2 = Symbol.for("react.memo"), y$2 = Symbol.for("react.lazy"), z$3 = Symbol.iterator; +function A$5(a2) { + return a2 === null || typeof a2 != "object" ? null : (a2 = z$3 && a2[z$3] || a2["@@iterator"], typeof a2 == "function" ? a2 : null); +} +__name(A$5, "A$5"); +var B$3 = { isMounted: function() { + return !1; +}, enqueueForceUpdate: function() { +}, enqueueReplaceState: function() { +}, enqueueSetState: function() { +} }, C$3 = Object.assign, D$3 = {}; +function E$2(a2, b2, e2) { + this.props = a2, this.context = b2, this.refs = D$3, this.updater = e2 || B$3; +} +__name(E$2, "E$2"); +E$2.prototype.isReactComponent = {}; +E$2.prototype.setState = function(a2, b2) { + if (typeof a2 != "object" && typeof a2 != "function" && a2 != null) + throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); + this.updater.enqueueSetState(this, a2, b2, "setState"); +}; +E$2.prototype.forceUpdate = function(a2) { + this.updater.enqueueForceUpdate(this, a2, "forceUpdate"); +}; +function F$2() { +} +__name(F$2, "F$2"); +F$2.prototype = E$2.prototype; +function G$3(a2, b2, e2) { + this.props = a2, this.context = b2, this.refs = D$3, this.updater = e2 || B$3; +} +__name(G$3, "G$3"); +var H$3 = G$3.prototype = new F$2(); +H$3.constructor = G$3; +C$3(H$3, E$2.prototype); +H$3.isPureReactComponent = !0; +var I$2 = Array.isArray, J$2 = Object.prototype.hasOwnProperty, K$2 = { current: null }, L$3 = { key: !0, ref: !0, __self: !0, __source: !0 }; +function M$2(a2, b2, e2) { + var d2, c2 = {}, k2 = null, h2 = null; + if (b2 != null) + for (d2 in b2.ref !== void 0 && (h2 = b2.ref), b2.key !== void 0 && (k2 = "" + b2.key), b2) + J$2.call(b2, d2) && !L$3.hasOwnProperty(d2) && (c2[d2] = b2[d2]); + var g2 = arguments.length - 2; + if (g2 === 1) + c2.children = e2; + else if (1 < g2) { + for (var f2 = Array(g2), m2 = 0; m2 < g2; m2++) + f2[m2] = arguments[m2 + 2]; + c2.children = f2; + } + if (a2 && a2.defaultProps) + for (d2 in g2 = a2.defaultProps, g2) + c2[d2] === void 0 && (c2[d2] = g2[d2]); + return { $$typeof: l$3, type: a2, key: k2, ref: h2, props: c2, _owner: K$2.current }; +} +__name(M$2, "M$2"); +function N$3(a2, b2) { + return { $$typeof: l$3, type: a2.type, key: b2, ref: a2.ref, props: a2.props, _owner: a2._owner }; +} +__name(N$3, "N$3"); +function O$3(a2) { + return typeof a2 == "object" && a2 !== null && a2.$$typeof === l$3; +} +__name(O$3, "O$3"); +function escape$1(a2) { + var b2 = { "=": "=0", ":": "=2" }; + return "$" + a2.replace(/[=:]/g, function(a3) { + return b2[a3]; + }); +} +__name(escape$1, "escape$1"); +var P$2 = /\/+/g; +function Q$3(a2, b2) { + return typeof a2 == "object" && a2 !== null && a2.key != null ? escape$1("" + a2.key) : b2.toString(36); +} +__name(Q$3, "Q$3"); +function R$2(a2, b2, e2, d2, c2) { + var k2 = typeof a2; + (k2 === "undefined" || k2 === "boolean") && (a2 = null); + var h2 = !1; + if (a2 === null) + h2 = !0; + else + switch (k2) { + case "string": + case "number": + h2 = !0; + break; + case "object": + switch (a2.$$typeof) { + case l$3: + case n$2: + h2 = !0; + } + } + if (h2) + return h2 = a2, c2 = c2(h2), a2 = d2 === "" ? "." + Q$3(h2, 0) : d2, I$2(c2) ? (e2 = "", a2 != null && (e2 = a2.replace(P$2, "$&/") + "/"), R$2(c2, b2, e2, "", function(a3) { + return a3; + })) : c2 != null && (O$3(c2) && (c2 = N$3(c2, e2 + (!c2.key || h2 && h2.key === c2.key ? "" : ("" + c2.key).replace(P$2, "$&/") + "/") + a2)), b2.push(c2)), 1; + if (h2 = 0, d2 = d2 === "" ? "." : d2 + ":", I$2(a2)) + for (var g2 = 0; g2 < a2.length; g2++) { + k2 = a2[g2]; + var f2 = d2 + Q$3(k2, g2); + h2 += R$2(k2, b2, e2, f2, c2); + } + else if (f2 = A$5(a2), typeof f2 == "function") + for (a2 = f2.call(a2), g2 = 0; !(k2 = a2.next()).done; ) + k2 = k2.value, f2 = d2 + Q$3(k2, g2++), h2 += R$2(k2, b2, e2, f2, c2); + else if (k2 === "object") + throw b2 = String(a2), Error("Objects are not valid as a React child (found: " + (b2 === "[object Object]" ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b2) + "). If you meant to render a collection of children, use an array instead."); + return h2; +} +__name(R$2, "R$2"); +function S$3(a2, b2, e2) { + if (a2 == null) + return a2; + var d2 = [], c2 = 0; + return R$2(a2, d2, "", "", function(a3) { + return b2.call(e2, a3, c2++); + }), d2; +} +__name(S$3, "S$3"); +function T$3(a2) { + if (a2._status === -1) { + var b2 = a2._result; + b2 = b2(), b2.then(function(b3) { + (a2._status === 0 || a2._status === -1) && (a2._status = 1, a2._result = b3); + }, function(b3) { + (a2._status === 0 || a2._status === -1) && (a2._status = 2, a2._result = b3); + }), a2._status === -1 && (a2._status = 0, a2._result = b2); + } + if (a2._status === 1) + return a2._result.default; + throw a2._result; +} +__name(T$3, "T$3"); +var U$3 = { current: null }, V$3 = { transition: null }, W$2 = { ReactCurrentDispatcher: U$3, ReactCurrentBatchConfig: V$3, ReactCurrentOwner: K$2 }; +react_production_min.Children = { map: S$3, forEach: function(a2, b2, e2) { + S$3(a2, function() { + b2.apply(this, arguments); + }, e2); +}, count: function(a2) { + var b2 = 0; + return S$3(a2, function() { + b2++; + }), b2; +}, toArray: function(a2) { + return S$3(a2, function(a3) { + return a3; + }) || []; +}, only: function(a2) { + if (!O$3(a2)) + throw Error("React.Children.only expected to receive a single React element child."); + return a2; +} }; +react_production_min.Component = E$2; +react_production_min.Fragment = p$5; +react_production_min.Profiler = r$2; +react_production_min.PureComponent = G$3; +react_production_min.StrictMode = q$3; +react_production_min.Suspense = w$4; +react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W$2; +react_production_min.cloneElement = function(a2, b2, e2) { + if (a2 == null) + throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a2 + "."); + var d2 = C$3({}, a2.props), c2 = a2.key, k2 = a2.ref, h2 = a2._owner; + if (b2 != null) { + if (b2.ref !== void 0 && (k2 = b2.ref, h2 = K$2.current), b2.key !== void 0 && (c2 = "" + b2.key), a2.type && a2.type.defaultProps) + var g2 = a2.type.defaultProps; + for (f2 in b2) + J$2.call(b2, f2) && !L$3.hasOwnProperty(f2) && (d2[f2] = b2[f2] === void 0 && g2 !== void 0 ? g2[f2] : b2[f2]); + } + var f2 = arguments.length - 2; + if (f2 === 1) + d2.children = e2; + else if (1 < f2) { + g2 = Array(f2); + for (var m2 = 0; m2 < f2; m2++) + g2[m2] = arguments[m2 + 2]; + d2.children = g2; + } + return { $$typeof: l$3, type: a2.type, key: c2, ref: k2, props: d2, _owner: h2 }; +}; +react_production_min.createContext = function(a2) { + return a2 = { $$typeof: u$1, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, a2.Provider = { $$typeof: t$2, _context: a2 }, a2.Consumer = a2; +}; +react_production_min.createElement = M$2; +react_production_min.createFactory = function(a2) { + var b2 = M$2.bind(null, a2); + return b2.type = a2, b2; +}; +react_production_min.createRef = function() { + return { current: null }; +}; +react_production_min.forwardRef = function(a2) { + return { $$typeof: v$3, render: a2 }; +}; +react_production_min.isValidElement = O$3; +react_production_min.lazy = function(a2) { + return { $$typeof: y$2, _payload: { _status: -1, _result: a2 }, _init: T$3 }; +}; +react_production_min.memo = function(a2, b2) { + return { $$typeof: x$2, type: a2, compare: b2 === void 0 ? null : b2 }; +}; +react_production_min.startTransition = function(a2) { + var b2 = V$3.transition; + V$3.transition = {}; + try { + a2(); + } finally { + V$3.transition = b2; + } +}; +react_production_min.unstable_act = function() { + throw Error("act(...) is not supported in production builds of React."); +}; +react_production_min.useCallback = function(a2, b2) { + return U$3.current.useCallback(a2, b2); +}; +react_production_min.useContext = function(a2) { + return U$3.current.useContext(a2); +}; +react_production_min.useDebugValue = function() { +}; +react_production_min.useDeferredValue = function(a2) { + return U$3.current.useDeferredValue(a2); +}; +react_production_min.useEffect = function(a2, b2) { + return U$3.current.useEffect(a2, b2); +}; +react_production_min.useId = function() { + return U$3.current.useId(); +}; +react_production_min.useImperativeHandle = function(a2, b2, e2) { + return U$3.current.useImperativeHandle(a2, b2, e2); +}; +react_production_min.useInsertionEffect = function(a2, b2) { + return U$3.current.useInsertionEffect(a2, b2); +}; +react_production_min.useLayoutEffect = function(a2, b2) { + return U$3.current.useLayoutEffect(a2, b2); +}; +react_production_min.useMemo = function(a2, b2) { + return U$3.current.useMemo(a2, b2); +}; +react_production_min.useReducer = function(a2, b2, e2) { + return U$3.current.useReducer(a2, b2, e2); +}; +react_production_min.useRef = function(a2) { + return U$3.current.useRef(a2); +}; +react_production_min.useState = function(a2) { + return U$3.current.useState(a2); +}; +react_production_min.useSyncExternalStore = function(a2, b2, e2) { + return U$3.current.useSyncExternalStore(a2, b2, e2); +}; +react_production_min.useTransition = function() { + return U$3.current.useTransition(); +}; +react_production_min.version = "18.2.0"; +react.exports = react_production_min; +var reactExports = react.exports; +const React = /* @__PURE__ */ getDefaultExportFromCjs(reactExports), React$1 = /* @__PURE__ */ _mergeNamespaces({ + __proto__: null, + default: React +}, [reactExports]); +/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var f$2 = reactExports, k$3 = Symbol.for("react.element"), l$2 = Symbol.for("react.fragment"), m$4 = Object.prototype.hasOwnProperty, n$1 = f$2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$4 = { key: !0, ref: !0, __self: !0, __source: !0 }; +function q$2(c2, a2, g2) { + var b2, d2 = {}, e2 = null, h2 = null; + g2 !== void 0 && (e2 = "" + g2), a2.key !== void 0 && (e2 = "" + a2.key), a2.ref !== void 0 && (h2 = a2.ref); + for (b2 in a2) + m$4.call(a2, b2) && !p$4.hasOwnProperty(b2) && (d2[b2] = a2[b2]); + if (c2 && c2.defaultProps) + for (b2 in a2 = c2.defaultProps, a2) + d2[b2] === void 0 && (d2[b2] = a2[b2]); + return { $$typeof: k$3, type: c2, key: e2, ref: h2, props: d2, _owner: n$1.current }; +} +__name(q$2, "q$2"); +reactJsxRuntime_production_min.Fragment = l$2; +reactJsxRuntime_production_min.jsx = q$2; +reactJsxRuntime_production_min.jsxs = q$2; +jsxRuntime.exports = reactJsxRuntime_production_min; +var jsxRuntimeExports = jsxRuntime.exports, reactDom = { exports: {} }, reactDom_production_min = {}, scheduler = { exports: {} }, scheduler_production_min = {}; +/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +(function(exports) { + function f2(a2, b2) { + var c2 = a2.length; + a2.push(b2); + a: + for (; 0 < c2; ) { + var d2 = c2 - 1 >>> 1, e2 = a2[d2]; + if (0 < g2(e2, b2)) + a2[d2] = b2, a2[c2] = e2, c2 = d2; + else + break a; + } + } + __name(f2, "f"); + function h2(a2) { + return a2.length === 0 ? null : a2[0]; + } + __name(h2, "h"); + function k2(a2) { + if (a2.length === 0) + return null; + var b2 = a2[0], c2 = a2.pop(); + if (c2 !== b2) { + a2[0] = c2; + a: + for (var d2 = 0, e2 = a2.length, w2 = e2 >>> 1; d2 < w2; ) { + var m2 = 2 * (d2 + 1) - 1, C2 = a2[m2], n2 = m2 + 1, x2 = a2[n2]; + if (0 > g2(C2, c2)) + n2 < e2 && 0 > g2(x2, C2) ? (a2[d2] = x2, a2[n2] = c2, d2 = n2) : (a2[d2] = C2, a2[m2] = c2, d2 = m2); + else if (n2 < e2 && 0 > g2(x2, c2)) + a2[d2] = x2, a2[n2] = c2, d2 = n2; + else + break a; + } + } + return b2; + } + __name(k2, "k"); + function g2(a2, b2) { + var c2 = a2.sortIndex - b2.sortIndex; + return c2 !== 0 ? c2 : a2.id - b2.id; + } + if (__name(g2, "g"), typeof performance == "object" && typeof performance.now == "function") { + var l2 = performance; + exports.unstable_now = function() { + return l2.now(); + }; + } else { + var p2 = Date, q2 = p2.now(); + exports.unstable_now = function() { + return p2.now() - q2; + }; + } + var r2 = [], t2 = [], u2 = 1, v2 = null, y2 = 3, z2 = !1, A2 = !1, B2 = !1, D2 = typeof setTimeout == "function" ? setTimeout : null, E2 = typeof clearTimeout == "function" ? clearTimeout : null, F2 = typeof setImmediate < "u" ? setImmediate : null; + typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); + function G2(a2) { + for (var b2 = h2(t2); b2 !== null; ) { + if (b2.callback === null) + k2(t2); + else if (b2.startTime <= a2) + k2(t2), b2.sortIndex = b2.expirationTime, f2(r2, b2); + else + break; + b2 = h2(t2); + } + } + __name(G2, "G"); + function H2(a2) { + if (B2 = !1, G2(a2), !A2) + if (h2(r2) !== null) + A2 = !0, I2(J2); + else { + var b2 = h2(t2); + b2 !== null && K2(H2, b2.startTime - a2); + } + } + __name(H2, "H"); + function J2(a2, b2) { + A2 = !1, B2 && (B2 = !1, E2(L2), L2 = -1), z2 = !0; + var c2 = y2; + try { + for (G2(b2), v2 = h2(r2); v2 !== null && (!(v2.expirationTime > b2) || a2 && !M2()); ) { + var d2 = v2.callback; + if (typeof d2 == "function") { + v2.callback = null, y2 = v2.priorityLevel; + var e2 = d2(v2.expirationTime <= b2); + b2 = exports.unstable_now(), typeof e2 == "function" ? v2.callback = e2 : v2 === h2(r2) && k2(r2), G2(b2); + } else + k2(r2); + v2 = h2(r2); + } + if (v2 !== null) + var w2 = !0; + else { + var m2 = h2(t2); + m2 !== null && K2(H2, m2.startTime - b2), w2 = !1; + } + return w2; + } finally { + v2 = null, y2 = c2, z2 = !1; + } + } + __name(J2, "J"); + var N2 = !1, O2 = null, L2 = -1, P2 = 5, Q2 = -1; + function M2() { + return !(exports.unstable_now() - Q2 < P2); + } + __name(M2, "M"); + function R2() { + if (O2 !== null) { + var a2 = exports.unstable_now(); + Q2 = a2; + var b2 = !0; + try { + b2 = O2(!0, a2); + } finally { + b2 ? S2() : (N2 = !1, O2 = null); + } + } else + N2 = !1; + } + __name(R2, "R"); + var S2; + if (typeof F2 == "function") + S2 = /* @__PURE__ */ __name(function() { + F2(R2); + }, "S"); + else if (typeof MessageChannel < "u") { + var T2 = new MessageChannel(), U2 = T2.port2; + T2.port1.onmessage = R2, S2 = /* @__PURE__ */ __name(function() { + U2.postMessage(null); + }, "S"); + } else + S2 = /* @__PURE__ */ __name(function() { + D2(R2, 0); + }, "S"); + function I2(a2) { + O2 = a2, N2 || (N2 = !0, S2()); + } + __name(I2, "I"); + function K2(a2, b2) { + L2 = D2(function() { + a2(exports.unstable_now()); + }, b2); + } + __name(K2, "K"), exports.unstable_IdlePriority = 5, exports.unstable_ImmediatePriority = 1, exports.unstable_LowPriority = 4, exports.unstable_NormalPriority = 3, exports.unstable_Profiling = null, exports.unstable_UserBlockingPriority = 2, exports.unstable_cancelCallback = function(a2) { + a2.callback = null; + }, exports.unstable_continueExecution = function() { + A2 || z2 || (A2 = !0, I2(J2)); + }, exports.unstable_forceFrameRate = function(a2) { + 0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a2 ? Math.floor(1e3 / a2) : 5; + }, exports.unstable_getCurrentPriorityLevel = function() { + return y2; + }, exports.unstable_getFirstCallbackNode = function() { + return h2(r2); + }, exports.unstable_next = function(a2) { + switch (y2) { + case 1: + case 2: + case 3: + var b2 = 3; + break; + default: + b2 = y2; + } + var c2 = y2; + y2 = b2; + try { + return a2(); + } finally { + y2 = c2; + } + }, exports.unstable_pauseExecution = function() { + }, exports.unstable_requestPaint = function() { + }, exports.unstable_runWithPriority = function(a2, b2) { + switch (a2) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + default: + a2 = 3; + } + var c2 = y2; + y2 = a2; + try { + return b2(); + } finally { + y2 = c2; + } + }, exports.unstable_scheduleCallback = function(a2, b2, c2) { + var d2 = exports.unstable_now(); + switch (typeof c2 == "object" && c2 !== null ? (c2 = c2.delay, c2 = typeof c2 == "number" && 0 < c2 ? d2 + c2 : d2) : c2 = d2, a2) { + case 1: + var e2 = -1; + break; + case 2: + e2 = 250; + break; + case 5: + e2 = 1073741823; + break; + case 4: + e2 = 1e4; + break; + default: + e2 = 5e3; + } + return e2 = c2 + e2, a2 = { id: u2++, callback: b2, priorityLevel: a2, startTime: c2, expirationTime: e2, sortIndex: -1 }, c2 > d2 ? (a2.sortIndex = c2, f2(t2, a2), h2(r2) === null && a2 === h2(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = !0, K2(H2, c2 - d2))) : (a2.sortIndex = e2, f2(r2, a2), A2 || z2 || (A2 = !0, I2(J2))), a2; + }, exports.unstable_shouldYield = M2, exports.unstable_wrapCallback = function(a2) { + var b2 = y2; + return function() { + var c2 = y2; + y2 = b2; + try { + return a2.apply(this, arguments); + } finally { + y2 = c2; + } + }; + }; +})(scheduler_production_min); +scheduler.exports = scheduler_production_min; +var schedulerExports = scheduler.exports; +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var aa = reactExports, ca = schedulerExports; +function p$3(a2) { + for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a2, c2 = 1; c2 < arguments.length; c2++) + b2 += "&args[]=" + encodeURIComponent(arguments[c2]); + return "Minified React error #" + a2 + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; +} +__name(p$3, "p$3"); +var da = /* @__PURE__ */ new Set(), ea = {}; +function fa(a2, b2) { + ha(a2, b2), ha(a2 + "Capture", b2); +} +__name(fa, "fa"); +function ha(a2, b2) { + for (ea[a2] = b2, a2 = 0; a2 < b2.length; a2++) + da.add(b2[a2]); +} +__name(ha, "ha"); +var ia = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), ja = Object.prototype.hasOwnProperty, ka = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, la = {}, ma = {}; +function oa(a2) { + return ja.call(ma, a2) ? !0 : ja.call(la, a2) ? !1 : ka.test(a2) ? ma[a2] = !0 : (la[a2] = !0, !1); +} +__name(oa, "oa"); +function pa(a2, b2, c2, d2) { + if (c2 !== null && c2.type === 0) + return !1; + switch (typeof b2) { + case "function": + case "symbol": + return !0; + case "boolean": + return d2 ? !1 : c2 !== null ? !c2.acceptsBooleans : (a2 = a2.toLowerCase().slice(0, 5), a2 !== "data-" && a2 !== "aria-"); + default: + return !1; + } +} +__name(pa, "pa"); +function qa(a2, b2, c2, d2) { + if (b2 === null || typeof b2 > "u" || pa(a2, b2, c2, d2)) + return !0; + if (d2) + return !1; + if (c2 !== null) + switch (c2.type) { + case 3: + return !b2; + case 4: + return b2 === !1; + case 5: + return isNaN(b2); + case 6: + return isNaN(b2) || 1 > b2; + } + return !1; +} +__name(qa, "qa"); +function v$2(a2, b2, c2, d2, e2, f2, g2) { + this.acceptsBooleans = b2 === 2 || b2 === 3 || b2 === 4, this.attributeName = d2, this.attributeNamespace = e2, this.mustUseProperty = c2, this.propertyName = a2, this.type = b2, this.sanitizeURL = f2, this.removeEmptyString = g2; +} +__name(v$2, "v$2"); +var z$2 = {}; +"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a2) { + z$2[a2] = new v$2(a2, 0, !1, a2, null, !1, !1); +}); +[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a2) { + var b2 = a2[0]; + z$2[b2] = new v$2(b2, 1, !1, a2[1], null, !1, !1); +}); +["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 2, !1, a2.toLowerCase(), null, !1, !1); +}); +["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 2, !1, a2, null, !1, !1); +}); +"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a2) { + z$2[a2] = new v$2(a2, 3, !1, a2.toLowerCase(), null, !1, !1); +}); +["checked", "multiple", "muted", "selected"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 3, !0, a2, null, !1, !1); +}); +["capture", "download"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 4, !1, a2, null, !1, !1); +}); +["cols", "rows", "size", "span"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 6, !1, a2, null, !1, !1); +}); +["rowSpan", "start"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 5, !1, a2.toLowerCase(), null, !1, !1); +}); +var ra = /[\-:]([a-z])/g; +function sa(a2) { + return a2[1].toUpperCase(); +} +__name(sa, "sa"); +"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a2) { + var b2 = a2.replace( + ra, + sa + ); + z$2[b2] = new v$2(b2, 1, !1, a2, null, !1, !1); +}); +"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a2) { + var b2 = a2.replace(ra, sa); + z$2[b2] = new v$2(b2, 1, !1, a2, "http://www.w3.org/1999/xlink", !1, !1); +}); +["xml:base", "xml:lang", "xml:space"].forEach(function(a2) { + var b2 = a2.replace(ra, sa); + z$2[b2] = new v$2(b2, 1, !1, a2, "http://www.w3.org/XML/1998/namespace", !1, !1); +}); +["tabIndex", "crossOrigin"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 1, !1, a2.toLowerCase(), null, !1, !1); +}); +z$2.xlinkHref = new v$2("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1); +["src", "href", "action", "formAction"].forEach(function(a2) { + z$2[a2] = new v$2(a2, 1, !1, a2.toLowerCase(), null, !0, !0); +}); +function ta(a2, b2, c2, d2) { + var e2 = z$2.hasOwnProperty(b2) ? z$2[b2] : null; + (e2 !== null ? e2.type !== 0 : d2 || !(2 < b2.length) || b2[0] !== "o" && b2[0] !== "O" || b2[1] !== "n" && b2[1] !== "N") && (qa(b2, c2, e2, d2) && (c2 = null), d2 || e2 === null ? oa(b2) && (c2 === null ? a2.removeAttribute(b2) : a2.setAttribute(b2, "" + c2)) : e2.mustUseProperty ? a2[e2.propertyName] = c2 === null ? e2.type === 3 ? !1 : "" : c2 : (b2 = e2.attributeName, d2 = e2.attributeNamespace, c2 === null ? a2.removeAttribute(b2) : (e2 = e2.type, c2 = e2 === 3 || e2 === 4 && c2 === !0 ? "" : "" + c2, d2 ? a2.setAttributeNS(d2, b2, c2) : a2.setAttribute(b2, c2)))); +} +__name(ta, "ta"); +var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, va = Symbol.for("react.element"), wa = Symbol.for("react.portal"), ya = Symbol.for("react.fragment"), za = Symbol.for("react.strict_mode"), Aa = Symbol.for("react.profiler"), Ba = Symbol.for("react.provider"), Ca = Symbol.for("react.context"), Da = Symbol.for("react.forward_ref"), Ea = Symbol.for("react.suspense"), Fa = Symbol.for("react.suspense_list"), Ga = Symbol.for("react.memo"), Ha = Symbol.for("react.lazy"), Ia = Symbol.for("react.offscreen"), Ja = Symbol.iterator; +function Ka(a2) { + return a2 === null || typeof a2 != "object" ? null : (a2 = Ja && a2[Ja] || a2["@@iterator"], typeof a2 == "function" ? a2 : null); +} +__name(Ka, "Ka"); +var A$4 = Object.assign, La; +function Ma(a2) { + if (La === void 0) + try { + throw Error(); + } catch (c2) { + var b2 = c2.stack.trim().match(/\n( *(at )?)/); + La = b2 && b2[1] || ""; + } + return ` +` + La + a2; +} +__name(Ma, "Ma"); +var Na = !1; +function Oa(a2, b2) { + if (!a2 || Na) + return ""; + Na = !0; + var c2 = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + try { + if (b2) + if (b2 = /* @__PURE__ */ __name(function() { + throw Error(); + }, "b"), Object.defineProperty(b2.prototype, "props", { set: function() { + throw Error(); + } }), typeof Reflect == "object" && Reflect.construct) { + try { + Reflect.construct(b2, []); + } catch (l2) { + var d2 = l2; + } + Reflect.construct(a2, [], b2); + } else { + try { + b2.call(); + } catch (l2) { + d2 = l2; + } + a2.call(b2.prototype); + } + else { + try { + throw Error(); + } catch (l2) { + d2 = l2; + } + a2(); + } + } catch (l2) { + if (l2 && d2 && typeof l2.stack == "string") { + for (var e2 = l2.stack.split(` +`), f2 = d2.stack.split(` +`), g2 = e2.length - 1, h2 = f2.length - 1; 1 <= g2 && 0 <= h2 && e2[g2] !== f2[h2]; ) + h2--; + for (; 1 <= g2 && 0 <= h2; g2--, h2--) + if (e2[g2] !== f2[h2]) { + if (g2 !== 1 || h2 !== 1) + do + if (g2--, h2--, 0 > h2 || e2[g2] !== f2[h2]) { + var k2 = ` +` + e2[g2].replace(" at new ", " at "); + return a2.displayName && k2.includes("") && (k2 = k2.replace("", a2.displayName)), k2; + } + while (1 <= g2 && 0 <= h2); + break; + } + } + } finally { + Na = !1, Error.prepareStackTrace = c2; + } + return (a2 = a2 ? a2.displayName || a2.name : "") ? Ma(a2) : ""; +} +__name(Oa, "Oa"); +function Pa(a2) { + switch (a2.tag) { + case 5: + return Ma(a2.type); + case 16: + return Ma("Lazy"); + case 13: + return Ma("Suspense"); + case 19: + return Ma("SuspenseList"); + case 0: + case 2: + case 15: + return a2 = Oa(a2.type, !1), a2; + case 11: + return a2 = Oa(a2.type.render, !1), a2; + case 1: + return a2 = Oa(a2.type, !0), a2; + default: + return ""; + } +} +__name(Pa, "Pa"); +function Qa(a2) { + if (a2 == null) + return null; + if (typeof a2 == "function") + return a2.displayName || a2.name || null; + if (typeof a2 == "string") + return a2; + switch (a2) { + case ya: + return "Fragment"; + case wa: + return "Portal"; + case Aa: + return "Profiler"; + case za: + return "StrictMode"; + case Ea: + return "Suspense"; + case Fa: + return "SuspenseList"; + } + if (typeof a2 == "object") + switch (a2.$$typeof) { + case Ca: + return (a2.displayName || "Context") + ".Consumer"; + case Ba: + return (a2._context.displayName || "Context") + ".Provider"; + case Da: + var b2 = a2.render; + return a2 = a2.displayName, a2 || (a2 = b2.displayName || b2.name || "", a2 = a2 !== "" ? "ForwardRef(" + a2 + ")" : "ForwardRef"), a2; + case Ga: + return b2 = a2.displayName || null, b2 !== null ? b2 : Qa(a2.type) || "Memo"; + case Ha: + b2 = a2._payload, a2 = a2._init; + try { + return Qa(a2(b2)); + } catch { + } + } + return null; +} +__name(Qa, "Qa"); +function Ra(a2) { + var b2 = a2.type; + switch (a2.tag) { + case 24: + return "Cache"; + case 9: + return (b2.displayName || "Context") + ".Consumer"; + case 10: + return (b2._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return a2 = b2.render, a2 = a2.displayName || a2.name || "", b2.displayName || (a2 !== "" ? "ForwardRef(" + a2 + ")" : "ForwardRef"); + case 7: + return "Fragment"; + case 5: + return b2; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return Qa(b2); + case 8: + return b2 === za ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if (typeof b2 == "function") + return b2.displayName || b2.name || null; + if (typeof b2 == "string") + return b2; + } + return null; +} +__name(Ra, "Ra"); +function Sa(a2) { + switch (typeof a2) { + case "boolean": + case "number": + case "string": + case "undefined": + return a2; + case "object": + return a2; + default: + return ""; + } +} +__name(Sa, "Sa"); +function Ta(a2) { + var b2 = a2.type; + return (a2 = a2.nodeName) && a2.toLowerCase() === "input" && (b2 === "checkbox" || b2 === "radio"); +} +__name(Ta, "Ta"); +function Ua(a2) { + var b2 = Ta(a2) ? "checked" : "value", c2 = Object.getOwnPropertyDescriptor(a2.constructor.prototype, b2), d2 = "" + a2[b2]; + if (!a2.hasOwnProperty(b2) && typeof c2 < "u" && typeof c2.get == "function" && typeof c2.set == "function") { + var e2 = c2.get, f2 = c2.set; + return Object.defineProperty(a2, b2, { configurable: !0, get: function() { + return e2.call(this); + }, set: function(a3) { + d2 = "" + a3, f2.call(this, a3); + } }), Object.defineProperty(a2, b2, { enumerable: c2.enumerable }), { getValue: function() { + return d2; + }, setValue: function(a3) { + d2 = "" + a3; + }, stopTracking: function() { + a2._valueTracker = null, delete a2[b2]; + } }; + } +} +__name(Ua, "Ua"); +function Va(a2) { + a2._valueTracker || (a2._valueTracker = Ua(a2)); +} +__name(Va, "Va"); +function Wa(a2) { + if (!a2) + return !1; + var b2 = a2._valueTracker; + if (!b2) + return !0; + var c2 = b2.getValue(), d2 = ""; + return a2 && (d2 = Ta(a2) ? a2.checked ? "true" : "false" : a2.value), a2 = d2, a2 !== c2 ? (b2.setValue(a2), !0) : !1; +} +__name(Wa, "Wa"); +function Xa(a2) { + if (a2 = a2 || (typeof document < "u" ? document : void 0), typeof a2 > "u") + return null; + try { + return a2.activeElement || a2.body; + } catch { + return a2.body; + } +} +__name(Xa, "Xa"); +function Ya(a2, b2) { + var c2 = b2.checked; + return A$4({}, b2, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: c2 ?? a2._wrapperState.initialChecked }); +} +__name(Ya, "Ya"); +function Za(a2, b2) { + var c2 = b2.defaultValue == null ? "" : b2.defaultValue, d2 = b2.checked != null ? b2.checked : b2.defaultChecked; + c2 = Sa(b2.value != null ? b2.value : c2), a2._wrapperState = { initialChecked: d2, initialValue: c2, controlled: b2.type === "checkbox" || b2.type === "radio" ? b2.checked != null : b2.value != null }; +} +__name(Za, "Za"); +function ab(a2, b2) { + b2 = b2.checked, b2 != null && ta(a2, "checked", b2, !1); +} +__name(ab, "ab"); +function bb(a2, b2) { + ab(a2, b2); + var c2 = Sa(b2.value), d2 = b2.type; + if (c2 != null) + d2 === "number" ? (c2 === 0 && a2.value === "" || a2.value != c2) && (a2.value = "" + c2) : a2.value !== "" + c2 && (a2.value = "" + c2); + else if (d2 === "submit" || d2 === "reset") { + a2.removeAttribute("value"); + return; + } + b2.hasOwnProperty("value") ? cb(a2, b2.type, c2) : b2.hasOwnProperty("defaultValue") && cb(a2, b2.type, Sa(b2.defaultValue)), b2.checked == null && b2.defaultChecked != null && (a2.defaultChecked = !!b2.defaultChecked); +} +__name(bb, "bb"); +function db(a2, b2, c2) { + if (b2.hasOwnProperty("value") || b2.hasOwnProperty("defaultValue")) { + var d2 = b2.type; + if (!(d2 !== "submit" && d2 !== "reset" || b2.value !== void 0 && b2.value !== null)) + return; + b2 = "" + a2._wrapperState.initialValue, c2 || b2 === a2.value || (a2.value = b2), a2.defaultValue = b2; + } + c2 = a2.name, c2 !== "" && (a2.name = ""), a2.defaultChecked = !!a2._wrapperState.initialChecked, c2 !== "" && (a2.name = c2); +} +__name(db, "db"); +function cb(a2, b2, c2) { + (b2 !== "number" || Xa(a2.ownerDocument) !== a2) && (c2 == null ? a2.defaultValue = "" + a2._wrapperState.initialValue : a2.defaultValue !== "" + c2 && (a2.defaultValue = "" + c2)); +} +__name(cb, "cb"); +var eb = Array.isArray; +function fb(a2, b2, c2, d2) { + if (a2 = a2.options, b2) { + b2 = {}; + for (var e2 = 0; e2 < c2.length; e2++) + b2["$" + c2[e2]] = !0; + for (c2 = 0; c2 < a2.length; c2++) + e2 = b2.hasOwnProperty("$" + a2[c2].value), a2[c2].selected !== e2 && (a2[c2].selected = e2), e2 && d2 && (a2[c2].defaultSelected = !0); + } else { + for (c2 = "" + Sa(c2), b2 = null, e2 = 0; e2 < a2.length; e2++) { + if (a2[e2].value === c2) { + a2[e2].selected = !0, d2 && (a2[e2].defaultSelected = !0); + return; + } + b2 !== null || a2[e2].disabled || (b2 = a2[e2]); + } + b2 !== null && (b2.selected = !0); + } +} +__name(fb, "fb"); +function gb(a2, b2) { + if (b2.dangerouslySetInnerHTML != null) + throw Error(p$3(91)); + return A$4({}, b2, { value: void 0, defaultValue: void 0, children: "" + a2._wrapperState.initialValue }); +} +__name(gb, "gb"); +function hb(a2, b2) { + var c2 = b2.value; + if (c2 == null) { + if (c2 = b2.children, b2 = b2.defaultValue, c2 != null) { + if (b2 != null) + throw Error(p$3(92)); + if (eb(c2)) { + if (1 < c2.length) + throw Error(p$3(93)); + c2 = c2[0]; + } + b2 = c2; + } + b2 == null && (b2 = ""), c2 = b2; + } + a2._wrapperState = { initialValue: Sa(c2) }; +} +__name(hb, "hb"); +function ib(a2, b2) { + var c2 = Sa(b2.value), d2 = Sa(b2.defaultValue); + c2 != null && (c2 = "" + c2, c2 !== a2.value && (a2.value = c2), b2.defaultValue == null && a2.defaultValue !== c2 && (a2.defaultValue = c2)), d2 != null && (a2.defaultValue = "" + d2); +} +__name(ib, "ib"); +function jb(a2) { + var b2 = a2.textContent; + b2 === a2._wrapperState.initialValue && b2 !== "" && b2 !== null && (a2.value = b2); +} +__name(jb, "jb"); +function kb(a2) { + switch (a2) { + case "svg": + return "http://www.w3.org/2000/svg"; + case "math": + return "http://www.w3.org/1998/Math/MathML"; + default: + return "http://www.w3.org/1999/xhtml"; + } +} +__name(kb, "kb"); +function lb(a2, b2) { + return a2 == null || a2 === "http://www.w3.org/1999/xhtml" ? kb(b2) : a2 === "http://www.w3.org/2000/svg" && b2 === "foreignObject" ? "http://www.w3.org/1999/xhtml" : a2; +} +__name(lb, "lb"); +var mb, nb = function(a2) { + return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(b2, c2, d2, e2) { + MSApp.execUnsafeLocalFunction(function() { + return a2(b2, c2, d2, e2); + }); + } : a2; +}(function(a2, b2) { + if (a2.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in a2) + a2.innerHTML = b2; + else { + for (mb = mb || document.createElement("div"), mb.innerHTML = "" + b2.valueOf().toString() + "", b2 = mb.firstChild; a2.firstChild; ) + a2.removeChild(a2.firstChild); + for (; b2.firstChild; ) + a2.appendChild(b2.firstChild); + } +}); +function ob(a2, b2) { + if (b2) { + var c2 = a2.firstChild; + if (c2 && c2 === a2.lastChild && c2.nodeType === 3) { + c2.nodeValue = b2; + return; + } + } + a2.textContent = b2; +} +__name(ob, "ob"); +var pb = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0 +}, qb = ["Webkit", "ms", "Moz", "O"]; +Object.keys(pb).forEach(function(a2) { + qb.forEach(function(b2) { + b2 = b2 + a2.charAt(0).toUpperCase() + a2.substring(1), pb[b2] = pb[a2]; + }); +}); +function rb(a2, b2, c2) { + return b2 == null || typeof b2 == "boolean" || b2 === "" ? "" : c2 || typeof b2 != "number" || b2 === 0 || pb.hasOwnProperty(a2) && pb[a2] ? ("" + b2).trim() : b2 + "px"; +} +__name(rb, "rb"); +function sb(a2, b2) { + a2 = a2.style; + for (var c2 in b2) + if (b2.hasOwnProperty(c2)) { + var d2 = c2.indexOf("--") === 0, e2 = rb(c2, b2[c2], d2); + c2 === "float" && (c2 = "cssFloat"), d2 ? a2.setProperty(c2, e2) : a2[c2] = e2; + } +} +__name(sb, "sb"); +var tb = A$4({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 }); +function ub(a2, b2) { + if (b2) { + if (tb[a2] && (b2.children != null || b2.dangerouslySetInnerHTML != null)) + throw Error(p$3(137, a2)); + if (b2.dangerouslySetInnerHTML != null) { + if (b2.children != null) + throw Error(p$3(60)); + if (typeof b2.dangerouslySetInnerHTML != "object" || !("__html" in b2.dangerouslySetInnerHTML)) + throw Error(p$3(61)); + } + if (b2.style != null && typeof b2.style != "object") + throw Error(p$3(62)); + } +} +__name(ub, "ub"); +function vb(a2, b2) { + if (a2.indexOf("-") === -1) + return typeof b2.is == "string"; + switch (a2) { + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return !1; + default: + return !0; + } +} +__name(vb, "vb"); +var wb = null; +function xb(a2) { + return a2 = a2.target || a2.srcElement || window, a2.correspondingUseElement && (a2 = a2.correspondingUseElement), a2.nodeType === 3 ? a2.parentNode : a2; +} +__name(xb, "xb"); +var yb = null, zb = null, Ab = null; +function Bb(a2) { + if (a2 = Cb(a2)) { + if (typeof yb != "function") + throw Error(p$3(280)); + var b2 = a2.stateNode; + b2 && (b2 = Db(b2), yb(a2.stateNode, a2.type, b2)); + } +} +__name(Bb, "Bb"); +function Eb(a2) { + zb ? Ab ? Ab.push(a2) : Ab = [a2] : zb = a2; +} +__name(Eb, "Eb"); +function Fb() { + if (zb) { + var a2 = zb, b2 = Ab; + if (Ab = zb = null, Bb(a2), b2) + for (a2 = 0; a2 < b2.length; a2++) + Bb(b2[a2]); + } +} +__name(Fb, "Fb"); +function Gb(a2, b2) { + return a2(b2); +} +__name(Gb, "Gb"); +function Hb() { +} +__name(Hb, "Hb"); +var Ib = !1; +function Jb(a2, b2, c2) { + if (Ib) + return a2(b2, c2); + Ib = !0; + try { + return Gb(a2, b2, c2); + } finally { + Ib = !1, (zb !== null || Ab !== null) && (Hb(), Fb()); + } +} +__name(Jb, "Jb"); +function Kb(a2, b2) { + var c2 = a2.stateNode; + if (c2 === null) + return null; + var d2 = Db(c2); + if (d2 === null) + return null; + c2 = d2[b2]; + a: + switch (b2) { + case "onClick": + case "onClickCapture": + case "onDoubleClick": + case "onDoubleClickCapture": + case "onMouseDown": + case "onMouseDownCapture": + case "onMouseMove": + case "onMouseMoveCapture": + case "onMouseUp": + case "onMouseUpCapture": + case "onMouseEnter": + (d2 = !d2.disabled) || (a2 = a2.type, d2 = !(a2 === "button" || a2 === "input" || a2 === "select" || a2 === "textarea")), a2 = !d2; + break a; + default: + a2 = !1; + } + if (a2) + return null; + if (c2 && typeof c2 != "function") + throw Error(p$3(231, b2, typeof c2)); + return c2; +} +__name(Kb, "Kb"); +var Lb = !1; +if (ia) + try { + var Mb = {}; + Object.defineProperty(Mb, "passive", { get: function() { + Lb = !0; + } }), window.addEventListener("test", Mb, Mb), window.removeEventListener("test", Mb, Mb); + } catch { + Lb = !1; + } +function Nb(a2, b2, c2, d2, e2, f2, g2, h2, k2) { + var l2 = Array.prototype.slice.call(arguments, 3); + try { + b2.apply(c2, l2); + } catch (m2) { + this.onError(m2); + } +} +__name(Nb, "Nb"); +var Ob = !1, Pb = null, Qb = !1, Rb = null, Sb = { onError: function(a2) { + Ob = !0, Pb = a2; +} }; +function Tb(a2, b2, c2, d2, e2, f2, g2, h2, k2) { + Ob = !1, Pb = null, Nb.apply(Sb, arguments); +} +__name(Tb, "Tb"); +function Ub(a2, b2, c2, d2, e2, f2, g2, h2, k2) { + if (Tb.apply(this, arguments), Ob) { + if (Ob) { + var l2 = Pb; + Ob = !1, Pb = null; + } else + throw Error(p$3(198)); + Qb || (Qb = !0, Rb = l2); + } +} +__name(Ub, "Ub"); +function Vb(a2) { + var b2 = a2, c2 = a2; + if (a2.alternate) + for (; b2.return; ) + b2 = b2.return; + else { + a2 = b2; + do + b2 = a2, b2.flags & 4098 && (c2 = b2.return), a2 = b2.return; + while (a2); + } + return b2.tag === 3 ? c2 : null; +} +__name(Vb, "Vb"); +function Wb(a2) { + if (a2.tag === 13) { + var b2 = a2.memoizedState; + if (b2 === null && (a2 = a2.alternate, a2 !== null && (b2 = a2.memoizedState)), b2 !== null) + return b2.dehydrated; + } + return null; +} +__name(Wb, "Wb"); +function Xb(a2) { + if (Vb(a2) !== a2) + throw Error(p$3(188)); +} +__name(Xb, "Xb"); +function Yb(a2) { + var b2 = a2.alternate; + if (!b2) { + if (b2 = Vb(a2), b2 === null) + throw Error(p$3(188)); + return b2 !== a2 ? null : a2; + } + for (var c2 = a2, d2 = b2; ; ) { + var e2 = c2.return; + if (e2 === null) + break; + var f2 = e2.alternate; + if (f2 === null) { + if (d2 = e2.return, d2 !== null) { + c2 = d2; + continue; + } + break; + } + if (e2.child === f2.child) { + for (f2 = e2.child; f2; ) { + if (f2 === c2) + return Xb(e2), a2; + if (f2 === d2) + return Xb(e2), b2; + f2 = f2.sibling; + } + throw Error(p$3(188)); + } + if (c2.return !== d2.return) + c2 = e2, d2 = f2; + else { + for (var g2 = !1, h2 = e2.child; h2; ) { + if (h2 === c2) { + g2 = !0, c2 = e2, d2 = f2; + break; + } + if (h2 === d2) { + g2 = !0, d2 = e2, c2 = f2; + break; + } + h2 = h2.sibling; + } + if (!g2) { + for (h2 = f2.child; h2; ) { + if (h2 === c2) { + g2 = !0, c2 = f2, d2 = e2; + break; + } + if (h2 === d2) { + g2 = !0, d2 = f2, c2 = e2; + break; + } + h2 = h2.sibling; + } + if (!g2) + throw Error(p$3(189)); + } + } + if (c2.alternate !== d2) + throw Error(p$3(190)); + } + if (c2.tag !== 3) + throw Error(p$3(188)); + return c2.stateNode.current === c2 ? a2 : b2; +} +__name(Yb, "Yb"); +function Zb(a2) { + return a2 = Yb(a2), a2 !== null ? $b(a2) : null; +} +__name(Zb, "Zb"); +function $b(a2) { + if (a2.tag === 5 || a2.tag === 6) + return a2; + for (a2 = a2.child; a2 !== null; ) { + var b2 = $b(a2); + if (b2 !== null) + return b2; + a2 = a2.sibling; + } + return null; +} +__name($b, "$b"); +var ac = ca.unstable_scheduleCallback, bc = ca.unstable_cancelCallback, cc = ca.unstable_shouldYield, dc = ca.unstable_requestPaint, B$2 = ca.unstable_now, ec = ca.unstable_getCurrentPriorityLevel, fc = ca.unstable_ImmediatePriority, gc = ca.unstable_UserBlockingPriority, hc = ca.unstable_NormalPriority, ic = ca.unstable_LowPriority, jc = ca.unstable_IdlePriority, kc = null, lc = null; +function mc(a2) { + if (lc && typeof lc.onCommitFiberRoot == "function") + try { + lc.onCommitFiberRoot(kc, a2, void 0, (a2.current.flags & 128) === 128); + } catch { + } +} +__name(mc, "mc"); +var oc = Math.clz32 ? Math.clz32 : nc, pc = Math.log, qc = Math.LN2; +function nc(a2) { + return a2 >>>= 0, a2 === 0 ? 32 : 31 - (pc(a2) / qc | 0) | 0; +} +__name(nc, "nc"); +var rc = 64, sc = 4194304; +function tc(a2) { + switch (a2 & -a2) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return a2 & 4194240; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return a2 & 130023424; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 1073741824; + default: + return a2; + } +} +__name(tc, "tc"); +function uc(a2, b2) { + var c2 = a2.pendingLanes; + if (c2 === 0) + return 0; + var d2 = 0, e2 = a2.suspendedLanes, f2 = a2.pingedLanes, g2 = c2 & 268435455; + if (g2 !== 0) { + var h2 = g2 & ~e2; + h2 !== 0 ? d2 = tc(h2) : (f2 &= g2, f2 !== 0 && (d2 = tc(f2))); + } else + g2 = c2 & ~e2, g2 !== 0 ? d2 = tc(g2) : f2 !== 0 && (d2 = tc(f2)); + if (d2 === 0) + return 0; + if (b2 !== 0 && b2 !== d2 && !(b2 & e2) && (e2 = d2 & -d2, f2 = b2 & -b2, e2 >= f2 || e2 === 16 && (f2 & 4194240) !== 0)) + return b2; + if (d2 & 4 && (d2 |= c2 & 16), b2 = a2.entangledLanes, b2 !== 0) + for (a2 = a2.entanglements, b2 &= d2; 0 < b2; ) + c2 = 31 - oc(b2), e2 = 1 << c2, d2 |= a2[c2], b2 &= ~e2; + return d2; +} +__name(uc, "uc"); +function vc(a2, b2) { + switch (a2) { + case 1: + case 2: + case 4: + return b2 + 250; + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return b2 + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return -1; + } +} +__name(vc, "vc"); +function wc(a2, b2) { + for (var c2 = a2.suspendedLanes, d2 = a2.pingedLanes, e2 = a2.expirationTimes, f2 = a2.pendingLanes; 0 < f2; ) { + var g2 = 31 - oc(f2), h2 = 1 << g2, k2 = e2[g2]; + k2 === -1 ? (!(h2 & c2) || h2 & d2) && (e2[g2] = vc(h2, b2)) : k2 <= b2 && (a2.expiredLanes |= h2), f2 &= ~h2; + } +} +__name(wc, "wc"); +function xc(a2) { + return a2 = a2.pendingLanes & -1073741825, a2 !== 0 ? a2 : a2 & 1073741824 ? 1073741824 : 0; +} +__name(xc, "xc"); +function yc() { + var a2 = rc; + return rc <<= 1, !(rc & 4194240) && (rc = 64), a2; +} +__name(yc, "yc"); +function zc(a2) { + for (var b2 = [], c2 = 0; 31 > c2; c2++) + b2.push(a2); + return b2; +} +__name(zc, "zc"); +function Ac(a2, b2, c2) { + a2.pendingLanes |= b2, b2 !== 536870912 && (a2.suspendedLanes = 0, a2.pingedLanes = 0), a2 = a2.eventTimes, b2 = 31 - oc(b2), a2[b2] = c2; +} +__name(Ac, "Ac"); +function Bc(a2, b2) { + var c2 = a2.pendingLanes & ~b2; + a2.pendingLanes = b2, a2.suspendedLanes = 0, a2.pingedLanes = 0, a2.expiredLanes &= b2, a2.mutableReadLanes &= b2, a2.entangledLanes &= b2, b2 = a2.entanglements; + var d2 = a2.eventTimes; + for (a2 = a2.expirationTimes; 0 < c2; ) { + var e2 = 31 - oc(c2), f2 = 1 << e2; + b2[e2] = 0, d2[e2] = -1, a2[e2] = -1, c2 &= ~f2; + } +} +__name(Bc, "Bc"); +function Cc(a2, b2) { + var c2 = a2.entangledLanes |= b2; + for (a2 = a2.entanglements; c2; ) { + var d2 = 31 - oc(c2), e2 = 1 << d2; + e2 & b2 | a2[d2] & b2 && (a2[d2] |= b2), c2 &= ~e2; + } +} +__name(Cc, "Cc"); +var C$2 = 0; +function Dc(a2) { + return a2 &= -a2, 1 < a2 ? 4 < a2 ? a2 & 268435455 ? 16 : 536870912 : 4 : 1; +} +__name(Dc, "Dc"); +var Ec, Fc, Gc, Hc, Ic, Jc = !1, Kc = [], Lc = null, Mc = null, Nc = null, Oc = /* @__PURE__ */ new Map(), Pc = /* @__PURE__ */ new Map(), Qc = [], Rc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); +function Sc(a2, b2) { + switch (a2) { + case "focusin": + case "focusout": + Lc = null; + break; + case "dragenter": + case "dragleave": + Mc = null; + break; + case "mouseover": + case "mouseout": + Nc = null; + break; + case "pointerover": + case "pointerout": + Oc.delete(b2.pointerId); + break; + case "gotpointercapture": + case "lostpointercapture": + Pc.delete(b2.pointerId); + } +} +__name(Sc, "Sc"); +function Tc(a2, b2, c2, d2, e2, f2) { + return a2 === null || a2.nativeEvent !== f2 ? (a2 = { blockedOn: b2, domEventName: c2, eventSystemFlags: d2, nativeEvent: f2, targetContainers: [e2] }, b2 !== null && (b2 = Cb(b2), b2 !== null && Fc(b2)), a2) : (a2.eventSystemFlags |= d2, b2 = a2.targetContainers, e2 !== null && b2.indexOf(e2) === -1 && b2.push(e2), a2); +} +__name(Tc, "Tc"); +function Uc(a2, b2, c2, d2, e2) { + switch (b2) { + case "focusin": + return Lc = Tc(Lc, a2, b2, c2, d2, e2), !0; + case "dragenter": + return Mc = Tc(Mc, a2, b2, c2, d2, e2), !0; + case "mouseover": + return Nc = Tc(Nc, a2, b2, c2, d2, e2), !0; + case "pointerover": + var f2 = e2.pointerId; + return Oc.set(f2, Tc(Oc.get(f2) || null, a2, b2, c2, d2, e2)), !0; + case "gotpointercapture": + return f2 = e2.pointerId, Pc.set(f2, Tc(Pc.get(f2) || null, a2, b2, c2, d2, e2)), !0; + } + return !1; +} +__name(Uc, "Uc"); +function Vc(a2) { + var b2 = Wc(a2.target); + if (b2 !== null) { + var c2 = Vb(b2); + if (c2 !== null) { + if (b2 = c2.tag, b2 === 13) { + if (b2 = Wb(c2), b2 !== null) { + a2.blockedOn = b2, Ic(a2.priority, function() { + Gc(c2); + }); + return; + } + } else if (b2 === 3 && c2.stateNode.current.memoizedState.isDehydrated) { + a2.blockedOn = c2.tag === 3 ? c2.stateNode.containerInfo : null; + return; + } + } + } + a2.blockedOn = null; +} +__name(Vc, "Vc"); +function Xc(a2) { + if (a2.blockedOn !== null) + return !1; + for (var b2 = a2.targetContainers; 0 < b2.length; ) { + var c2 = Yc(a2.domEventName, a2.eventSystemFlags, b2[0], a2.nativeEvent); + if (c2 === null) { + c2 = a2.nativeEvent; + var d2 = new c2.constructor(c2.type, c2); + wb = d2, c2.target.dispatchEvent(d2), wb = null; + } else + return b2 = Cb(c2), b2 !== null && Fc(b2), a2.blockedOn = c2, !1; + b2.shift(); + } + return !0; +} +__name(Xc, "Xc"); +function Zc(a2, b2, c2) { + Xc(a2) && c2.delete(b2); +} +__name(Zc, "Zc"); +function $c() { + Jc = !1, Lc !== null && Xc(Lc) && (Lc = null), Mc !== null && Xc(Mc) && (Mc = null), Nc !== null && Xc(Nc) && (Nc = null), Oc.forEach(Zc), Pc.forEach(Zc); +} +__name($c, "$c"); +function ad(a2, b2) { + a2.blockedOn === b2 && (a2.blockedOn = null, Jc || (Jc = !0, ca.unstable_scheduleCallback(ca.unstable_NormalPriority, $c))); +} +__name(ad, "ad"); +function bd(a2) { + function b2(b3) { + return ad(b3, a2); + } + if (__name(b2, "b"), 0 < Kc.length) { + ad(Kc[0], a2); + for (var c2 = 1; c2 < Kc.length; c2++) { + var d2 = Kc[c2]; + d2.blockedOn === a2 && (d2.blockedOn = null); + } + } + for (Lc !== null && ad(Lc, a2), Mc !== null && ad(Mc, a2), Nc !== null && ad(Nc, a2), Oc.forEach(b2), Pc.forEach(b2), c2 = 0; c2 < Qc.length; c2++) + d2 = Qc[c2], d2.blockedOn === a2 && (d2.blockedOn = null); + for (; 0 < Qc.length && (c2 = Qc[0], c2.blockedOn === null); ) + Vc(c2), c2.blockedOn === null && Qc.shift(); +} +__name(bd, "bd"); +var cd = ua.ReactCurrentBatchConfig, dd = !0; +function ed(a2, b2, c2, d2) { + var e2 = C$2, f2 = cd.transition; + cd.transition = null; + try { + C$2 = 1, fd(a2, b2, c2, d2); + } finally { + C$2 = e2, cd.transition = f2; + } +} +__name(ed, "ed"); +function gd(a2, b2, c2, d2) { + var e2 = C$2, f2 = cd.transition; + cd.transition = null; + try { + C$2 = 4, fd(a2, b2, c2, d2); + } finally { + C$2 = e2, cd.transition = f2; + } +} +__name(gd, "gd"); +function fd(a2, b2, c2, d2) { + if (dd) { + var e2 = Yc(a2, b2, c2, d2); + if (e2 === null) + hd(a2, b2, d2, id, c2), Sc(a2, d2); + else if (Uc(e2, a2, b2, c2, d2)) + d2.stopPropagation(); + else if (Sc(a2, d2), b2 & 4 && -1 < Rc.indexOf(a2)) { + for (; e2 !== null; ) { + var f2 = Cb(e2); + if (f2 !== null && Ec(f2), f2 = Yc(a2, b2, c2, d2), f2 === null && hd(a2, b2, d2, id, c2), f2 === e2) + break; + e2 = f2; + } + e2 !== null && d2.stopPropagation(); + } else + hd(a2, b2, d2, null, c2); + } +} +__name(fd, "fd"); +var id = null; +function Yc(a2, b2, c2, d2) { + if (id = null, a2 = xb(d2), a2 = Wc(a2), a2 !== null) + if (b2 = Vb(a2), b2 === null) + a2 = null; + else if (c2 = b2.tag, c2 === 13) { + if (a2 = Wb(b2), a2 !== null) + return a2; + a2 = null; + } else if (c2 === 3) { + if (b2.stateNode.current.memoizedState.isDehydrated) + return b2.tag === 3 ? b2.stateNode.containerInfo : null; + a2 = null; + } else + b2 !== a2 && (a2 = null); + return id = a2, null; +} +__name(Yc, "Yc"); +function jd(a2) { + switch (a2) { + case "cancel": + case "click": + case "close": + case "contextmenu": + case "copy": + case "cut": + case "auxclick": + case "dblclick": + case "dragend": + case "dragstart": + case "drop": + case "focusin": + case "focusout": + case "input": + case "invalid": + case "keydown": + case "keypress": + case "keyup": + case "mousedown": + case "mouseup": + case "paste": + case "pause": + case "play": + case "pointercancel": + case "pointerdown": + case "pointerup": + case "ratechange": + case "reset": + case "resize": + case "seeked": + case "submit": + case "touchcancel": + case "touchend": + case "touchstart": + case "volumechange": + case "change": + case "selectionchange": + case "textInput": + case "compositionstart": + case "compositionend": + case "compositionupdate": + case "beforeblur": + case "afterblur": + case "beforeinput": + case "blur": + case "fullscreenchange": + case "focus": + case "hashchange": + case "popstate": + case "select": + case "selectstart": + return 1; + case "drag": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "mousemove": + case "mouseout": + case "mouseover": + case "pointermove": + case "pointerout": + case "pointerover": + case "scroll": + case "toggle": + case "touchmove": + case "wheel": + case "mouseenter": + case "mouseleave": + case "pointerenter": + case "pointerleave": + return 4; + case "message": + switch (ec()) { + case fc: + return 1; + case gc: + return 4; + case hc: + case ic: + return 16; + case jc: + return 536870912; + default: + return 16; + } + default: + return 16; + } +} +__name(jd, "jd"); +var kd = null, ld = null, md = null; +function nd() { + if (md) + return md; + var a2, b2 = ld, c2 = b2.length, d2, e2 = "value" in kd ? kd.value : kd.textContent, f2 = e2.length; + for (a2 = 0; a2 < c2 && b2[a2] === e2[a2]; a2++) + ; + var g2 = c2 - a2; + for (d2 = 1; d2 <= g2 && b2[c2 - d2] === e2[f2 - d2]; d2++) + ; + return md = e2.slice(a2, 1 < d2 ? 1 - d2 : void 0); +} +__name(nd, "nd"); +function od(a2) { + var b2 = a2.keyCode; + return "charCode" in a2 ? (a2 = a2.charCode, a2 === 0 && b2 === 13 && (a2 = 13)) : a2 = b2, a2 === 10 && (a2 = 13), 32 <= a2 || a2 === 13 ? a2 : 0; +} +__name(od, "od"); +function pd() { + return !0; +} +__name(pd, "pd"); +function qd() { + return !1; +} +__name(qd, "qd"); +function rd(a2) { + function b2(b3, d2, e2, f2, g2) { + this._reactName = b3, this._targetInst = e2, this.type = d2, this.nativeEvent = f2, this.target = g2, this.currentTarget = null; + for (var c2 in a2) + a2.hasOwnProperty(c2) && (b3 = a2[c2], this[c2] = b3 ? b3(f2) : f2[c2]); + return this.isDefaultPrevented = (f2.defaultPrevented != null ? f2.defaultPrevented : f2.returnValue === !1) ? pd : qd, this.isPropagationStopped = qd, this; + } + return __name(b2, "b"), A$4(b2.prototype, { preventDefault: function() { + this.defaultPrevented = !0; + var a3 = this.nativeEvent; + a3 && (a3.preventDefault ? a3.preventDefault() : typeof a3.returnValue != "unknown" && (a3.returnValue = !1), this.isDefaultPrevented = pd); + }, stopPropagation: function() { + var a3 = this.nativeEvent; + a3 && (a3.stopPropagation ? a3.stopPropagation() : typeof a3.cancelBubble != "unknown" && (a3.cancelBubble = !0), this.isPropagationStopped = pd); + }, persist: function() { + }, isPersistent: pd }), b2; +} +__name(rd, "rd"); +var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a2) { + return a2.timeStamp || Date.now(); +}, defaultPrevented: 0, isTrusted: 0 }, td = rd(sd), ud = A$4({}, sd, { view: 0, detail: 0 }), vd = rd(ud), wd, xd, yd, Ad = A$4({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a2) { + return a2.relatedTarget === void 0 ? a2.fromElement === a2.srcElement ? a2.toElement : a2.fromElement : a2.relatedTarget; +}, movementX: function(a2) { + return "movementX" in a2 ? a2.movementX : (a2 !== yd && (yd && a2.type === "mousemove" ? (wd = a2.screenX - yd.screenX, xd = a2.screenY - yd.screenY) : xd = wd = 0, yd = a2), wd); +}, movementY: function(a2) { + return "movementY" in a2 ? a2.movementY : xd; +} }), Bd = rd(Ad), Cd = A$4({}, Ad, { dataTransfer: 0 }), Dd = rd(Cd), Ed = A$4({}, ud, { relatedTarget: 0 }), Fd = rd(Ed), Gd = A$4({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Hd = rd(Gd), Id = A$4({}, sd, { clipboardData: function(a2) { + return "clipboardData" in a2 ? a2.clipboardData : window.clipboardData; +} }), Jd = rd(Id), Kd = A$4({}, sd, { data: 0 }), Ld = rd(Kd), Md = { + Esc: "Escape", + Spacebar: " ", + Left: "ArrowLeft", + Up: "ArrowUp", + Right: "ArrowRight", + Down: "ArrowDown", + Del: "Delete", + Win: "OS", + Menu: "ContextMenu", + Apps: "ContextMenu", + Scroll: "ScrollLock", + MozPrintableKey: "Unidentified" +}, Nd = { + 8: "Backspace", + 9: "Tab", + 12: "Clear", + 13: "Enter", + 16: "Shift", + 17: "Control", + 18: "Alt", + 19: "Pause", + 20: "CapsLock", + 27: "Escape", + 32: " ", + 33: "PageUp", + 34: "PageDown", + 35: "End", + 36: "Home", + 37: "ArrowLeft", + 38: "ArrowUp", + 39: "ArrowRight", + 40: "ArrowDown", + 45: "Insert", + 46: "Delete", + 112: "F1", + 113: "F2", + 114: "F3", + 115: "F4", + 116: "F5", + 117: "F6", + 118: "F7", + 119: "F8", + 120: "F9", + 121: "F10", + 122: "F11", + 123: "F12", + 144: "NumLock", + 145: "ScrollLock", + 224: "Meta" +}, Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; +function Pd(a2) { + var b2 = this.nativeEvent; + return b2.getModifierState ? b2.getModifierState(a2) : (a2 = Od[a2]) ? !!b2[a2] : !1; +} +__name(Pd, "Pd"); +function zd() { + return Pd; +} +__name(zd, "zd"); +var Qd = A$4({}, ud, { key: function(a2) { + if (a2.key) { + var b2 = Md[a2.key] || a2.key; + if (b2 !== "Unidentified") + return b2; + } + return a2.type === "keypress" ? (a2 = od(a2), a2 === 13 ? "Enter" : String.fromCharCode(a2)) : a2.type === "keydown" || a2.type === "keyup" ? Nd[a2.keyCode] || "Unidentified" : ""; +}, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a2) { + return a2.type === "keypress" ? od(a2) : 0; +}, keyCode: function(a2) { + return a2.type === "keydown" || a2.type === "keyup" ? a2.keyCode : 0; +}, which: function(a2) { + return a2.type === "keypress" ? od(a2) : a2.type === "keydown" || a2.type === "keyup" ? a2.keyCode : 0; +} }), Rd = rd(Qd), Sd = A$4({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Td = rd(Sd), Ud = A$4({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }), Vd = rd(Ud), Wd = A$4({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xd = rd(Wd), Yd = A$4({}, Ad, { + deltaX: function(a2) { + return "deltaX" in a2 ? a2.deltaX : "wheelDeltaX" in a2 ? -a2.wheelDeltaX : 0; + }, + deltaY: function(a2) { + return "deltaY" in a2 ? a2.deltaY : "wheelDeltaY" in a2 ? -a2.wheelDeltaY : "wheelDelta" in a2 ? -a2.wheelDelta : 0; + }, + deltaZ: 0, + deltaMode: 0 +}), Zd = rd(Yd), $d = [9, 13, 27, 32], ae$2 = ia && "CompositionEvent" in window, be$1 = null; +ia && "documentMode" in document && (be$1 = document.documentMode); +var ce$2 = ia && "TextEvent" in window && !be$1, de$1 = ia && (!ae$2 || be$1 && 8 < be$1 && 11 >= be$1), ee$2 = String.fromCharCode(32), fe$1 = !1; +function ge$1(a2, b2) { + switch (a2) { + case "keyup": + return $d.indexOf(b2.keyCode) !== -1; + case "keydown": + return b2.keyCode !== 229; + case "keypress": + case "mousedown": + case "focusout": + return !0; + default: + return !1; + } +} +__name(ge$1, "ge$1"); +function he$1(a2) { + return a2 = a2.detail, typeof a2 == "object" && "data" in a2 ? a2.data : null; +} +__name(he$1, "he$1"); +var ie$2 = !1; +function je(a2, b2) { + switch (a2) { + case "compositionend": + return he$1(b2); + case "keypress": + return b2.which !== 32 ? null : (fe$1 = !0, ee$2); + case "textInput": + return a2 = b2.data, a2 === ee$2 && fe$1 ? null : a2; + default: + return null; + } +} +__name(je, "je"); +function ke$2(a2, b2) { + if (ie$2) + return a2 === "compositionend" || !ae$2 && ge$1(a2, b2) ? (a2 = nd(), md = ld = kd = null, ie$2 = !1, a2) : null; + switch (a2) { + case "paste": + return null; + case "keypress": + if (!(b2.ctrlKey || b2.altKey || b2.metaKey) || b2.ctrlKey && b2.altKey) { + if (b2.char && 1 < b2.char.length) + return b2.char; + if (b2.which) + return String.fromCharCode(b2.which); + } + return null; + case "compositionend": + return de$1 && b2.locale !== "ko" ? null : b2.data; + default: + return null; + } +} +__name(ke$2, "ke$2"); +var le$1 = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 }; +function me$1(a2) { + var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase(); + return b2 === "input" ? !!le$1[a2.type] : b2 === "textarea"; +} +__name(me$1, "me$1"); +function ne$1(a2, b2, c2, d2) { + Eb(d2), b2 = oe$2(b2, "onChange"), 0 < b2.length && (c2 = new td("onChange", "change", null, c2, d2), a2.push({ event: c2, listeners: b2 })); +} +__name(ne$1, "ne$1"); +var pe$1 = null, qe$1 = null; +function re$2(a2) { + se$2(a2, 0); +} +__name(re$2, "re$2"); +function te$2(a2) { + var b2 = ue$1(a2); + if (Wa(b2)) + return a2; +} +__name(te$2, "te$2"); +function ve$1(a2, b2) { + if (a2 === "change") + return b2; +} +__name(ve$1, "ve$1"); +var we$1 = !1; +if (ia) { + var xe$1; + if (ia) { + var ye$1 = "oninput" in document; + if (!ye$1) { + var ze$1 = document.createElement("div"); + ze$1.setAttribute("oninput", "return;"), ye$1 = typeof ze$1.oninput == "function"; + } + xe$1 = ye$1; + } else + xe$1 = !1; + we$1 = xe$1 && (!document.documentMode || 9 < document.documentMode); +} +function Ae$1() { + pe$1 && (pe$1.detachEvent("onpropertychange", Be$1), qe$1 = pe$1 = null); +} +__name(Ae$1, "Ae$1"); +function Be$1(a2) { + if (a2.propertyName === "value" && te$2(qe$1)) { + var b2 = []; + ne$1(b2, qe$1, a2, xb(a2)), Jb(re$2, b2); + } +} +__name(Be$1, "Be$1"); +function Ce$2(a2, b2, c2) { + a2 === "focusin" ? (Ae$1(), pe$1 = b2, qe$1 = c2, pe$1.attachEvent("onpropertychange", Be$1)) : a2 === "focusout" && Ae$1(); +} +__name(Ce$2, "Ce$2"); +function De$1(a2) { + if (a2 === "selectionchange" || a2 === "keyup" || a2 === "keydown") + return te$2(qe$1); +} +__name(De$1, "De$1"); +function Ee(a2, b2) { + if (a2 === "click") + return te$2(b2); +} +__name(Ee, "Ee"); +function Fe$1(a2, b2) { + if (a2 === "input" || a2 === "change") + return te$2(b2); +} +__name(Fe$1, "Fe$1"); +function Ge$1(a2, b2) { + return a2 === b2 && (a2 !== 0 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2; +} +__name(Ge$1, "Ge$1"); +var He$1 = typeof Object.is == "function" ? Object.is : Ge$1; +function Ie$1(a2, b2) { + if (He$1(a2, b2)) + return !0; + if (typeof a2 != "object" || a2 === null || typeof b2 != "object" || b2 === null) + return !1; + var c2 = Object.keys(a2), d2 = Object.keys(b2); + if (c2.length !== d2.length) + return !1; + for (d2 = 0; d2 < c2.length; d2++) { + var e2 = c2[d2]; + if (!ja.call(b2, e2) || !He$1(a2[e2], b2[e2])) + return !1; + } + return !0; +} +__name(Ie$1, "Ie$1"); +function Je$1(a2) { + for (; a2 && a2.firstChild; ) + a2 = a2.firstChild; + return a2; +} +__name(Je$1, "Je$1"); +function Ke(a2, b2) { + var c2 = Je$1(a2); + a2 = 0; + for (var d2; c2; ) { + if (c2.nodeType === 3) { + if (d2 = a2 + c2.textContent.length, a2 <= b2 && d2 >= b2) + return { node: c2, offset: b2 - a2 }; + a2 = d2; + } + a: { + for (; c2; ) { + if (c2.nextSibling) { + c2 = c2.nextSibling; + break a; + } + c2 = c2.parentNode; + } + c2 = void 0; + } + c2 = Je$1(c2); + } +} +__name(Ke, "Ke"); +function Le(a2, b2) { + return a2 && b2 ? a2 === b2 ? !0 : a2 && a2.nodeType === 3 ? !1 : b2 && b2.nodeType === 3 ? Le(a2, b2.parentNode) : "contains" in a2 ? a2.contains(b2) : a2.compareDocumentPosition ? !!(a2.compareDocumentPosition(b2) & 16) : !1 : !1; +} +__name(Le, "Le"); +function Me$2() { + for (var a2 = window, b2 = Xa(); b2 instanceof a2.HTMLIFrameElement; ) { + try { + var c2 = typeof b2.contentWindow.location.href == "string"; + } catch { + c2 = !1; + } + if (c2) + a2 = b2.contentWindow; + else + break; + b2 = Xa(a2.document); + } + return b2; +} +__name(Me$2, "Me$2"); +function Ne(a2) { + var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase(); + return b2 && (b2 === "input" && (a2.type === "text" || a2.type === "search" || a2.type === "tel" || a2.type === "url" || a2.type === "password") || b2 === "textarea" || a2.contentEditable === "true"); +} +__name(Ne, "Ne"); +function Oe(a2) { + var b2 = Me$2(), c2 = a2.focusedElem, d2 = a2.selectionRange; + if (b2 !== c2 && c2 && c2.ownerDocument && Le(c2.ownerDocument.documentElement, c2)) { + if (d2 !== null && Ne(c2)) { + if (b2 = d2.start, a2 = d2.end, a2 === void 0 && (a2 = b2), "selectionStart" in c2) + c2.selectionStart = b2, c2.selectionEnd = Math.min(a2, c2.value.length); + else if (a2 = (b2 = c2.ownerDocument || document) && b2.defaultView || window, a2.getSelection) { + a2 = a2.getSelection(); + var e2 = c2.textContent.length, f2 = Math.min(d2.start, e2); + d2 = d2.end === void 0 ? f2 : Math.min(d2.end, e2), !a2.extend && f2 > d2 && (e2 = d2, d2 = f2, f2 = e2), e2 = Ke(c2, f2); + var g2 = Ke( + c2, + d2 + ); + e2 && g2 && (a2.rangeCount !== 1 || a2.anchorNode !== e2.node || a2.anchorOffset !== e2.offset || a2.focusNode !== g2.node || a2.focusOffset !== g2.offset) && (b2 = b2.createRange(), b2.setStart(e2.node, e2.offset), a2.removeAllRanges(), f2 > d2 ? (a2.addRange(b2), a2.extend(g2.node, g2.offset)) : (b2.setEnd(g2.node, g2.offset), a2.addRange(b2))); + } + } + for (b2 = [], a2 = c2; a2 = a2.parentNode; ) + a2.nodeType === 1 && b2.push({ element: a2, left: a2.scrollLeft, top: a2.scrollTop }); + for (typeof c2.focus == "function" && c2.focus(), c2 = 0; c2 < b2.length; c2++) + a2 = b2[c2], a2.element.scrollLeft = a2.left, a2.element.scrollTop = a2.top; + } +} +__name(Oe, "Oe"); +var Pe$1 = ia && "documentMode" in document && 11 >= document.documentMode, Qe$1 = null, Re$1 = null, Se$1 = null, Te$1 = !1; +function Ue$1(a2, b2, c2) { + var d2 = c2.window === c2 ? c2.document : c2.nodeType === 9 ? c2 : c2.ownerDocument; + Te$1 || Qe$1 == null || Qe$1 !== Xa(d2) || (d2 = Qe$1, "selectionStart" in d2 && Ne(d2) ? d2 = { start: d2.selectionStart, end: d2.selectionEnd } : (d2 = (d2.ownerDocument && d2.ownerDocument.defaultView || window).getSelection(), d2 = { anchorNode: d2.anchorNode, anchorOffset: d2.anchorOffset, focusNode: d2.focusNode, focusOffset: d2.focusOffset }), Se$1 && Ie$1(Se$1, d2) || (Se$1 = d2, d2 = oe$2(Re$1, "onSelect"), 0 < d2.length && (b2 = new td("onSelect", "select", null, b2, c2), a2.push({ event: b2, listeners: d2 }), b2.target = Qe$1))); +} +__name(Ue$1, "Ue$1"); +function Ve$1(a2, b2) { + var c2 = {}; + return c2[a2.toLowerCase()] = b2.toLowerCase(), c2["Webkit" + a2] = "webkit" + b2, c2["Moz" + a2] = "moz" + b2, c2; +} +__name(Ve$1, "Ve$1"); +var We$1 = { animationend: Ve$1("Animation", "AnimationEnd"), animationiteration: Ve$1("Animation", "AnimationIteration"), animationstart: Ve$1("Animation", "AnimationStart"), transitionend: Ve$1("Transition", "TransitionEnd") }, Xe$1 = {}, Ye$1 = {}; +ia && (Ye$1 = document.createElement("div").style, "AnimationEvent" in window || (delete We$1.animationend.animation, delete We$1.animationiteration.animation, delete We$1.animationstart.animation), "TransitionEvent" in window || delete We$1.transitionend.transition); +function Ze$1(a2) { + if (Xe$1[a2]) + return Xe$1[a2]; + if (!We$1[a2]) + return a2; + var b2 = We$1[a2], c2; + for (c2 in b2) + if (b2.hasOwnProperty(c2) && c2 in Ye$1) + return Xe$1[a2] = b2[c2]; + return a2; +} +__name(Ze$1, "Ze$1"); +var $e$1 = Ze$1("animationend"), af = Ze$1("animationiteration"), bf = Ze$1("animationstart"), cf = Ze$1("transitionend"), df = /* @__PURE__ */ new Map(), ef = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); +function ff(a2, b2) { + df.set(a2, b2), fa(b2, [a2]); +} +__name(ff, "ff"); +for (var gf = 0; gf < ef.length; gf++) { + var hf = ef[gf], jf = hf.toLowerCase(), kf = hf[0].toUpperCase() + hf.slice(1); + ff(jf, "on" + kf); +} +ff($e$1, "onAnimationEnd"); +ff(af, "onAnimationIteration"); +ff(bf, "onAnimationStart"); +ff("dblclick", "onDoubleClick"); +ff("focusin", "onFocus"); +ff("focusout", "onBlur"); +ff(cf, "onTransitionEnd"); +ha("onMouseEnter", ["mouseout", "mouseover"]); +ha("onMouseLeave", ["mouseout", "mouseover"]); +ha("onPointerEnter", ["pointerout", "pointerover"]); +ha("onPointerLeave", ["pointerout", "pointerover"]); +fa("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); +fa("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); +fa("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); +fa("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); +fa("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); +fa("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); +var lf = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), mf = new Set("cancel close invalid load scroll toggle".split(" ").concat(lf)); +function nf(a2, b2, c2) { + var d2 = a2.type || "unknown-event"; + a2.currentTarget = c2, Ub(d2, b2, void 0, a2), a2.currentTarget = null; +} +__name(nf, "nf"); +function se$2(a2, b2) { + b2 = (b2 & 4) !== 0; + for (var c2 = 0; c2 < a2.length; c2++) { + var d2 = a2[c2], e2 = d2.event; + d2 = d2.listeners; + a: { + var f2 = void 0; + if (b2) + for (var g2 = d2.length - 1; 0 <= g2; g2--) { + var h2 = d2[g2], k2 = h2.instance, l2 = h2.currentTarget; + if (h2 = h2.listener, k2 !== f2 && e2.isPropagationStopped()) + break a; + nf(e2, h2, l2), f2 = k2; + } + else + for (g2 = 0; g2 < d2.length; g2++) { + if (h2 = d2[g2], k2 = h2.instance, l2 = h2.currentTarget, h2 = h2.listener, k2 !== f2 && e2.isPropagationStopped()) + break a; + nf(e2, h2, l2), f2 = k2; + } + } + } + if (Qb) + throw a2 = Rb, Qb = !1, Rb = null, a2; +} +__name(se$2, "se$2"); +function D$2(a2, b2) { + var c2 = b2[of]; + c2 === void 0 && (c2 = b2[of] = /* @__PURE__ */ new Set()); + var d2 = a2 + "__bubble"; + c2.has(d2) || (pf(b2, a2, 2, !1), c2.add(d2)); +} +__name(D$2, "D$2"); +function qf(a2, b2, c2) { + var d2 = 0; + b2 && (d2 |= 4), pf(c2, a2, d2, b2); +} +__name(qf, "qf"); +var rf = "_reactListening" + Math.random().toString(36).slice(2); +function sf(a2) { + if (!a2[rf]) { + a2[rf] = !0, da.forEach(function(b3) { + b3 !== "selectionchange" && (mf.has(b3) || qf(b3, !1, a2), qf(b3, !0, a2)); + }); + var b2 = a2.nodeType === 9 ? a2 : a2.ownerDocument; + b2 === null || b2[rf] || (b2[rf] = !0, qf("selectionchange", !1, b2)); + } +} +__name(sf, "sf"); +function pf(a2, b2, c2, d2) { + switch (jd(b2)) { + case 1: + var e2 = ed; + break; + case 4: + e2 = gd; + break; + default: + e2 = fd; + } + c2 = e2.bind(null, b2, c2, a2), e2 = void 0, !Lb || b2 !== "touchstart" && b2 !== "touchmove" && b2 !== "wheel" || (e2 = !0), d2 ? e2 !== void 0 ? a2.addEventListener(b2, c2, { capture: !0, passive: e2 }) : a2.addEventListener(b2, c2, !0) : e2 !== void 0 ? a2.addEventListener(b2, c2, { passive: e2 }) : a2.addEventListener(b2, c2, !1); +} +__name(pf, "pf"); +function hd(a2, b2, c2, d2, e2) { + var f2 = d2; + if (!(b2 & 1) && !(b2 & 2) && d2 !== null) + a: + for (; ; ) { + if (d2 === null) + return; + var g2 = d2.tag; + if (g2 === 3 || g2 === 4) { + var h2 = d2.stateNode.containerInfo; + if (h2 === e2 || h2.nodeType === 8 && h2.parentNode === e2) + break; + if (g2 === 4) + for (g2 = d2.return; g2 !== null; ) { + var k2 = g2.tag; + if ((k2 === 3 || k2 === 4) && (k2 = g2.stateNode.containerInfo, k2 === e2 || k2.nodeType === 8 && k2.parentNode === e2)) + return; + g2 = g2.return; + } + for (; h2 !== null; ) { + if (g2 = Wc(h2), g2 === null) + return; + if (k2 = g2.tag, k2 === 5 || k2 === 6) { + d2 = f2 = g2; + continue a; + } + h2 = h2.parentNode; + } + } + d2 = d2.return; + } + Jb(function() { + var d3 = f2, e3 = xb(c2), g3 = []; + a: { + var h3 = df.get(a2); + if (h3 !== void 0) { + var k3 = td, n2 = a2; + switch (a2) { + case "keypress": + if (od(c2) === 0) + break a; + case "keydown": + case "keyup": + k3 = Rd; + break; + case "focusin": + n2 = "focus", k3 = Fd; + break; + case "focusout": + n2 = "blur", k3 = Fd; + break; + case "beforeblur": + case "afterblur": + k3 = Fd; + break; + case "click": + if (c2.button === 2) + break a; + case "auxclick": + case "dblclick": + case "mousedown": + case "mousemove": + case "mouseup": + case "mouseout": + case "mouseover": + case "contextmenu": + k3 = Bd; + break; + case "drag": + case "dragend": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "dragstart": + case "drop": + k3 = Dd; + break; + case "touchcancel": + case "touchend": + case "touchmove": + case "touchstart": + k3 = Vd; + break; + case $e$1: + case af: + case bf: + k3 = Hd; + break; + case cf: + k3 = Xd; + break; + case "scroll": + k3 = vd; + break; + case "wheel": + k3 = Zd; + break; + case "copy": + case "cut": + case "paste": + k3 = Jd; + break; + case "gotpointercapture": + case "lostpointercapture": + case "pointercancel": + case "pointerdown": + case "pointermove": + case "pointerout": + case "pointerover": + case "pointerup": + k3 = Td; + } + var t2 = (b2 & 4) !== 0, J2 = !t2 && a2 === "scroll", x2 = t2 ? h3 !== null ? h3 + "Capture" : null : h3; + t2 = []; + for (var w2 = d3, u2; w2 !== null; ) { + u2 = w2; + var F2 = u2.stateNode; + if (u2.tag === 5 && F2 !== null && (u2 = F2, x2 !== null && (F2 = Kb(w2, x2), F2 != null && t2.push(tf(w2, F2, u2)))), J2) + break; + w2 = w2.return; + } + 0 < t2.length && (h3 = new k3(h3, n2, null, c2, e3), g3.push({ event: h3, listeners: t2 })); + } + } + if (!(b2 & 7)) { + a: { + if (h3 = a2 === "mouseover" || a2 === "pointerover", k3 = a2 === "mouseout" || a2 === "pointerout", h3 && c2 !== wb && (n2 = c2.relatedTarget || c2.fromElement) && (Wc(n2) || n2[uf])) + break a; + if ((k3 || h3) && (h3 = e3.window === e3 ? e3 : (h3 = e3.ownerDocument) ? h3.defaultView || h3.parentWindow : window, k3 ? (n2 = c2.relatedTarget || c2.toElement, k3 = d3, n2 = n2 ? Wc(n2) : null, n2 !== null && (J2 = Vb(n2), n2 !== J2 || n2.tag !== 5 && n2.tag !== 6) && (n2 = null)) : (k3 = null, n2 = d3), k3 !== n2)) { + if (t2 = Bd, F2 = "onMouseLeave", x2 = "onMouseEnter", w2 = "mouse", (a2 === "pointerout" || a2 === "pointerover") && (t2 = Td, F2 = "onPointerLeave", x2 = "onPointerEnter", w2 = "pointer"), J2 = k3 == null ? h3 : ue$1(k3), u2 = n2 == null ? h3 : ue$1(n2), h3 = new t2(F2, w2 + "leave", k3, c2, e3), h3.target = J2, h3.relatedTarget = u2, F2 = null, Wc(e3) === d3 && (t2 = new t2(x2, w2 + "enter", n2, c2, e3), t2.target = u2, t2.relatedTarget = J2, F2 = t2), J2 = F2, k3 && n2) + b: { + for (t2 = k3, x2 = n2, w2 = 0, u2 = t2; u2; u2 = vf(u2)) + w2++; + for (u2 = 0, F2 = x2; F2; F2 = vf(F2)) + u2++; + for (; 0 < w2 - u2; ) + t2 = vf(t2), w2--; + for (; 0 < u2 - w2; ) + x2 = vf(x2), u2--; + for (; w2--; ) { + if (t2 === x2 || x2 !== null && t2 === x2.alternate) + break b; + t2 = vf(t2), x2 = vf(x2); + } + t2 = null; + } + else + t2 = null; + k3 !== null && wf(g3, h3, k3, t2, !1), n2 !== null && J2 !== null && wf(g3, J2, n2, t2, !0); + } + } + a: { + if (h3 = d3 ? ue$1(d3) : window, k3 = h3.nodeName && h3.nodeName.toLowerCase(), k3 === "select" || k3 === "input" && h3.type === "file") + var na = ve$1; + else if (me$1(h3)) + if (we$1) + na = Fe$1; + else { + na = De$1; + var xa = Ce$2; + } + else + (k3 = h3.nodeName) && k3.toLowerCase() === "input" && (h3.type === "checkbox" || h3.type === "radio") && (na = Ee); + if (na && (na = na(a2, d3))) { + ne$1(g3, na, c2, e3); + break a; + } + xa && xa(a2, h3, d3), a2 === "focusout" && (xa = h3._wrapperState) && xa.controlled && h3.type === "number" && cb(h3, "number", h3.value); + } + switch (xa = d3 ? ue$1(d3) : window, a2) { + case "focusin": + (me$1(xa) || xa.contentEditable === "true") && (Qe$1 = xa, Re$1 = d3, Se$1 = null); + break; + case "focusout": + Se$1 = Re$1 = Qe$1 = null; + break; + case "mousedown": + Te$1 = !0; + break; + case "contextmenu": + case "mouseup": + case "dragend": + Te$1 = !1, Ue$1(g3, c2, e3); + break; + case "selectionchange": + if (Pe$1) + break; + case "keydown": + case "keyup": + Ue$1(g3, c2, e3); + } + var $a; + if (ae$2) + b: { + switch (a2) { + case "compositionstart": + var ba = "onCompositionStart"; + break b; + case "compositionend": + ba = "onCompositionEnd"; + break b; + case "compositionupdate": + ba = "onCompositionUpdate"; + break b; + } + ba = void 0; + } + else + ie$2 ? ge$1(a2, c2) && (ba = "onCompositionEnd") : a2 === "keydown" && c2.keyCode === 229 && (ba = "onCompositionStart"); + ba && (de$1 && c2.locale !== "ko" && (ie$2 || ba !== "onCompositionStart" ? ba === "onCompositionEnd" && ie$2 && ($a = nd()) : (kd = e3, ld = "value" in kd ? kd.value : kd.textContent, ie$2 = !0)), xa = oe$2(d3, ba), 0 < xa.length && (ba = new Ld(ba, a2, null, c2, e3), g3.push({ event: ba, listeners: xa }), $a ? ba.data = $a : ($a = he$1(c2), $a !== null && (ba.data = $a)))), ($a = ce$2 ? je(a2, c2) : ke$2(a2, c2)) && (d3 = oe$2(d3, "onBeforeInput"), 0 < d3.length && (e3 = new Ld("onBeforeInput", "beforeinput", null, c2, e3), g3.push({ event: e3, listeners: d3 }), e3.data = $a)); + } + se$2(g3, b2); + }); +} +__name(hd, "hd"); +function tf(a2, b2, c2) { + return { instance: a2, listener: b2, currentTarget: c2 }; +} +__name(tf, "tf"); +function oe$2(a2, b2) { + for (var c2 = b2 + "Capture", d2 = []; a2 !== null; ) { + var e2 = a2, f2 = e2.stateNode; + e2.tag === 5 && f2 !== null && (e2 = f2, f2 = Kb(a2, c2), f2 != null && d2.unshift(tf(a2, f2, e2)), f2 = Kb(a2, b2), f2 != null && d2.push(tf(a2, f2, e2))), a2 = a2.return; + } + return d2; +} +__name(oe$2, "oe$2"); +function vf(a2) { + if (a2 === null) + return null; + do + a2 = a2.return; + while (a2 && a2.tag !== 5); + return a2 || null; +} +__name(vf, "vf"); +function wf(a2, b2, c2, d2, e2) { + for (var f2 = b2._reactName, g2 = []; c2 !== null && c2 !== d2; ) { + var h2 = c2, k2 = h2.alternate, l2 = h2.stateNode; + if (k2 !== null && k2 === d2) + break; + h2.tag === 5 && l2 !== null && (h2 = l2, e2 ? (k2 = Kb(c2, f2), k2 != null && g2.unshift(tf(c2, k2, h2))) : e2 || (k2 = Kb(c2, f2), k2 != null && g2.push(tf(c2, k2, h2)))), c2 = c2.return; + } + g2.length !== 0 && a2.push({ event: b2, listeners: g2 }); +} +__name(wf, "wf"); +var xf = /\r\n?/g, yf = /\u0000|\uFFFD/g; +function zf(a2) { + return (typeof a2 == "string" ? a2 : "" + a2).replace(xf, ` +`).replace(yf, ""); +} +__name(zf, "zf"); +function Af(a2, b2, c2) { + if (b2 = zf(b2), zf(a2) !== b2 && c2) + throw Error(p$3(425)); +} +__name(Af, "Af"); +function Bf() { +} +__name(Bf, "Bf"); +var Cf = null, Df = null; +function Ef(a2, b2) { + return a2 === "textarea" || a2 === "noscript" || typeof b2.children == "string" || typeof b2.children == "number" || typeof b2.dangerouslySetInnerHTML == "object" && b2.dangerouslySetInnerHTML !== null && b2.dangerouslySetInnerHTML.__html != null; +} +__name(Ef, "Ef"); +var Ff = typeof setTimeout == "function" ? setTimeout : void 0, Gf = typeof clearTimeout == "function" ? clearTimeout : void 0, Hf = typeof Promise == "function" ? Promise : void 0, Jf = typeof queueMicrotask == "function" ? queueMicrotask : typeof Hf < "u" ? function(a2) { + return Hf.resolve(null).then(a2).catch(If); +} : Ff; +function If(a2) { + setTimeout(function() { + throw a2; + }); +} +__name(If, "If"); +function Kf(a2, b2) { + var c2 = b2, d2 = 0; + do { + var e2 = c2.nextSibling; + if (a2.removeChild(c2), e2 && e2.nodeType === 8) + if (c2 = e2.data, c2 === "/$") { + if (d2 === 0) { + a2.removeChild(e2), bd(b2); + return; + } + d2--; + } else + c2 !== "$" && c2 !== "$?" && c2 !== "$!" || d2++; + c2 = e2; + } while (c2); + bd(b2); +} +__name(Kf, "Kf"); +function Lf(a2) { + for (; a2 != null; a2 = a2.nextSibling) { + var b2 = a2.nodeType; + if (b2 === 1 || b2 === 3) + break; + if (b2 === 8) { + if (b2 = a2.data, b2 === "$" || b2 === "$!" || b2 === "$?") + break; + if (b2 === "/$") + return null; + } + } + return a2; +} +__name(Lf, "Lf"); +function Mf(a2) { + a2 = a2.previousSibling; + for (var b2 = 0; a2; ) { + if (a2.nodeType === 8) { + var c2 = a2.data; + if (c2 === "$" || c2 === "$!" || c2 === "$?") { + if (b2 === 0) + return a2; + b2--; + } else + c2 === "/$" && b2++; + } + a2 = a2.previousSibling; + } + return null; +} +__name(Mf, "Mf"); +var Nf = Math.random().toString(36).slice(2), Of = "__reactFiber$" + Nf, Pf = "__reactProps$" + Nf, uf = "__reactContainer$" + Nf, of = "__reactEvents$" + Nf, Qf = "__reactListeners$" + Nf, Rf = "__reactHandles$" + Nf; +function Wc(a2) { + var b2 = a2[Of]; + if (b2) + return b2; + for (var c2 = a2.parentNode; c2; ) { + if (b2 = c2[uf] || c2[Of]) { + if (c2 = b2.alternate, b2.child !== null || c2 !== null && c2.child !== null) + for (a2 = Mf(a2); a2 !== null; ) { + if (c2 = a2[Of]) + return c2; + a2 = Mf(a2); + } + return b2; + } + a2 = c2, c2 = a2.parentNode; + } + return null; +} +__name(Wc, "Wc"); +function Cb(a2) { + return a2 = a2[Of] || a2[uf], !a2 || a2.tag !== 5 && a2.tag !== 6 && a2.tag !== 13 && a2.tag !== 3 ? null : a2; +} +__name(Cb, "Cb"); +function ue$1(a2) { + if (a2.tag === 5 || a2.tag === 6) + return a2.stateNode; + throw Error(p$3(33)); +} +__name(ue$1, "ue$1"); +function Db(a2) { + return a2[Pf] || null; +} +__name(Db, "Db"); +var Sf = [], Tf = -1; +function Uf(a2) { + return { current: a2 }; +} +__name(Uf, "Uf"); +function E$1(a2) { + 0 > Tf || (a2.current = Sf[Tf], Sf[Tf] = null, Tf--); +} +__name(E$1, "E$1"); +function G$2(a2, b2) { + Tf++, Sf[Tf] = a2.current, a2.current = b2; +} +__name(G$2, "G$2"); +var Vf = {}, H$2 = Uf(Vf), Wf = Uf(!1), Xf = Vf; +function Yf(a2, b2) { + var c2 = a2.type.contextTypes; + if (!c2) + return Vf; + var d2 = a2.stateNode; + if (d2 && d2.__reactInternalMemoizedUnmaskedChildContext === b2) + return d2.__reactInternalMemoizedMaskedChildContext; + var e2 = {}, f2; + for (f2 in c2) + e2[f2] = b2[f2]; + return d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = b2, a2.__reactInternalMemoizedMaskedChildContext = e2), e2; +} +__name(Yf, "Yf"); +function Zf(a2) { + return a2 = a2.childContextTypes, a2 != null; +} +__name(Zf, "Zf"); +function $f() { + E$1(Wf), E$1(H$2); +} +__name($f, "$f"); +function ag(a2, b2, c2) { + if (H$2.current !== Vf) + throw Error(p$3(168)); + G$2(H$2, b2), G$2(Wf, c2); +} +__name(ag, "ag"); +function bg(a2, b2, c2) { + var d2 = a2.stateNode; + if (b2 = b2.childContextTypes, typeof d2.getChildContext != "function") + return c2; + d2 = d2.getChildContext(); + for (var e2 in d2) + if (!(e2 in b2)) + throw Error(p$3(108, Ra(a2) || "Unknown", e2)); + return A$4({}, c2, d2); +} +__name(bg, "bg"); +function cg(a2) { + return a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || Vf, Xf = H$2.current, G$2(H$2, a2), G$2(Wf, Wf.current), !0; +} +__name(cg, "cg"); +function dg(a2, b2, c2) { + var d2 = a2.stateNode; + if (!d2) + throw Error(p$3(169)); + c2 ? (a2 = bg(a2, b2, Xf), d2.__reactInternalMemoizedMergedChildContext = a2, E$1(Wf), E$1(H$2), G$2(H$2, a2)) : E$1(Wf), G$2(Wf, c2); +} +__name(dg, "dg"); +var eg = null, fg = !1, gg = !1; +function hg(a2) { + eg === null ? eg = [a2] : eg.push(a2); +} +__name(hg, "hg"); +function ig(a2) { + fg = !0, hg(a2); +} +__name(ig, "ig"); +function jg() { + if (!gg && eg !== null) { + gg = !0; + var a2 = 0, b2 = C$2; + try { + var c2 = eg; + for (C$2 = 1; a2 < c2.length; a2++) { + var d2 = c2[a2]; + do + d2 = d2(!0); + while (d2 !== null); + } + eg = null, fg = !1; + } catch (e2) { + throw eg !== null && (eg = eg.slice(a2 + 1)), ac(fc, jg), e2; + } finally { + C$2 = b2, gg = !1; + } + } + return null; +} +__name(jg, "jg"); +var kg = [], lg = 0, mg = null, ng = 0, og = [], pg = 0, qg = null, rg = 1, sg = ""; +function tg(a2, b2) { + kg[lg++] = ng, kg[lg++] = mg, mg = a2, ng = b2; +} +__name(tg, "tg"); +function ug(a2, b2, c2) { + og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, qg = a2; + var d2 = rg; + a2 = sg; + var e2 = 32 - oc(d2) - 1; + d2 &= ~(1 << e2), c2 += 1; + var f2 = 32 - oc(b2) + e2; + if (30 < f2) { + var g2 = e2 - e2 % 5; + f2 = (d2 & (1 << g2) - 1).toString(32), d2 >>= g2, e2 -= g2, rg = 1 << 32 - oc(b2) + e2 | c2 << e2 | d2, sg = f2 + a2; + } else + rg = 1 << f2 | c2 << e2 | d2, sg = a2; +} +__name(ug, "ug"); +function vg(a2) { + a2.return !== null && (tg(a2, 1), ug(a2, 1, 0)); +} +__name(vg, "vg"); +function wg(a2) { + for (; a2 === mg; ) + mg = kg[--lg], kg[lg] = null, ng = kg[--lg], kg[lg] = null; + for (; a2 === qg; ) + qg = og[--pg], og[pg] = null, sg = og[--pg], og[pg] = null, rg = og[--pg], og[pg] = null; +} +__name(wg, "wg"); +var xg = null, yg = null, I$1 = !1, zg = null; +function Ag(a2, b2) { + var c2 = Bg(5, null, null, 0); + c2.elementType = "DELETED", c2.stateNode = b2, c2.return = a2, b2 = a2.deletions, b2 === null ? (a2.deletions = [c2], a2.flags |= 16) : b2.push(c2); +} +__name(Ag, "Ag"); +function Cg(a2, b2) { + switch (a2.tag) { + case 5: + var c2 = a2.type; + return b2 = b2.nodeType !== 1 || c2.toLowerCase() !== b2.nodeName.toLowerCase() ? null : b2, b2 !== null ? (a2.stateNode = b2, xg = a2, yg = Lf(b2.firstChild), !0) : !1; + case 6: + return b2 = a2.pendingProps === "" || b2.nodeType !== 3 ? null : b2, b2 !== null ? (a2.stateNode = b2, xg = a2, yg = null, !0) : !1; + case 13: + return b2 = b2.nodeType !== 8 ? null : b2, b2 !== null ? (c2 = qg !== null ? { id: rg, overflow: sg } : null, a2.memoizedState = { dehydrated: b2, treeContext: c2, retryLane: 1073741824 }, c2 = Bg(18, null, null, 0), c2.stateNode = b2, c2.return = a2, a2.child = c2, xg = a2, yg = null, !0) : !1; + default: + return !1; + } +} +__name(Cg, "Cg"); +function Dg(a2) { + return (a2.mode & 1) !== 0 && (a2.flags & 128) === 0; +} +__name(Dg, "Dg"); +function Eg(a2) { + if (I$1) { + var b2 = yg; + if (b2) { + var c2 = b2; + if (!Cg(a2, b2)) { + if (Dg(a2)) + throw Error(p$3(418)); + b2 = Lf(c2.nextSibling); + var d2 = xg; + b2 && Cg(a2, b2) ? Ag(d2, c2) : (a2.flags = a2.flags & -4097 | 2, I$1 = !1, xg = a2); + } + } else { + if (Dg(a2)) + throw Error(p$3(418)); + a2.flags = a2.flags & -4097 | 2, I$1 = !1, xg = a2; + } + } +} +__name(Eg, "Eg"); +function Fg(a2) { + for (a2 = a2.return; a2 !== null && a2.tag !== 5 && a2.tag !== 3 && a2.tag !== 13; ) + a2 = a2.return; + xg = a2; +} +__name(Fg, "Fg"); +function Gg(a2) { + if (a2 !== xg) + return !1; + if (!I$1) + return Fg(a2), I$1 = !0, !1; + var b2; + if ((b2 = a2.tag !== 3) && !(b2 = a2.tag !== 5) && (b2 = a2.type, b2 = b2 !== "head" && b2 !== "body" && !Ef(a2.type, a2.memoizedProps)), b2 && (b2 = yg)) { + if (Dg(a2)) + throw Hg(), Error(p$3(418)); + for (; b2; ) + Ag(a2, b2), b2 = Lf(b2.nextSibling); + } + if (Fg(a2), a2.tag === 13) { + if (a2 = a2.memoizedState, a2 = a2 !== null ? a2.dehydrated : null, !a2) + throw Error(p$3(317)); + a: { + for (a2 = a2.nextSibling, b2 = 0; a2; ) { + if (a2.nodeType === 8) { + var c2 = a2.data; + if (c2 === "/$") { + if (b2 === 0) { + yg = Lf(a2.nextSibling); + break a; + } + b2--; + } else + c2 !== "$" && c2 !== "$!" && c2 !== "$?" || b2++; + } + a2 = a2.nextSibling; + } + yg = null; + } + } else + yg = xg ? Lf(a2.stateNode.nextSibling) : null; + return !0; +} +__name(Gg, "Gg"); +function Hg() { + for (var a2 = yg; a2; ) + a2 = Lf(a2.nextSibling); +} +__name(Hg, "Hg"); +function Ig() { + yg = xg = null, I$1 = !1; +} +__name(Ig, "Ig"); +function Jg(a2) { + zg === null ? zg = [a2] : zg.push(a2); +} +__name(Jg, "Jg"); +var Kg = ua.ReactCurrentBatchConfig; +function Lg(a2, b2) { + if (a2 && a2.defaultProps) { + b2 = A$4({}, b2), a2 = a2.defaultProps; + for (var c2 in a2) + b2[c2] === void 0 && (b2[c2] = a2[c2]); + return b2; + } + return b2; +} +__name(Lg, "Lg"); +var Mg = Uf(null), Ng = null, Og = null, Pg = null; +function Qg() { + Pg = Og = Ng = null; +} +__name(Qg, "Qg"); +function Rg(a2) { + var b2 = Mg.current; + E$1(Mg), a2._currentValue = b2; +} +__name(Rg, "Rg"); +function Sg(a2, b2, c2) { + for (; a2 !== null; ) { + var d2 = a2.alternate; + if ((a2.childLanes & b2) !== b2 ? (a2.childLanes |= b2, d2 !== null && (d2.childLanes |= b2)) : d2 !== null && (d2.childLanes & b2) !== b2 && (d2.childLanes |= b2), a2 === c2) + break; + a2 = a2.return; + } +} +__name(Sg, "Sg"); +function Tg(a2, b2) { + Ng = a2, Pg = Og = null, a2 = a2.dependencies, a2 !== null && a2.firstContext !== null && (a2.lanes & b2 && (Ug = !0), a2.firstContext = null); +} +__name(Tg, "Tg"); +function Vg(a2) { + var b2 = a2._currentValue; + if (Pg !== a2) + if (a2 = { context: a2, memoizedValue: b2, next: null }, Og === null) { + if (Ng === null) + throw Error(p$3(308)); + Og = a2, Ng.dependencies = { lanes: 0, firstContext: a2 }; + } else + Og = Og.next = a2; + return b2; +} +__name(Vg, "Vg"); +var Wg = null; +function Xg(a2) { + Wg === null ? Wg = [a2] : Wg.push(a2); +} +__name(Xg, "Xg"); +function Yg(a2, b2, c2, d2) { + var e2 = b2.interleaved; + return e2 === null ? (c2.next = c2, Xg(b2)) : (c2.next = e2.next, e2.next = c2), b2.interleaved = c2, Zg(a2, d2); +} +__name(Yg, "Yg"); +function Zg(a2, b2) { + a2.lanes |= b2; + var c2 = a2.alternate; + for (c2 !== null && (c2.lanes |= b2), c2 = a2, a2 = a2.return; a2 !== null; ) + a2.childLanes |= b2, c2 = a2.alternate, c2 !== null && (c2.childLanes |= b2), c2 = a2, a2 = a2.return; + return c2.tag === 3 ? c2.stateNode : null; +} +__name(Zg, "Zg"); +var $g = !1; +function ah(a2) { + a2.updateQueue = { baseState: a2.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; +} +__name(ah, "ah"); +function bh(a2, b2) { + a2 = a2.updateQueue, b2.updateQueue === a2 && (b2.updateQueue = { baseState: a2.baseState, firstBaseUpdate: a2.firstBaseUpdate, lastBaseUpdate: a2.lastBaseUpdate, shared: a2.shared, effects: a2.effects }); +} +__name(bh, "bh"); +function ch(a2, b2) { + return { eventTime: a2, lane: b2, tag: 0, payload: null, callback: null, next: null }; +} +__name(ch, "ch"); +function dh(a2, b2, c2) { + var d2 = a2.updateQueue; + if (d2 === null) + return null; + if (d2 = d2.shared, K$1 & 2) { + var e2 = d2.pending; + return e2 === null ? b2.next = b2 : (b2.next = e2.next, e2.next = b2), d2.pending = b2, Zg(a2, c2); + } + return e2 = d2.interleaved, e2 === null ? (b2.next = b2, Xg(d2)) : (b2.next = e2.next, e2.next = b2), d2.interleaved = b2, Zg(a2, c2); +} +__name(dh, "dh"); +function eh(a2, b2, c2) { + if (b2 = b2.updateQueue, b2 !== null && (b2 = b2.shared, (c2 & 4194240) !== 0)) { + var d2 = b2.lanes; + d2 &= a2.pendingLanes, c2 |= d2, b2.lanes = c2, Cc(a2, c2); + } +} +__name(eh, "eh"); +function fh(a2, b2) { + var c2 = a2.updateQueue, d2 = a2.alternate; + if (d2 !== null && (d2 = d2.updateQueue, c2 === d2)) { + var e2 = null, f2 = null; + if (c2 = c2.firstBaseUpdate, c2 !== null) { + do { + var g2 = { eventTime: c2.eventTime, lane: c2.lane, tag: c2.tag, payload: c2.payload, callback: c2.callback, next: null }; + f2 === null ? e2 = f2 = g2 : f2 = f2.next = g2, c2 = c2.next; + } while (c2 !== null); + f2 === null ? e2 = f2 = b2 : f2 = f2.next = b2; + } else + e2 = f2 = b2; + c2 = { baseState: d2.baseState, firstBaseUpdate: e2, lastBaseUpdate: f2, shared: d2.shared, effects: d2.effects }, a2.updateQueue = c2; + return; + } + a2 = c2.lastBaseUpdate, a2 === null ? c2.firstBaseUpdate = b2 : a2.next = b2, c2.lastBaseUpdate = b2; +} +__name(fh, "fh"); +function gh(a2, b2, c2, d2) { + var e2 = a2.updateQueue; + $g = !1; + var f2 = e2.firstBaseUpdate, g2 = e2.lastBaseUpdate, h2 = e2.shared.pending; + if (h2 !== null) { + e2.shared.pending = null; + var k2 = h2, l2 = k2.next; + k2.next = null, g2 === null ? f2 = l2 : g2.next = l2, g2 = k2; + var m2 = a2.alternate; + m2 !== null && (m2 = m2.updateQueue, h2 = m2.lastBaseUpdate, h2 !== g2 && (h2 === null ? m2.firstBaseUpdate = l2 : h2.next = l2, m2.lastBaseUpdate = k2)); + } + if (f2 !== null) { + var q2 = e2.baseState; + g2 = 0, m2 = l2 = k2 = null, h2 = f2; + do { + var r2 = h2.lane, y2 = h2.eventTime; + if ((d2 & r2) === r2) { + m2 !== null && (m2 = m2.next = { + eventTime: y2, + lane: 0, + tag: h2.tag, + payload: h2.payload, + callback: h2.callback, + next: null + }); + a: { + var n2 = a2, t2 = h2; + switch (r2 = b2, y2 = c2, t2.tag) { + case 1: + if (n2 = t2.payload, typeof n2 == "function") { + q2 = n2.call(y2, q2, r2); + break a; + } + q2 = n2; + break a; + case 3: + n2.flags = n2.flags & -65537 | 128; + case 0: + if (n2 = t2.payload, r2 = typeof n2 == "function" ? n2.call(y2, q2, r2) : n2, r2 == null) + break a; + q2 = A$4({}, q2, r2); + break a; + case 2: + $g = !0; + } + } + h2.callback !== null && h2.lane !== 0 && (a2.flags |= 64, r2 = e2.effects, r2 === null ? e2.effects = [h2] : r2.push(h2)); + } else + y2 = { eventTime: y2, lane: r2, tag: h2.tag, payload: h2.payload, callback: h2.callback, next: null }, m2 === null ? (l2 = m2 = y2, k2 = q2) : m2 = m2.next = y2, g2 |= r2; + if (h2 = h2.next, h2 === null) { + if (h2 = e2.shared.pending, h2 === null) + break; + r2 = h2, h2 = r2.next, r2.next = null, e2.lastBaseUpdate = r2, e2.shared.pending = null; + } + } while (1); + if (m2 === null && (k2 = q2), e2.baseState = k2, e2.firstBaseUpdate = l2, e2.lastBaseUpdate = m2, b2 = e2.shared.interleaved, b2 !== null) { + e2 = b2; + do + g2 |= e2.lane, e2 = e2.next; + while (e2 !== b2); + } else + f2 === null && (e2.shared.lanes = 0); + hh |= g2, a2.lanes = g2, a2.memoizedState = q2; + } +} +__name(gh, "gh"); +function ih(a2, b2, c2) { + if (a2 = b2.effects, b2.effects = null, a2 !== null) + for (b2 = 0; b2 < a2.length; b2++) { + var d2 = a2[b2], e2 = d2.callback; + if (e2 !== null) { + if (d2.callback = null, d2 = c2, typeof e2 != "function") + throw Error(p$3(191, e2)); + e2.call(d2); + } + } +} +__name(ih, "ih"); +var jh = new aa.Component().refs; +function kh(a2, b2, c2, d2) { + b2 = a2.memoizedState, c2 = c2(d2, b2), c2 = c2 == null ? b2 : A$4({}, b2, c2), a2.memoizedState = c2, a2.lanes === 0 && (a2.updateQueue.baseState = c2); +} +__name(kh, "kh"); +var nh = { isMounted: function(a2) { + return (a2 = a2._reactInternals) ? Vb(a2) === a2 : !1; +}, enqueueSetState: function(a2, b2, c2) { + a2 = a2._reactInternals; + var d2 = L$2(), e2 = lh(a2), f2 = ch(d2, e2); + f2.payload = b2, c2 != null && (f2.callback = c2), b2 = dh(a2, f2, e2), b2 !== null && (mh(b2, a2, e2, d2), eh(b2, a2, e2)); +}, enqueueReplaceState: function(a2, b2, c2) { + a2 = a2._reactInternals; + var d2 = L$2(), e2 = lh(a2), f2 = ch(d2, e2); + f2.tag = 1, f2.payload = b2, c2 != null && (f2.callback = c2), b2 = dh(a2, f2, e2), b2 !== null && (mh(b2, a2, e2, d2), eh(b2, a2, e2)); +}, enqueueForceUpdate: function(a2, b2) { + a2 = a2._reactInternals; + var c2 = L$2(), d2 = lh(a2), e2 = ch(c2, d2); + e2.tag = 2, b2 != null && (e2.callback = b2), b2 = dh(a2, e2, d2), b2 !== null && (mh(b2, a2, d2, c2), eh(b2, a2, d2)); +} }; +function oh(a2, b2, c2, d2, e2, f2, g2) { + return a2 = a2.stateNode, typeof a2.shouldComponentUpdate == "function" ? a2.shouldComponentUpdate(d2, f2, g2) : b2.prototype && b2.prototype.isPureReactComponent ? !Ie$1(c2, d2) || !Ie$1(e2, f2) : !0; +} +__name(oh, "oh"); +function ph(a2, b2, c2) { + var d2 = !1, e2 = Vf, f2 = b2.contextType; + return typeof f2 == "object" && f2 !== null ? f2 = Vg(f2) : (e2 = Zf(b2) ? Xf : H$2.current, d2 = b2.contextTypes, f2 = (d2 = d2 != null) ? Yf(a2, e2) : Vf), b2 = new b2(c2, f2), a2.memoizedState = b2.state !== null && b2.state !== void 0 ? b2.state : null, b2.updater = nh, a2.stateNode = b2, b2._reactInternals = a2, d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = e2, a2.__reactInternalMemoizedMaskedChildContext = f2), b2; +} +__name(ph, "ph"); +function qh(a2, b2, c2, d2) { + a2 = b2.state, typeof b2.componentWillReceiveProps == "function" && b2.componentWillReceiveProps(c2, d2), typeof b2.UNSAFE_componentWillReceiveProps == "function" && b2.UNSAFE_componentWillReceiveProps(c2, d2), b2.state !== a2 && nh.enqueueReplaceState(b2, b2.state, null); +} +__name(qh, "qh"); +function rh(a2, b2, c2, d2) { + var e2 = a2.stateNode; + e2.props = c2, e2.state = a2.memoizedState, e2.refs = jh, ah(a2); + var f2 = b2.contextType; + typeof f2 == "object" && f2 !== null ? e2.context = Vg(f2) : (f2 = Zf(b2) ? Xf : H$2.current, e2.context = Yf(a2, f2)), e2.state = a2.memoizedState, f2 = b2.getDerivedStateFromProps, typeof f2 == "function" && (kh(a2, b2, f2, c2), e2.state = a2.memoizedState), typeof b2.getDerivedStateFromProps == "function" || typeof e2.getSnapshotBeforeUpdate == "function" || typeof e2.UNSAFE_componentWillMount != "function" && typeof e2.componentWillMount != "function" || (b2 = e2.state, typeof e2.componentWillMount == "function" && e2.componentWillMount(), typeof e2.UNSAFE_componentWillMount == "function" && e2.UNSAFE_componentWillMount(), b2 !== e2.state && nh.enqueueReplaceState(e2, e2.state, null), gh(a2, c2, e2, d2), e2.state = a2.memoizedState), typeof e2.componentDidMount == "function" && (a2.flags |= 4194308); +} +__name(rh, "rh"); +function sh(a2, b2, c2) { + if (a2 = c2.ref, a2 !== null && typeof a2 != "function" && typeof a2 != "object") { + if (c2._owner) { + if (c2 = c2._owner, c2) { + if (c2.tag !== 1) + throw Error(p$3(309)); + var d2 = c2.stateNode; + } + if (!d2) + throw Error(p$3(147, a2)); + var e2 = d2, f2 = "" + a2; + return b2 !== null && b2.ref !== null && typeof b2.ref == "function" && b2.ref._stringRef === f2 ? b2.ref : (b2 = /* @__PURE__ */ __name(function(a3) { + var b3 = e2.refs; + b3 === jh && (b3 = e2.refs = {}), a3 === null ? delete b3[f2] : b3[f2] = a3; + }, "b"), b2._stringRef = f2, b2); + } + if (typeof a2 != "string") + throw Error(p$3(284)); + if (!c2._owner) + throw Error(p$3(290, a2)); + } + return a2; +} +__name(sh, "sh"); +function th(a2, b2) { + throw a2 = Object.prototype.toString.call(b2), Error(p$3(31, a2 === "[object Object]" ? "object with keys {" + Object.keys(b2).join(", ") + "}" : a2)); +} +__name(th, "th"); +function uh(a2) { + var b2 = a2._init; + return b2(a2._payload); +} +__name(uh, "uh"); +function vh(a2) { + function b2(b3, c3) { + if (a2) { + var d3 = b3.deletions; + d3 === null ? (b3.deletions = [c3], b3.flags |= 16) : d3.push(c3); + } + } + __name(b2, "b"); + function c2(c3, d3) { + if (!a2) + return null; + for (; d3 !== null; ) + b2(c3, d3), d3 = d3.sibling; + return null; + } + __name(c2, "c"); + function d2(a3, b3) { + for (a3 = /* @__PURE__ */ new Map(); b3 !== null; ) + b3.key !== null ? a3.set(b3.key, b3) : a3.set(b3.index, b3), b3 = b3.sibling; + return a3; + } + __name(d2, "d"); + function e2(a3, b3) { + return a3 = wh(a3, b3), a3.index = 0, a3.sibling = null, a3; + } + __name(e2, "e"); + function f2(b3, c3, d3) { + return b3.index = d3, a2 ? (d3 = b3.alternate, d3 !== null ? (d3 = d3.index, d3 < c3 ? (b3.flags |= 2, c3) : d3) : (b3.flags |= 2, c3)) : (b3.flags |= 1048576, c3); + } + __name(f2, "f"); + function g2(b3) { + return a2 && b3.alternate === null && (b3.flags |= 2), b3; + } + __name(g2, "g"); + function h2(a3, b3, c3, d3) { + return b3 === null || b3.tag !== 6 ? (b3 = xh(c3, a3.mode, d3), b3.return = a3, b3) : (b3 = e2(b3, c3), b3.return = a3, b3); + } + __name(h2, "h"); + function k2(a3, b3, c3, d3) { + var f3 = c3.type; + return f3 === ya ? m2(a3, b3, c3.props.children, d3, c3.key) : b3 !== null && (b3.elementType === f3 || typeof f3 == "object" && f3 !== null && f3.$$typeof === Ha && uh(f3) === b3.type) ? (d3 = e2(b3, c3.props), d3.ref = sh(a3, b3, c3), d3.return = a3, d3) : (d3 = yh(c3.type, c3.key, c3.props, null, a3.mode, d3), d3.ref = sh(a3, b3, c3), d3.return = a3, d3); + } + __name(k2, "k"); + function l2(a3, b3, c3, d3) { + return b3 === null || b3.tag !== 4 || b3.stateNode.containerInfo !== c3.containerInfo || b3.stateNode.implementation !== c3.implementation ? (b3 = zh(c3, a3.mode, d3), b3.return = a3, b3) : (b3 = e2(b3, c3.children || []), b3.return = a3, b3); + } + __name(l2, "l"); + function m2(a3, b3, c3, d3, f3) { + return b3 === null || b3.tag !== 7 ? (b3 = Ah(c3, a3.mode, d3, f3), b3.return = a3, b3) : (b3 = e2(b3, c3), b3.return = a3, b3); + } + __name(m2, "m"); + function q2(a3, b3, c3) { + if (typeof b3 == "string" && b3 !== "" || typeof b3 == "number") + return b3 = xh("" + b3, a3.mode, c3), b3.return = a3, b3; + if (typeof b3 == "object" && b3 !== null) { + switch (b3.$$typeof) { + case va: + return c3 = yh(b3.type, b3.key, b3.props, null, a3.mode, c3), c3.ref = sh(a3, null, b3), c3.return = a3, c3; + case wa: + return b3 = zh(b3, a3.mode, c3), b3.return = a3, b3; + case Ha: + var d3 = b3._init; + return q2(a3, d3(b3._payload), c3); + } + if (eb(b3) || Ka(b3)) + return b3 = Ah(b3, a3.mode, c3, null), b3.return = a3, b3; + th(a3, b3); + } + return null; + } + __name(q2, "q"); + function r2(a3, b3, c3, d3) { + var e3 = b3 !== null ? b3.key : null; + if (typeof c3 == "string" && c3 !== "" || typeof c3 == "number") + return e3 !== null ? null : h2(a3, b3, "" + c3, d3); + if (typeof c3 == "object" && c3 !== null) { + switch (c3.$$typeof) { + case va: + return c3.key === e3 ? k2(a3, b3, c3, d3) : null; + case wa: + return c3.key === e3 ? l2(a3, b3, c3, d3) : null; + case Ha: + return e3 = c3._init, r2( + a3, + b3, + e3(c3._payload), + d3 + ); + } + if (eb(c3) || Ka(c3)) + return e3 !== null ? null : m2(a3, b3, c3, d3, null); + th(a3, c3); + } + return null; + } + __name(r2, "r"); + function y2(a3, b3, c3, d3, e3) { + if (typeof d3 == "string" && d3 !== "" || typeof d3 == "number") + return a3 = a3.get(c3) || null, h2(b3, a3, "" + d3, e3); + if (typeof d3 == "object" && d3 !== null) { + switch (d3.$$typeof) { + case va: + return a3 = a3.get(d3.key === null ? c3 : d3.key) || null, k2(b3, a3, d3, e3); + case wa: + return a3 = a3.get(d3.key === null ? c3 : d3.key) || null, l2(b3, a3, d3, e3); + case Ha: + var f3 = d3._init; + return y2(a3, b3, c3, f3(d3._payload), e3); + } + if (eb(d3) || Ka(d3)) + return a3 = a3.get(c3) || null, m2(b3, a3, d3, e3, null); + th(b3, d3); + } + return null; + } + __name(y2, "y"); + function n2(e3, g3, h3, k3) { + for (var l3 = null, m3 = null, u2 = g3, w2 = g3 = 0, x2 = null; u2 !== null && w2 < h3.length; w2++) { + u2.index > w2 ? (x2 = u2, u2 = null) : x2 = u2.sibling; + var n3 = r2(e3, u2, h3[w2], k3); + if (n3 === null) { + u2 === null && (u2 = x2); + break; + } + a2 && u2 && n3.alternate === null && b2(e3, u2), g3 = f2(n3, g3, w2), m3 === null ? l3 = n3 : m3.sibling = n3, m3 = n3, u2 = x2; + } + if (w2 === h3.length) + return c2(e3, u2), I$1 && tg(e3, w2), l3; + if (u2 === null) { + for (; w2 < h3.length; w2++) + u2 = q2(e3, h3[w2], k3), u2 !== null && (g3 = f2(u2, g3, w2), m3 === null ? l3 = u2 : m3.sibling = u2, m3 = u2); + return I$1 && tg(e3, w2), l3; + } + for (u2 = d2(e3, u2); w2 < h3.length; w2++) + x2 = y2(u2, e3, w2, h3[w2], k3), x2 !== null && (a2 && x2.alternate !== null && u2.delete(x2.key === null ? w2 : x2.key), g3 = f2(x2, g3, w2), m3 === null ? l3 = x2 : m3.sibling = x2, m3 = x2); + return a2 && u2.forEach(function(a3) { + return b2(e3, a3); + }), I$1 && tg(e3, w2), l3; + } + __name(n2, "n"); + function t2(e3, g3, h3, k3) { + var l3 = Ka(h3); + if (typeof l3 != "function") + throw Error(p$3(150)); + if (h3 = l3.call(h3), h3 == null) + throw Error(p$3(151)); + for (var u2 = l3 = null, m3 = g3, w2 = g3 = 0, x2 = null, n3 = h3.next(); m3 !== null && !n3.done; w2++, n3 = h3.next()) { + m3.index > w2 ? (x2 = m3, m3 = null) : x2 = m3.sibling; + var t3 = r2(e3, m3, n3.value, k3); + if (t3 === null) { + m3 === null && (m3 = x2); + break; + } + a2 && m3 && t3.alternate === null && b2(e3, m3), g3 = f2(t3, g3, w2), u2 === null ? l3 = t3 : u2.sibling = t3, u2 = t3, m3 = x2; + } + if (n3.done) + return c2( + e3, + m3 + ), I$1 && tg(e3, w2), l3; + if (m3 === null) { + for (; !n3.done; w2++, n3 = h3.next()) + n3 = q2(e3, n3.value, k3), n3 !== null && (g3 = f2(n3, g3, w2), u2 === null ? l3 = n3 : u2.sibling = n3, u2 = n3); + return I$1 && tg(e3, w2), l3; + } + for (m3 = d2(e3, m3); !n3.done; w2++, n3 = h3.next()) + n3 = y2(m3, e3, w2, n3.value, k3), n3 !== null && (a2 && n3.alternate !== null && m3.delete(n3.key === null ? w2 : n3.key), g3 = f2(n3, g3, w2), u2 === null ? l3 = n3 : u2.sibling = n3, u2 = n3); + return a2 && m3.forEach(function(a3) { + return b2(e3, a3); + }), I$1 && tg(e3, w2), l3; + } + __name(t2, "t"); + function J2(a3, d3, f3, h3) { + if (typeof f3 == "object" && f3 !== null && f3.type === ya && f3.key === null && (f3 = f3.props.children), typeof f3 == "object" && f3 !== null) { + switch (f3.$$typeof) { + case va: + a: { + for (var k3 = f3.key, l3 = d3; l3 !== null; ) { + if (l3.key === k3) { + if (k3 = f3.type, k3 === ya) { + if (l3.tag === 7) { + c2(a3, l3.sibling), d3 = e2(l3, f3.props.children), d3.return = a3, a3 = d3; + break a; + } + } else if (l3.elementType === k3 || typeof k3 == "object" && k3 !== null && k3.$$typeof === Ha && uh(k3) === l3.type) { + c2(a3, l3.sibling), d3 = e2(l3, f3.props), d3.ref = sh(a3, l3, f3), d3.return = a3, a3 = d3; + break a; + } + c2(a3, l3); + break; + } else + b2(a3, l3); + l3 = l3.sibling; + } + f3.type === ya ? (d3 = Ah(f3.props.children, a3.mode, h3, f3.key), d3.return = a3, a3 = d3) : (h3 = yh(f3.type, f3.key, f3.props, null, a3.mode, h3), h3.ref = sh(a3, d3, f3), h3.return = a3, a3 = h3); + } + return g2(a3); + case wa: + a: { + for (l3 = f3.key; d3 !== null; ) { + if (d3.key === l3) + if (d3.tag === 4 && d3.stateNode.containerInfo === f3.containerInfo && d3.stateNode.implementation === f3.implementation) { + c2(a3, d3.sibling), d3 = e2(d3, f3.children || []), d3.return = a3, a3 = d3; + break a; + } else { + c2(a3, d3); + break; + } + else + b2(a3, d3); + d3 = d3.sibling; + } + d3 = zh(f3, a3.mode, h3), d3.return = a3, a3 = d3; + } + return g2(a3); + case Ha: + return l3 = f3._init, J2(a3, d3, l3(f3._payload), h3); + } + if (eb(f3)) + return n2(a3, d3, f3, h3); + if (Ka(f3)) + return t2(a3, d3, f3, h3); + th(a3, f3); + } + return typeof f3 == "string" && f3 !== "" || typeof f3 == "number" ? (f3 = "" + f3, d3 !== null && d3.tag === 6 ? (c2(a3, d3.sibling), d3 = e2(d3, f3), d3.return = a3, a3 = d3) : (c2(a3, d3), d3 = xh(f3, a3.mode, h3), d3.return = a3, a3 = d3), g2(a3)) : c2(a3, d3); + } + return __name(J2, "J"), J2; +} +__name(vh, "vh"); +var Bh = vh(!0), Ch = vh(!1), Dh = {}, Eh = Uf(Dh), Fh = Uf(Dh), Gh = Uf(Dh); +function Hh(a2) { + if (a2 === Dh) + throw Error(p$3(174)); + return a2; +} +__name(Hh, "Hh"); +function Ih(a2, b2) { + switch (G$2(Gh, b2), G$2(Fh, a2), G$2(Eh, Dh), a2 = b2.nodeType, a2) { + case 9: + case 11: + b2 = (b2 = b2.documentElement) ? b2.namespaceURI : lb(null, ""); + break; + default: + a2 = a2 === 8 ? b2.parentNode : b2, b2 = a2.namespaceURI || null, a2 = a2.tagName, b2 = lb(b2, a2); + } + E$1(Eh), G$2(Eh, b2); +} +__name(Ih, "Ih"); +function Jh() { + E$1(Eh), E$1(Fh), E$1(Gh); +} +__name(Jh, "Jh"); +function Kh(a2) { + Hh(Gh.current); + var b2 = Hh(Eh.current), c2 = lb(b2, a2.type); + b2 !== c2 && (G$2(Fh, a2), G$2(Eh, c2)); +} +__name(Kh, "Kh"); +function Lh(a2) { + Fh.current === a2 && (E$1(Eh), E$1(Fh)); +} +__name(Lh, "Lh"); +var M$1 = Uf(0); +function Mh(a2) { + for (var b2 = a2; b2 !== null; ) { + if (b2.tag === 13) { + var c2 = b2.memoizedState; + if (c2 !== null && (c2 = c2.dehydrated, c2 === null || c2.data === "$?" || c2.data === "$!")) + return b2; + } else if (b2.tag === 19 && b2.memoizedProps.revealOrder !== void 0) { + if (b2.flags & 128) + return b2; + } else if (b2.child !== null) { + b2.child.return = b2, b2 = b2.child; + continue; + } + if (b2 === a2) + break; + for (; b2.sibling === null; ) { + if (b2.return === null || b2.return === a2) + return null; + b2 = b2.return; + } + b2.sibling.return = b2.return, b2 = b2.sibling; + } + return null; +} +__name(Mh, "Mh"); +var Nh = []; +function Oh() { + for (var a2 = 0; a2 < Nh.length; a2++) + Nh[a2]._workInProgressVersionPrimary = null; + Nh.length = 0; +} +__name(Oh, "Oh"); +var Ph = ua.ReactCurrentDispatcher, Qh = ua.ReactCurrentBatchConfig, Rh = 0, N$2 = null, O$2 = null, P$1 = null, Sh = !1, Th = !1, Uh = 0, Vh = 0; +function Q$2() { + throw Error(p$3(321)); +} +__name(Q$2, "Q$2"); +function Wh(a2, b2) { + if (b2 === null) + return !1; + for (var c2 = 0; c2 < b2.length && c2 < a2.length; c2++) + if (!He$1(a2[c2], b2[c2])) + return !1; + return !0; +} +__name(Wh, "Wh"); +function Xh(a2, b2, c2, d2, e2, f2) { + if (Rh = f2, N$2 = b2, b2.memoizedState = null, b2.updateQueue = null, b2.lanes = 0, Ph.current = a2 === null || a2.memoizedState === null ? Yh : Zh, a2 = c2(d2, e2), Th) { + f2 = 0; + do { + if (Th = !1, Uh = 0, 25 <= f2) + throw Error(p$3(301)); + f2 += 1, P$1 = O$2 = null, b2.updateQueue = null, Ph.current = $h, a2 = c2(d2, e2); + } while (Th); + } + if (Ph.current = ai$1, b2 = O$2 !== null && O$2.next !== null, Rh = 0, P$1 = O$2 = N$2 = null, Sh = !1, b2) + throw Error(p$3(300)); + return a2; +} +__name(Xh, "Xh"); +function bi$1() { + var a2 = Uh !== 0; + return Uh = 0, a2; +} +__name(bi$1, "bi$1"); +function ci$1() { + var a2 = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; + return P$1 === null ? N$2.memoizedState = P$1 = a2 : P$1 = P$1.next = a2, P$1; +} +__name(ci$1, "ci$1"); +function di$1() { + if (O$2 === null) { + var a2 = N$2.alternate; + a2 = a2 !== null ? a2.memoizedState : null; + } else + a2 = O$2.next; + var b2 = P$1 === null ? N$2.memoizedState : P$1.next; + if (b2 !== null) + P$1 = b2, O$2 = a2; + else { + if (a2 === null) + throw Error(p$3(310)); + O$2 = a2, a2 = { memoizedState: O$2.memoizedState, baseState: O$2.baseState, baseQueue: O$2.baseQueue, queue: O$2.queue, next: null }, P$1 === null ? N$2.memoizedState = P$1 = a2 : P$1 = P$1.next = a2; + } + return P$1; +} +__name(di$1, "di$1"); +function ei$1(a2, b2) { + return typeof b2 == "function" ? b2(a2) : b2; +} +__name(ei$1, "ei$1"); +function fi$1(a2) { + var b2 = di$1(), c2 = b2.queue; + if (c2 === null) + throw Error(p$3(311)); + c2.lastRenderedReducer = a2; + var d2 = O$2, e2 = d2.baseQueue, f2 = c2.pending; + if (f2 !== null) { + if (e2 !== null) { + var g2 = e2.next; + e2.next = f2.next, f2.next = g2; + } + d2.baseQueue = e2 = f2, c2.pending = null; + } + if (e2 !== null) { + f2 = e2.next, d2 = d2.baseState; + var h2 = g2 = null, k2 = null, l2 = f2; + do { + var m2 = l2.lane; + if ((Rh & m2) === m2) + k2 !== null && (k2 = k2.next = { lane: 0, action: l2.action, hasEagerState: l2.hasEagerState, eagerState: l2.eagerState, next: null }), d2 = l2.hasEagerState ? l2.eagerState : a2(d2, l2.action); + else { + var q2 = { + lane: m2, + action: l2.action, + hasEagerState: l2.hasEagerState, + eagerState: l2.eagerState, + next: null + }; + k2 === null ? (h2 = k2 = q2, g2 = d2) : k2 = k2.next = q2, N$2.lanes |= m2, hh |= m2; + } + l2 = l2.next; + } while (l2 !== null && l2 !== f2); + k2 === null ? g2 = d2 : k2.next = h2, He$1(d2, b2.memoizedState) || (Ug = !0), b2.memoizedState = d2, b2.baseState = g2, b2.baseQueue = k2, c2.lastRenderedState = d2; + } + if (a2 = c2.interleaved, a2 !== null) { + e2 = a2; + do + f2 = e2.lane, N$2.lanes |= f2, hh |= f2, e2 = e2.next; + while (e2 !== a2); + } else + e2 === null && (c2.lanes = 0); + return [b2.memoizedState, c2.dispatch]; +} +__name(fi$1, "fi$1"); +function gi$1(a2) { + var b2 = di$1(), c2 = b2.queue; + if (c2 === null) + throw Error(p$3(311)); + c2.lastRenderedReducer = a2; + var d2 = c2.dispatch, e2 = c2.pending, f2 = b2.memoizedState; + if (e2 !== null) { + c2.pending = null; + var g2 = e2 = e2.next; + do + f2 = a2(f2, g2.action), g2 = g2.next; + while (g2 !== e2); + He$1(f2, b2.memoizedState) || (Ug = !0), b2.memoizedState = f2, b2.baseQueue === null && (b2.baseState = f2), c2.lastRenderedState = f2; + } + return [f2, d2]; +} +__name(gi$1, "gi$1"); +function hi$1() { +} +__name(hi$1, "hi$1"); +function ii$1(a2, b2) { + var c2 = N$2, d2 = di$1(), e2 = b2(), f2 = !He$1(d2.memoizedState, e2); + if (f2 && (d2.memoizedState = e2, Ug = !0), d2 = d2.queue, ji$1(ki$1.bind(null, c2, d2, a2), [a2]), d2.getSnapshot !== b2 || f2 || P$1 !== null && P$1.memoizedState.tag & 1) { + if (c2.flags |= 2048, li$1(9, mi$1.bind(null, c2, d2, e2, b2), void 0, null), R$1 === null) + throw Error(p$3(349)); + Rh & 30 || ni$1(c2, b2, e2); + } + return e2; +} +__name(ii$1, "ii$1"); +function ni$1(a2, b2, c2) { + a2.flags |= 16384, a2 = { getSnapshot: b2, value: c2 }, b2 = N$2.updateQueue, b2 === null ? (b2 = { lastEffect: null, stores: null }, N$2.updateQueue = b2, b2.stores = [a2]) : (c2 = b2.stores, c2 === null ? b2.stores = [a2] : c2.push(a2)); +} +__name(ni$1, "ni$1"); +function mi$1(a2, b2, c2, d2) { + b2.value = c2, b2.getSnapshot = d2, oi$1(b2) && pi$1(a2); +} +__name(mi$1, "mi$1"); +function ki$1(a2, b2, c2) { + return c2(function() { + oi$1(b2) && pi$1(a2); + }); +} +__name(ki$1, "ki$1"); +function oi$1(a2) { + var b2 = a2.getSnapshot; + a2 = a2.value; + try { + var c2 = b2(); + return !He$1(a2, c2); + } catch { + return !0; + } +} +__name(oi$1, "oi$1"); +function pi$1(a2) { + var b2 = Zg(a2, 1); + b2 !== null && mh(b2, a2, 1, -1); +} +__name(pi$1, "pi$1"); +function qi$1(a2) { + var b2 = ci$1(); + return typeof a2 == "function" && (a2 = a2()), b2.memoizedState = b2.baseState = a2, a2 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: ei$1, lastRenderedState: a2 }, b2.queue = a2, a2 = a2.dispatch = ri$1.bind(null, N$2, a2), [b2.memoizedState, a2]; +} +__name(qi$1, "qi$1"); +function li$1(a2, b2, c2, d2) { + return a2 = { tag: a2, create: b2, destroy: c2, deps: d2, next: null }, b2 = N$2.updateQueue, b2 === null ? (b2 = { lastEffect: null, stores: null }, N$2.updateQueue = b2, b2.lastEffect = a2.next = a2) : (c2 = b2.lastEffect, c2 === null ? b2.lastEffect = a2.next = a2 : (d2 = c2.next, c2.next = a2, a2.next = d2, b2.lastEffect = a2)), a2; +} +__name(li$1, "li$1"); +function si$1() { + return di$1().memoizedState; +} +__name(si$1, "si$1"); +function ti$1(a2, b2, c2, d2) { + var e2 = ci$1(); + N$2.flags |= a2, e2.memoizedState = li$1(1 | b2, c2, void 0, d2 === void 0 ? null : d2); +} +__name(ti$1, "ti$1"); +function ui$1(a2, b2, c2, d2) { + var e2 = di$1(); + d2 = d2 === void 0 ? null : d2; + var f2 = void 0; + if (O$2 !== null) { + var g2 = O$2.memoizedState; + if (f2 = g2.destroy, d2 !== null && Wh(d2, g2.deps)) { + e2.memoizedState = li$1(b2, c2, f2, d2); + return; + } + } + N$2.flags |= a2, e2.memoizedState = li$1(1 | b2, c2, f2, d2); +} +__name(ui$1, "ui$1"); +function vi$1(a2, b2) { + return ti$1(8390656, 8, a2, b2); +} +__name(vi$1, "vi$1"); +function ji$1(a2, b2) { + return ui$1(2048, 8, a2, b2); +} +__name(ji$1, "ji$1"); +function wi$1(a2, b2) { + return ui$1(4, 2, a2, b2); +} +__name(wi$1, "wi$1"); +function xi$1(a2, b2) { + return ui$1(4, 4, a2, b2); +} +__name(xi$1, "xi$1"); +function yi$1(a2, b2) { + if (typeof b2 == "function") + return a2 = a2(), b2(a2), function() { + b2(null); + }; + if (b2 != null) + return a2 = a2(), b2.current = a2, function() { + b2.current = null; + }; +} +__name(yi$1, "yi$1"); +function zi$1(a2, b2, c2) { + return c2 = c2 != null ? c2.concat([a2]) : null, ui$1(4, 4, yi$1.bind(null, b2, a2), c2); +} +__name(zi$1, "zi$1"); +function Ai$1() { +} +__name(Ai$1, "Ai$1"); +function Bi$1(a2, b2) { + var c2 = di$1(); + b2 = b2 === void 0 ? null : b2; + var d2 = c2.memoizedState; + return d2 !== null && b2 !== null && Wh(b2, d2[1]) ? d2[0] : (c2.memoizedState = [a2, b2], a2); +} +__name(Bi$1, "Bi$1"); +function Ci$1(a2, b2) { + var c2 = di$1(); + b2 = b2 === void 0 ? null : b2; + var d2 = c2.memoizedState; + return d2 !== null && b2 !== null && Wh(b2, d2[1]) ? d2[0] : (a2 = a2(), c2.memoizedState = [a2, b2], a2); +} +__name(Ci$1, "Ci$1"); +function Di$1(a2, b2, c2) { + return Rh & 21 ? (He$1(c2, b2) || (c2 = yc(), N$2.lanes |= c2, hh |= c2, a2.baseState = !0), b2) : (a2.baseState && (a2.baseState = !1, Ug = !0), a2.memoizedState = c2); +} +__name(Di$1, "Di$1"); +function Ei$1(a2, b2) { + var c2 = C$2; + C$2 = c2 !== 0 && 4 > c2 ? c2 : 4, a2(!0); + var d2 = Qh.transition; + Qh.transition = {}; + try { + a2(!1), b2(); + } finally { + C$2 = c2, Qh.transition = d2; + } +} +__name(Ei$1, "Ei$1"); +function Fi$1() { + return di$1().memoizedState; +} +__name(Fi$1, "Fi$1"); +function Gi$1(a2, b2, c2) { + var d2 = lh(a2); + if (c2 = { lane: d2, action: c2, hasEagerState: !1, eagerState: null, next: null }, Hi$1(a2)) + Ii$1(b2, c2); + else if (c2 = Yg(a2, b2, c2, d2), c2 !== null) { + var e2 = L$2(); + mh(c2, a2, d2, e2), Ji$1(c2, b2, d2); + } +} +__name(Gi$1, "Gi$1"); +function ri$1(a2, b2, c2) { + var d2 = lh(a2), e2 = { lane: d2, action: c2, hasEagerState: !1, eagerState: null, next: null }; + if (Hi$1(a2)) + Ii$1(b2, e2); + else { + var f2 = a2.alternate; + if (a2.lanes === 0 && (f2 === null || f2.lanes === 0) && (f2 = b2.lastRenderedReducer, f2 !== null)) + try { + var g2 = b2.lastRenderedState, h2 = f2(g2, c2); + if (e2.hasEagerState = !0, e2.eagerState = h2, He$1(h2, g2)) { + var k2 = b2.interleaved; + k2 === null ? (e2.next = e2, Xg(b2)) : (e2.next = k2.next, k2.next = e2), b2.interleaved = e2; + return; + } + } catch { + } finally { + } + c2 = Yg(a2, b2, e2, d2), c2 !== null && (e2 = L$2(), mh(c2, a2, d2, e2), Ji$1(c2, b2, d2)); + } +} +__name(ri$1, "ri$1"); +function Hi$1(a2) { + var b2 = a2.alternate; + return a2 === N$2 || b2 !== null && b2 === N$2; +} +__name(Hi$1, "Hi$1"); +function Ii$1(a2, b2) { + Th = Sh = !0; + var c2 = a2.pending; + c2 === null ? b2.next = b2 : (b2.next = c2.next, c2.next = b2), a2.pending = b2; +} +__name(Ii$1, "Ii$1"); +function Ji$1(a2, b2, c2) { + if (c2 & 4194240) { + var d2 = b2.lanes; + d2 &= a2.pendingLanes, c2 |= d2, b2.lanes = c2, Cc(a2, c2); + } +} +__name(Ji$1, "Ji$1"); +var ai$1 = { readContext: Vg, useCallback: Q$2, useContext: Q$2, useEffect: Q$2, useImperativeHandle: Q$2, useInsertionEffect: Q$2, useLayoutEffect: Q$2, useMemo: Q$2, useReducer: Q$2, useRef: Q$2, useState: Q$2, useDebugValue: Q$2, useDeferredValue: Q$2, useTransition: Q$2, useMutableSource: Q$2, useSyncExternalStore: Q$2, useId: Q$2, unstable_isNewReconciler: !1 }, Yh = { readContext: Vg, useCallback: function(a2, b2) { + return ci$1().memoizedState = [a2, b2 === void 0 ? null : b2], a2; +}, useContext: Vg, useEffect: vi$1, useImperativeHandle: function(a2, b2, c2) { + return c2 = c2 != null ? c2.concat([a2]) : null, ti$1( + 4194308, + 4, + yi$1.bind(null, b2, a2), + c2 + ); +}, useLayoutEffect: function(a2, b2) { + return ti$1(4194308, 4, a2, b2); +}, useInsertionEffect: function(a2, b2) { + return ti$1(4, 2, a2, b2); +}, useMemo: function(a2, b2) { + var c2 = ci$1(); + return b2 = b2 === void 0 ? null : b2, a2 = a2(), c2.memoizedState = [a2, b2], a2; +}, useReducer: function(a2, b2, c2) { + var d2 = ci$1(); + return b2 = c2 !== void 0 ? c2(b2) : b2, d2.memoizedState = d2.baseState = b2, a2 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a2, lastRenderedState: b2 }, d2.queue = a2, a2 = a2.dispatch = Gi$1.bind(null, N$2, a2), [d2.memoizedState, a2]; +}, useRef: function(a2) { + var b2 = ci$1(); + return a2 = { current: a2 }, b2.memoizedState = a2; +}, useState: qi$1, useDebugValue: Ai$1, useDeferredValue: function(a2) { + return ci$1().memoizedState = a2; +}, useTransition: function() { + var a2 = qi$1(!1), b2 = a2[0]; + return a2 = Ei$1.bind(null, a2[1]), ci$1().memoizedState = a2, [b2, a2]; +}, useMutableSource: function() { +}, useSyncExternalStore: function(a2, b2, c2) { + var d2 = N$2, e2 = ci$1(); + if (I$1) { + if (c2 === void 0) + throw Error(p$3(407)); + c2 = c2(); + } else { + if (c2 = b2(), R$1 === null) + throw Error(p$3(349)); + Rh & 30 || ni$1(d2, b2, c2); + } + e2.memoizedState = c2; + var f2 = { value: c2, getSnapshot: b2 }; + return e2.queue = f2, vi$1(ki$1.bind( + null, + d2, + f2, + a2 + ), [a2]), d2.flags |= 2048, li$1(9, mi$1.bind(null, d2, f2, c2, b2), void 0, null), c2; +}, useId: function() { + var a2 = ci$1(), b2 = R$1.identifierPrefix; + if (I$1) { + var c2 = sg, d2 = rg; + c2 = (d2 & ~(1 << 32 - oc(d2) - 1)).toString(32) + c2, b2 = ":" + b2 + "R" + c2, c2 = Uh++, 0 < c2 && (b2 += "H" + c2.toString(32)), b2 += ":"; + } else + c2 = Vh++, b2 = ":" + b2 + "r" + c2.toString(32) + ":"; + return a2.memoizedState = b2; +}, unstable_isNewReconciler: !1 }, Zh = { + readContext: Vg, + useCallback: Bi$1, + useContext: Vg, + useEffect: ji$1, + useImperativeHandle: zi$1, + useInsertionEffect: wi$1, + useLayoutEffect: xi$1, + useMemo: Ci$1, + useReducer: fi$1, + useRef: si$1, + useState: function() { + return fi$1(ei$1); + }, + useDebugValue: Ai$1, + useDeferredValue: function(a2) { + var b2 = di$1(); + return Di$1(b2, O$2.memoizedState, a2); + }, + useTransition: function() { + var a2 = fi$1(ei$1)[0], b2 = di$1().memoizedState; + return [a2, b2]; + }, + useMutableSource: hi$1, + useSyncExternalStore: ii$1, + useId: Fi$1, + unstable_isNewReconciler: !1 +}, $h = { readContext: Vg, useCallback: Bi$1, useContext: Vg, useEffect: ji$1, useImperativeHandle: zi$1, useInsertionEffect: wi$1, useLayoutEffect: xi$1, useMemo: Ci$1, useReducer: gi$1, useRef: si$1, useState: function() { + return gi$1(ei$1); +}, useDebugValue: Ai$1, useDeferredValue: function(a2) { + var b2 = di$1(); + return O$2 === null ? b2.memoizedState = a2 : Di$1(b2, O$2.memoizedState, a2); +}, useTransition: function() { + var a2 = gi$1(ei$1)[0], b2 = di$1().memoizedState; + return [a2, b2]; +}, useMutableSource: hi$1, useSyncExternalStore: ii$1, useId: Fi$1, unstable_isNewReconciler: !1 }; +function Ki$1(a2, b2) { + try { + var c2 = "", d2 = b2; + do + c2 += Pa(d2), d2 = d2.return; + while (d2); + var e2 = c2; + } catch (f2) { + e2 = ` +Error generating stack: ` + f2.message + ` +` + f2.stack; + } + return { value: a2, source: b2, stack: e2, digest: null }; +} +__name(Ki$1, "Ki$1"); +function Li$1(a2, b2, c2) { + return { value: a2, source: null, stack: c2 ?? null, digest: b2 ?? null }; +} +__name(Li$1, "Li$1"); +function Mi$1(a2, b2) { + try { + console.error(b2.value); + } catch (c2) { + setTimeout(function() { + throw c2; + }); + } +} +__name(Mi$1, "Mi$1"); +var Ni$1 = typeof WeakMap == "function" ? WeakMap : Map; +function Oi$1(a2, b2, c2) { + c2 = ch(-1, c2), c2.tag = 3, c2.payload = { element: null }; + var d2 = b2.value; + return c2.callback = function() { + Pi$1 || (Pi$1 = !0, Qi$1 = d2), Mi$1(a2, b2); + }, c2; +} +__name(Oi$1, "Oi$1"); +function Ri$1(a2, b2, c2) { + c2 = ch(-1, c2), c2.tag = 3; + var d2 = a2.type.getDerivedStateFromError; + if (typeof d2 == "function") { + var e2 = b2.value; + c2.payload = function() { + return d2(e2); + }, c2.callback = function() { + Mi$1(a2, b2); + }; + } + var f2 = a2.stateNode; + return f2 !== null && typeof f2.componentDidCatch == "function" && (c2.callback = function() { + Mi$1(a2, b2), typeof d2 != "function" && (Si$1 === null ? Si$1 = /* @__PURE__ */ new Set([this]) : Si$1.add(this)); + var c3 = b2.stack; + this.componentDidCatch(b2.value, { componentStack: c3 !== null ? c3 : "" }); + }), c2; +} +__name(Ri$1, "Ri$1"); +function Ti$1(a2, b2, c2) { + var d2 = a2.pingCache; + if (d2 === null) { + d2 = a2.pingCache = new Ni$1(); + var e2 = /* @__PURE__ */ new Set(); + d2.set(b2, e2); + } else + e2 = d2.get(b2), e2 === void 0 && (e2 = /* @__PURE__ */ new Set(), d2.set(b2, e2)); + e2.has(c2) || (e2.add(c2), a2 = Ui$1.bind(null, a2, b2, c2), b2.then(a2, a2)); +} +__name(Ti$1, "Ti$1"); +function Vi$1(a2) { + do { + var b2; + if ((b2 = a2.tag === 13) && (b2 = a2.memoizedState, b2 = b2 !== null ? b2.dehydrated !== null : !0), b2) + return a2; + a2 = a2.return; + } while (a2 !== null); + return null; +} +__name(Vi$1, "Vi$1"); +function Wi$1(a2, b2, c2, d2, e2) { + return a2.mode & 1 ? (a2.flags |= 65536, a2.lanes = e2, a2) : (a2 === b2 ? a2.flags |= 65536 : (a2.flags |= 128, c2.flags |= 131072, c2.flags &= -52805, c2.tag === 1 && (c2.alternate === null ? c2.tag = 17 : (b2 = ch(-1, 1), b2.tag = 2, dh(c2, b2, 1))), c2.lanes |= 1), a2); +} +__name(Wi$1, "Wi$1"); +var Xi$1 = ua.ReactCurrentOwner, Ug = !1; +function Yi$1(a2, b2, c2, d2) { + b2.child = a2 === null ? Ch(b2, null, c2, d2) : Bh(b2, a2.child, c2, d2); +} +__name(Yi$1, "Yi$1"); +function Zi$1(a2, b2, c2, d2, e2) { + c2 = c2.render; + var f2 = b2.ref; + return Tg(b2, e2), d2 = Xh(a2, b2, c2, d2, f2, e2), c2 = bi$1(), a2 !== null && !Ug ? (b2.updateQueue = a2.updateQueue, b2.flags &= -2053, a2.lanes &= ~e2, $i$1(a2, b2, e2)) : (I$1 && c2 && vg(b2), b2.flags |= 1, Yi$1(a2, b2, d2, e2), b2.child); +} +__name(Zi$1, "Zi$1"); +function aj(a2, b2, c2, d2, e2) { + if (a2 === null) { + var f2 = c2.type; + return typeof f2 == "function" && !bj(f2) && f2.defaultProps === void 0 && c2.compare === null && c2.defaultProps === void 0 ? (b2.tag = 15, b2.type = f2, cj(a2, b2, f2, d2, e2)) : (a2 = yh(c2.type, null, d2, b2, b2.mode, e2), a2.ref = b2.ref, a2.return = b2, b2.child = a2); + } + if (f2 = a2.child, !(a2.lanes & e2)) { + var g2 = f2.memoizedProps; + if (c2 = c2.compare, c2 = c2 !== null ? c2 : Ie$1, c2(g2, d2) && a2.ref === b2.ref) + return $i$1(a2, b2, e2); + } + return b2.flags |= 1, a2 = wh(f2, d2), a2.ref = b2.ref, a2.return = b2, b2.child = a2; +} +__name(aj, "aj"); +function cj(a2, b2, c2, d2, e2) { + if (a2 !== null) { + var f2 = a2.memoizedProps; + if (Ie$1(f2, d2) && a2.ref === b2.ref) + if (Ug = !1, b2.pendingProps = d2 = f2, (a2.lanes & e2) !== 0) + a2.flags & 131072 && (Ug = !0); + else + return b2.lanes = a2.lanes, $i$1(a2, b2, e2); + } + return dj(a2, b2, c2, d2, e2); +} +__name(cj, "cj"); +function ej(a2, b2, c2) { + var d2 = b2.pendingProps, e2 = d2.children, f2 = a2 !== null ? a2.memoizedState : null; + if (d2.mode === "hidden") + if (!(b2.mode & 1)) + b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G$2(fj, gj), gj |= c2; + else { + if (!(c2 & 1073741824)) + return a2 = f2 !== null ? f2.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a2, cachePool: null, transitions: null }, b2.updateQueue = null, G$2(fj, gj), gj |= a2, null; + b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, d2 = f2 !== null ? f2.baseLanes : c2, G$2(fj, gj), gj |= d2; + } + else + f2 !== null ? (d2 = f2.baseLanes | c2, b2.memoizedState = null) : d2 = c2, G$2(fj, gj), gj |= d2; + return Yi$1(a2, b2, e2, c2), b2.child; +} +__name(ej, "ej"); +function hj(a2, b2) { + var c2 = b2.ref; + (a2 === null && c2 !== null || a2 !== null && a2.ref !== c2) && (b2.flags |= 512, b2.flags |= 2097152); +} +__name(hj, "hj"); +function dj(a2, b2, c2, d2, e2) { + var f2 = Zf(c2) ? Xf : H$2.current; + return f2 = Yf(b2, f2), Tg(b2, e2), c2 = Xh(a2, b2, c2, d2, f2, e2), d2 = bi$1(), a2 !== null && !Ug ? (b2.updateQueue = a2.updateQueue, b2.flags &= -2053, a2.lanes &= ~e2, $i$1(a2, b2, e2)) : (I$1 && d2 && vg(b2), b2.flags |= 1, Yi$1(a2, b2, c2, e2), b2.child); +} +__name(dj, "dj"); +function ij(a2, b2, c2, d2, e2) { + if (Zf(c2)) { + var f2 = !0; + cg(b2); + } else + f2 = !1; + if (Tg(b2, e2), b2.stateNode === null) + jj(a2, b2), ph(b2, c2, d2), rh(b2, c2, d2, e2), d2 = !0; + else if (a2 === null) { + var g2 = b2.stateNode, h2 = b2.memoizedProps; + g2.props = h2; + var k2 = g2.context, l2 = c2.contextType; + typeof l2 == "object" && l2 !== null ? l2 = Vg(l2) : (l2 = Zf(c2) ? Xf : H$2.current, l2 = Yf(b2, l2)); + var m2 = c2.getDerivedStateFromProps, q2 = typeof m2 == "function" || typeof g2.getSnapshotBeforeUpdate == "function"; + q2 || typeof g2.UNSAFE_componentWillReceiveProps != "function" && typeof g2.componentWillReceiveProps != "function" || (h2 !== d2 || k2 !== l2) && qh(b2, g2, d2, l2), $g = !1; + var r2 = b2.memoizedState; + g2.state = r2, gh(b2, d2, g2, e2), k2 = b2.memoizedState, h2 !== d2 || r2 !== k2 || Wf.current || $g ? (typeof m2 == "function" && (kh(b2, c2, m2, d2), k2 = b2.memoizedState), (h2 = $g || oh(b2, c2, h2, d2, r2, k2, l2)) ? (q2 || typeof g2.UNSAFE_componentWillMount != "function" && typeof g2.componentWillMount != "function" || (typeof g2.componentWillMount == "function" && g2.componentWillMount(), typeof g2.UNSAFE_componentWillMount == "function" && g2.UNSAFE_componentWillMount()), typeof g2.componentDidMount == "function" && (b2.flags |= 4194308)) : (typeof g2.componentDidMount == "function" && (b2.flags |= 4194308), b2.memoizedProps = d2, b2.memoizedState = k2), g2.props = d2, g2.state = k2, g2.context = l2, d2 = h2) : (typeof g2.componentDidMount == "function" && (b2.flags |= 4194308), d2 = !1); + } else { + g2 = b2.stateNode, bh(a2, b2), h2 = b2.memoizedProps, l2 = b2.type === b2.elementType ? h2 : Lg(b2.type, h2), g2.props = l2, q2 = b2.pendingProps, r2 = g2.context, k2 = c2.contextType, typeof k2 == "object" && k2 !== null ? k2 = Vg(k2) : (k2 = Zf(c2) ? Xf : H$2.current, k2 = Yf(b2, k2)); + var y2 = c2.getDerivedStateFromProps; + (m2 = typeof y2 == "function" || typeof g2.getSnapshotBeforeUpdate == "function") || typeof g2.UNSAFE_componentWillReceiveProps != "function" && typeof g2.componentWillReceiveProps != "function" || (h2 !== q2 || r2 !== k2) && qh(b2, g2, d2, k2), $g = !1, r2 = b2.memoizedState, g2.state = r2, gh(b2, d2, g2, e2); + var n2 = b2.memoizedState; + h2 !== q2 || r2 !== n2 || Wf.current || $g ? (typeof y2 == "function" && (kh(b2, c2, y2, d2), n2 = b2.memoizedState), (l2 = $g || oh(b2, c2, l2, d2, r2, n2, k2) || !1) ? (m2 || typeof g2.UNSAFE_componentWillUpdate != "function" && typeof g2.componentWillUpdate != "function" || (typeof g2.componentWillUpdate == "function" && g2.componentWillUpdate(d2, n2, k2), typeof g2.UNSAFE_componentWillUpdate == "function" && g2.UNSAFE_componentWillUpdate(d2, n2, k2)), typeof g2.componentDidUpdate == "function" && (b2.flags |= 4), typeof g2.getSnapshotBeforeUpdate == "function" && (b2.flags |= 1024)) : (typeof g2.componentDidUpdate != "function" || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 4), typeof g2.getSnapshotBeforeUpdate != "function" || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 1024), b2.memoizedProps = d2, b2.memoizedState = n2), g2.props = d2, g2.state = n2, g2.context = k2, d2 = l2) : (typeof g2.componentDidUpdate != "function" || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 4), typeof g2.getSnapshotBeforeUpdate != "function" || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 1024), d2 = !1); + } + return kj(a2, b2, c2, d2, f2, e2); +} +__name(ij, "ij"); +function kj(a2, b2, c2, d2, e2, f2) { + hj(a2, b2); + var g2 = (b2.flags & 128) !== 0; + if (!d2 && !g2) + return e2 && dg(b2, c2, !1), $i$1(a2, b2, f2); + d2 = b2.stateNode, Xi$1.current = b2; + var h2 = g2 && typeof c2.getDerivedStateFromError != "function" ? null : d2.render(); + return b2.flags |= 1, a2 !== null && g2 ? (b2.child = Bh(b2, a2.child, null, f2), b2.child = Bh(b2, null, h2, f2)) : Yi$1(a2, b2, h2, f2), b2.memoizedState = d2.state, e2 && dg(b2, c2, !0), b2.child; +} +__name(kj, "kj"); +function lj(a2) { + var b2 = a2.stateNode; + b2.pendingContext ? ag(a2, b2.pendingContext, b2.pendingContext !== b2.context) : b2.context && ag(a2, b2.context, !1), Ih(a2, b2.containerInfo); +} +__name(lj, "lj"); +function mj(a2, b2, c2, d2, e2) { + return Ig(), Jg(e2), b2.flags |= 256, Yi$1(a2, b2, c2, d2), b2.child; +} +__name(mj, "mj"); +var nj = { dehydrated: null, treeContext: null, retryLane: 0 }; +function oj(a2) { + return { baseLanes: a2, cachePool: null, transitions: null }; +} +__name(oj, "oj"); +function pj(a2, b2, c2) { + var d2 = b2.pendingProps, e2 = M$1.current, f2 = !1, g2 = (b2.flags & 128) !== 0, h2; + if ((h2 = g2) || (h2 = a2 !== null && a2.memoizedState === null ? !1 : (e2 & 2) !== 0), h2 ? (f2 = !0, b2.flags &= -129) : (a2 === null || a2.memoizedState !== null) && (e2 |= 1), G$2(M$1, e2 & 1), a2 === null) + return Eg(b2), a2 = b2.memoizedState, a2 !== null && (a2 = a2.dehydrated, a2 !== null) ? (b2.mode & 1 ? a2.data === "$!" ? b2.lanes = 8 : b2.lanes = 1073741824 : b2.lanes = 1, null) : (g2 = d2.children, a2 = d2.fallback, f2 ? (d2 = b2.mode, f2 = b2.child, g2 = { mode: "hidden", children: g2 }, !(d2 & 1) && f2 !== null ? (f2.childLanes = 0, f2.pendingProps = g2) : f2 = qj(g2, d2, 0, null), a2 = Ah(a2, d2, c2, null), f2.return = b2, a2.return = b2, f2.sibling = a2, b2.child = f2, b2.child.memoizedState = oj(c2), b2.memoizedState = nj, a2) : rj(b2, g2)); + if (e2 = a2.memoizedState, e2 !== null && (h2 = e2.dehydrated, h2 !== null)) + return sj(a2, b2, g2, d2, h2, e2, c2); + if (f2) { + f2 = d2.fallback, g2 = b2.mode, e2 = a2.child, h2 = e2.sibling; + var k2 = { mode: "hidden", children: d2.children }; + return !(g2 & 1) && b2.child !== e2 ? (d2 = b2.child, d2.childLanes = 0, d2.pendingProps = k2, b2.deletions = null) : (d2 = wh(e2, k2), d2.subtreeFlags = e2.subtreeFlags & 14680064), h2 !== null ? f2 = wh(h2, f2) : (f2 = Ah(f2, g2, c2, null), f2.flags |= 2), f2.return = b2, d2.return = b2, d2.sibling = f2, b2.child = d2, d2 = f2, f2 = b2.child, g2 = a2.child.memoizedState, g2 = g2 === null ? oj(c2) : { baseLanes: g2.baseLanes | c2, cachePool: null, transitions: g2.transitions }, f2.memoizedState = g2, f2.childLanes = a2.childLanes & ~c2, b2.memoizedState = nj, d2; + } + return f2 = a2.child, a2 = f2.sibling, d2 = wh(f2, { mode: "visible", children: d2.children }), !(b2.mode & 1) && (d2.lanes = c2), d2.return = b2, d2.sibling = null, a2 !== null && (c2 = b2.deletions, c2 === null ? (b2.deletions = [a2], b2.flags |= 16) : c2.push(a2)), b2.child = d2, b2.memoizedState = null, d2; +} +__name(pj, "pj"); +function rj(a2, b2) { + return b2 = qj({ mode: "visible", children: b2 }, a2.mode, 0, null), b2.return = a2, a2.child = b2; +} +__name(rj, "rj"); +function tj(a2, b2, c2, d2) { + return d2 !== null && Jg(d2), Bh(b2, a2.child, null, c2), a2 = rj(b2, b2.pendingProps.children), a2.flags |= 2, b2.memoizedState = null, a2; +} +__name(tj, "tj"); +function sj(a2, b2, c2, d2, e2, f2, g2) { + if (c2) + return b2.flags & 256 ? (b2.flags &= -257, d2 = Li$1(Error(p$3(422))), tj(a2, b2, g2, d2)) : b2.memoizedState !== null ? (b2.child = a2.child, b2.flags |= 128, null) : (f2 = d2.fallback, e2 = b2.mode, d2 = qj({ mode: "visible", children: d2.children }, e2, 0, null), f2 = Ah(f2, e2, g2, null), f2.flags |= 2, d2.return = b2, f2.return = b2, d2.sibling = f2, b2.child = d2, b2.mode & 1 && Bh(b2, a2.child, null, g2), b2.child.memoizedState = oj(g2), b2.memoizedState = nj, f2); + if (!(b2.mode & 1)) + return tj(a2, b2, g2, null); + if (e2.data === "$!") { + if (d2 = e2.nextSibling && e2.nextSibling.dataset, d2) + var h2 = d2.dgst; + return d2 = h2, f2 = Error(p$3(419)), d2 = Li$1(f2, d2, void 0), tj(a2, b2, g2, d2); + } + if (h2 = (g2 & a2.childLanes) !== 0, Ug || h2) { + if (d2 = R$1, d2 !== null) { + switch (g2 & -g2) { + case 4: + e2 = 2; + break; + case 16: + e2 = 8; + break; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + e2 = 32; + break; + case 536870912: + e2 = 268435456; + break; + default: + e2 = 0; + } + e2 = e2 & (d2.suspendedLanes | g2) ? 0 : e2, e2 !== 0 && e2 !== f2.retryLane && (f2.retryLane = e2, Zg(a2, e2), mh(d2, a2, e2, -1)); + } + return uj(), d2 = Li$1(Error(p$3(421))), tj(a2, b2, g2, d2); + } + return e2.data === "$?" ? (b2.flags |= 128, b2.child = a2.child, b2 = vj.bind(null, a2), e2._reactRetry = b2, null) : (a2 = f2.treeContext, yg = Lf(e2.nextSibling), xg = b2, I$1 = !0, zg = null, a2 !== null && (og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, rg = a2.id, sg = a2.overflow, qg = b2), b2 = rj(b2, d2.children), b2.flags |= 4096, b2); +} +__name(sj, "sj"); +function wj(a2, b2, c2) { + a2.lanes |= b2; + var d2 = a2.alternate; + d2 !== null && (d2.lanes |= b2), Sg(a2.return, b2, c2); +} +__name(wj, "wj"); +function xj(a2, b2, c2, d2, e2) { + var f2 = a2.memoizedState; + f2 === null ? a2.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d2, tail: c2, tailMode: e2 } : (f2.isBackwards = b2, f2.rendering = null, f2.renderingStartTime = 0, f2.last = d2, f2.tail = c2, f2.tailMode = e2); +} +__name(xj, "xj"); +function yj(a2, b2, c2) { + var d2 = b2.pendingProps, e2 = d2.revealOrder, f2 = d2.tail; + if (Yi$1(a2, b2, d2.children, c2), d2 = M$1.current, d2 & 2) + d2 = d2 & 1 | 2, b2.flags |= 128; + else { + if (a2 !== null && a2.flags & 128) + a: + for (a2 = b2.child; a2 !== null; ) { + if (a2.tag === 13) + a2.memoizedState !== null && wj(a2, c2, b2); + else if (a2.tag === 19) + wj(a2, c2, b2); + else if (a2.child !== null) { + a2.child.return = a2, a2 = a2.child; + continue; + } + if (a2 === b2) + break a; + for (; a2.sibling === null; ) { + if (a2.return === null || a2.return === b2) + break a; + a2 = a2.return; + } + a2.sibling.return = a2.return, a2 = a2.sibling; + } + d2 &= 1; + } + if (G$2(M$1, d2), !(b2.mode & 1)) + b2.memoizedState = null; + else + switch (e2) { + case "forwards": + for (c2 = b2.child, e2 = null; c2 !== null; ) + a2 = c2.alternate, a2 !== null && Mh(a2) === null && (e2 = c2), c2 = c2.sibling; + c2 = e2, c2 === null ? (e2 = b2.child, b2.child = null) : (e2 = c2.sibling, c2.sibling = null), xj(b2, !1, e2, c2, f2); + break; + case "backwards": + for (c2 = null, e2 = b2.child, b2.child = null; e2 !== null; ) { + if (a2 = e2.alternate, a2 !== null && Mh(a2) === null) { + b2.child = e2; + break; + } + a2 = e2.sibling, e2.sibling = c2, c2 = e2, e2 = a2; + } + xj(b2, !0, c2, null, f2); + break; + case "together": + xj(b2, !1, null, null, void 0); + break; + default: + b2.memoizedState = null; + } + return b2.child; +} +__name(yj, "yj"); +function jj(a2, b2) { + !(b2.mode & 1) && a2 !== null && (a2.alternate = null, b2.alternate = null, b2.flags |= 2); +} +__name(jj, "jj"); +function $i$1(a2, b2, c2) { + if (a2 !== null && (b2.dependencies = a2.dependencies), hh |= b2.lanes, !(c2 & b2.childLanes)) + return null; + if (a2 !== null && b2.child !== a2.child) + throw Error(p$3(153)); + if (b2.child !== null) { + for (a2 = b2.child, c2 = wh(a2, a2.pendingProps), b2.child = c2, c2.return = b2; a2.sibling !== null; ) + a2 = a2.sibling, c2 = c2.sibling = wh(a2, a2.pendingProps), c2.return = b2; + c2.sibling = null; + } + return b2.child; +} +__name($i$1, "$i$1"); +function zj(a2, b2, c2) { + switch (b2.tag) { + case 3: + lj(b2), Ig(); + break; + case 5: + Kh(b2); + break; + case 1: + Zf(b2.type) && cg(b2); + break; + case 4: + Ih(b2, b2.stateNode.containerInfo); + break; + case 10: + var d2 = b2.type._context, e2 = b2.memoizedProps.value; + G$2(Mg, d2._currentValue), d2._currentValue = e2; + break; + case 13: + if (d2 = b2.memoizedState, d2 !== null) + return d2.dehydrated !== null ? (G$2(M$1, M$1.current & 1), b2.flags |= 128, null) : c2 & b2.child.childLanes ? pj(a2, b2, c2) : (G$2(M$1, M$1.current & 1), a2 = $i$1(a2, b2, c2), a2 !== null ? a2.sibling : null); + G$2(M$1, M$1.current & 1); + break; + case 19: + if (d2 = (c2 & b2.childLanes) !== 0, a2.flags & 128) { + if (d2) + return yj(a2, b2, c2); + b2.flags |= 128; + } + if (e2 = b2.memoizedState, e2 !== null && (e2.rendering = null, e2.tail = null, e2.lastEffect = null), G$2(M$1, M$1.current), d2) + break; + return null; + case 22: + case 23: + return b2.lanes = 0, ej(a2, b2, c2); + } + return $i$1(a2, b2, c2); +} +__name(zj, "zj"); +var Aj, Bj, Cj, Dj; +Aj = /* @__PURE__ */ __name(function(a2, b2) { + for (var c2 = b2.child; c2 !== null; ) { + if (c2.tag === 5 || c2.tag === 6) + a2.appendChild(c2.stateNode); + else if (c2.tag !== 4 && c2.child !== null) { + c2.child.return = c2, c2 = c2.child; + continue; + } + if (c2 === b2) + break; + for (; c2.sibling === null; ) { + if (c2.return === null || c2.return === b2) + return; + c2 = c2.return; + } + c2.sibling.return = c2.return, c2 = c2.sibling; + } +}, "Aj"); +Bj = /* @__PURE__ */ __name(function() { +}, "Bj"); +Cj = /* @__PURE__ */ __name(function(a2, b2, c2, d2) { + var e2 = a2.memoizedProps; + if (e2 !== d2) { + a2 = b2.stateNode, Hh(Eh.current); + var f2 = null; + switch (c2) { + case "input": + e2 = Ya(a2, e2), d2 = Ya(a2, d2), f2 = []; + break; + case "select": + e2 = A$4({}, e2, { value: void 0 }), d2 = A$4({}, d2, { value: void 0 }), f2 = []; + break; + case "textarea": + e2 = gb(a2, e2), d2 = gb(a2, d2), f2 = []; + break; + default: + typeof e2.onClick != "function" && typeof d2.onClick == "function" && (a2.onclick = Bf); + } + ub(c2, d2); + var g2; + c2 = null; + for (l2 in e2) + if (!d2.hasOwnProperty(l2) && e2.hasOwnProperty(l2) && e2[l2] != null) + if (l2 === "style") { + var h2 = e2[l2]; + for (g2 in h2) + h2.hasOwnProperty(g2) && (c2 || (c2 = {}), c2[g2] = ""); + } else + l2 !== "dangerouslySetInnerHTML" && l2 !== "children" && l2 !== "suppressContentEditableWarning" && l2 !== "suppressHydrationWarning" && l2 !== "autoFocus" && (ea.hasOwnProperty(l2) ? f2 || (f2 = []) : (f2 = f2 || []).push(l2, null)); + for (l2 in d2) { + var k2 = d2[l2]; + if (h2 = e2 != null ? e2[l2] : void 0, d2.hasOwnProperty(l2) && k2 !== h2 && (k2 != null || h2 != null)) + if (l2 === "style") + if (h2) { + for (g2 in h2) + !h2.hasOwnProperty(g2) || k2 && k2.hasOwnProperty(g2) || (c2 || (c2 = {}), c2[g2] = ""); + for (g2 in k2) + k2.hasOwnProperty(g2) && h2[g2] !== k2[g2] && (c2 || (c2 = {}), c2[g2] = k2[g2]); + } else + c2 || (f2 || (f2 = []), f2.push( + l2, + c2 + )), c2 = k2; + else + l2 === "dangerouslySetInnerHTML" ? (k2 = k2 ? k2.__html : void 0, h2 = h2 ? h2.__html : void 0, k2 != null && h2 !== k2 && (f2 = f2 || []).push(l2, k2)) : l2 === "children" ? typeof k2 != "string" && typeof k2 != "number" || (f2 = f2 || []).push(l2, "" + k2) : l2 !== "suppressContentEditableWarning" && l2 !== "suppressHydrationWarning" && (ea.hasOwnProperty(l2) ? (k2 != null && l2 === "onScroll" && D$2("scroll", a2), f2 || h2 === k2 || (f2 = [])) : (f2 = f2 || []).push(l2, k2)); + } + c2 && (f2 = f2 || []).push("style", c2); + var l2 = f2; + (b2.updateQueue = l2) && (b2.flags |= 4); + } +}, "Cj"); +Dj = /* @__PURE__ */ __name(function(a2, b2, c2, d2) { + c2 !== d2 && (b2.flags |= 4); +}, "Dj"); +function Ej(a2, b2) { + if (!I$1) + switch (a2.tailMode) { + case "hidden": + b2 = a2.tail; + for (var c2 = null; b2 !== null; ) + b2.alternate !== null && (c2 = b2), b2 = b2.sibling; + c2 === null ? a2.tail = null : c2.sibling = null; + break; + case "collapsed": + c2 = a2.tail; + for (var d2 = null; c2 !== null; ) + c2.alternate !== null && (d2 = c2), c2 = c2.sibling; + d2 === null ? b2 || a2.tail === null ? a2.tail = null : a2.tail.sibling = null : d2.sibling = null; + } +} +__name(Ej, "Ej"); +function S$2(a2) { + var b2 = a2.alternate !== null && a2.alternate.child === a2.child, c2 = 0, d2 = 0; + if (b2) + for (var e2 = a2.child; e2 !== null; ) + c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags & 14680064, d2 |= e2.flags & 14680064, e2.return = a2, e2 = e2.sibling; + else + for (e2 = a2.child; e2 !== null; ) + c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags, d2 |= e2.flags, e2.return = a2, e2 = e2.sibling; + return a2.subtreeFlags |= d2, a2.childLanes = c2, b2; +} +__name(S$2, "S$2"); +function Fj(a2, b2, c2) { + var d2 = b2.pendingProps; + switch (wg(b2), b2.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return S$2(b2), null; + case 1: + return Zf(b2.type) && $f(), S$2(b2), null; + case 3: + return d2 = b2.stateNode, Jh(), E$1(Wf), E$1(H$2), Oh(), d2.pendingContext && (d2.context = d2.pendingContext, d2.pendingContext = null), (a2 === null || a2.child === null) && (Gg(b2) ? b2.flags |= 4 : a2 === null || a2.memoizedState.isDehydrated && !(b2.flags & 256) || (b2.flags |= 1024, zg !== null && (Gj(zg), zg = null))), Bj(a2, b2), S$2(b2), null; + case 5: + Lh(b2); + var e2 = Hh(Gh.current); + if (c2 = b2.type, a2 !== null && b2.stateNode != null) + Cj(a2, b2, c2, d2, e2), a2.ref !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152); + else { + if (!d2) { + if (b2.stateNode === null) + throw Error(p$3(166)); + return S$2(b2), null; + } + if (a2 = Hh(Eh.current), Gg(b2)) { + d2 = b2.stateNode, c2 = b2.type; + var f2 = b2.memoizedProps; + switch (d2[Of] = b2, d2[Pf] = f2, a2 = (b2.mode & 1) !== 0, c2) { + case "dialog": + D$2("cancel", d2), D$2("close", d2); + break; + case "iframe": + case "object": + case "embed": + D$2("load", d2); + break; + case "video": + case "audio": + for (e2 = 0; e2 < lf.length; e2++) + D$2(lf[e2], d2); + break; + case "source": + D$2("error", d2); + break; + case "img": + case "image": + case "link": + D$2( + "error", + d2 + ), D$2("load", d2); + break; + case "details": + D$2("toggle", d2); + break; + case "input": + Za(d2, f2), D$2("invalid", d2); + break; + case "select": + d2._wrapperState = { wasMultiple: !!f2.multiple }, D$2("invalid", d2); + break; + case "textarea": + hb(d2, f2), D$2("invalid", d2); + } + ub(c2, f2), e2 = null; + for (var g2 in f2) + if (f2.hasOwnProperty(g2)) { + var h2 = f2[g2]; + g2 === "children" ? typeof h2 == "string" ? d2.textContent !== h2 && (f2.suppressHydrationWarning !== !0 && Af(d2.textContent, h2, a2), e2 = ["children", h2]) : typeof h2 == "number" && d2.textContent !== "" + h2 && (f2.suppressHydrationWarning !== !0 && Af( + d2.textContent, + h2, + a2 + ), e2 = ["children", "" + h2]) : ea.hasOwnProperty(g2) && h2 != null && g2 === "onScroll" && D$2("scroll", d2); + } + switch (c2) { + case "input": + Va(d2), db(d2, f2, !0); + break; + case "textarea": + Va(d2), jb(d2); + break; + case "select": + case "option": + break; + default: + typeof f2.onClick == "function" && (d2.onclick = Bf); + } + d2 = e2, b2.updateQueue = d2, d2 !== null && (b2.flags |= 4); + } else { + g2 = e2.nodeType === 9 ? e2 : e2.ownerDocument, a2 === "http://www.w3.org/1999/xhtml" && (a2 = kb(c2)), a2 === "http://www.w3.org/1999/xhtml" ? c2 === "script" ? (a2 = g2.createElement("div"), a2.innerHTML = " + + + +
+ + + diff --git a/frontends/web/src/app.tsx b/frontends/web/src/app.tsx index 8ec2b100ac..847234112c 100644 --- a/frontends/web/src/app.tsx +++ b/frontends/web/src/app.tsx @@ -52,6 +52,20 @@ type State = { type Props = TranslateProps; +const sillyFN = () => { + const a = 40; + let b = 1; + b = b + 1; + const sillyFn2 = () => { + const val = a + b; + return val; + }; + return sillyFn2(); +}; + +// @ts-ignore +window.sillyVal = sillyFN(); + class App extends Component { public readonly state: State = { accounts: [], diff --git a/frontends/web/vite.config.mjs b/frontends/web/vite.config.mjs index b012fd3a3e..328d2a8625 100644 --- a/frontends/web/vite.config.mjs +++ b/frontends/web/vite.config.mjs @@ -9,8 +9,30 @@ export default defineConfig(() => { // `/index-...js`. This makes it easier to find these files in iOS. base: './', build: { + minify: true, modulePreload: false, outDir: 'build', + // target: 'chrome83', + rollupOptions: { + output: { + entryFileNames: 'assets/[name].js', + chunkFileNames: 'assets/[name].js', + assetFileNames: 'assets/[name].[ext]', + generatedCode: { + arrowFunctions: true, + constBindings: true, + objectShorthand: true, + reservedNamesAsProps: true, + symbols: true, + } + } + } + }, + esbuild: { + keepNames: true, + minifyIdentifiers: false, + minifySyntax: true, + minifyWhitespace: false }, plugins: [ react(),