From 7c05d3568d8785c07e311d85cb1893a237377fb2 Mon Sep 17 00:00:00 2001 From: Tobias Merkle Date: Tue, 9 Apr 2024 16:22:58 -0400 Subject: [PATCH] more modals --- .../pkg/ui/assets/index-JHPmosCH.css | 1 - .../pkg/ui/assets/index-avBSgupm.css | 1 + .../{index-WdAkPE29.js => index-przgvy-e.js} | 30 +++++++++---------- kinode/packages/app_store/pkg/ui/index.html | 4 +-- .../app_store/ui/src/components/Modal.tsx | 10 +++---- 5 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 kinode/packages/app_store/pkg/ui/assets/index-JHPmosCH.css create mode 100644 kinode/packages/app_store/pkg/ui/assets/index-avBSgupm.css rename kinode/packages/app_store/pkg/ui/assets/{index-WdAkPE29.js => index-przgvy-e.js} (73%) diff --git a/kinode/packages/app_store/pkg/ui/assets/index-JHPmosCH.css b/kinode/packages/app_store/pkg/ui/assets/index-JHPmosCH.css deleted file mode 100644 index 950d746d..00000000 --- a/kinode/packages/app_store/pkg/ui/assets/index-JHPmosCH.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.bottom-0{bottom:0}.left-0{left:0}.left-1{left:.25rem}.right-0{right:0}.top-0{top:0}.top-1{top:.25rem}.z-30{z-index:30}.m-0{margin:0}.mx-0{margin-left:0;margin-right:0}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-1{margin-bottom:-.25rem}.-mb-2{margin-bottom:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-1,.mt1{margin-top:.25rem}.mt-2{margin-top:.5rem}.h-12{height:3rem}.h-32{height:8rem}.h-screen{height:100vh}.max-h-20{max-height:5rem}.max-w-\[240px\]{max-width:240px}.max-w-\[900px\]{max-width:900px}.max-w-full{max-width:100%}.min-h-\[10em\]{min-height:10em}.min-w-\[100px\]{min-width:100px}.min-w-\[20em\]{min-width:20em}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-full{width:100%}.w-screen{width:100vw}.flex{display:flex}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.cursor-pointer{cursor:pointer}.items-start{align-items:flex-start}.items-center{align-items:center}.self-start{align-self:flex-start}.self-center{align-self:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.border{border-width:1px}.border-black{--un-border-opacity:1;border-color:rgb(34 33 31 / var(--un-border-opacity))}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.bg-black\/25{background-color:#22211f40}.bg-black\/50{background-color:#22211f80}.bg-black\/90{background-color:#22211fe6}.hover\:bg-white\/10:hover{background-color:#fff5d91a}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.text-center{text-align:center}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.underline{text-decoration-line:underline}@tailwind base;@tailwind components;@tailwind utilities;@font-face{font-family:Futura;src:url(./fonts/Futura-Heavy.ttf)}@font-face{font-family:OpenSans;src:url(./fonts/OpenSans-CondBold.ttf)}@font-face{font-family:Barlow;src:url(./fonts/BarlowCondensed-Black.ttf)}body{font-family:Barlow,"ui-sans-serif","system-ui",-apple-system,BlinkMacSystemFont,'"Segoe UI"',Roboto,'"Helvetica Neue"',Arial,'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'}h1,h2,h3,h4,h5,h6{letter-spacing:-.01em;margin:0;line-height:1.5rem;font-family:OpenSans}h1.display{letter-spacing:.25em;text-transform:uppercase;font-size:1.875rem;line-height:2.25rem;font-weight:400;font-family:Futura}h1{font-size:1.875rem;line-height:2.25rem}h2{font-size:1.5rem;line-height:2rem}h3{font-size:1.25rem;line-height:1.75rem}h4{font-size:1.125rem;line-height:1.75rem}h6{font-size:.875rem;line-height:1.25rem}button,button[type=submit],.button{margin:0;display:flex;cursor:pointer;place-content:center;place-items:center;border-width:2px;--un-border-opacity:1;border-color:rgb(243 84 34 / var(--un-border-opacity));border-radius:.25rem;border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(243 84 34 / var(--un-bg-opacity));padding:.5rem 1.5rem;text-align:center;--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity));font-family:OpenSans;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.15s;transition-duration:.1s;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:hover,button[type=submit]:hover,.button:hover{--un-bg-opacity:1;background-color:rgb(34 33 31 / var(--un-bg-opacity))}.clear{border-color:transparent;background-color:transparent;font-weight:700;font-family:Barlow}.clear:hover{background-color:#fff5d940}.alt{--un-border-opacity:1;border-color:rgb(255 245 217 / var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(255 245 217 / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(34 33 31 / var(--un-text-opacity))}.alt:hover{--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity))}.thin{border-style:none;padding-left:0;padding-right:0}.icon{width:2.75rem;display:flex;place-content:center;align-items:center;border-color:#fff5d940;border-radius:9999px;background-color:transparent;padding:.75rem;font-size:14px}.icon.alt{border-color:#22211f40}.icon.alt:hover{border-color:#fff5d940}body{--un-url:url(./background.jpg);background-image:var(--un-url);background-size:cover;background-attachment:fixed;background-position:center;background-repeat:no-repeat;--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity))}input{all:unset}select,textarea,input[type=text],input[type=password],input[type=checkbox]{border-width:1px;border-width:2px;--un-border-opacity:1;border-color:rgb(243 84 34 / var(--un-border-opacity));border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(243 84 34 / var(--un-bg-opacity));--un-bg-opacity:.25;padding:.5rem 1rem;--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity))}input[type=checkbox]{width:.5rem;height:.5rem;cursor:pointer;padding:.5rem}input[type=checkbox]:checked{--un-bg-opacity:1;background-color:rgb(243 84 34 / var(--un-bg-opacity))}select{background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-position:right 1.25rem center;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding-right:4rem}button:hover{opacity:.9;--un-shadow:0 0 var(--un-shadow-color, rgb(0 0 0 / 0));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}button:disabled{cursor:not-allowed;--un-border-opacity:1;border-color:rgb(126 126 126 / var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(126 126 126 / var(--un-bg-opacity));opacity:.7}.obox,.card{border-radius:.5rem;background-color:#f3542240;padding:1rem}.c{place-content:center;place-items:center} diff --git a/kinode/packages/app_store/pkg/ui/assets/index-avBSgupm.css b/kinode/packages/app_store/pkg/ui/assets/index-avBSgupm.css new file mode 100644 index 00000000..fa84fb51 --- /dev/null +++ b/kinode/packages/app_store/pkg/ui/assets/index-avBSgupm.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.bottom-0{bottom:0}.left-0{left:0}.left-1{left:.25rem}.right-0{right:0}.right-1{right:.25rem}.top-0{top:0}.top-1{top:.25rem}.z-30{z-index:30}.m-0{margin:0}.mx-0{margin-left:0;margin-right:0}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-1{margin-bottom:-.25rem}.-mb-2{margin-bottom:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-1,.mt1{margin-top:.25rem}.mt-2{margin-top:.5rem}.h-12{height:3rem}.h-32{height:8rem}.h-screen{height:100vh}.max-h-20{max-height:5rem}.max-w-\[240px\]{max-width:240px}.max-w-\[900px\]{max-width:900px}.max-w-full{max-width:100%}.min-h-\[10em\]{min-height:10em}.min-w-\[100px\]{min-width:100px}.min-w-\[30em\]{min-width:30em}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-full{width:100%}.w-screen{width:100vw}.flex{display:flex}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.cursor-pointer{cursor:pointer}.items-start{align-items:flex-start}.items-center{align-items:center}.self-start{align-self:flex-start}.self-center{align-self:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.border{border-width:1px}.border-black{--un-border-opacity:1;border-color:rgb(34 33 31 / var(--un-border-opacity))}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.bg-black\/25{background-color:#22211f40}.bg-black\/50{background-color:#22211f80}.bg-black\/90{background-color:#22211fe6}.hover\:bg-white\/10:hover{background-color:#fff5d91a}.p-1{padding:.25rem}.p-2{padding:.5rem}.px-12{padding-left:3rem;padding-right:3rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-center{text-align:center}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.underline{text-decoration-line:underline}@tailwind base;@tailwind components;@tailwind utilities;@font-face{font-family:Futura;src:url(./fonts/Futura-Heavy.ttf)}@font-face{font-family:OpenSans;src:url(./fonts/OpenSans-CondBold.ttf)}@font-face{font-family:Barlow;src:url(./fonts/BarlowCondensed-Black.ttf)}body{font-family:Barlow,"ui-sans-serif","system-ui",-apple-system,BlinkMacSystemFont,'"Segoe UI"',Roboto,'"Helvetica Neue"',Arial,'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'}h1,h2,h3,h4,h5,h6{letter-spacing:-.01em;margin:0;line-height:1.5rem;font-family:OpenSans}h1.display{letter-spacing:.25em;text-transform:uppercase;font-size:1.875rem;line-height:2.25rem;font-weight:400;font-family:Futura}h1{font-size:1.875rem;line-height:2.25rem}h2{font-size:1.5rem;line-height:2rem}h3{font-size:1.25rem;line-height:1.75rem}h4{font-size:1.125rem;line-height:1.75rem}h6{font-size:.875rem;line-height:1.25rem}button,button[type=submit],.button{margin:0;display:flex;cursor:pointer;place-content:center;place-items:center;border-width:2px;--un-border-opacity:1;border-color:rgb(243 84 34 / var(--un-border-opacity));border-radius:.25rem;border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(243 84 34 / var(--un-bg-opacity));padding:.5rem 1.5rem;text-align:center;--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity));font-family:OpenSans;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.15s;transition-duration:.1s;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:hover,button[type=submit]:hover,.button:hover{--un-bg-opacity:1;background-color:rgb(34 33 31 / var(--un-bg-opacity))}.clear{border-color:transparent;background-color:transparent;font-weight:700;font-family:Barlow}.clear:hover{background-color:#fff5d940}.alt{--un-border-opacity:1;border-color:rgb(255 245 217 / var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(255 245 217 / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(34 33 31 / var(--un-text-opacity))}.alt:hover{--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity))}.thin{border-style:none;padding-left:0;padding-right:0}.icon{width:2.75rem;display:flex;place-content:center;align-items:center;border-color:#fff5d940;border-radius:9999px;background-color:transparent;padding:.75rem;font-size:14px}.icon.alt{border-color:#22211f40}.icon.alt:hover{border-color:#fff5d940}body{--un-url:url(./background.jpg);background-image:var(--un-url);background-size:cover;background-attachment:fixed;background-position:center;background-repeat:no-repeat;--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity))}input{all:unset}select,textarea,input[type=text],input[type=password],input[type=checkbox]{border-width:1px;border-width:2px;--un-border-opacity:1;border-color:rgb(243 84 34 / var(--un-border-opacity));border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(243 84 34 / var(--un-bg-opacity));--un-bg-opacity:.25;padding:.5rem 1rem;--un-text-opacity:1;color:rgb(255 245 217 / var(--un-text-opacity))}input[type=checkbox]{width:.5rem;height:.5rem;cursor:pointer;padding:.5rem}input[type=checkbox]:checked{--un-bg-opacity:1;background-color:rgb(243 84 34 / var(--un-bg-opacity))}select{background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-position:right 1.25rem center;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding-right:4rem}button:hover{opacity:.9;--un-shadow:0 0 var(--un-shadow-color, rgb(0 0 0 / 0));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}button:disabled{cursor:not-allowed;--un-border-opacity:1;border-color:rgb(126 126 126 / var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(126 126 126 / var(--un-bg-opacity));opacity:.7}.obox,.card{border-radius:.5rem;background-color:#f3542240;padding:1rem}.c{place-content:center;place-items:center} diff --git a/kinode/packages/app_store/pkg/ui/assets/index-WdAkPE29.js b/kinode/packages/app_store/pkg/ui/assets/index-przgvy-e.js similarity index 73% rename from kinode/packages/app_store/pkg/ui/assets/index-WdAkPE29.js rename to kinode/packages/app_store/pkg/ui/assets/index-przgvy-e.js index 92ce36f6..90a30d3a 100644 --- a/kinode/packages/app_store/pkg/ui/assets/index-WdAkPE29.js +++ b/kinode/packages/app_store/pkg/ui/assets/index-przgvy-e.js @@ -1,4 +1,4 @@ -var P2=Object.defineProperty;var C2=(t,e,r)=>e in t?P2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var t0=(t,e,r)=>(C2(t,typeof e!="symbol"?e+"":e,r),r);function I2(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Si(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Qo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Zm={exports:{}},bu={},eg={exports:{}},we={};/** +var P2=Object.defineProperty;var C2=(t,e,r)=>e in t?P2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var r0=(t,e,r)=>(C2(t,typeof e!="symbol"?e+"":e,r),r);function I2(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Si(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Qo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var eg={exports:{}},bu={},tg={exports:{}},we={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var P2=Object.defineProperty;var C2=(t,e,r)=>e in t?P2(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xa=Symbol.for("react.element"),R2=Symbol.for("react.portal"),O2=Symbol.for("react.fragment"),T2=Symbol.for("react.strict_mode"),L2=Symbol.for("react.profiler"),j2=Symbol.for("react.provider"),B2=Symbol.for("react.context"),D2=Symbol.for("react.forward_ref"),F2=Symbol.for("react.suspense"),U2=Symbol.for("react.memo"),z2=Symbol.for("react.lazy"),r0=Symbol.iterator;function $2(t){return t===null||typeof t!="object"?null:(t=r0&&t[r0]||t["@@iterator"],typeof t=="function"?t:null)}var tg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rg=Object.assign,ng={};function Jo(t,e,r){this.props=t,this.context=e,this.refs=ng,this.updater=r||tg}Jo.prototype.isReactComponent={};Jo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Jo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ig(){}ig.prototype=Jo.prototype;function Fh(t,e,r){this.props=t,this.context=e,this.refs=ng,this.updater=r||tg}var Uh=Fh.prototype=new ig;Uh.constructor=Fh;rg(Uh,Jo.prototype);Uh.isPureReactComponent=!0;var n0=Array.isArray,og=Object.prototype.hasOwnProperty,zh={current:null},sg={key:!0,ref:!0,__self:!0,__source:!0};function ag(t,e,r){var n,i={},o=null,s=null;if(e!=null)for(n in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)og.call(e,n)&&!sg.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1e in t?P2(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var K2=L,Q2=Symbol.for("react.element"),J2=Symbol.for("react.fragment"),Y2=Object.prototype.hasOwnProperty,X2=K2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Z2={key:!0,ref:!0,__self:!0,__source:!0};function lg(t,e,r){var n,i={},o=null,s=null;r!==void 0&&(o=""+r),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)Y2.call(e,n)&&!Z2.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:Q2,type:t,key:o,ref:s,props:i,_owner:X2.current}}bu.Fragment=J2;bu.jsx=lg;bu.jsxs=lg;Zm.exports=bu;var M=Zm.exports,Ef={},ug={exports:{}},vr={},cg={exports:{}},fg={};/** + */var K2=L,Q2=Symbol.for("react.element"),J2=Symbol.for("react.fragment"),Y2=Object.prototype.hasOwnProperty,X2=K2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Z2={key:!0,ref:!0,__self:!0,__source:!0};function ug(t,e,r){var n,i={},o=null,s=null;r!==void 0&&(o=""+r),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)Y2.call(e,n)&&!Z2.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:Q2,type:t,key:o,ref:s,props:i,_owner:X2.current}}bu.Fragment=J2;bu.jsx=ug;bu.jsxs=ug;eg.exports=bu;var M=eg.exports,Ef={},cg={exports:{}},vr={},fg={exports:{}},hg={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var P2=Object.defineProperty;var C2=(t,e,r)=>e in t?P2(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(_,I){var R=_.length;_.push(I);e:for(;0>>1,d=_[N];if(0>>1;Ni(y,R))Bi(F,y)?(_[N]=F,_[B]=R,N=B):(_[N]=y,_[X]=R,N=X);else if(Bi(F,R))_[N]=F,_[B]=R,N=B;else break e}}return I}function i(_,I){var R=_.sortIndex-I.sortIndex;return R!==0?R:_.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,h=null,p=3,g=!1,v=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(_){for(var I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=_)n(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=r(u)}}function T(_){if(b=!1,E(_),!v)if(r(l)!==null)v=!0,A(j);else{var I=r(u);I!==null&&k(T,I.startTime-_)}}function j(_,I){v=!1,b&&(b=!1,x(H),H=-1),g=!0;var R=p;try{for(E(I),h=r(l);h!==null&&(!(h.expirationTime>I)||_&&!ie());){var N=h.callback;if(typeof N=="function"){h.callback=null,p=h.priorityLevel;var d=N(h.expirationTime<=I);I=t.unstable_now(),typeof d=="function"?h.callback=d:h===r(l)&&n(l),E(I)}else n(l);h=r(l)}if(h!==null)var P=!0;else{var X=r(u);X!==null&&k(T,X.startTime-I),P=!1}return P}finally{h=null,p=R,g=!1}}var D=!1,$=null,H=-1,J=5,Y=-1;function ie(){return!(t.unstable_now()-Y_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(_){switch(p){case 1:case 2:case 3:var I=3;break;default:I=p}var R=p;p=I;try{return _()}finally{p=R}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(_,I){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var R=p;p=_;try{return I()}finally{p=R}},t.unstable_scheduleCallback=function(_,I,R){var N=t.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0N?(_.sortIndex=R,e(u,_),r(l)===null&&_===r(u)&&(b?(x(H),H=-1):b=!0,k(T,R-N))):(_.sortIndex=d,e(l,_),v||g||(v=!0,A(j))),_},t.unstable_shouldYield=ie,t.unstable_wrapCallback=function(_){var I=p;return function(){var R=p;p=I;try{return _.apply(this,arguments)}finally{p=R}}}})(fg);cg.exports=fg;var ew=cg.exports;/** + */(function(t){function e(_,I){var R=_.length;_.push(I);e:for(;0>>1,d=_[N];if(0>>1;Ni(y,R))Bi(F,y)?(_[N]=F,_[B]=R,N=B):(_[N]=y,_[X]=R,N=X);else if(Bi(F,R))_[N]=F,_[B]=R,N=B;else break e}}return I}function i(_,I){var R=_.sortIndex-I.sortIndex;return R!==0?R:_.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,h=null,p=3,g=!1,v=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(_){for(var I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=_)n(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=r(u)}}function T(_){if(b=!1,E(_),!v)if(r(l)!==null)v=!0,A(j);else{var I=r(u);I!==null&&k(T,I.startTime-_)}}function j(_,I){v=!1,b&&(b=!1,x(H),H=-1),g=!0;var R=p;try{for(E(I),h=r(l);h!==null&&(!(h.expirationTime>I)||_&&!ie());){var N=h.callback;if(typeof N=="function"){h.callback=null,p=h.priorityLevel;var d=N(h.expirationTime<=I);I=t.unstable_now(),typeof d=="function"?h.callback=d:h===r(l)&&n(l),E(I)}else n(l);h=r(l)}if(h!==null)var P=!0;else{var X=r(u);X!==null&&k(T,X.startTime-I),P=!1}return P}finally{h=null,p=R,g=!1}}var D=!1,$=null,H=-1,J=5,Y=-1;function ie(){return!(t.unstable_now()-Y_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(_){switch(p){case 1:case 2:case 3:var I=3;break;default:I=p}var R=p;p=I;try{return _()}finally{p=R}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(_,I){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var R=p;p=_;try{return I()}finally{p=R}},t.unstable_scheduleCallback=function(_,I,R){var N=t.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0N?(_.sortIndex=R,e(u,_),r(l)===null&&_===r(u)&&(b?(x(H),H=-1):b=!0,k(T,R-N))):(_.sortIndex=d,e(l,_),v||g||(v=!0,A(j))),_},t.unstable_shouldYield=ie,t.unstable_wrapCallback=function(_){var I=p;return function(){var R=p;p=I;try{return _.apply(this,arguments)}finally{p=R}}}})(hg);fg.exports=hg;var ew=fg.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var P2=Object.defineProperty;var C2=(t,e,r)=>e in t?P2(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var hg=L,mr=ew;function q(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Af=Object.prototype.hasOwnProperty,tw=/^[: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]*$/,o0={},s0={};function rw(t){return Af.call(s0,t)?!0:Af.call(o0,t)?!1:tw.test(t)?s0[t]=!0:(o0[t]=!0,!1)}function nw(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function iw(t,e,r,n){if(e===null||typeof e>"u"||nw(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Kt(t,e,r,n,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Tt[t]=new Kt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Tt[e]=new Kt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Tt[t]=new Kt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Tt[t]=new Kt(t,2,!1,t,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(t){Tt[t]=new Kt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Tt[t]=new Kt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Tt[t]=new Kt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Tt[t]=new Kt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Tt[t]=new Kt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Hh=/[\-:]([a-z])/g;function qh(t){return t[1].toUpperCase()}"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(t){var e=t.replace(Hh,qh);Tt[e]=new Kt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Hh,qh);Tt[e]=new Kt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Hh,qh);Tt[e]=new Kt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Tt[t]=new Kt(t,1,!1,t.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new Kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Tt[t]=new Kt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Vh(t,e,r,n){var i=Tt.hasOwnProperty(e)?Tt[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Af=Object.prototype.hasOwnProperty,tw=/^[: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]*$/,s0={},a0={};function rw(t){return Af.call(a0,t)?!0:Af.call(s0,t)?!1:tw.test(t)?a0[t]=!0:(s0[t]=!0,!1)}function nw(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function iw(t,e,r,n){if(e===null||typeof e>"u"||nw(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Kt(t,e,r,n,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Tt[t]=new Kt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Tt[e]=new Kt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Tt[t]=new Kt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Tt[t]=new Kt(t,2,!1,t,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(t){Tt[t]=new Kt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Tt[t]=new Kt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Tt[t]=new Kt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Tt[t]=new Kt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Tt[t]=new Kt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Hh=/[\-:]([a-z])/g;function qh(t){return t[1].toUpperCase()}"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(t){var e=t.replace(Hh,qh);Tt[e]=new Kt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Hh,qh);Tt[e]=new Kt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Hh,qh);Tt[e]=new Kt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Tt[t]=new Kt(t,1,!1,t.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new Kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Tt[t]=new Kt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Vh(t,e,r,n){var i=Tt.hasOwnProperty(e)?Tt[e]:null;(i!==null?i.type!==0:n||!(2a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{bc=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?xs(t):""}function ow(t){switch(t.tag){case 5:return xs(t.type);case 16:return xs("Lazy");case 13:return xs("Suspense");case 19:return xs("SuspenseList");case 0:case 2:case 15:return t=Ec(t.type,!1),t;case 11:return t=Ec(t.type.render,!1),t;case 1:return t=Ec(t.type,!0),t;default:return""}}function Nf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case co:return"Fragment";case uo:return"Portal";case _f:return"Profiler";case Gh:return"StrictMode";case Sf:return"Suspense";case kf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mg:return(t.displayName||"Context")+".Consumer";case pg:return(t._context.displayName||"Context")+".Provider";case Wh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Kh:return e=t.displayName||null,e!==null?e:Nf(t.type)||"Memo";case ri:e=t._payload,t=t._init;try{return Nf(t(e))}catch{}}return null}function sw(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nf(e);case 8:return e===Gh?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function bi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vg(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function aw(t){var e=vg(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function La(t){t._valueTracker||(t._valueTracker=aw(t))}function yg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=vg(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Rl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Mf(t,e){var r=e.checked;return ht({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function l0(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=bi(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function wg(t,e){e=e.checked,e!=null&&Vh(t,"checked",e,!1)}function Pf(t,e){wg(t,e);var r=bi(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Cf(t,e.type,r):e.hasOwnProperty("defaultValue")&&Cf(t,e.type,bi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function u0(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Cf(t,e,r){(e!=="number"||Rl(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var bs=Array.isArray;function No(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=ja.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function $s(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Ms={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},lw=["Webkit","ms","Moz","O"];Object.keys(Ms).forEach(function(t){lw.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ms[e]=Ms[t]})});function Ag(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Ms.hasOwnProperty(t)&&Ms[t]?(""+e).trim():e+"px"}function _g(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Ag(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var uw=ht({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 Of(t,e){if(e){if(uw[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(q(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(q(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(q(61))}if(e.style!=null&&typeof e.style!="object")throw Error(q(62))}}function Tf(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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}}var Lf=null;function Qh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var jf=null,Mo=null,Po=null;function h0(t){if(t=Aa(t)){if(typeof jf!="function")throw Error(q(280));var e=t.stateNode;e&&(e=ku(e),jf(t.stateNode,t.type,e))}}function Sg(t){Mo?Po?Po.push(t):Po=[t]:Mo=t}function kg(){if(Mo){var t=Mo,e=Po;if(Po=Mo=null,h0(t),e)for(t=0;t>>=0,t===0?32:31-(xw(t)/bw|0)|0}var Ba=64,Da=4194304;function Es(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function jl(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,o=t.pingedLanes,s=r&268435455;if(s!==0){var a=s&~i;a!==0?n=Es(a):(o&=s,o!==0&&(n=Es(o)))}else s=r&~i,s!==0?n=Es(s):o!==0&&(n=Es(o));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function ba(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Gr(e),t[e]=r}function Sw(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Cs),b0=" ",E0=!1;function Gg(t,e){switch(t){case"keyup":return Zw.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fo=!1;function tx(t,e){switch(t){case"compositionend":return Wg(e);case"keypress":return e.which!==32?null:(E0=!0,b0);case"textInput":return t=e.data,t===b0&&E0?null:t;default:return null}}function rx(t,e){if(fo)return t==="compositionend"||!nd&&Gg(t,e)?(t=qg(),hl=ed=li=null,fo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=k0(r)}}function Yg(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Yg(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Xg(){for(var t=window,e=Rl();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Rl(t.document)}return e}function id(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function fx(t){var e=Xg(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Yg(r.ownerDocument.documentElement,r)){if(n!==null&&id(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=n.end===void 0?o:Math.min(n.end,i),!t.extend&&o>n&&(i=n,n=o,o=i),i=N0(r,o);var s=N0(r,n);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ho=null,$f=null,Rs=null,Hf=!1;function M0(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Hf||ho==null||ho!==Rl(n)||(n=ho,"selectionStart"in n&&id(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rs&&Ks(Rs,n)||(Rs=n,n=Fl($f,"onSelect"),0go||(t.current=Qf[go],Qf[go]=null,go--)}function Je(t,e){go++,Qf[go]=t.current,t.current=e}var Ei={},$t=Ni(Ei),rr=Ni(!1),$i=Ei;function Bo(t,e){var r=t.type.contextTypes;if(!r)return Ei;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=e[o];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function nr(t){return t=t.childContextTypes,t!=null}function zl(){rt(rr),rt($t)}function L0(t,e,r){if($t.current!==Ei)throw Error(q(168));Je($t,e),Je(rr,r)}function av(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(q(108,sw(t)||"Unknown",i));return ht({},r,n)}function $l(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ei,$i=$t.current,Je($t,t),Je(rr,rr.current),!0}function j0(t,e,r){var n=t.stateNode;if(!n)throw Error(q(169));r?(t=av(t,e,$i),n.__reactInternalMemoizedMergedChildContext=t,rt(rr),rt($t),Je($t,t)):rt(rr),Je(rr,r)}var Nn=null,Nu=!1,jc=!1;function lv(t){Nn===null?Nn=[t]:Nn.push(t)}function Ax(t){Nu=!0,lv(t)}function Mi(){if(!jc&&Nn!==null){jc=!0;var t=0,e=Oe;try{var r=Nn;for(Oe=1;t>=s,i-=s,In=1<<32-Gr(e)+i|r<H?(J=$,$=null):J=$.sibling;var Y=p(x,$,E[H],T);if(Y===null){$===null&&($=J);break}t&&$&&Y.alternate===null&&e(x,$),w=o(Y,w,H),D===null?j=Y:D.sibling=Y,D=Y,$=J}if(H===E.length)return r(x,$),it&&Ii(x,H),j;if($===null){for(;HH?(J=$,$=null):J=$.sibling;var ie=p(x,$,Y.value,T);if(ie===null){$===null&&($=J);break}t&&$&&ie.alternate===null&&e(x,$),w=o(ie,w,H),D===null?j=ie:D.sibling=ie,D=ie,$=J}if(Y.done)return r(x,$),it&&Ii(x,H),j;if($===null){for(;!Y.done;H++,Y=E.next())Y=h(x,Y.value,T),Y!==null&&(w=o(Y,w,H),D===null?j=Y:D.sibling=Y,D=Y);return it&&Ii(x,H),j}for($=n(x,$);!Y.done;H++,Y=E.next())Y=g($,x,H,Y.value,T),Y!==null&&(t&&Y.alternate!==null&&$.delete(Y.key===null?H:Y.key),w=o(Y,w,H),D===null?j=Y:D.sibling=Y,D=Y);return t&&$.forEach(function(ae){return e(x,ae)}),it&&Ii(x,H),j}function S(x,w,E,T){if(typeof E=="object"&&E!==null&&E.type===co&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Ta:e:{for(var j=E.key,D=w;D!==null;){if(D.key===j){if(j=E.type,j===co){if(D.tag===7){r(x,D.sibling),w=i(D,E.props.children),w.return=x,x=w;break e}}else if(D.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ri&&H0(j)===D.type){r(x,D.sibling),w=i(D,E.props),w.ref=fs(x,D,E),w.return=x,x=w;break e}r(x,D);break}else e(x,D);D=D.sibling}E.type===co?(w=Di(E.props.children,x.mode,T,E.key),w.return=x,x=w):(T=xl(E.type,E.key,E.props,null,x.mode,T),T.ref=fs(x,w,E),T.return=x,x=T)}return s(x);case uo:e:{for(D=E.key;w!==null;){if(w.key===D)if(w.tag===4&&w.stateNode.containerInfo===E.containerInfo&&w.stateNode.implementation===E.implementation){r(x,w.sibling),w=i(w,E.children||[]),w.return=x,x=w;break e}else{r(x,w);break}else e(x,w);w=w.sibling}w=qc(E,x.mode,T),w.return=x,x=w}return s(x);case ri:return D=E._init,S(x,w,D(E._payload),T)}if(bs(E))return v(x,w,E,T);if(ss(E))return b(x,w,E,T);Va(x,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,w!==null&&w.tag===6?(r(x,w.sibling),w=i(w,E),w.return=x,x=w):(r(x,w),w=Hc(E,x.mode,T),w.return=x,x=w),s(x)):r(x,w)}return S}var Fo=gv(!0),vv=gv(!1),_a={},fn=Ni(_a),Xs=Ni(_a),Zs=Ni(_a);function ji(t){if(t===_a)throw Error(q(174));return t}function dd(t,e){switch(Je(Zs,e),Je(Xs,t),Je(fn,_a),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Rf(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Rf(e,t)}rt(fn),Je(fn,e)}function Uo(){rt(fn),rt(Xs),rt(Zs)}function yv(t){ji(Zs.current);var e=ji(fn.current),r=Rf(e,t.type);e!==r&&(Je(Xs,t),Je(fn,r))}function pd(t){Xs.current===t&&(rt(fn),rt(Xs))}var ut=Ni(0);function Kl(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Bc=[];function md(){for(var t=0;tr?r:4,t(!0);var n=Dc.transition;Dc.transition={};try{t(!1),e()}finally{Oe=r,Dc.transition=n}}function Tv(){return Pr().memoizedState}function Nx(t,e,r){var n=yi(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Lv(t))jv(e,r);else if(r=hv(t,e,r,n),r!==null){var i=Gt();Wr(r,t,n,i),Bv(r,e,n)}}function Mx(t,e,r){var n=yi(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Lv(t))jv(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,r);if(i.hasEagerState=!0,i.eagerState=a,Kr(a,s)){var l=e.interleaved;l===null?(i.next=i,fd(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=hv(t,e,i,n),r!==null&&(i=Gt(),Wr(r,t,n,i),Bv(r,e,n))}}function Lv(t){var e=t.alternate;return t===ft||e!==null&&e===ft}function jv(t,e){Os=Ql=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function Bv(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Yh(t,r)}}var Jl={readContext:Mr,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},Px={readContext:Mr,useCallback:function(t,e){return tn().memoizedState=[t,e===void 0?null:e],t},useContext:Mr,useEffect:V0,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,gl(4194308,4,Pv.bind(null,e,t),r)},useLayoutEffect:function(t,e){return gl(4194308,4,t,e)},useInsertionEffect:function(t,e){return gl(4,2,t,e)},useMemo:function(t,e){var r=tn();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=tn();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Nx.bind(null,ft,t),[n.memoizedState,t]},useRef:function(t){var e=tn();return t={current:t},e.memoizedState=t},useState:q0,useDebugValue:xd,useDeferredValue:function(t){return tn().memoizedState=t},useTransition:function(){var t=q0(!1),e=t[0];return t=kx.bind(null,t[1]),tn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=ft,i=tn();if(it){if(r===void 0)throw Error(q(407));r=r()}else{if(r=e(),Nt===null)throw Error(q(349));qi&30||bv(n,e,r)}i.memoizedState=r;var o={value:r,getSnapshot:e};return i.queue=o,V0(Av.bind(null,n,o,t),[t]),n.flags|=2048,ra(9,Ev.bind(null,n,o,r,e),void 0,null),r},useId:function(){var t=tn(),e=Nt.identifierPrefix;if(it){var r=Rn,n=In;r=(n&~(1<<32-Gr(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=ea++,0")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{bc=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?xs(t):""}function ow(t){switch(t.tag){case 5:return xs(t.type);case 16:return xs("Lazy");case 13:return xs("Suspense");case 19:return xs("SuspenseList");case 0:case 2:case 15:return t=Ec(t.type,!1),t;case 11:return t=Ec(t.type.render,!1),t;case 1:return t=Ec(t.type,!0),t;default:return""}}function Nf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case co:return"Fragment";case uo:return"Portal";case _f:return"Profiler";case Gh:return"StrictMode";case Sf:return"Suspense";case kf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case gg:return(t.displayName||"Context")+".Consumer";case mg:return(t._context.displayName||"Context")+".Provider";case Wh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Kh:return e=t.displayName||null,e!==null?e:Nf(t.type)||"Memo";case ri:e=t._payload,t=t._init;try{return Nf(t(e))}catch{}}return null}function sw(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nf(e);case 8:return e===Gh?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function bi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function yg(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function aw(t){var e=yg(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function La(t){t._valueTracker||(t._valueTracker=aw(t))}function wg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=yg(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Rl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Mf(t,e){var r=e.checked;return ht({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function u0(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=bi(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function xg(t,e){e=e.checked,e!=null&&Vh(t,"checked",e,!1)}function Pf(t,e){xg(t,e);var r=bi(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Cf(t,e.type,r):e.hasOwnProperty("defaultValue")&&Cf(t,e.type,bi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function c0(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Cf(t,e,r){(e!=="number"||Rl(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var bs=Array.isArray;function No(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=ja.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function $s(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Ms={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},lw=["Webkit","ms","Moz","O"];Object.keys(Ms).forEach(function(t){lw.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ms[e]=Ms[t]})});function _g(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Ms.hasOwnProperty(t)&&Ms[t]?(""+e).trim():e+"px"}function Sg(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=_g(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var uw=ht({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 Of(t,e){if(e){if(uw[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(q(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(q(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(q(61))}if(e.style!=null&&typeof e.style!="object")throw Error(q(62))}}function Tf(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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}}var Lf=null;function Qh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var jf=null,Mo=null,Po=null;function d0(t){if(t=Aa(t)){if(typeof jf!="function")throw Error(q(280));var e=t.stateNode;e&&(e=ku(e),jf(t.stateNode,t.type,e))}}function kg(t){Mo?Po?Po.push(t):Po=[t]:Mo=t}function Ng(){if(Mo){var t=Mo,e=Po;if(Po=Mo=null,d0(t),e)for(t=0;t>>=0,t===0?32:31-(xw(t)/bw|0)|0}var Ba=64,Da=4194304;function Es(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function jl(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,o=t.pingedLanes,s=r&268435455;if(s!==0){var a=s&~i;a!==0?n=Es(a):(o&=s,o!==0&&(n=Es(o)))}else s=r&~i,s!==0?n=Es(s):o!==0&&(n=Es(o));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function ba(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Gr(e),t[e]=r}function Sw(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Cs),E0=" ",A0=!1;function Wg(t,e){switch(t){case"keyup":return Zw.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fo=!1;function tx(t,e){switch(t){case"compositionend":return Kg(e);case"keypress":return e.which!==32?null:(A0=!0,E0);case"textInput":return t=e.data,t===E0&&A0?null:t;default:return null}}function rx(t,e){if(fo)return t==="compositionend"||!nd&&Wg(t,e)?(t=Vg(),hl=ed=li=null,fo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=N0(r)}}function Xg(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Xg(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Zg(){for(var t=window,e=Rl();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Rl(t.document)}return e}function id(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function fx(t){var e=Zg(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Xg(r.ownerDocument.documentElement,r)){if(n!==null&&id(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=n.end===void 0?o:Math.min(n.end,i),!t.extend&&o>n&&(i=n,n=o,o=i),i=M0(r,o);var s=M0(r,n);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ho=null,$f=null,Rs=null,Hf=!1;function P0(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Hf||ho==null||ho!==Rl(n)||(n=ho,"selectionStart"in n&&id(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rs&&Ks(Rs,n)||(Rs=n,n=Fl($f,"onSelect"),0go||(t.current=Qf[go],Qf[go]=null,go--)}function Je(t,e){go++,Qf[go]=t.current,t.current=e}var Ei={},$t=Ni(Ei),rr=Ni(!1),$i=Ei;function Bo(t,e){var r=t.type.contextTypes;if(!r)return Ei;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=e[o];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function nr(t){return t=t.childContextTypes,t!=null}function zl(){rt(rr),rt($t)}function j0(t,e,r){if($t.current!==Ei)throw Error(q(168));Je($t,e),Je(rr,r)}function lv(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(q(108,sw(t)||"Unknown",i));return ht({},r,n)}function $l(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ei,$i=$t.current,Je($t,t),Je(rr,rr.current),!0}function B0(t,e,r){var n=t.stateNode;if(!n)throw Error(q(169));r?(t=lv(t,e,$i),n.__reactInternalMemoizedMergedChildContext=t,rt(rr),rt($t),Je($t,t)):rt(rr),Je(rr,r)}var Nn=null,Nu=!1,jc=!1;function uv(t){Nn===null?Nn=[t]:Nn.push(t)}function Ax(t){Nu=!0,uv(t)}function Mi(){if(!jc&&Nn!==null){jc=!0;var t=0,e=Oe;try{var r=Nn;for(Oe=1;t>=s,i-=s,In=1<<32-Gr(e)+i|r<H?(J=$,$=null):J=$.sibling;var Y=p(x,$,E[H],T);if(Y===null){$===null&&($=J);break}t&&$&&Y.alternate===null&&e(x,$),w=o(Y,w,H),D===null?j=Y:D.sibling=Y,D=Y,$=J}if(H===E.length)return r(x,$),it&&Ii(x,H),j;if($===null){for(;HH?(J=$,$=null):J=$.sibling;var ie=p(x,$,Y.value,T);if(ie===null){$===null&&($=J);break}t&&$&&ie.alternate===null&&e(x,$),w=o(ie,w,H),D===null?j=ie:D.sibling=ie,D=ie,$=J}if(Y.done)return r(x,$),it&&Ii(x,H),j;if($===null){for(;!Y.done;H++,Y=E.next())Y=h(x,Y.value,T),Y!==null&&(w=o(Y,w,H),D===null?j=Y:D.sibling=Y,D=Y);return it&&Ii(x,H),j}for($=n(x,$);!Y.done;H++,Y=E.next())Y=g($,x,H,Y.value,T),Y!==null&&(t&&Y.alternate!==null&&$.delete(Y.key===null?H:Y.key),w=o(Y,w,H),D===null?j=Y:D.sibling=Y,D=Y);return t&&$.forEach(function(ae){return e(x,ae)}),it&&Ii(x,H),j}function S(x,w,E,T){if(typeof E=="object"&&E!==null&&E.type===co&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Ta:e:{for(var j=E.key,D=w;D!==null;){if(D.key===j){if(j=E.type,j===co){if(D.tag===7){r(x,D.sibling),w=i(D,E.props.children),w.return=x,x=w;break e}}else if(D.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ri&&q0(j)===D.type){r(x,D.sibling),w=i(D,E.props),w.ref=fs(x,D,E),w.return=x,x=w;break e}r(x,D);break}else e(x,D);D=D.sibling}E.type===co?(w=Di(E.props.children,x.mode,T,E.key),w.return=x,x=w):(T=xl(E.type,E.key,E.props,null,x.mode,T),T.ref=fs(x,w,E),T.return=x,x=T)}return s(x);case uo:e:{for(D=E.key;w!==null;){if(w.key===D)if(w.tag===4&&w.stateNode.containerInfo===E.containerInfo&&w.stateNode.implementation===E.implementation){r(x,w.sibling),w=i(w,E.children||[]),w.return=x,x=w;break e}else{r(x,w);break}else e(x,w);w=w.sibling}w=qc(E,x.mode,T),w.return=x,x=w}return s(x);case ri:return D=E._init,S(x,w,D(E._payload),T)}if(bs(E))return v(x,w,E,T);if(ss(E))return b(x,w,E,T);Va(x,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,w!==null&&w.tag===6?(r(x,w.sibling),w=i(w,E),w.return=x,x=w):(r(x,w),w=Hc(E,x.mode,T),w.return=x,x=w),s(x)):r(x,w)}return S}var Fo=vv(!0),yv=vv(!1),_a={},cn=Ni(_a),Xs=Ni(_a),Zs=Ni(_a);function ji(t){if(t===_a)throw Error(q(174));return t}function dd(t,e){switch(Je(Zs,e),Je(Xs,t),Je(cn,_a),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Rf(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Rf(e,t)}rt(cn),Je(cn,e)}function Uo(){rt(cn),rt(Xs),rt(Zs)}function wv(t){ji(Zs.current);var e=ji(cn.current),r=Rf(e,t.type);e!==r&&(Je(Xs,t),Je(cn,r))}function pd(t){Xs.current===t&&(rt(cn),rt(Xs))}var ut=Ni(0);function Kl(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Bc=[];function md(){for(var t=0;tr?r:4,t(!0);var n=Dc.transition;Dc.transition={};try{t(!1),e()}finally{Oe=r,Dc.transition=n}}function Lv(){return Pr().memoizedState}function Nx(t,e,r){var n=yi(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},jv(t))Bv(e,r);else if(r=dv(t,e,r,n),r!==null){var i=Gt();Wr(r,t,n,i),Dv(r,e,n)}}function Mx(t,e,r){var n=yi(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(jv(t))Bv(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,r);if(i.hasEagerState=!0,i.eagerState=a,Kr(a,s)){var l=e.interleaved;l===null?(i.next=i,fd(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=dv(t,e,i,n),r!==null&&(i=Gt(),Wr(r,t,n,i),Dv(r,e,n))}}function jv(t){var e=t.alternate;return t===ft||e!==null&&e===ft}function Bv(t,e){Os=Ql=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function Dv(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Yh(t,r)}}var Jl={readContext:Mr,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},Px={readContext:Mr,useCallback:function(t,e){return en().memoizedState=[t,e===void 0?null:e],t},useContext:Mr,useEffect:G0,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,gl(4194308,4,Cv.bind(null,e,t),r)},useLayoutEffect:function(t,e){return gl(4194308,4,t,e)},useInsertionEffect:function(t,e){return gl(4,2,t,e)},useMemo:function(t,e){var r=en();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=en();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Nx.bind(null,ft,t),[n.memoizedState,t]},useRef:function(t){var e=en();return t={current:t},e.memoizedState=t},useState:V0,useDebugValue:xd,useDeferredValue:function(t){return en().memoizedState=t},useTransition:function(){var t=V0(!1),e=t[0];return t=kx.bind(null,t[1]),en().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=ft,i=en();if(it){if(r===void 0)throw Error(q(407));r=r()}else{if(r=e(),Nt===null)throw Error(q(349));qi&30||Ev(n,e,r)}i.memoizedState=r;var o={value:r,getSnapshot:e};return i.queue=o,G0(_v.bind(null,n,o,t),[t]),n.flags|=2048,ra(9,Av.bind(null,n,o,r,e),void 0,null),r},useId:function(){var t=en(),e=Nt.identifierPrefix;if(it){var r=Rn,n=In;r=(n&~(1<<32-Gr(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=ea++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[sn]=e,t[Ys]=n,Gv(t,e,!1,!1),e.stateNode=t;e:{switch(s=Tf(r,n),r){case"dialog":tt("cancel",t),tt("close",t),i=n;break;case"iframe":case"object":case"embed":tt("load",t),i=n;break;case"video":case"audio":for(i=0;i$o&&(e.flags|=128,n=!0,hs(o,!1),e.lanes=4194304)}else{if(!n)if(t=Kl(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),hs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!it)return Bt(e),null}else 2*yt()-o.renderingStartTime>$o&&r!==1073741824&&(e.flags|=128,n=!0,hs(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(r=o.last,r!==null?r.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=yt(),e.sibling=null,r=ut.current,Je(ut,n?r&1|2:r&1),e):(Bt(e),null);case 22:case 23:return kd(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ur&1073741824&&(Bt(e),e.subtreeFlags&6&&(e.flags|=8192)):Bt(e),null;case 24:return null;case 25:return null}throw Error(q(156,e.tag))}function Bx(t,e){switch(sd(e),e.tag){case 1:return nr(e.type)&&zl(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Uo(),rt(rr),rt($t),md(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return pd(e),null;case 13:if(rt(ut),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(q(340));Do()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return rt(ut),null;case 4:return Uo(),null;case 10:return cd(e.type._context),null;case 22:case 23:return kd(),null;case 24:return null;default:return null}}var Wa=!1,Dt=!1,Dx=typeof WeakSet=="function"?WeakSet:Set,Z=null;function xo(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){pt(t,e,n)}else r.current=null}function ah(t,e,r){try{r()}catch(n){pt(t,e,n)}}var ep=!1;function Fx(t,e){if(qf=Bl,t=Xg(),id(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,u=0,c=0,h=t,p=null;t:for(;;){for(var g;h!==r||i!==0&&h.nodeType!==3||(a=s+i),h!==o||n!==0&&h.nodeType!==3||(l=s+n),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===t)break t;if(p===r&&++u===i&&(a=s),p===o&&++c===n&&(l=s),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Vf={focusedElem:t,selectionRange:r},Bl=!1,Z=e;Z!==null;)if(e=Z,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Z=t;else for(;Z!==null;){e=Z;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,S=v.memoizedState,x=e.stateNode,w=x.getSnapshotBeforeUpdate(e.elementType===e.type?b:Fr(e.type,b),S);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(T){pt(e,e.return,T)}if(t=e.sibling,t!==null){t.return=e.return,Z=t;break}Z=e.return}return v=ep,ep=!1,v}function Ts(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&ah(e,r,o)}i=i.next}while(i!==n)}}function Cu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function lh(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function Qv(t){var e=t.alternate;e!==null&&(t.alternate=null,Qv(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[sn],delete e[Ys],delete e[Kf],delete e[bx],delete e[Ex])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Jv(t){return t.tag===5||t.tag===3||t.tag===4}function tp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Jv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function uh(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Ul));else if(n!==4&&(t=t.child,t!==null))for(uh(t,e,r),t=t.sibling;t!==null;)uh(t,e,r),t=t.sibling}function ch(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(ch(t,e,r),t=t.sibling;t!==null;)ch(t,e,r),t=t.sibling}var Ct=null,$r=!1;function Zn(t,e,r){for(r=r.child;r!==null;)Yv(t,e,r),r=r.sibling}function Yv(t,e,r){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount(Eu,r)}catch{}switch(r.tag){case 5:Dt||xo(r,e);case 6:var n=Ct,i=$r;Ct=null,Zn(t,e,r),Ct=n,$r=i,Ct!==null&&($r?(t=Ct,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ct.removeChild(r.stateNode));break;case 18:Ct!==null&&($r?(t=Ct,r=r.stateNode,t.nodeType===8?Lc(t.parentNode,r):t.nodeType===1&&Lc(t,r),Gs(t)):Lc(Ct,r.stateNode));break;case 4:n=Ct,i=$r,Ct=r.stateNode.containerInfo,$r=!0,Zn(t,e,r),Ct=n,$r=i;break;case 0:case 11:case 14:case 15:if(!Dt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&ah(r,e,s),i=i.next}while(i!==n)}Zn(t,e,r);break;case 1:if(!Dt&&(xo(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){pt(r,e,a)}Zn(t,e,r);break;case 21:Zn(t,e,r);break;case 22:r.mode&1?(Dt=(n=Dt)||r.memoizedState!==null,Zn(t,e,r),Dt=n):Zn(t,e,r);break;default:Zn(t,e,r)}}function rp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Dx),e.forEach(function(n){var i=Kx.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Tr(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=s),n&=~o}if(n=i,n=yt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*zx(n/1960))-n,10t?16:t,ui===null)var n=!1;else{if(t=ui,ui=null,Zl=0,Ae&6)throw Error(q(331));var i=Ae;for(Ae|=4,Z=t.current;Z!==null;){var o=Z,s=o.child;if(Z.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lyt()-_d?Bi(t,0):Ad|=r),ir(t,e)}function o1(t,e){e===0&&(t.mode&1?(e=Da,Da<<=1,!(Da&130023424)&&(Da=4194304)):e=1);var r=Gt();t=Dn(t,e),t!==null&&(ba(t,e,r),ir(t,r))}function Wx(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),o1(t,r)}function Kx(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(q(314))}n!==null&&n.delete(e),o1(t,r)}var s1;s1=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||rr.current)tr=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return tr=!1,Lx(t,e,r);tr=!!(t.flags&131072)}else tr=!1,it&&e.flags&1048576&&uv(e,ql,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;vl(t,e),t=e.pendingProps;var i=Bo(e,$t.current);Io(e,r),i=vd(null,e,n,t,i,r);var o=yd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,nr(n)?(o=!0,$l(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,hd(e),i.updater=Mu,e.stateNode=i,i._reactInternals=e,eh(e,n,t,r),e=nh(null,e,n,!0,o,r)):(e.tag=0,it&&o&&od(e),Vt(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(vl(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Jx(n),t=Fr(n,t),i){case 0:e=rh(null,e,n,t,r);break e;case 1:e=Y0(null,e,n,t,r);break e;case 11:e=Q0(null,e,n,t,r);break e;case 14:e=J0(null,e,n,Fr(n.type,t),r);break e}throw Error(q(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),rh(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),Y0(t,e,n,i,r);case 3:e:{if(Hv(e),t===null)throw Error(q(387));n=e.pendingProps,o=e.memoizedState,i=o.element,dv(t,e),Wl(e,n,null,r);var s=e.memoizedState;if(n=s.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=zo(Error(q(423)),e),e=X0(t,e,n,r,i);break e}else if(n!==i){i=zo(Error(q(424)),e),e=X0(t,e,n,r,i);break e}else for(hr=mi(e.stateNode.containerInfo.firstChild),pr=e,it=!0,Hr=null,r=vv(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Do(),n===i){e=Fn(t,e,r);break e}Vt(t,e,n,r)}e=e.child}return e;case 5:return yv(e),t===null&&Yf(e),n=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,Gf(n,i)?s=null:o!==null&&Gf(n,o)&&(e.flags|=32),$v(t,e),Vt(t,e,s,r),e.child;case 6:return t===null&&Yf(e),null;case 13:return qv(t,e,r);case 4:return dd(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Fo(e,null,n,r):Vt(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),Q0(t,e,n,i,r);case 7:return Vt(t,e,e.pendingProps,r),e.child;case 8:return Vt(t,e,e.pendingProps.children,r),e.child;case 12:return Vt(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Je(Vl,n._currentValue),n._currentValue=s,o!==null)if(Kr(o.value,s)){if(o.children===i.children&&!rr.current){e=Fn(t,e,r);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=Tn(-1,r&-r),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Xf(o.return,r,e),a.lanes|=r;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(q(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),Xf(s,r,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Vt(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Io(e,r),i=Mr(i),n=n(i),e.flags|=1,Vt(t,e,n,r),e.child;case 14:return n=e.type,i=Fr(n,e.pendingProps),i=Fr(n.type,i),J0(t,e,n,i,r);case 15:return Uv(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),vl(t,e),e.tag=1,nr(n)?(t=!0,$l(e)):t=!1,Io(e,r),mv(e,n,i),eh(e,n,i,r),nh(null,e,n,!0,t,r);case 19:return Vv(t,e,r);case 22:return zv(t,e,r)}throw Error(q(156,e.tag))};function a1(t,e){return Og(t,e)}function Qx(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kr(t,e,r,n){return new Qx(t,e,r,n)}function Md(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Jx(t){if(typeof t=="function")return Md(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Wh)return 11;if(t===Kh)return 14}return 2}function wi(t,e){var r=t.alternate;return r===null?(r=kr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function xl(t,e,r,n,i,o){var s=2;if(n=t,typeof t=="function")Md(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case co:return Di(r.children,i,o,e);case Gh:s=8,i|=8;break;case _f:return t=kr(12,r,e,i|2),t.elementType=_f,t.lanes=o,t;case Sf:return t=kr(13,r,e,i),t.elementType=Sf,t.lanes=o,t;case kf:return t=kr(19,r,e,i),t.elementType=kf,t.lanes=o,t;case gg:return Ru(r,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case pg:s=10;break e;case mg:s=9;break e;case Wh:s=11;break e;case Kh:s=14;break e;case ri:s=16,n=null;break e}throw Error(q(130,t==null?t:typeof t,""))}return e=kr(s,r,e,i),e.elementType=t,e.type=n,e.lanes=o,e}function Di(t,e,r,n){return t=kr(7,t,n,e),t.lanes=r,t}function Ru(t,e,r,n){return t=kr(22,t,n,e),t.elementType=gg,t.lanes=r,t.stateNode={isHidden:!1},t}function Hc(t,e,r){return t=kr(6,t,null,e),t.lanes=r,t}function qc(t,e,r){return e=kr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Yx(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_c(0),this.expirationTimes=_c(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_c(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Pd(t,e,r,n,i,o,s,a,l){return t=new Yx(t,e,r,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=kr(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},hd(o),t}function Xx(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f1)}catch(t){console.error(t)}}f1(),ug.exports=vr;var ia=ug.exports,cp=ia;Ef.createRoot=cp.createRoot,Ef.hydrateRoot=cp.hydrateRoot;/** +`+o.stack}return{value:t,source:e,stack:i,digest:null}}function zc(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function th(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Rx=typeof WeakMap=="function"?WeakMap:Map;function Fv(t,e,r){r=Tn(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Xl||(Xl=!0,fh=n),th(t,e)},r}function Uv(t,e,r){r=Tn(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){th(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){th(t,e),typeof n!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),r}function W0(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Rx;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=Gx.bind(null,t,e,r),e.then(t,t))}function K0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Q0(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Tn(-1,1),e.tag=2,gi(r,e,1))),r.lanes|=1),t)}var Ox=Hn.ReactCurrentOwner,tr=!1;function Vt(t,e,r,n){e.child=t===null?yv(e,null,r,n):Fo(e,t.child,r,n)}function J0(t,e,r,n,i){r=r.render;var o=e.ref;return Io(e,i),n=vd(t,e,r,n,o,i),r=yd(),t!==null&&!tr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Fn(t,e,i)):(it&&r&&od(e),e.flags|=1,Vt(t,e,n,i),e.child)}function Y0(t,e,r,n,i){if(t===null){var o=r.type;return typeof o=="function"&&!Md(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=o,zv(t,e,o,n,i)):(t=xl(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var s=o.memoizedProps;if(r=r.compare,r=r!==null?r:Ks,r(s,n)&&t.ref===e.ref)return Fn(t,e,i)}return e.flags|=1,t=wi(o,n),t.ref=e.ref,t.return=e,e.child=t}function zv(t,e,r,n,i){if(t!==null){var o=t.memoizedProps;if(Ks(o,n)&&t.ref===e.ref)if(tr=!1,e.pendingProps=n=o,(t.lanes&i)!==0)t.flags&131072&&(tr=!0);else return e.lanes=t.lanes,Fn(t,e,i)}return rh(t,e,r,n,i)}function $v(t,e,r){var n=e.pendingProps,i=n.children,o=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(bo,ur),ur|=r;else{if(!(r&1073741824))return t=o!==null?o.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Je(bo,ur),ur|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,Je(bo,ur),ur|=n}else o!==null?(n=o.baseLanes|r,e.memoizedState=null):n=r,Je(bo,ur),ur|=n;return Vt(t,e,i,r),e.child}function Hv(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function rh(t,e,r,n,i){var o=nr(r)?$i:$t.current;return o=Bo(e,o),Io(e,i),r=vd(t,e,r,n,o,i),n=yd(),t!==null&&!tr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Fn(t,e,i)):(it&&n&&od(e),e.flags|=1,Vt(t,e,r,i),e.child)}function X0(t,e,r,n,i){if(nr(r)){var o=!0;$l(e)}else o=!1;if(Io(e,i),e.stateNode===null)vl(t,e),gv(e,r,n),eh(e,r,n,i),n=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=Mr(u):(u=nr(r)?$i:$t.current,u=Bo(e,u));var c=r.getDerivedStateFromProps,h=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==n||l!==u)&&H0(e,s,n,u),ni=!1;var p=e.memoizedState;s.state=p,Wl(e,n,s,i),l=e.memoizedState,a!==n||p!==l||rr.current||ni?(typeof c=="function"&&(Zf(e,r,c,n),l=e.memoizedState),(a=ni||$0(e,r,a,n,p,l,u))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),s.props=n,s.state=l,s.context=u,n=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,pv(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Fr(e.type,a),s.props=u,h=e.pendingProps,p=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=Mr(l):(l=nr(r)?$i:$t.current,l=Bo(e,l));var g=r.getDerivedStateFromProps;(c=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==h||p!==l)&&H0(e,s,n,l),ni=!1,p=e.memoizedState,s.state=p,Wl(e,n,s,i);var v=e.memoizedState;a!==h||p!==v||rr.current||ni?(typeof g=="function"&&(Zf(e,r,g,n),v=e.memoizedState),(u=ni||$0(e,r,u,n,p,v,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,v,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=v),s.props=n,s.state=v,s.context=l,n=u):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),n=!1)}return nh(t,e,r,n,o,i)}function nh(t,e,r,n,i,o){Hv(t,e);var s=(e.flags&128)!==0;if(!n&&!s)return i&&B0(e,r,!1),Fn(t,e,o);n=e.stateNode,Ox.current=e;var a=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&s?(e.child=Fo(e,t.child,null,o),e.child=Fo(e,null,a,o)):Vt(t,e,a,o),e.memoizedState=n.state,i&&B0(e,r,!0),e.child}function qv(t){var e=t.stateNode;e.pendingContext?j0(t,e.pendingContext,e.pendingContext!==e.context):e.context&&j0(t,e.context,!1),dd(t,e.containerInfo)}function Z0(t,e,r,n,i){return Do(),ad(i),e.flags|=256,Vt(t,e,r,n),e.child}var ih={dehydrated:null,treeContext:null,retryLane:0};function oh(t){return{baseLanes:t,cachePool:null,transitions:null}}function Vv(t,e,r){var n=e.pendingProps,i=ut.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Je(ut,i&1),t===null)return Yf(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=n.children,t=n.fallback,o?(n=e.mode,o=e.child,s={mode:"hidden",children:s},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Ru(s,n,0,null),t=Di(t,n,r,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=oh(r),e.memoizedState=ih,t):bd(e,s));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Tx(t,e,s,n,a,i,r);if(o){o=n.fallback,s=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:n.children};return!(s&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=wi(i,l),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=wi(a,o):(o=Di(o,s,r,null),o.flags|=2),o.return=e,n.return=e,n.sibling=o,e.child=n,n=o,o=e.child,s=t.child.memoizedState,s=s===null?oh(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~r,e.memoizedState=ih,n}return o=t.child,t=o.sibling,n=wi(o,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function bd(t,e){return e=Ru({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ga(t,e,r,n){return n!==null&&ad(n),Fo(e,t.child,null,r),t=bd(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Tx(t,e,r,n,i,o,s){if(r)return e.flags&256?(e.flags&=-257,n=zc(Error(q(422))),Ga(t,e,s,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=n.fallback,i=e.mode,n=Ru({mode:"visible",children:n.children},i,0,null),o=Di(o,i,s,null),o.flags|=2,n.return=e,o.return=e,n.sibling=o,e.child=n,e.mode&1&&Fo(e,t.child,null,s),e.child.memoizedState=oh(s),e.memoizedState=ih,o);if(!(e.mode&1))return Ga(t,e,s,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(q(419)),n=zc(o,n,void 0),Ga(t,e,s,n)}if(a=(s&t.childLanes)!==0,tr||a){if(n=Nt,n!==null){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Dn(t,i),Wr(n,t,i,-1))}return Nd(),n=zc(Error(q(421))),Ga(t,e,s,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Wx.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,hr=mi(i.nextSibling),pr=e,it=!0,Hr=null,t!==null&&(_r[Sr++]=In,_r[Sr++]=Rn,_r[Sr++]=Hi,In=t.id,Rn=t.overflow,Hi=e),e=bd(e,n.children),e.flags|=4096,e)}function ep(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Xf(t.return,e,r)}function $c(t,e,r,n,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i)}function Gv(t,e,r){var n=e.pendingProps,i=n.revealOrder,o=n.tail;if(Vt(t,e,n.children,r),n=ut.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ep(t,r,e);else if(t.tag===19)ep(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(Je(ut,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&Kl(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),$c(e,!1,i,r,o);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Kl(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}$c(e,!0,r,null,o);break;case"together":$c(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function vl(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Fn(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Vi|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(q(153));if(e.child!==null){for(t=e.child,r=wi(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=wi(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Lx(t,e,r){switch(e.tag){case 3:qv(e),Do();break;case 5:wv(e);break;case 1:nr(e.type)&&$l(e);break;case 4:dd(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;Je(Vl,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Je(ut,ut.current&1),e.flags|=128,null):r&e.child.childLanes?Vv(t,e,r):(Je(ut,ut.current&1),t=Fn(t,e,r),t!==null?t.sibling:null);Je(ut,ut.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return Gv(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Je(ut,ut.current),n)break;return null;case 22:case 23:return e.lanes=0,$v(t,e,r)}return Fn(t,e,r)}var Wv,sh,Kv,Qv;Wv=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};sh=function(){};Kv=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,ji(cn.current);var o=null;switch(r){case"input":i=Mf(t,i),n=Mf(t,n),o=[];break;case"select":i=ht({},i,{value:void 0}),n=ht({},n,{value:void 0}),o=[];break;case"textarea":i=If(t,i),n=If(t,n),o=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Ul)}Of(r,n);var s;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(zs.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in n){var l=n[u];if(a=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(o||(o=[]),o.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(zs.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&tt("scroll",t),o||a===l||(o=[])):(o=o||[]).push(u,l))}r&&(o=o||[]).push("style",r);var u=o;(e.updateQueue=u)&&(e.flags|=4)}};Qv=function(t,e,r,n){r!==n&&(e.flags|=4)};function hs(t,e){if(!it)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Bt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function jx(t,e,r){var n=e.pendingProps;switch(sd(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(e),null;case 1:return nr(e.type)&&zl(),Bt(e),null;case 3:return n=e.stateNode,Uo(),rt(rr),rt($t),md(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(qa(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Hr!==null&&(ph(Hr),Hr=null))),sh(t,e),Bt(e),null;case 5:pd(e);var i=ji(Zs.current);if(r=e.type,t!==null&&e.stateNode!=null)Kv(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(q(166));return Bt(e),null}if(t=ji(cn.current),qa(e)){n=e.stateNode,r=e.type;var o=e.memoizedProps;switch(n[on]=e,n[Ys]=o,t=(e.mode&1)!==0,r){case"dialog":tt("cancel",n),tt("close",n);break;case"iframe":case"object":case"embed":tt("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[on]=e,t[Ys]=n,Wv(t,e,!1,!1),e.stateNode=t;e:{switch(s=Tf(r,n),r){case"dialog":tt("cancel",t),tt("close",t),i=n;break;case"iframe":case"object":case"embed":tt("load",t),i=n;break;case"video":case"audio":for(i=0;i$o&&(e.flags|=128,n=!0,hs(o,!1),e.lanes=4194304)}else{if(!n)if(t=Kl(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),hs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!it)return Bt(e),null}else 2*yt()-o.renderingStartTime>$o&&r!==1073741824&&(e.flags|=128,n=!0,hs(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(r=o.last,r!==null?r.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=yt(),e.sibling=null,r=ut.current,Je(ut,n?r&1|2:r&1),e):(Bt(e),null);case 22:case 23:return kd(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ur&1073741824&&(Bt(e),e.subtreeFlags&6&&(e.flags|=8192)):Bt(e),null;case 24:return null;case 25:return null}throw Error(q(156,e.tag))}function Bx(t,e){switch(sd(e),e.tag){case 1:return nr(e.type)&&zl(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Uo(),rt(rr),rt($t),md(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return pd(e),null;case 13:if(rt(ut),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(q(340));Do()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return rt(ut),null;case 4:return Uo(),null;case 10:return cd(e.type._context),null;case 22:case 23:return kd(),null;case 24:return null;default:return null}}var Wa=!1,Dt=!1,Dx=typeof WeakSet=="function"?WeakSet:Set,Z=null;function xo(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){pt(t,e,n)}else r.current=null}function ah(t,e,r){try{r()}catch(n){pt(t,e,n)}}var tp=!1;function Fx(t,e){if(qf=Bl,t=Zg(),id(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,u=0,c=0,h=t,p=null;t:for(;;){for(var g;h!==r||i!==0&&h.nodeType!==3||(a=s+i),h!==o||n!==0&&h.nodeType!==3||(l=s+n),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===t)break t;if(p===r&&++u===i&&(a=s),p===o&&++c===n&&(l=s),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Vf={focusedElem:t,selectionRange:r},Bl=!1,Z=e;Z!==null;)if(e=Z,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Z=t;else for(;Z!==null;){e=Z;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,S=v.memoizedState,x=e.stateNode,w=x.getSnapshotBeforeUpdate(e.elementType===e.type?b:Fr(e.type,b),S);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(T){pt(e,e.return,T)}if(t=e.sibling,t!==null){t.return=e.return,Z=t;break}Z=e.return}return v=tp,tp=!1,v}function Ts(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&ah(e,r,o)}i=i.next}while(i!==n)}}function Cu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function lh(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function Jv(t){var e=t.alternate;e!==null&&(t.alternate=null,Jv(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[on],delete e[Ys],delete e[Kf],delete e[bx],delete e[Ex])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Yv(t){return t.tag===5||t.tag===3||t.tag===4}function rp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Yv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function uh(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Ul));else if(n!==4&&(t=t.child,t!==null))for(uh(t,e,r),t=t.sibling;t!==null;)uh(t,e,r),t=t.sibling}function ch(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(ch(t,e,r),t=t.sibling;t!==null;)ch(t,e,r),t=t.sibling}var Ct=null,$r=!1;function Zn(t,e,r){for(r=r.child;r!==null;)Xv(t,e,r),r=r.sibling}function Xv(t,e,r){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Eu,r)}catch{}switch(r.tag){case 5:Dt||xo(r,e);case 6:var n=Ct,i=$r;Ct=null,Zn(t,e,r),Ct=n,$r=i,Ct!==null&&($r?(t=Ct,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ct.removeChild(r.stateNode));break;case 18:Ct!==null&&($r?(t=Ct,r=r.stateNode,t.nodeType===8?Lc(t.parentNode,r):t.nodeType===1&&Lc(t,r),Gs(t)):Lc(Ct,r.stateNode));break;case 4:n=Ct,i=$r,Ct=r.stateNode.containerInfo,$r=!0,Zn(t,e,r),Ct=n,$r=i;break;case 0:case 11:case 14:case 15:if(!Dt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&ah(r,e,s),i=i.next}while(i!==n)}Zn(t,e,r);break;case 1:if(!Dt&&(xo(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){pt(r,e,a)}Zn(t,e,r);break;case 21:Zn(t,e,r);break;case 22:r.mode&1?(Dt=(n=Dt)||r.memoizedState!==null,Zn(t,e,r),Dt=n):Zn(t,e,r);break;default:Zn(t,e,r)}}function np(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Dx),e.forEach(function(n){var i=Kx.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Tr(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=s),n&=~o}if(n=i,n=yt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*zx(n/1960))-n,10t?16:t,ui===null)var n=!1;else{if(t=ui,ui=null,Zl=0,Ae&6)throw Error(q(331));var i=Ae;for(Ae|=4,Z=t.current;Z!==null;){var o=Z,s=o.child;if(Z.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lyt()-_d?Bi(t,0):Ad|=r),ir(t,e)}function s1(t,e){e===0&&(t.mode&1?(e=Da,Da<<=1,!(Da&130023424)&&(Da=4194304)):e=1);var r=Gt();t=Dn(t,e),t!==null&&(ba(t,e,r),ir(t,r))}function Wx(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),s1(t,r)}function Kx(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(q(314))}n!==null&&n.delete(e),s1(t,r)}var a1;a1=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||rr.current)tr=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return tr=!1,Lx(t,e,r);tr=!!(t.flags&131072)}else tr=!1,it&&e.flags&1048576&&cv(e,ql,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;vl(t,e),t=e.pendingProps;var i=Bo(e,$t.current);Io(e,r),i=vd(null,e,n,t,i,r);var o=yd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,nr(n)?(o=!0,$l(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,hd(e),i.updater=Mu,e.stateNode=i,i._reactInternals=e,eh(e,n,t,r),e=nh(null,e,n,!0,o,r)):(e.tag=0,it&&o&&od(e),Vt(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(vl(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Jx(n),t=Fr(n,t),i){case 0:e=rh(null,e,n,t,r);break e;case 1:e=X0(null,e,n,t,r);break e;case 11:e=J0(null,e,n,t,r);break e;case 14:e=Y0(null,e,n,Fr(n.type,t),r);break e}throw Error(q(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),rh(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),X0(t,e,n,i,r);case 3:e:{if(qv(e),t===null)throw Error(q(387));n=e.pendingProps,o=e.memoizedState,i=o.element,pv(t,e),Wl(e,n,null,r);var s=e.memoizedState;if(n=s.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=zo(Error(q(423)),e),e=Z0(t,e,n,r,i);break e}else if(n!==i){i=zo(Error(q(424)),e),e=Z0(t,e,n,r,i);break e}else for(hr=mi(e.stateNode.containerInfo.firstChild),pr=e,it=!0,Hr=null,r=yv(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Do(),n===i){e=Fn(t,e,r);break e}Vt(t,e,n,r)}e=e.child}return e;case 5:return wv(e),t===null&&Yf(e),n=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,Gf(n,i)?s=null:o!==null&&Gf(n,o)&&(e.flags|=32),Hv(t,e),Vt(t,e,s,r),e.child;case 6:return t===null&&Yf(e),null;case 13:return Vv(t,e,r);case 4:return dd(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Fo(e,null,n,r):Vt(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),J0(t,e,n,i,r);case 7:return Vt(t,e,e.pendingProps,r),e.child;case 8:return Vt(t,e,e.pendingProps.children,r),e.child;case 12:return Vt(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Je(Vl,n._currentValue),n._currentValue=s,o!==null)if(Kr(o.value,s)){if(o.children===i.children&&!rr.current){e=Fn(t,e,r);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=Tn(-1,r&-r),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Xf(o.return,r,e),a.lanes|=r;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(q(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),Xf(s,r,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Vt(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Io(e,r),i=Mr(i),n=n(i),e.flags|=1,Vt(t,e,n,r),e.child;case 14:return n=e.type,i=Fr(n,e.pendingProps),i=Fr(n.type,i),Y0(t,e,n,i,r);case 15:return zv(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Fr(n,i),vl(t,e),e.tag=1,nr(n)?(t=!0,$l(e)):t=!1,Io(e,r),gv(e,n,i),eh(e,n,i,r),nh(null,e,n,!0,t,r);case 19:return Gv(t,e,r);case 22:return $v(t,e,r)}throw Error(q(156,e.tag))};function l1(t,e){return Tg(t,e)}function Qx(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kr(t,e,r,n){return new Qx(t,e,r,n)}function Md(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Jx(t){if(typeof t=="function")return Md(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Wh)return 11;if(t===Kh)return 14}return 2}function wi(t,e){var r=t.alternate;return r===null?(r=kr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function xl(t,e,r,n,i,o){var s=2;if(n=t,typeof t=="function")Md(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case co:return Di(r.children,i,o,e);case Gh:s=8,i|=8;break;case _f:return t=kr(12,r,e,i|2),t.elementType=_f,t.lanes=o,t;case Sf:return t=kr(13,r,e,i),t.elementType=Sf,t.lanes=o,t;case kf:return t=kr(19,r,e,i),t.elementType=kf,t.lanes=o,t;case vg:return Ru(r,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case mg:s=10;break e;case gg:s=9;break e;case Wh:s=11;break e;case Kh:s=14;break e;case ri:s=16,n=null;break e}throw Error(q(130,t==null?t:typeof t,""))}return e=kr(s,r,e,i),e.elementType=t,e.type=n,e.lanes=o,e}function Di(t,e,r,n){return t=kr(7,t,n,e),t.lanes=r,t}function Ru(t,e,r,n){return t=kr(22,t,n,e),t.elementType=vg,t.lanes=r,t.stateNode={isHidden:!1},t}function Hc(t,e,r){return t=kr(6,t,null,e),t.lanes=r,t}function qc(t,e,r){return e=kr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Yx(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_c(0),this.expirationTimes=_c(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_c(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Pd(t,e,r,n,i,o,s,a,l){return t=new Yx(t,e,r,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=kr(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},hd(o),t}function Xx(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h1)}catch(t){console.error(t)}}h1(),cg.exports=vr;var ia=cg.exports,fp=ia;Ef.createRoot=fp.createRoot,Ef.hydrateRoot=fp.hydrateRoot;/** * @remix-run/router v1.14.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function oa(){return oa=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Od(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function ib(){return Math.random().toString(36).substr(2,8)}function hp(t,e){return{usr:t.state,key:t.key,idx:e}}function mh(t,e,r,n){return r===void 0&&(r=null),oa({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Zo(e):e,{state:r,key:e&&e.key||n||ib()})}function h1(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Zo(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function ob(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:o=!1}=n,s=i.history,a=ci.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(oa({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function h(){a=ci.Pop;let S=c(),x=S==null?null:S-u;u=S,l&&l({action:a,location:b.location,delta:x})}function p(S,x){a=ci.Push;let w=mh(b.location,S,x);r&&r(w,S),u=c()+1;let E=hp(w,u),T=b.createHref(w);try{s.pushState(E,"",T)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(T)}o&&l&&l({action:a,location:b.location,delta:1})}function g(S,x){a=ci.Replace;let w=mh(b.location,S,x);r&&r(w,S),u=c();let E=hp(w,u),T=b.createHref(w);s.replaceState(E,"",T),o&&l&&l({action:a,location:b.location,delta:0})}function v(S){let x=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof S=="string"?S:h1(S);return _t(x,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,x)}let b={get action(){return a},get location(){return t(i,s)},listen(S){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(fp,h),l=S,()=>{i.removeEventListener(fp,h),l=null}},createHref(S){return e(i,S)},createURL:v,encodeLocation(S){let x=v(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:g,go(S){return s.go(S)}};return b}var dp;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(dp||(dp={}));function sb(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Zo(e):e,i=m1(n.pathname||"/",r);if(i==null)return null;let o=d1(t);ab(o);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(_t(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Fi([n,l.relativePath]),c=r.concat(l);o.children&&o.children.length>0&&(_t(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),d1(o.children,e,c,u)),!(o.path==null&&!o.index)&&e.push({path:u,score:pb(u,o.index),routesMeta:c})};return t.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of p1(o.path))i(o,s,l)}),e}function p1(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return i?[o,""]:[o];let s=p1(n.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function ab(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:mb(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const lb=/^:[\w-]+$/,ub=3,cb=2,fb=1,hb=10,db=-2,pp=t=>t==="*";function pb(t,e){let r=t.split("/"),n=r.length;return r.some(pp)&&(n+=db),e&&(n+=cb),r.filter(i=>!pp(i)).reduce((i,o)=>i+(lb.test(o)?ub:o===""?fb:hb),n)}function mb(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function gb(t,e){let{routesMeta:r}=t,n={},i="/",o=[];for(let s=0;s{let{paramName:p,isOptional:g}=c;if(p==="*"){let b=a[h]||"";s=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const v=a[h];return g&&!v?u[p]=void 0:u[p]=xb(v||"",p),u},{}),pathname:o,pathnameBase:s,pattern:t}}function yb(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Od(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function wb(t){try{return decodeURI(t)}catch(e){return Od(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function xb(t,e){try{return decodeURIComponent(t)}catch(r){return Od(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function m1(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function bb(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Zo(t):t;return{pathname:r?r.startsWith("/")?r:Eb(r,e):e,search:Nb(n),hash:Mb(i)}}function Eb(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Vc(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ab(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function _b(t,e){let r=Ab(t);return e?r.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Sb(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Zo(t):(i=oa({},t),_t(!i.pathname||!i.pathname.includes("?"),Vc("?","pathname","search",i)),_t(!i.pathname||!i.pathname.includes("#"),Vc("#","pathname","hash",i)),_t(!i.search||!i.search.includes("#"),Vc("#","search","hash",i)));let o=t===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=r;else{let h=e.length-1;if(!n&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}a=h>=0?e[h]:"/"}let l=bb(i,a),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Fi=t=>t.join("/").replace(/\/\/+/g,"/"),kb=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Nb=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Mb=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Pb(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const g1=["post","put","patch","delete"];new Set(g1);const Cb=["get",...g1];new Set(Cb);/** + */function oa(){return oa=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Od(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function ib(){return Math.random().toString(36).substr(2,8)}function dp(t,e){return{usr:t.state,key:t.key,idx:e}}function mh(t,e,r,n){return r===void 0&&(r=null),oa({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Zo(e):e,{state:r,key:e&&e.key||n||ib()})}function d1(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Zo(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function ob(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:o=!1}=n,s=i.history,a=ci.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(oa({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function h(){a=ci.Pop;let S=c(),x=S==null?null:S-u;u=S,l&&l({action:a,location:b.location,delta:x})}function p(S,x){a=ci.Push;let w=mh(b.location,S,x);r&&r(w,S),u=c()+1;let E=dp(w,u),T=b.createHref(w);try{s.pushState(E,"",T)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(T)}o&&l&&l({action:a,location:b.location,delta:1})}function g(S,x){a=ci.Replace;let w=mh(b.location,S,x);r&&r(w,S),u=c();let E=dp(w,u),T=b.createHref(w);s.replaceState(E,"",T),o&&l&&l({action:a,location:b.location,delta:0})}function v(S){let x=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof S=="string"?S:d1(S);return _t(x,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,x)}let b={get action(){return a},get location(){return t(i,s)},listen(S){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(hp,h),l=S,()=>{i.removeEventListener(hp,h),l=null}},createHref(S){return e(i,S)},createURL:v,encodeLocation(S){let x=v(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:g,go(S){return s.go(S)}};return b}var pp;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(pp||(pp={}));function sb(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?Zo(e):e,i=g1(n.pathname||"/",r);if(i==null)return null;let o=p1(t);ab(o);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(_t(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Fi([n,l.relativePath]),c=r.concat(l);o.children&&o.children.length>0&&(_t(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),p1(o.children,e,c,u)),!(o.path==null&&!o.index)&&e.push({path:u,score:pb(u,o.index),routesMeta:c})};return t.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of m1(o.path))i(o,s,l)}),e}function m1(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return i?[o,""]:[o];let s=m1(n.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function ab(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:mb(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const lb=/^:[\w-]+$/,ub=3,cb=2,fb=1,hb=10,db=-2,mp=t=>t==="*";function pb(t,e){let r=t.split("/"),n=r.length;return r.some(mp)&&(n+=db),e&&(n+=cb),r.filter(i=>!mp(i)).reduce((i,o)=>i+(lb.test(o)?ub:o===""?fb:hb),n)}function mb(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function gb(t,e){let{routesMeta:r}=t,n={},i="/",o=[];for(let s=0;s{let{paramName:p,isOptional:g}=c;if(p==="*"){let b=a[h]||"";s=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const v=a[h];return g&&!v?u[p]=void 0:u[p]=xb(v||"",p),u},{}),pathname:o,pathnameBase:s,pattern:t}}function yb(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Od(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function wb(t){try{return decodeURI(t)}catch(e){return Od(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function xb(t,e){try{return decodeURIComponent(t)}catch(r){return Od(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function g1(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function bb(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Zo(t):t;return{pathname:r?r.startsWith("/")?r:Eb(r,e):e,search:Nb(n),hash:Mb(i)}}function Eb(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Vc(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ab(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function _b(t,e){let r=Ab(t);return e?r.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Sb(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=Zo(t):(i=oa({},t),_t(!i.pathname||!i.pathname.includes("?"),Vc("?","pathname","search",i)),_t(!i.pathname||!i.pathname.includes("#"),Vc("#","pathname","hash",i)),_t(!i.search||!i.search.includes("#"),Vc("#","search","hash",i)));let o=t===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=r;else{let h=e.length-1;if(!n&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}a=h>=0?e[h]:"/"}let l=bb(i,a),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Fi=t=>t.join("/").replace(/\/\/+/g,"/"),kb=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Nb=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Mb=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Pb(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const v1=["post","put","patch","delete"];new Set(v1);const Cb=["get",...v1];new Set(Cb);/** * React Router v6.21.3 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function sa(){return sa=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),L.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let h=Sb(u,JSON.parse(s),o,c.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Fi([e,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[e,n,s,o,t])}function Ob(){let{matches:t}=L.useContext(Xi),e=t[t.length-1];return e?e.params:{}}function Tb(t,e){return Lb(t,e)}function Lb(t,e,r,n){Fu()||_t(!1);let{navigator:i}=L.useContext(Bu),{matches:o}=L.useContext(Xi),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Uu(),c;if(e){var h;let S=typeof e=="string"?Zo(e):e;l==="/"||(h=S.pathname)!=null&&h.startsWith(l)||_t(!1),c=S}else c=u;let p=c.pathname||"/",g=l==="/"?p:p.slice(l.length)||"/",v=sb(t,{pathname:g}),b=Ub(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:Fi([l,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Fi([l,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,r,n);return e&&b?L.createElement(Du.Provider,{value:{location:sa({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ci.Pop}},b):b}function jb(){let t=qb(),e=Pb(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},e),r?L.createElement("pre",{style:i},r):null,o)}const Bb=L.createElement(jb,null);class Db extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?L.createElement(Xi.Provider,{value:this.props.routeContext},L.createElement(v1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fb(t){let{routeContext:e,match:r,children:n}=t,i=L.useContext(Td);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),L.createElement(Xi.Provider,{value:e},n)}function Ub(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var o;if((o=r)!=null&&o.errors)t=r.matches;else return null}let s=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let c=s.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id]));c>=0||_t(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,h,p)=>{let g,v=!1,b=null,S=null;r&&(g=a&&h.route.id?a[h.route.id]:void 0,b=h.route.errorElement||Bb,l&&(u<0&&p===0?(Gb("route-fallback",!1),v=!0,S=null):u===p&&(v=!0,S=h.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,p+1)),w=()=>{let E;return g?E=b:v?E=S:h.route.Component?E=L.createElement(h.route.Component,null):h.route.element?E=h.route.element:E=c,L.createElement(Fb,{match:h,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:E})};return r&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?L.createElement(Db,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):w()},null)}var w1=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(w1||{}),ru=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(ru||{});function zb(t){let e=L.useContext(Td);return e||_t(!1),e}function $b(t){let e=L.useContext(Ib);return e||_t(!1),e}function Hb(t){let e=L.useContext(Xi);return e||_t(!1),e}function x1(t){let e=Hb(),r=e.matches[e.matches.length-1];return r.route.id||_t(!1),r.route.id}function qb(){var t;let e=L.useContext(v1),r=$b(ru.UseRouteError),n=x1(ru.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function Vb(){let{router:t}=zb(w1.UseNavigateStable),e=x1(ru.UseNavigateStable),r=L.useRef(!1);return y1(()=>{r.current=!0}),L.useCallback(function(i,o){o===void 0&&(o={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,sa({fromRouteId:e},o)))},[t,e])}const mp={};function Gb(t,e,r){!e&&!mp[t]&&(mp[t]=!0)}function _s(t){_t(!1)}function Wb(t){let{basename:e="/",children:r=null,location:n,navigationType:i=ci.Pop,navigator:o,static:s=!1,future:a}=t;Fu()&&_t(!1);let l=e.replace(/^\/*/,"/"),u=L.useMemo(()=>({basename:l,navigator:o,static:s,future:sa({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof n=="string"&&(n=Zo(n));let{pathname:c="/",search:h="",hash:p="",state:g=null,key:v="default"}=n,b=L.useMemo(()=>{let S=m1(c,l);return S==null?null:{location:{pathname:S,search:h,hash:p,state:g,key:v},navigationType:i}},[l,c,h,p,g,v,i]);return b==null?null:L.createElement(Bu.Provider,{value:u},L.createElement(Du.Provider,{children:r,value:b}))}function Kb(t){let{children:e,location:r}=t;return Tb(gh(e),r)}new Promise(()=>{});function gh(t,e){e===void 0&&(e=[]);let r=[];return L.Children.forEach(t,(n,i)=>{if(!L.isValidElement(n))return;let o=[...e,i];if(n.type===L.Fragment){r.push.apply(r,gh(n.props.children,o));return}n.type!==_s&&_t(!1),!n.props.index||!n.props.children||_t(!1);let s={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=gh(n.props.children,o)),r.push(s)}),r}/** + */function sa(){return sa=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),L.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let h=Sb(u,JSON.parse(s),o,c.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Fi([e,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[e,n,s,o,t])}function Ob(){let{matches:t}=L.useContext(Xi),e=t[t.length-1];return e?e.params:{}}function Tb(t,e){return Lb(t,e)}function Lb(t,e,r,n){Fu()||_t(!1);let{navigator:i}=L.useContext(Bu),{matches:o}=L.useContext(Xi),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Uu(),c;if(e){var h;let S=typeof e=="string"?Zo(e):e;l==="/"||(h=S.pathname)!=null&&h.startsWith(l)||_t(!1),c=S}else c=u;let p=c.pathname||"/",g=l==="/"?p:p.slice(l.length)||"/",v=sb(t,{pathname:g}),b=Ub(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:Fi([l,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Fi([l,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,r,n);return e&&b?L.createElement(Du.Provider,{value:{location:sa({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ci.Pop}},b):b}function jb(){let t=qb(),e=Pb(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},e),r?L.createElement("pre",{style:i},r):null,o)}const Bb=L.createElement(jb,null);class Db extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?L.createElement(Xi.Provider,{value:this.props.routeContext},L.createElement(y1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fb(t){let{routeContext:e,match:r,children:n}=t,i=L.useContext(Td);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),L.createElement(Xi.Provider,{value:e},n)}function Ub(t,e,r,n){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var o;if((o=r)!=null&&o.errors)t=r.matches;else return null}let s=t,a=(i=r)==null?void 0:i.errors;if(a!=null){let c=s.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id]));c>=0||_t(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,h,p)=>{let g,v=!1,b=null,S=null;r&&(g=a&&h.route.id?a[h.route.id]:void 0,b=h.route.errorElement||Bb,l&&(u<0&&p===0?(Gb("route-fallback",!1),v=!0,S=null):u===p&&(v=!0,S=h.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,p+1)),w=()=>{let E;return g?E=b:v?E=S:h.route.Component?E=L.createElement(h.route.Component,null):h.route.element?E=h.route.element:E=c,L.createElement(Fb,{match:h,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:E})};return r&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?L.createElement(Db,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):w()},null)}var x1=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(x1||{}),ru=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(ru||{});function zb(t){let e=L.useContext(Td);return e||_t(!1),e}function $b(t){let e=L.useContext(Ib);return e||_t(!1),e}function Hb(t){let e=L.useContext(Xi);return e||_t(!1),e}function b1(t){let e=Hb(),r=e.matches[e.matches.length-1];return r.route.id||_t(!1),r.route.id}function qb(){var t;let e=L.useContext(y1),r=$b(ru.UseRouteError),n=b1(ru.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function Vb(){let{router:t}=zb(x1.UseNavigateStable),e=b1(ru.UseNavigateStable),r=L.useRef(!1);return w1(()=>{r.current=!0}),L.useCallback(function(i,o){o===void 0&&(o={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,sa({fromRouteId:e},o)))},[t,e])}const gp={};function Gb(t,e,r){!e&&!gp[t]&&(gp[t]=!0)}function _s(t){_t(!1)}function Wb(t){let{basename:e="/",children:r=null,location:n,navigationType:i=ci.Pop,navigator:o,static:s=!1,future:a}=t;Fu()&&_t(!1);let l=e.replace(/^\/*/,"/"),u=L.useMemo(()=>({basename:l,navigator:o,static:s,future:sa({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof n=="string"&&(n=Zo(n));let{pathname:c="/",search:h="",hash:p="",state:g=null,key:v="default"}=n,b=L.useMemo(()=>{let S=g1(c,l);return S==null?null:{location:{pathname:S,search:h,hash:p,state:g,key:v},navigationType:i}},[l,c,h,p,g,v,i]);return b==null?null:L.createElement(Bu.Provider,{value:u},L.createElement(Du.Provider,{children:r,value:b}))}function Kb(t){let{children:e,location:r}=t;return Tb(gh(e),r)}new Promise(()=>{});function gh(t,e){e===void 0&&(e=[]);let r=[];return L.Children.forEach(t,(n,i)=>{if(!L.isValidElement(n))return;let o=[...e,i];if(n.type===L.Fragment){r.push.apply(r,gh(n.props.children,o));return}n.type!==_s&&_t(!1),!n.props.index||!n.props.children||_t(!1);let s={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=gh(n.props.children,o)),r.push(s)}),r}/** * React Router DOM v6.21.3 * * Copyright (c) Remix Software Inc. @@ -64,14 +64,14 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */const Qb="startTransition",gp=W2[Qb];function Jb(t){let{basename:e,children:r,future:n,window:i}=t,o=L.useRef();o.current==null&&(o.current=nb({window:i,v5Compat:!0}));let s=o.current,[a,l]=L.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},c=L.useCallback(h=>{u&&gp?gp(()=>l(h)):l(h)},[l,u]);return L.useLayoutEffect(()=>s.listen(c),[s,c]),L.createElement(Wb,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:s,future:n})}var vp;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(vp||(vp={}));var yp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(yp||(yp={}));var Ld={exports:{}};const Yb={},Xb=Object.freeze(Object.defineProperty({__proto__:null,default:Yb},Symbol.toStringTag,{value:"Module"})),Zb=Qo(Xb);Ld.exports;(function(t){(function(e,r){function n(C,f){if(!C)throw new Error(f||"Assertion failed")}function i(C,f){C.super_=f;var m=function(){};m.prototype=f.prototype,C.prototype=new m,C.prototype.constructor=C}function o(C,f,m){if(o.isBN(C))return C;this.negative=0,this.words=null,this.length=0,this.red=null,C!==null&&((f==="le"||f==="be")&&(m=f,f=10),this._init(C||0,f||10,m||"be"))}typeof e=="object"?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=Zb.Buffer}catch{}o.isBN=function(f){return f instanceof o?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===o.wordSize&&Array.isArray(f.words)},o.max=function(f,m){return f.cmp(m)>0?f:m},o.min=function(f,m){return f.cmp(m)<0?f:m},o.prototype._init=function(f,m,A){if(typeof f=="number")return this._initNumber(f,m,A);if(typeof f=="object")return this._initArray(f,m,A);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),f=f.toString().replace(/\s+/g,"");var k=0;f[0]==="-"&&(k++,this.negative=1),k=0;k-=3)I=f[k]|f[k-1]<<8|f[k-2]<<16,this.words[_]|=I<>>26-R&67108863,R+=24,R>=26&&(R-=26,_++);else if(A==="le")for(k=0,_=0;k>>26-R&67108863,R+=24,R>=26&&(R-=26,_++);return this._strip()};function a(C,f){var m=C.charCodeAt(f);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+C)}function l(C,f,m){var A=a(C,m);return m-1>=f&&(A|=a(C,m-1)<<4),A}o.prototype._parseHex=function(f,m,A){this.length=Math.ceil((f.length-m)/6),this.words=new Array(this.length);for(var k=0;k=m;k-=2)R=l(f,m,k)<<_,this.words[I]|=R&67108863,_>=18?(_-=18,I+=1,this.words[I]|=R>>>26):_+=8;else{var N=f.length-m;for(k=N%2===0?m+1:m;k=18?(_-=18,I+=1,this.words[I]|=R>>>26):_+=8}this._strip()};function u(C,f,m,A){for(var k=0,_=0,I=Math.min(C.length,m),R=f;R=49?_=N-49+10:N>=17?_=N-17+10:_=N,n(N>=0&&_1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?""}var p=["","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"],g=[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],v=[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];o.prototype.toString=function(f,m){f=f||10,m=m|0||1;var A;if(f===16||f==="hex"){A="";for(var k=0,_=0,I=0;I>>24-k&16777215,k+=2,k>=26&&(k-=26,I--),_!==0||I!==this.length-1?A=p[6-N.length]+N+A:A=N+A}for(_!==0&&(A=_.toString(16)+A);A.length%m!==0;)A="0"+A;return this.negative!==0&&(A="-"+A),A}if(f===(f|0)&&f>=2&&f<=36){var d=g[f],P=v[f];A="";var X=this.clone();for(X.negative=0;!X.isZero();){var y=X.modrn(P).toString(f);X=X.idivn(P),X.isZero()?A=y+A:A=p[d-y.length]+y+A}for(this.isZero()&&(A="0"+A);A.length%m!==0;)A="0"+A;return this.negative!==0&&(A="-"+A),A}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(f,m){return this.toArrayLike(s,f,m)}),o.prototype.toArray=function(f,m){return this.toArrayLike(Array,f,m)};var b=function(f,m){return f.allocUnsafe?f.allocUnsafe(m):new f(m)};o.prototype.toArrayLike=function(f,m,A){this._strip();var k=this.byteLength(),_=A||Math.max(1,k);n(k<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0");var I=b(f,_),R=m==="le"?"LE":"BE";return this["_toArrayLike"+R](I,k),I},o.prototype._toArrayLikeLE=function(f,m){for(var A=0,k=0,_=0,I=0;_>8&255),A>16&255),I===6?(A>24&255),k=0,I=0):(k=R>>>24,I+=2)}if(A=0&&(f[A--]=R>>8&255),A>=0&&(f[A--]=R>>16&255),I===6?(A>=0&&(f[A--]=R>>24&255),k=0,I=0):(k=R>>>24,I+=2)}if(A>=0)for(f[A--]=k;A>=0;)f[A--]=0},Math.clz32?o.prototype._countBits=function(f){return 32-Math.clz32(f)}:o.prototype._countBits=function(f){var m=f,A=0;return m>=4096&&(A+=13,m>>>=13),m>=64&&(A+=7,m>>>=7),m>=8&&(A+=4,m>>>=4),m>=2&&(A+=2,m>>>=2),A+m},o.prototype._zeroBits=function(f){if(f===0)return 26;var m=f,A=0;return m&8191||(A+=13,m>>>=13),m&127||(A+=7,m>>>=7),m&15||(A+=4,m>>>=4),m&3||(A+=2,m>>>=2),m&1||A++,A},o.prototype.bitLength=function(){var f=this.words[this.length-1],m=this._countBits(f);return(this.length-1)*26+m};function S(C){for(var f=new Array(C.bitLength()),m=0;m>>k&1}return f}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,m=0;mf.length?this.clone().ior(f):f.clone().ior(this)},o.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},o.prototype.iuand=function(f){var m;this.length>f.length?m=f:m=this;for(var A=0;Af.length?this.clone().iand(f):f.clone().iand(this)},o.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},o.prototype.iuxor=function(f){var m,A;this.length>f.length?(m=this,A=f):(m=f,A=this);for(var k=0;kf.length?this.clone().ixor(f):f.clone().ixor(this)},o.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},o.prototype.inotn=function(f){n(typeof f=="number"&&f>=0);var m=Math.ceil(f/26)|0,A=f%26;this._expand(m),A>0&&m--;for(var k=0;k0&&(this.words[k]=~this.words[k]&67108863>>26-A),this._strip()},o.prototype.notn=function(f){return this.clone().inotn(f)},o.prototype.setn=function(f,m){n(typeof f=="number"&&f>=0);var A=f/26|0,k=f%26;return this._expand(A+1),m?this.words[A]=this.words[A]|1<f.length?(A=this,k=f):(A=f,k=this);for(var _=0,I=0;I>>26;for(;_!==0&&I>>26;if(this.length=A.length,_!==0)this.words[this.length]=_,this.length++;else if(A!==this)for(;If.length?this.clone().iadd(f):f.clone().iadd(this)},o.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var m=this.iadd(f);return f.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var A=this.cmp(f);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;var k,_;A>0?(k=this,_=f):(k=f,_=this);for(var I=0,R=0;R<_.length;R++)m=(k.words[R]|0)-(_.words[R]|0)+I,I=m>>26,this.words[R]=m&67108863;for(;I!==0&&R>26,this.words[R]=m&67108863;if(I===0&&R>>26,X=N&67108863,y=Math.min(d,f.length-1),B=Math.max(0,d-C.length+1);B<=y;B++){var F=d-B|0;k=C.words[F]|0,_=f.words[B]|0,I=k*_+X,P+=I/67108864|0,X=I&67108863}m.words[d]=X|0,N=P|0}return N!==0?m.words[d]=N|0:m.length--,m._strip()}var w=function(f,m,A){var k=f.words,_=m.words,I=A.words,R=0,N,d,P,X=k[0]|0,y=X&8191,B=X>>>13,F=k[1]|0,U=F&8191,V=F>>>13,oe=k[2]|0,Q=oe&8191,W=oe>>>13,Ye=k[3]|0,K=Ye&8191,le=Ye>>>13,Yr=k[4]|0,Te=Yr&8191,Me=Yr>>>13,Xr=k[5]|0,Pe=Xr&8191,fe=Xr>>>13,xr=k[6]|0,he=xr&8191,Le=xr>>>13,Zr=k[7]|0,ge=Zr&8191,$e=Zr>>>13,bn=k[8]|0,He=bn&8191,qe=bn>>>13,qt=k[9]|0,je=qt&8191,Ve=qt>>>13,Or=_[0]|0,Ce=Or&8191,Ge=Or>>>13,En=_[1]|0,Be=En&8191,We=En>>>13,An=_[2]|0,De=An&8191,ne=An>>>13,st=_[3]|0,ve=st&8191,de=st>>>13,nt=_[4]|0,_e=nt&8191,Se=nt>>>13,Pt=_[5]|0,Ie=Pt&8191,Fe=Pt>>>13,Qt=_[6]|0,Ke=Qt&8191,Qe=Qt>>>13,Jt=_[7]|0,Re=Jt&8191,Ue=Jt>>>13,br=_[8]|0,Ne=br&8191,Xe=br>>>13,Ci=_[9]|0,Ze=Ci&8191,et=Ci>>>13;A.negative=f.negative^m.negative,A.length=19,N=Math.imul(y,Ce),d=Math.imul(y,Ge),d=d+Math.imul(B,Ce)|0,P=Math.imul(B,Ge);var Kn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,N=Math.imul(U,Ce),d=Math.imul(U,Ge),d=d+Math.imul(V,Ce)|0,P=Math.imul(V,Ge),N=N+Math.imul(y,Be)|0,d=d+Math.imul(y,We)|0,d=d+Math.imul(B,Be)|0,P=P+Math.imul(B,We)|0;var Qn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,N=Math.imul(Q,Ce),d=Math.imul(Q,Ge),d=d+Math.imul(W,Ce)|0,P=Math.imul(W,Ge),N=N+Math.imul(U,Be)|0,d=d+Math.imul(U,We)|0,d=d+Math.imul(V,Be)|0,P=P+Math.imul(V,We)|0,N=N+Math.imul(y,De)|0,d=d+Math.imul(y,ne)|0,d=d+Math.imul(B,De)|0,P=P+Math.imul(B,ne)|0;var Jn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,N=Math.imul(K,Ce),d=Math.imul(K,Ge),d=d+Math.imul(le,Ce)|0,P=Math.imul(le,Ge),N=N+Math.imul(Q,Be)|0,d=d+Math.imul(Q,We)|0,d=d+Math.imul(W,Be)|0,P=P+Math.imul(W,We)|0,N=N+Math.imul(U,De)|0,d=d+Math.imul(U,ne)|0,d=d+Math.imul(V,De)|0,P=P+Math.imul(V,ne)|0,N=N+Math.imul(y,ve)|0,d=d+Math.imul(y,de)|0,d=d+Math.imul(B,ve)|0,P=P+Math.imul(B,de)|0;var Yn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,N=Math.imul(Te,Ce),d=Math.imul(Te,Ge),d=d+Math.imul(Me,Ce)|0,P=Math.imul(Me,Ge),N=N+Math.imul(K,Be)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(le,Be)|0,P=P+Math.imul(le,We)|0,N=N+Math.imul(Q,De)|0,d=d+Math.imul(Q,ne)|0,d=d+Math.imul(W,De)|0,P=P+Math.imul(W,ne)|0,N=N+Math.imul(U,ve)|0,d=d+Math.imul(U,de)|0,d=d+Math.imul(V,ve)|0,P=P+Math.imul(V,de)|0,N=N+Math.imul(y,_e)|0,d=d+Math.imul(y,Se)|0,d=d+Math.imul(B,_e)|0,P=P+Math.imul(B,Se)|0;var Xn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,N=Math.imul(Pe,Ce),d=Math.imul(Pe,Ge),d=d+Math.imul(fe,Ce)|0,P=Math.imul(fe,Ge),N=N+Math.imul(Te,Be)|0,d=d+Math.imul(Te,We)|0,d=d+Math.imul(Me,Be)|0,P=P+Math.imul(Me,We)|0,N=N+Math.imul(K,De)|0,d=d+Math.imul(K,ne)|0,d=d+Math.imul(le,De)|0,P=P+Math.imul(le,ne)|0,N=N+Math.imul(Q,ve)|0,d=d+Math.imul(Q,de)|0,d=d+Math.imul(W,ve)|0,P=P+Math.imul(W,de)|0,N=N+Math.imul(U,_e)|0,d=d+Math.imul(U,Se)|0,d=d+Math.imul(V,_e)|0,P=P+Math.imul(V,Se)|0,N=N+Math.imul(y,Ie)|0,d=d+Math.imul(y,Fe)|0,d=d+Math.imul(B,Ie)|0,P=P+Math.imul(B,Fe)|0;var oc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(oc>>>26)|0,oc&=67108863,N=Math.imul(he,Ce),d=Math.imul(he,Ge),d=d+Math.imul(Le,Ce)|0,P=Math.imul(Le,Ge),N=N+Math.imul(Pe,Be)|0,d=d+Math.imul(Pe,We)|0,d=d+Math.imul(fe,Be)|0,P=P+Math.imul(fe,We)|0,N=N+Math.imul(Te,De)|0,d=d+Math.imul(Te,ne)|0,d=d+Math.imul(Me,De)|0,P=P+Math.imul(Me,ne)|0,N=N+Math.imul(K,ve)|0,d=d+Math.imul(K,de)|0,d=d+Math.imul(le,ve)|0,P=P+Math.imul(le,de)|0,N=N+Math.imul(Q,_e)|0,d=d+Math.imul(Q,Se)|0,d=d+Math.imul(W,_e)|0,P=P+Math.imul(W,Se)|0,N=N+Math.imul(U,Ie)|0,d=d+Math.imul(U,Fe)|0,d=d+Math.imul(V,Ie)|0,P=P+Math.imul(V,Fe)|0,N=N+Math.imul(y,Ke)|0,d=d+Math.imul(y,Qe)|0,d=d+Math.imul(B,Ke)|0,P=P+Math.imul(B,Qe)|0;var sc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(sc>>>26)|0,sc&=67108863,N=Math.imul(ge,Ce),d=Math.imul(ge,Ge),d=d+Math.imul($e,Ce)|0,P=Math.imul($e,Ge),N=N+Math.imul(he,Be)|0,d=d+Math.imul(he,We)|0,d=d+Math.imul(Le,Be)|0,P=P+Math.imul(Le,We)|0,N=N+Math.imul(Pe,De)|0,d=d+Math.imul(Pe,ne)|0,d=d+Math.imul(fe,De)|0,P=P+Math.imul(fe,ne)|0,N=N+Math.imul(Te,ve)|0,d=d+Math.imul(Te,de)|0,d=d+Math.imul(Me,ve)|0,P=P+Math.imul(Me,de)|0,N=N+Math.imul(K,_e)|0,d=d+Math.imul(K,Se)|0,d=d+Math.imul(le,_e)|0,P=P+Math.imul(le,Se)|0,N=N+Math.imul(Q,Ie)|0,d=d+Math.imul(Q,Fe)|0,d=d+Math.imul(W,Ie)|0,P=P+Math.imul(W,Fe)|0,N=N+Math.imul(U,Ke)|0,d=d+Math.imul(U,Qe)|0,d=d+Math.imul(V,Ke)|0,P=P+Math.imul(V,Qe)|0,N=N+Math.imul(y,Re)|0,d=d+Math.imul(y,Ue)|0,d=d+Math.imul(B,Re)|0,P=P+Math.imul(B,Ue)|0;var ac=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ac>>>26)|0,ac&=67108863,N=Math.imul(He,Ce),d=Math.imul(He,Ge),d=d+Math.imul(qe,Ce)|0,P=Math.imul(qe,Ge),N=N+Math.imul(ge,Be)|0,d=d+Math.imul(ge,We)|0,d=d+Math.imul($e,Be)|0,P=P+Math.imul($e,We)|0,N=N+Math.imul(he,De)|0,d=d+Math.imul(he,ne)|0,d=d+Math.imul(Le,De)|0,P=P+Math.imul(Le,ne)|0,N=N+Math.imul(Pe,ve)|0,d=d+Math.imul(Pe,de)|0,d=d+Math.imul(fe,ve)|0,P=P+Math.imul(fe,de)|0,N=N+Math.imul(Te,_e)|0,d=d+Math.imul(Te,Se)|0,d=d+Math.imul(Me,_e)|0,P=P+Math.imul(Me,Se)|0,N=N+Math.imul(K,Ie)|0,d=d+Math.imul(K,Fe)|0,d=d+Math.imul(le,Ie)|0,P=P+Math.imul(le,Fe)|0,N=N+Math.imul(Q,Ke)|0,d=d+Math.imul(Q,Qe)|0,d=d+Math.imul(W,Ke)|0,P=P+Math.imul(W,Qe)|0,N=N+Math.imul(U,Re)|0,d=d+Math.imul(U,Ue)|0,d=d+Math.imul(V,Re)|0,P=P+Math.imul(V,Ue)|0,N=N+Math.imul(y,Ne)|0,d=d+Math.imul(y,Xe)|0,d=d+Math.imul(B,Ne)|0,P=P+Math.imul(B,Xe)|0;var lc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(lc>>>26)|0,lc&=67108863,N=Math.imul(je,Ce),d=Math.imul(je,Ge),d=d+Math.imul(Ve,Ce)|0,P=Math.imul(Ve,Ge),N=N+Math.imul(He,Be)|0,d=d+Math.imul(He,We)|0,d=d+Math.imul(qe,Be)|0,P=P+Math.imul(qe,We)|0,N=N+Math.imul(ge,De)|0,d=d+Math.imul(ge,ne)|0,d=d+Math.imul($e,De)|0,P=P+Math.imul($e,ne)|0,N=N+Math.imul(he,ve)|0,d=d+Math.imul(he,de)|0,d=d+Math.imul(Le,ve)|0,P=P+Math.imul(Le,de)|0,N=N+Math.imul(Pe,_e)|0,d=d+Math.imul(Pe,Se)|0,d=d+Math.imul(fe,_e)|0,P=P+Math.imul(fe,Se)|0,N=N+Math.imul(Te,Ie)|0,d=d+Math.imul(Te,Fe)|0,d=d+Math.imul(Me,Ie)|0,P=P+Math.imul(Me,Fe)|0,N=N+Math.imul(K,Ke)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(le,Ke)|0,P=P+Math.imul(le,Qe)|0,N=N+Math.imul(Q,Re)|0,d=d+Math.imul(Q,Ue)|0,d=d+Math.imul(W,Re)|0,P=P+Math.imul(W,Ue)|0,N=N+Math.imul(U,Ne)|0,d=d+Math.imul(U,Xe)|0,d=d+Math.imul(V,Ne)|0,P=P+Math.imul(V,Xe)|0,N=N+Math.imul(y,Ze)|0,d=d+Math.imul(y,et)|0,d=d+Math.imul(B,Ze)|0,P=P+Math.imul(B,et)|0;var uc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(uc>>>26)|0,uc&=67108863,N=Math.imul(je,Be),d=Math.imul(je,We),d=d+Math.imul(Ve,Be)|0,P=Math.imul(Ve,We),N=N+Math.imul(He,De)|0,d=d+Math.imul(He,ne)|0,d=d+Math.imul(qe,De)|0,P=P+Math.imul(qe,ne)|0,N=N+Math.imul(ge,ve)|0,d=d+Math.imul(ge,de)|0,d=d+Math.imul($e,ve)|0,P=P+Math.imul($e,de)|0,N=N+Math.imul(he,_e)|0,d=d+Math.imul(he,Se)|0,d=d+Math.imul(Le,_e)|0,P=P+Math.imul(Le,Se)|0,N=N+Math.imul(Pe,Ie)|0,d=d+Math.imul(Pe,Fe)|0,d=d+Math.imul(fe,Ie)|0,P=P+Math.imul(fe,Fe)|0,N=N+Math.imul(Te,Ke)|0,d=d+Math.imul(Te,Qe)|0,d=d+Math.imul(Me,Ke)|0,P=P+Math.imul(Me,Qe)|0,N=N+Math.imul(K,Re)|0,d=d+Math.imul(K,Ue)|0,d=d+Math.imul(le,Re)|0,P=P+Math.imul(le,Ue)|0,N=N+Math.imul(Q,Ne)|0,d=d+Math.imul(Q,Xe)|0,d=d+Math.imul(W,Ne)|0,P=P+Math.imul(W,Xe)|0,N=N+Math.imul(U,Ze)|0,d=d+Math.imul(U,et)|0,d=d+Math.imul(V,Ze)|0,P=P+Math.imul(V,et)|0;var cc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(cc>>>26)|0,cc&=67108863,N=Math.imul(je,De),d=Math.imul(je,ne),d=d+Math.imul(Ve,De)|0,P=Math.imul(Ve,ne),N=N+Math.imul(He,ve)|0,d=d+Math.imul(He,de)|0,d=d+Math.imul(qe,ve)|0,P=P+Math.imul(qe,de)|0,N=N+Math.imul(ge,_e)|0,d=d+Math.imul(ge,Se)|0,d=d+Math.imul($e,_e)|0,P=P+Math.imul($e,Se)|0,N=N+Math.imul(he,Ie)|0,d=d+Math.imul(he,Fe)|0,d=d+Math.imul(Le,Ie)|0,P=P+Math.imul(Le,Fe)|0,N=N+Math.imul(Pe,Ke)|0,d=d+Math.imul(Pe,Qe)|0,d=d+Math.imul(fe,Ke)|0,P=P+Math.imul(fe,Qe)|0,N=N+Math.imul(Te,Re)|0,d=d+Math.imul(Te,Ue)|0,d=d+Math.imul(Me,Re)|0,P=P+Math.imul(Me,Ue)|0,N=N+Math.imul(K,Ne)|0,d=d+Math.imul(K,Xe)|0,d=d+Math.imul(le,Ne)|0,P=P+Math.imul(le,Xe)|0,N=N+Math.imul(Q,Ze)|0,d=d+Math.imul(Q,et)|0,d=d+Math.imul(W,Ze)|0,P=P+Math.imul(W,et)|0;var fc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(fc>>>26)|0,fc&=67108863,N=Math.imul(je,ve),d=Math.imul(je,de),d=d+Math.imul(Ve,ve)|0,P=Math.imul(Ve,de),N=N+Math.imul(He,_e)|0,d=d+Math.imul(He,Se)|0,d=d+Math.imul(qe,_e)|0,P=P+Math.imul(qe,Se)|0,N=N+Math.imul(ge,Ie)|0,d=d+Math.imul(ge,Fe)|0,d=d+Math.imul($e,Ie)|0,P=P+Math.imul($e,Fe)|0,N=N+Math.imul(he,Ke)|0,d=d+Math.imul(he,Qe)|0,d=d+Math.imul(Le,Ke)|0,P=P+Math.imul(Le,Qe)|0,N=N+Math.imul(Pe,Re)|0,d=d+Math.imul(Pe,Ue)|0,d=d+Math.imul(fe,Re)|0,P=P+Math.imul(fe,Ue)|0,N=N+Math.imul(Te,Ne)|0,d=d+Math.imul(Te,Xe)|0,d=d+Math.imul(Me,Ne)|0,P=P+Math.imul(Me,Xe)|0,N=N+Math.imul(K,Ze)|0,d=d+Math.imul(K,et)|0,d=d+Math.imul(le,Ze)|0,P=P+Math.imul(le,et)|0;var hc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(hc>>>26)|0,hc&=67108863,N=Math.imul(je,_e),d=Math.imul(je,Se),d=d+Math.imul(Ve,_e)|0,P=Math.imul(Ve,Se),N=N+Math.imul(He,Ie)|0,d=d+Math.imul(He,Fe)|0,d=d+Math.imul(qe,Ie)|0,P=P+Math.imul(qe,Fe)|0,N=N+Math.imul(ge,Ke)|0,d=d+Math.imul(ge,Qe)|0,d=d+Math.imul($e,Ke)|0,P=P+Math.imul($e,Qe)|0,N=N+Math.imul(he,Re)|0,d=d+Math.imul(he,Ue)|0,d=d+Math.imul(Le,Re)|0,P=P+Math.imul(Le,Ue)|0,N=N+Math.imul(Pe,Ne)|0,d=d+Math.imul(Pe,Xe)|0,d=d+Math.imul(fe,Ne)|0,P=P+Math.imul(fe,Xe)|0,N=N+Math.imul(Te,Ze)|0,d=d+Math.imul(Te,et)|0,d=d+Math.imul(Me,Ze)|0,P=P+Math.imul(Me,et)|0;var dc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(dc>>>26)|0,dc&=67108863,N=Math.imul(je,Ie),d=Math.imul(je,Fe),d=d+Math.imul(Ve,Ie)|0,P=Math.imul(Ve,Fe),N=N+Math.imul(He,Ke)|0,d=d+Math.imul(He,Qe)|0,d=d+Math.imul(qe,Ke)|0,P=P+Math.imul(qe,Qe)|0,N=N+Math.imul(ge,Re)|0,d=d+Math.imul(ge,Ue)|0,d=d+Math.imul($e,Re)|0,P=P+Math.imul($e,Ue)|0,N=N+Math.imul(he,Ne)|0,d=d+Math.imul(he,Xe)|0,d=d+Math.imul(Le,Ne)|0,P=P+Math.imul(Le,Xe)|0,N=N+Math.imul(Pe,Ze)|0,d=d+Math.imul(Pe,et)|0,d=d+Math.imul(fe,Ze)|0,P=P+Math.imul(fe,et)|0;var pc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(pc>>>26)|0,pc&=67108863,N=Math.imul(je,Ke),d=Math.imul(je,Qe),d=d+Math.imul(Ve,Ke)|0,P=Math.imul(Ve,Qe),N=N+Math.imul(He,Re)|0,d=d+Math.imul(He,Ue)|0,d=d+Math.imul(qe,Re)|0,P=P+Math.imul(qe,Ue)|0,N=N+Math.imul(ge,Ne)|0,d=d+Math.imul(ge,Xe)|0,d=d+Math.imul($e,Ne)|0,P=P+Math.imul($e,Xe)|0,N=N+Math.imul(he,Ze)|0,d=d+Math.imul(he,et)|0,d=d+Math.imul(Le,Ze)|0,P=P+Math.imul(Le,et)|0;var mc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(mc>>>26)|0,mc&=67108863,N=Math.imul(je,Re),d=Math.imul(je,Ue),d=d+Math.imul(Ve,Re)|0,P=Math.imul(Ve,Ue),N=N+Math.imul(He,Ne)|0,d=d+Math.imul(He,Xe)|0,d=d+Math.imul(qe,Ne)|0,P=P+Math.imul(qe,Xe)|0,N=N+Math.imul(ge,Ze)|0,d=d+Math.imul(ge,et)|0,d=d+Math.imul($e,Ze)|0,P=P+Math.imul($e,et)|0;var gc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(gc>>>26)|0,gc&=67108863,N=Math.imul(je,Ne),d=Math.imul(je,Xe),d=d+Math.imul(Ve,Ne)|0,P=Math.imul(Ve,Xe),N=N+Math.imul(He,Ze)|0,d=d+Math.imul(He,et)|0,d=d+Math.imul(qe,Ze)|0,P=P+Math.imul(qe,et)|0;var vc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(vc>>>26)|0,vc&=67108863,N=Math.imul(je,Ze),d=Math.imul(je,et),d=d+Math.imul(Ve,Ze)|0,P=Math.imul(Ve,et);var yc=(R+N|0)+((d&8191)<<13)|0;return R=(P+(d>>>13)|0)+(yc>>>26)|0,yc&=67108863,I[0]=Kn,I[1]=Qn,I[2]=Jn,I[3]=Yn,I[4]=Xn,I[5]=oc,I[6]=sc,I[7]=ac,I[8]=lc,I[9]=uc,I[10]=cc,I[11]=fc,I[12]=hc,I[13]=dc,I[14]=pc,I[15]=mc,I[16]=gc,I[17]=vc,I[18]=yc,R!==0&&(I[19]=R,A.length++),A};Math.imul||(w=x);function E(C,f,m){m.negative=f.negative^C.negative,m.length=C.length+f.length;for(var A=0,k=0,_=0;_>>26)|0,k+=I>>>26,I&=67108863}m.words[_]=R,A=I,I=k}return A!==0?m.words[_]=A:m.length--,m._strip()}function T(C,f,m){return E(C,f,m)}o.prototype.mulTo=function(f,m){var A,k=this.length+f.length;return this.length===10&&f.length===10?A=w(this,f,m):k<63?A=x(this,f,m):k<1024?A=E(this,f,m):A=T(this,f,m),A},o.prototype.mul=function(f){var m=new o(null);return m.words=new Array(this.length+f.length),this.mulTo(f,m)},o.prototype.mulf=function(f){var m=new o(null);return m.words=new Array(this.length+f.length),T(this,f,m)},o.prototype.imul=function(f){return this.clone().mulTo(f,this)},o.prototype.imuln=function(f){var m=f<0;m&&(f=-f),n(typeof f=="number"),n(f<67108864);for(var A=0,k=0;k>=26,A+=_/67108864|0,A+=I>>>26,this.words[k]=I&67108863}return A!==0&&(this.words[k]=A,this.length++),m?this.ineg():this},o.prototype.muln=function(f){return this.clone().imuln(f)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(f){var m=S(f);if(m.length===0)return new o(1);for(var A=this,k=0;k=0);var m=f%26,A=(f-m)/26,k=67108863>>>26-m<<26-m,_;if(m!==0){var I=0;for(_=0;_>>26-m}I&&(this.words[_]=I,this.length++)}if(A!==0){for(_=this.length-1;_>=0;_--)this.words[_+A]=this.words[_];for(_=0;_=0);var k;m?k=(m-m%26)/26:k=0;var _=f%26,I=Math.min((f-_)/26,this.length),R=67108863^67108863>>>_<<_,N=A;if(k-=I,k=Math.max(0,k),N){for(var d=0;dI)for(this.length-=I,d=0;d=0&&(P!==0||d>=k);d--){var X=this.words[d]|0;this.words[d]=P<<26-_|X>>>_,P=X&R}return N&&P!==0&&(N.words[N.length++]=P),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(f,m,A){return n(this.negative===0),this.iushrn(f,m,A)},o.prototype.shln=function(f){return this.clone().ishln(f)},o.prototype.ushln=function(f){return this.clone().iushln(f)},o.prototype.shrn=function(f){return this.clone().ishrn(f)},o.prototype.ushrn=function(f){return this.clone().iushrn(f)},o.prototype.testn=function(f){n(typeof f=="number"&&f>=0);var m=f%26,A=(f-m)/26,k=1<=0);var m=f%26,A=(f-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=A)return this;if(m!==0&&A++,this.length=Math.min(A,this.length),m!==0){var k=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},o.prototype.isubn=function(f){if(n(typeof f=="number"),n(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(N/67108864|0),this.words[_+A]=I&67108863}for(;_>26,this.words[_+A]=I&67108863;if(R===0)return this._strip();for(n(R===-1),R=0,_=0;_>26,this.words[_]=I&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(f,m){var A=this.length-f.length,k=this.clone(),_=f,I=_.words[_.length-1]|0,R=this._countBits(I);A=26-R,A!==0&&(_=_.ushln(A),k.iushln(A),I=_.words[_.length-1]|0);var N=k.length-_.length,d;if(m!=="mod"){d=new o(null),d.length=N+1,d.words=new Array(d.length);for(var P=0;P=0;y--){var B=(k.words[_.length+y]|0)*67108864+(k.words[_.length+y-1]|0);for(B=Math.min(B/I|0,67108863),k._ishlnsubmul(_,B,y);k.negative!==0;)B--,k.negative=0,k._ishlnsubmul(_,1,y),k.isZero()||(k.negative^=1);d&&(d.words[y]=B)}return d&&d._strip(),k._strip(),m!=="div"&&A!==0&&k.iushrn(A),{div:d||null,mod:k}},o.prototype.divmod=function(f,m,A){if(n(!f.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var k,_,I;return this.negative!==0&&f.negative===0?(I=this.neg().divmod(f,m),m!=="mod"&&(k=I.div.neg()),m!=="div"&&(_=I.mod.neg(),A&&_.negative!==0&&_.iadd(f)),{div:k,mod:_}):this.negative===0&&f.negative!==0?(I=this.divmod(f.neg(),m),m!=="mod"&&(k=I.div.neg()),{div:k,mod:I.mod}):this.negative&f.negative?(I=this.neg().divmod(f.neg(),m),m!=="div"&&(_=I.mod.neg(),A&&_.negative!==0&&_.isub(f)),{div:I.div,mod:_}):f.length>this.length||this.cmp(f)<0?{div:new o(0),mod:this}:f.length===1?m==="div"?{div:this.divn(f.words[0]),mod:null}:m==="mod"?{div:null,mod:new o(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new o(this.modrn(f.words[0]))}:this._wordDiv(f,m)},o.prototype.div=function(f){return this.divmod(f,"div",!1).div},o.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},o.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},o.prototype.divRound=function(f){var m=this.divmod(f);if(m.mod.isZero())return m.div;var A=m.div.negative!==0?m.mod.isub(f):m.mod,k=f.ushrn(1),_=f.andln(1),I=A.cmp(k);return I<0||_===1&&I===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},o.prototype.modrn=function(f){var m=f<0;m&&(f=-f),n(f<=67108863);for(var A=(1<<26)%f,k=0,_=this.length-1;_>=0;_--)k=(A*k+(this.words[_]|0))%f;return m?-k:k},o.prototype.modn=function(f){return this.modrn(f)},o.prototype.idivn=function(f){var m=f<0;m&&(f=-f),n(f<=67108863);for(var A=0,k=this.length-1;k>=0;k--){var _=(this.words[k]|0)+A*67108864;this.words[k]=_/f|0,A=_%f}return this._strip(),m?this.ineg():this},o.prototype.divn=function(f){return this.clone().idivn(f)},o.prototype.egcd=function(f){n(f.negative===0),n(!f.isZero());var m=this,A=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var k=new o(1),_=new o(0),I=new o(0),R=new o(1),N=0;m.isEven()&&A.isEven();)m.iushrn(1),A.iushrn(1),++N;for(var d=A.clone(),P=m.clone();!m.isZero();){for(var X=0,y=1;!(m.words[0]&y)&&X<26;++X,y<<=1);if(X>0)for(m.iushrn(X);X-- >0;)(k.isOdd()||_.isOdd())&&(k.iadd(d),_.isub(P)),k.iushrn(1),_.iushrn(1);for(var B=0,F=1;!(A.words[0]&F)&&B<26;++B,F<<=1);if(B>0)for(A.iushrn(B);B-- >0;)(I.isOdd()||R.isOdd())&&(I.iadd(d),R.isub(P)),I.iushrn(1),R.iushrn(1);m.cmp(A)>=0?(m.isub(A),k.isub(I),_.isub(R)):(A.isub(m),I.isub(k),R.isub(_))}return{a:I,b:R,gcd:A.iushln(N)}},o.prototype._invmp=function(f){n(f.negative===0),n(!f.isZero());var m=this,A=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var k=new o(1),_=new o(0),I=A.clone();m.cmpn(1)>0&&A.cmpn(1)>0;){for(var R=0,N=1;!(m.words[0]&N)&&R<26;++R,N<<=1);if(R>0)for(m.iushrn(R);R-- >0;)k.isOdd()&&k.iadd(I),k.iushrn(1);for(var d=0,P=1;!(A.words[0]&P)&&d<26;++d,P<<=1);if(d>0)for(A.iushrn(d);d-- >0;)_.isOdd()&&_.iadd(I),_.iushrn(1);m.cmp(A)>=0?(m.isub(A),k.isub(_)):(A.isub(m),_.isub(k))}var X;return m.cmpn(1)===0?X=k:X=_,X.cmpn(0)<0&&X.iadd(f),X},o.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var m=this.clone(),A=f.clone();m.negative=0,A.negative=0;for(var k=0;m.isEven()&&A.isEven();k++)m.iushrn(1),A.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;A.isEven();)A.iushrn(1);var _=m.cmp(A);if(_<0){var I=m;m=A,A=I}else if(_===0||A.cmpn(1)===0)break;m.isub(A)}while(!0);return A.iushln(k)},o.prototype.invm=function(f){return this.egcd(f).a.umod(f)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(f){return this.words[0]&f},o.prototype.bincn=function(f){n(typeof f=="number");var m=f%26,A=(f-m)/26,k=1<>>26,R&=67108863,this.words[I]=R}return _!==0&&(this.words[I]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(f){var m=f<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var A;if(this.length>1)A=1;else{m&&(f=-f),n(f<=67108863,"Number is too big");var k=this.words[0]|0;A=k===f?0:kf.length)return 1;if(this.length=0;A--){var k=this.words[A]|0,_=f.words[A]|0;if(k!==_){k<_?m=-1:k>_&&(m=1);break}}return m},o.prototype.gtn=function(f){return this.cmpn(f)===1},o.prototype.gt=function(f){return this.cmp(f)===1},o.prototype.gten=function(f){return this.cmpn(f)>=0},o.prototype.gte=function(f){return this.cmp(f)>=0},o.prototype.ltn=function(f){return this.cmpn(f)===-1},o.prototype.lt=function(f){return this.cmp(f)===-1},o.prototype.lten=function(f){return this.cmpn(f)<=0},o.prototype.lte=function(f){return this.cmp(f)<=0},o.prototype.eqn=function(f){return this.cmpn(f)===0},o.prototype.eq=function(f){return this.cmp(f)===0},o.red=function(f){return new ie(f)},o.prototype.toRed=function(f){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(f){return this.red=f,this},o.prototype.forceRed=function(f){return n(!this.red,"Already a number in reduction context"),this._forceRed(f)},o.prototype.redAdd=function(f){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},o.prototype.redIAdd=function(f){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},o.prototype.redSub=function(f){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},o.prototype.redISub=function(f){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},o.prototype.redShl=function(f){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},o.prototype.redMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},o.prototype.redIMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(f){return n(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var j={k256:null,p224:null,p192:null,p25519:null};function D(C,f){this.name=C,this.p=new o(f,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var f=new o(null);return f.words=new Array(Math.ceil(this.n/13)),f},D.prototype.ireduce=function(f){var m=f,A;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),A=m.bitLength();while(A>this.n);var k=A0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},D.prototype.split=function(f,m){f.iushrn(this.n,0,m)},D.prototype.imulK=function(f){return f.imul(this.k)};function $(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i($,D),$.prototype.split=function(f,m){for(var A=4194303,k=Math.min(f.length,9),_=0;_>>22,I=R}I>>>=22,f.words[_-10]=I,I===0&&f.length>10?f.length-=10:f.length-=9},$.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var m=0,A=0;A>>=26,f.words[A]=_,m=k}return m!==0&&(f.words[f.length++]=m),f},o._prime=function(f){if(j[f])return j[f];var m;if(f==="k256")m=new $;else if(f==="p224")m=new H;else if(f==="p192")m=new J;else if(f==="p25519")m=new Y;else throw new Error("Unknown prime "+f);return j[f]=m,m};function ie(C){if(typeof C=="string"){var f=o._prime(C);this.m=f.p,this.prime=f}else n(C.gtn(1),"modulus must be greater than 1"),this.m=C,this.prime=null}ie.prototype._verify1=function(f){n(f.negative===0,"red works only with positives"),n(f.red,"red works only with red numbers")},ie.prototype._verify2=function(f,m){n((f.negative|m.negative)===0,"red works only with positives"),n(f.red&&f.red===m.red,"red works only with red numbers")},ie.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},ie.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},ie.prototype.add=function(f,m){this._verify2(f,m);var A=f.add(m);return A.cmp(this.m)>=0&&A.isub(this.m),A._forceRed(this)},ie.prototype.iadd=function(f,m){this._verify2(f,m);var A=f.iadd(m);return A.cmp(this.m)>=0&&A.isub(this.m),A},ie.prototype.sub=function(f,m){this._verify2(f,m);var A=f.sub(m);return A.cmpn(0)<0&&A.iadd(this.m),A._forceRed(this)},ie.prototype.isub=function(f,m){this._verify2(f,m);var A=f.isub(m);return A.cmpn(0)<0&&A.iadd(this.m),A},ie.prototype.shl=function(f,m){return this._verify1(f),this.imod(f.ushln(m))},ie.prototype.imul=function(f,m){return this._verify2(f,m),this.imod(f.imul(m))},ie.prototype.mul=function(f,m){return this._verify2(f,m),this.imod(f.mul(m))},ie.prototype.isqr=function(f){return this.imul(f,f.clone())},ie.prototype.sqr=function(f){return this.mul(f,f)},ie.prototype.sqrt=function(f){if(f.isZero())return f.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var A=this.m.add(new o(1)).iushrn(2);return this.pow(f,A)}for(var k=this.m.subn(1),_=0;!k.isZero()&&k.andln(1)===0;)_++,k.iushrn(1);n(!k.isZero());var I=new o(1).toRed(this),R=I.redNeg(),N=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new o(2*d*d).toRed(this);this.pow(d,N).cmp(R)!==0;)d.redIAdd(R);for(var P=this.pow(d,k),X=this.pow(f,k.addn(1).iushrn(1)),y=this.pow(f,k),B=_;y.cmp(I)!==0;){for(var F=y,U=0;F.cmp(I)!==0;U++)F=F.redSqr();n(U=0;_--){for(var P=m.words[_],X=d-1;X>=0;X--){var y=P>>X&1;if(I!==k[0]&&(I=this.sqr(I)),y===0&&R===0){N=0;continue}R<<=1,R|=y,N++,!(N!==A&&(_!==0||X!==0))&&(I=this.mul(I,k[R]),N=0,R=0)}d=26}return I},ie.prototype.convertTo=function(f){var m=f.umod(this.m);return m===f?m.clone():m},ie.prototype.convertFrom=function(f){var m=f.clone();return m.red=null,m},o.mont=function(f){return new ae(f)};function ae(C){ie.call(this,C),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}i(ae,ie),ae.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},ae.prototype.convertFrom=function(f){var m=this.imod(f.mul(this.rinv));return m.red=null,m},ae.prototype.imul=function(f,m){if(f.isZero()||m.isZero())return f.words[0]=0,f.length=1,f;var A=f.imul(m),k=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=A.isub(k).iushrn(this.shift),I=_;return _.cmp(this.m)>=0?I=_.isub(this.m):_.cmpn(0)<0&&(I=_.iadd(this.m)),I._forceRed(this)},ae.prototype.mul=function(f,m){if(f.isZero()||m.isZero())return new o(0)._forceRed(this);var A=f.mul(m),k=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=A.isub(k).iushrn(this.shift),I=_;return _.cmp(this.m)>=0?I=_.isub(this.m):_.cmpn(0)<0&&(I=_.iadd(this.m)),I._forceRed(this)},ae.prototype.invm=function(f){var m=this.imod(f._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,ze)})(Ld);var eE=Ld.exports;const ce=Si(eE),tE="logger/5.7.0";let wp=!1,xp=!1;const bl={debug:1,default:2,info:2,warning:3,error:4,off:5};let bp=bl.default,Gc=null;function rE(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const Ep=rE();var vh;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(vh||(vh={}));var Ur;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Ur||(Ur={}));const Ap="0123456789abcdef";class O{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();bl[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(bp>bl[n])&&console.log.apply(console,r)}debug(...e){this._log(O.levels.DEBUG,e)}info(...e){this._log(O.levels.INFO,e)}warn(...e){this._log(O.levels.WARNING,e)}makeError(e,r,n){if(xp)return this.makeError("censored error",r,{});r||(r=O.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let c="";for(let h=0;h>4],c+=Ap[u[h]&15];i.push(l+"=Uint8Array(0x"+c+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const o=e;let s="";switch(r){case Ur.NUMERIC_FAULT:{s="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":s+="-"+l;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case Ur.CALL_EXCEPTION:case Ur.INSUFFICIENT_FUNDS:case Ur.MISSING_NEW:case Ur.NONCE_EXPIRED:case Ur.REPLACEMENT_UNDERPRICED:case Ur.TRANSACTION_REPLACED:case Ur.UNPREDICTABLE_GAS_LIMIT:s=r;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,O.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Ep&&this.throwError("platform missing String.prototype.normalize",O.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ep})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,O.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",O.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Gc||(Gc=new O(tE)),Gc}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),wp){if(!e)return;this.globalLogger().throwError("error censorship permanent",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}xp=!!e,wp=!!r}static setLogLevel(e){const r=bl[e.toLowerCase()];if(r==null){O.globalLogger().warn("invalid log level - "+e);return}bp=r}static from(e){return new O(e)}}O.errors=Ur;O.levels=vh;const nE="bytes/5.7.0",dt=new O(nE);function b1(t){return!!t.toHexString}function Oo(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Oo(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function jd(t){return me(t)&&!(t.length%2)||zu(t)}function _p(t){return typeof t=="number"&&t==t&&t%1===0}function zu(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!_p(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function se(t,e){if(e||(e={}),typeof t=="number"){dt.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Oo(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),b1(t)&&(t=t.toHexString()),me(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":dt.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ise(i)),r=e.reduce((i,o)=>i+o.length,0),n=new Uint8Array(r);return e.reduce((i,o)=>(n.set(o,i),i+o.length),0),Oo(n)}function Ho(t){let e=se(t);if(e.length===0)return e;let r=0;for(;re&&dt.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Oo(r)}function me(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Wc="0123456789abcdef";function re(t,e){if(e||(e={}),typeof t=="number"){dt.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Wc[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),b1(t))return t.toHexString();if(me(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":dt.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(zu(t)){let r="0x";for(let n=0;n>4]+Wc[i&15]}return r}return dt.throwArgumentError("invalid hexlify value","value",t)}function Un(t){if(typeof t!="string")t=re(t);else if(!me(t)||t.length%2)return null;return(t.length-2)/2}function Rt(t,e,r){return typeof t!="string"?t=re(t):(!me(t)||t.length%2)&&dt.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function er(t){let e="0x";return t.forEach(r=>{e+=re(r).substring(2)}),e}function $u(t){const e=iE(re(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function iE(t){typeof t!="string"&&(t=re(t)),me(t)||dt.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&dt.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Hu(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(jd(t)){let r=se(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=re(r.slice(0,32)),e.s=re(r.slice(32,64))):r.length===65?(e.r=re(r.slice(0,32)),e.s=re(r.slice(32,64)),e.v=r[64]):dt.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:dt.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=re(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=El(se(e._vs),32);e._vs=re(i);const o=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&dt.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const s=re(i);e.s==null?e.s=s:e.s!==s&&dt.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?dt.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&dt.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!me(e.r)?dt.throwArgumentError("signature missing or invalid r","signature",t):e.r=mt(e.r,32),e.s==null||!me(e.s)?dt.throwArgumentError("signature missing or invalid s","signature",t):e.s=mt(e.s,32);const r=se(e.s);r[0]>=128&&dt.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=re(r);e._vs&&(me(e._vs)||dt.throwArgumentError("signature invalid _vs","signature",t),e._vs=mt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&dt.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const oE="bignumber/5.7.0";var aa=ce.BN;const Sn=new O(oE),Kc={},Sp=9007199254740991;let kp=!1;class G{constructor(e,r){e!==Kc&&Sn.throwError("cannot call constructor directly; use BigNumber.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Yt(ye(this).fromTwos(e))}toTwos(e){return Yt(ye(this).toTwos(e))}abs(){return this._hex[0]==="-"?G.from(this._hex.substring(1)):this}add(e){return Yt(ye(this).add(ye(e)))}sub(e){return Yt(ye(this).sub(ye(e)))}div(e){return G.from(e).isZero()&&Er("division-by-zero","div"),Yt(ye(this).div(ye(e)))}mul(e){return Yt(ye(this).mul(ye(e)))}mod(e){const r=ye(e);return r.isNeg()&&Er("division-by-zero","mod"),Yt(ye(this).umod(r))}pow(e){const r=ye(e);return r.isNeg()&&Er("negative-power","pow"),Yt(ye(this).pow(r))}and(e){const r=ye(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","and"),Yt(ye(this).and(r))}or(e){const r=ye(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","or"),Yt(ye(this).or(r))}xor(e){const r=ye(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","xor"),Yt(ye(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Er("negative-width","mask"),Yt(ye(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Er("negative-width","shl"),Yt(ye(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Er("negative-width","shr"),Yt(ye(this).shrn(e))}eq(e){return ye(this).eq(ye(e))}lt(e){return ye(this).lt(ye(e))}lte(e){return ye(this).lte(ye(e))}gt(e){return ye(this).gt(ye(e))}gte(e){return ye(this).gte(ye(e))}isNegative(){return this._hex[0]==="-"}isZero(){return ye(this).isZero()}toNumber(){try{return ye(this).toNumber()}catch{Er("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Sn.throwError("this platform does not support BigInt",O.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?kp||(kp=!0,Sn.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Sn.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",O.errors.UNEXPECTED_ARGUMENT,{}):Sn.throwError("BigNumber.toString does not accept parameters",O.errors.UNEXPECTED_ARGUMENT,{})),ye(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof G)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new G(Kc,la(e)):e.match(/^-?[0-9]+$/)?new G(Kc,la(new aa(e))):Sn.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Er("underflow","BigNumber.from",e),(e>=Sp||e<=-Sp)&&Er("overflow","BigNumber.from",e),G.from(String(e));const r=e;if(typeof r=="bigint")return G.from(r.toString());if(zu(r))return G.from(re(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return G.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(me(n)||n[0]==="-"&&me(n.substring(1))))return G.from(n)}return Sn.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function la(t){if(typeof t!="string")return la(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Sn.throwArgumentError("invalid hex","value",t),t=la(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Yt(t){return G.from(la(t))}function ye(t){const e=G.from(t).toHexString();return e[0]==="-"?new aa("-"+e.substring(3),16):new aa(e.substring(2),16)}function Er(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Sn.throwError(t,O.errors.NUMERIC_FAULT,n)}function sE(t){return new aa(t,36).toString(16)}function aE(t){return new aa(t,16).toString(36)}const lE="properties/5.7.0";var uE=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const nu=new O(lE);function z(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function dr(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function wt(t){return uE(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(o=>({key:n,value:o}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function cE(t,e){(!t||typeof t!="object")&&nu.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||nu.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function ot(t){const e={};for(const r in t)e[r]=t[r];return e}const fE={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function E1(t){if(t==null||fE[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;ror(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&z(e,r,or(n))}return e}return nu.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function or(t){return hE(t)}class ka{constructor(e){for(const r in e)this[r]=or(e[r])}}const Na="abi/5.7.0",be=new O(Na),Wi={};let Np={calldata:!0,memory:!0,storage:!0},dE={calldata:!0,memory:!0};function Ja(t,e){if(t==="bytes"||t==="string"){if(Np[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&dE[e])return!0;return(Np[e]||e==="payable")&&be.throwArgumentError("invalid modifier","name",e),!1}function pE(t,e){let r=t;function n(a){be.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let o={type:"",name:"",state:{allowType:!0}},s=o;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==ke.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===ke.full?", ":",")+")"):r+=this.type,e!==ke.sighash&&(this.indexed===!0&&(r+=" indexed"),e===ke.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?kt.fromString(e,r):kt.fromObject(e)}static fromObject(e){return kt.isParamType(e)?e:new kt(Wi,{name:e.name||null,type:so(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(kt.fromObject):null})}static fromString(e,r){function n(i){return kt.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(pE(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function ua(t,e){return vE(t).map(r=>kt.fromString(r,e))}class On{constructor(e,r){e!==Wi&&be.throwError("use a static from method",O.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Al(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return On.isFragment(e)?e:typeof e=="string"?On.fromString(e):On.fromObject(e)}static fromObject(e){if(On.isFragment(e))return e;switch(e.type){case"function":return ln.fromObject(e);case"event":return Pn.fromObject(e);case"constructor":return an.fromObject(e);case"error":return si.fromObject(e);case"fallback":case"receive":return null}return be.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Pn.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?ln.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?an.fromString(e.trim()):e.split(" ")[0]==="error"?si.fromString(e.substring(5).trim()):be.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Pn extends On{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ke.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ",e!==ke.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Pn.fromString(e):Pn.fromObject(e)}static fromObject(e){if(Pn.isEventFragment(e))return e;e.type!=="event"&&be.throwArgumentError("invalid event object","value",e);const r={name:ca(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(kt.fromObject):[],type:"event"};return new Pn(Wi,r)}static fromString(e){let r=e.match(fa);r||be.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:be.warn("unknown modifier: "+i)}}),Pn.fromObject({name:r[1].trim(),anonymous:n,inputs:ua(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function A1(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&be.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||be.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=G.from(r[1]),r[0]):t}function _1(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function S1(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&be.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&be.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&be.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&be.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&be.throwArgumentError("unable to determine stateMutability","value",t),e}class an extends On{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===ke.sighash&&be.throwError("cannot format a constructor for sighash",O.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?an.fromString(e):an.fromObject(e)}static fromObject(e){if(an.isConstructorFragment(e))return e;e.type!=="constructor"&&be.throwArgumentError("invalid constructor object","value",e);let r=S1(e);r.constant&&be.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(kt.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?G.from(e.gas):null};return new an(Wi,n)}static fromString(e){let r={type:"constructor"};e=A1(e,r);let n=e.match(fa);return(!n||n[1].trim()!=="constructor")&&be.throwArgumentError("invalid constructor string","value",e),r.inputs=ua(n[2].trim(),!1),_1(n[3].trim(),r),an.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class ln extends an{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ke.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ",e!==ke.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?ln.fromString(e):ln.fromObject(e)}static fromObject(e){if(ln.isFunctionFragment(e))return e;e.type!=="function"&&be.throwArgumentError("invalid function object","value",e);let r=S1(e);const n={type:e.type,name:ca(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(kt.fromObject):[],outputs:e.outputs?e.outputs.map(kt.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?G.from(e.gas):null};return new ln(Wi,n)}static fromString(e){let r={type:"function"};e=A1(e,r);let n=e.split(" returns ");n.length>2&&be.throwArgumentError("invalid function string","value",e);let i=n[0].match(fa);if(i||be.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&ca(r.name),r.inputs=ua(i[2],!1),_1(i[3].trim(),r),n.length>1){let o=n[1].match(fa);(o[1].trim()!=""||o[3].trim()!="")&&be.throwArgumentError("unexpected tokens","value",e),r.outputs=ua(o[2],!1)}else r.outputs=[];return ln.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function Mp(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&be.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class si extends On{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ke.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?si.fromString(e):si.fromObject(e)}static fromObject(e){if(si.isErrorFragment(e))return e;e.type!=="error"&&be.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:ca(e.name),inputs:e.inputs?e.inputs.map(kt.fromObject):[]};return Mp(new si(Wi,r))}static fromString(e){let r={type:"error"},n=e.match(fa);return n||be.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&ca(r.name),r.inputs=ua(n[2],!1),Mp(si.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function so(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const gE=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function ca(t){return(!t||!t.match(gE))&&be.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const fa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function vE(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&Bd.throwError("value out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Ut([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class iu{constructor(e,r,n,i){z(this,"_data",se(e)),z(this,"wordSize",r||32),z(this,"_coerceFunc",n),z(this,"allowLoose",i),this._offset=0}get data(){return re(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):iu.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:Bd.throwError("data out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new iu(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return G.from(this.readBytes(this.wordSize))}}var k1={exports:{}};/** + */const Qb="startTransition",vp=W2[Qb];function Jb(t){let{basename:e,children:r,future:n,window:i}=t,o=L.useRef();o.current==null&&(o.current=nb({window:i,v5Compat:!0}));let s=o.current,[a,l]=L.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},c=L.useCallback(h=>{u&&vp?vp(()=>l(h)):l(h)},[l,u]);return L.useLayoutEffect(()=>s.listen(c),[s,c]),L.createElement(Wb,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:s,future:n})}var yp;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(yp||(yp={}));var wp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(wp||(wp={}));var Ld={exports:{}};const Yb={},Xb=Object.freeze(Object.defineProperty({__proto__:null,default:Yb},Symbol.toStringTag,{value:"Module"})),Zb=Qo(Xb);Ld.exports;(function(t){(function(e,r){function n(C,f){if(!C)throw new Error(f||"Assertion failed")}function i(C,f){C.super_=f;var m=function(){};m.prototype=f.prototype,C.prototype=new m,C.prototype.constructor=C}function o(C,f,m){if(o.isBN(C))return C;this.negative=0,this.words=null,this.length=0,this.red=null,C!==null&&((f==="le"||f==="be")&&(m=f,f=10),this._init(C||0,f||10,m||"be"))}typeof e=="object"?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=Zb.Buffer}catch{}o.isBN=function(f){return f instanceof o?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===o.wordSize&&Array.isArray(f.words)},o.max=function(f,m){return f.cmp(m)>0?f:m},o.min=function(f,m){return f.cmp(m)<0?f:m},o.prototype._init=function(f,m,A){if(typeof f=="number")return this._initNumber(f,m,A);if(typeof f=="object")return this._initArray(f,m,A);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),f=f.toString().replace(/\s+/g,"");var k=0;f[0]==="-"&&(k++,this.negative=1),k=0;k-=3)I=f[k]|f[k-1]<<8|f[k-2]<<16,this.words[_]|=I<>>26-R&67108863,R+=24,R>=26&&(R-=26,_++);else if(A==="le")for(k=0,_=0;k>>26-R&67108863,R+=24,R>=26&&(R-=26,_++);return this._strip()};function a(C,f){var m=C.charCodeAt(f);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+C)}function l(C,f,m){var A=a(C,m);return m-1>=f&&(A|=a(C,m-1)<<4),A}o.prototype._parseHex=function(f,m,A){this.length=Math.ceil((f.length-m)/6),this.words=new Array(this.length);for(var k=0;k=m;k-=2)R=l(f,m,k)<<_,this.words[I]|=R&67108863,_>=18?(_-=18,I+=1,this.words[I]|=R>>>26):_+=8;else{var N=f.length-m;for(k=N%2===0?m+1:m;k=18?(_-=18,I+=1,this.words[I]|=R>>>26):_+=8}this._strip()};function u(C,f,m,A){for(var k=0,_=0,I=Math.min(C.length,m),R=f;R=49?_=N-49+10:N>=17?_=N-17+10:_=N,n(N>=0&&_1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?""}var p=["","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"],g=[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],v=[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];o.prototype.toString=function(f,m){f=f||10,m=m|0||1;var A;if(f===16||f==="hex"){A="";for(var k=0,_=0,I=0;I>>24-k&16777215,k+=2,k>=26&&(k-=26,I--),_!==0||I!==this.length-1?A=p[6-N.length]+N+A:A=N+A}for(_!==0&&(A=_.toString(16)+A);A.length%m!==0;)A="0"+A;return this.negative!==0&&(A="-"+A),A}if(f===(f|0)&&f>=2&&f<=36){var d=g[f],P=v[f];A="";var X=this.clone();for(X.negative=0;!X.isZero();){var y=X.modrn(P).toString(f);X=X.idivn(P),X.isZero()?A=y+A:A=p[d-y.length]+y+A}for(this.isZero()&&(A="0"+A);A.length%m!==0;)A="0"+A;return this.negative!==0&&(A="-"+A),A}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(f,m){return this.toArrayLike(s,f,m)}),o.prototype.toArray=function(f,m){return this.toArrayLike(Array,f,m)};var b=function(f,m){return f.allocUnsafe?f.allocUnsafe(m):new f(m)};o.prototype.toArrayLike=function(f,m,A){this._strip();var k=this.byteLength(),_=A||Math.max(1,k);n(k<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0");var I=b(f,_),R=m==="le"?"LE":"BE";return this["_toArrayLike"+R](I,k),I},o.prototype._toArrayLikeLE=function(f,m){for(var A=0,k=0,_=0,I=0;_>8&255),A>16&255),I===6?(A>24&255),k=0,I=0):(k=R>>>24,I+=2)}if(A=0&&(f[A--]=R>>8&255),A>=0&&(f[A--]=R>>16&255),I===6?(A>=0&&(f[A--]=R>>24&255),k=0,I=0):(k=R>>>24,I+=2)}if(A>=0)for(f[A--]=k;A>=0;)f[A--]=0},Math.clz32?o.prototype._countBits=function(f){return 32-Math.clz32(f)}:o.prototype._countBits=function(f){var m=f,A=0;return m>=4096&&(A+=13,m>>>=13),m>=64&&(A+=7,m>>>=7),m>=8&&(A+=4,m>>>=4),m>=2&&(A+=2,m>>>=2),A+m},o.prototype._zeroBits=function(f){if(f===0)return 26;var m=f,A=0;return m&8191||(A+=13,m>>>=13),m&127||(A+=7,m>>>=7),m&15||(A+=4,m>>>=4),m&3||(A+=2,m>>>=2),m&1||A++,A},o.prototype.bitLength=function(){var f=this.words[this.length-1],m=this._countBits(f);return(this.length-1)*26+m};function S(C){for(var f=new Array(C.bitLength()),m=0;m>>k&1}return f}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,m=0;mf.length?this.clone().ior(f):f.clone().ior(this)},o.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},o.prototype.iuand=function(f){var m;this.length>f.length?m=f:m=this;for(var A=0;Af.length?this.clone().iand(f):f.clone().iand(this)},o.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},o.prototype.iuxor=function(f){var m,A;this.length>f.length?(m=this,A=f):(m=f,A=this);for(var k=0;kf.length?this.clone().ixor(f):f.clone().ixor(this)},o.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},o.prototype.inotn=function(f){n(typeof f=="number"&&f>=0);var m=Math.ceil(f/26)|0,A=f%26;this._expand(m),A>0&&m--;for(var k=0;k0&&(this.words[k]=~this.words[k]&67108863>>26-A),this._strip()},o.prototype.notn=function(f){return this.clone().inotn(f)},o.prototype.setn=function(f,m){n(typeof f=="number"&&f>=0);var A=f/26|0,k=f%26;return this._expand(A+1),m?this.words[A]=this.words[A]|1<f.length?(A=this,k=f):(A=f,k=this);for(var _=0,I=0;I>>26;for(;_!==0&&I>>26;if(this.length=A.length,_!==0)this.words[this.length]=_,this.length++;else if(A!==this)for(;If.length?this.clone().iadd(f):f.clone().iadd(this)},o.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var m=this.iadd(f);return f.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var A=this.cmp(f);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;var k,_;A>0?(k=this,_=f):(k=f,_=this);for(var I=0,R=0;R<_.length;R++)m=(k.words[R]|0)-(_.words[R]|0)+I,I=m>>26,this.words[R]=m&67108863;for(;I!==0&&R>26,this.words[R]=m&67108863;if(I===0&&R>>26,X=N&67108863,y=Math.min(d,f.length-1),B=Math.max(0,d-C.length+1);B<=y;B++){var F=d-B|0;k=C.words[F]|0,_=f.words[B]|0,I=k*_+X,P+=I/67108864|0,X=I&67108863}m.words[d]=X|0,N=P|0}return N!==0?m.words[d]=N|0:m.length--,m._strip()}var w=function(f,m,A){var k=f.words,_=m.words,I=A.words,R=0,N,d,P,X=k[0]|0,y=X&8191,B=X>>>13,F=k[1]|0,U=F&8191,V=F>>>13,oe=k[2]|0,Q=oe&8191,W=oe>>>13,Ye=k[3]|0,K=Ye&8191,le=Ye>>>13,Jr=k[4]|0,Te=Jr&8191,Me=Jr>>>13,Yr=k[5]|0,Pe=Yr&8191,fe=Yr>>>13,xr=k[6]|0,he=xr&8191,Le=xr>>>13,Xr=k[7]|0,ge=Xr&8191,$e=Xr>>>13,bn=k[8]|0,He=bn&8191,qe=bn>>>13,qt=k[9]|0,je=qt&8191,Ve=qt>>>13,Or=_[0]|0,Ce=Or&8191,Ge=Or>>>13,En=_[1]|0,Be=En&8191,We=En>>>13,An=_[2]|0,De=An&8191,ne=An>>>13,st=_[3]|0,ve=st&8191,de=st>>>13,nt=_[4]|0,_e=nt&8191,Se=nt>>>13,Pt=_[5]|0,Ie=Pt&8191,Fe=Pt>>>13,Qt=_[6]|0,Ke=Qt&8191,Qe=Qt>>>13,Jt=_[7]|0,Re=Jt&8191,Ue=Jt>>>13,br=_[8]|0,Ne=br&8191,Xe=br>>>13,Ci=_[9]|0,Ze=Ci&8191,et=Ci>>>13;A.negative=f.negative^m.negative,A.length=19,N=Math.imul(y,Ce),d=Math.imul(y,Ge),d=d+Math.imul(B,Ce)|0,P=Math.imul(B,Ge);var Kn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,N=Math.imul(U,Ce),d=Math.imul(U,Ge),d=d+Math.imul(V,Ce)|0,P=Math.imul(V,Ge),N=N+Math.imul(y,Be)|0,d=d+Math.imul(y,We)|0,d=d+Math.imul(B,Be)|0,P=P+Math.imul(B,We)|0;var Qn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,N=Math.imul(Q,Ce),d=Math.imul(Q,Ge),d=d+Math.imul(W,Ce)|0,P=Math.imul(W,Ge),N=N+Math.imul(U,Be)|0,d=d+Math.imul(U,We)|0,d=d+Math.imul(V,Be)|0,P=P+Math.imul(V,We)|0,N=N+Math.imul(y,De)|0,d=d+Math.imul(y,ne)|0,d=d+Math.imul(B,De)|0,P=P+Math.imul(B,ne)|0;var Jn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,N=Math.imul(K,Ce),d=Math.imul(K,Ge),d=d+Math.imul(le,Ce)|0,P=Math.imul(le,Ge),N=N+Math.imul(Q,Be)|0,d=d+Math.imul(Q,We)|0,d=d+Math.imul(W,Be)|0,P=P+Math.imul(W,We)|0,N=N+Math.imul(U,De)|0,d=d+Math.imul(U,ne)|0,d=d+Math.imul(V,De)|0,P=P+Math.imul(V,ne)|0,N=N+Math.imul(y,ve)|0,d=d+Math.imul(y,de)|0,d=d+Math.imul(B,ve)|0,P=P+Math.imul(B,de)|0;var Yn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,N=Math.imul(Te,Ce),d=Math.imul(Te,Ge),d=d+Math.imul(Me,Ce)|0,P=Math.imul(Me,Ge),N=N+Math.imul(K,Be)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(le,Be)|0,P=P+Math.imul(le,We)|0,N=N+Math.imul(Q,De)|0,d=d+Math.imul(Q,ne)|0,d=d+Math.imul(W,De)|0,P=P+Math.imul(W,ne)|0,N=N+Math.imul(U,ve)|0,d=d+Math.imul(U,de)|0,d=d+Math.imul(V,ve)|0,P=P+Math.imul(V,de)|0,N=N+Math.imul(y,_e)|0,d=d+Math.imul(y,Se)|0,d=d+Math.imul(B,_e)|0,P=P+Math.imul(B,Se)|0;var Xn=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,N=Math.imul(Pe,Ce),d=Math.imul(Pe,Ge),d=d+Math.imul(fe,Ce)|0,P=Math.imul(fe,Ge),N=N+Math.imul(Te,Be)|0,d=d+Math.imul(Te,We)|0,d=d+Math.imul(Me,Be)|0,P=P+Math.imul(Me,We)|0,N=N+Math.imul(K,De)|0,d=d+Math.imul(K,ne)|0,d=d+Math.imul(le,De)|0,P=P+Math.imul(le,ne)|0,N=N+Math.imul(Q,ve)|0,d=d+Math.imul(Q,de)|0,d=d+Math.imul(W,ve)|0,P=P+Math.imul(W,de)|0,N=N+Math.imul(U,_e)|0,d=d+Math.imul(U,Se)|0,d=d+Math.imul(V,_e)|0,P=P+Math.imul(V,Se)|0,N=N+Math.imul(y,Ie)|0,d=d+Math.imul(y,Fe)|0,d=d+Math.imul(B,Ie)|0,P=P+Math.imul(B,Fe)|0;var oc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(oc>>>26)|0,oc&=67108863,N=Math.imul(he,Ce),d=Math.imul(he,Ge),d=d+Math.imul(Le,Ce)|0,P=Math.imul(Le,Ge),N=N+Math.imul(Pe,Be)|0,d=d+Math.imul(Pe,We)|0,d=d+Math.imul(fe,Be)|0,P=P+Math.imul(fe,We)|0,N=N+Math.imul(Te,De)|0,d=d+Math.imul(Te,ne)|0,d=d+Math.imul(Me,De)|0,P=P+Math.imul(Me,ne)|0,N=N+Math.imul(K,ve)|0,d=d+Math.imul(K,de)|0,d=d+Math.imul(le,ve)|0,P=P+Math.imul(le,de)|0,N=N+Math.imul(Q,_e)|0,d=d+Math.imul(Q,Se)|0,d=d+Math.imul(W,_e)|0,P=P+Math.imul(W,Se)|0,N=N+Math.imul(U,Ie)|0,d=d+Math.imul(U,Fe)|0,d=d+Math.imul(V,Ie)|0,P=P+Math.imul(V,Fe)|0,N=N+Math.imul(y,Ke)|0,d=d+Math.imul(y,Qe)|0,d=d+Math.imul(B,Ke)|0,P=P+Math.imul(B,Qe)|0;var sc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(sc>>>26)|0,sc&=67108863,N=Math.imul(ge,Ce),d=Math.imul(ge,Ge),d=d+Math.imul($e,Ce)|0,P=Math.imul($e,Ge),N=N+Math.imul(he,Be)|0,d=d+Math.imul(he,We)|0,d=d+Math.imul(Le,Be)|0,P=P+Math.imul(Le,We)|0,N=N+Math.imul(Pe,De)|0,d=d+Math.imul(Pe,ne)|0,d=d+Math.imul(fe,De)|0,P=P+Math.imul(fe,ne)|0,N=N+Math.imul(Te,ve)|0,d=d+Math.imul(Te,de)|0,d=d+Math.imul(Me,ve)|0,P=P+Math.imul(Me,de)|0,N=N+Math.imul(K,_e)|0,d=d+Math.imul(K,Se)|0,d=d+Math.imul(le,_e)|0,P=P+Math.imul(le,Se)|0,N=N+Math.imul(Q,Ie)|0,d=d+Math.imul(Q,Fe)|0,d=d+Math.imul(W,Ie)|0,P=P+Math.imul(W,Fe)|0,N=N+Math.imul(U,Ke)|0,d=d+Math.imul(U,Qe)|0,d=d+Math.imul(V,Ke)|0,P=P+Math.imul(V,Qe)|0,N=N+Math.imul(y,Re)|0,d=d+Math.imul(y,Ue)|0,d=d+Math.imul(B,Re)|0,P=P+Math.imul(B,Ue)|0;var ac=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(ac>>>26)|0,ac&=67108863,N=Math.imul(He,Ce),d=Math.imul(He,Ge),d=d+Math.imul(qe,Ce)|0,P=Math.imul(qe,Ge),N=N+Math.imul(ge,Be)|0,d=d+Math.imul(ge,We)|0,d=d+Math.imul($e,Be)|0,P=P+Math.imul($e,We)|0,N=N+Math.imul(he,De)|0,d=d+Math.imul(he,ne)|0,d=d+Math.imul(Le,De)|0,P=P+Math.imul(Le,ne)|0,N=N+Math.imul(Pe,ve)|0,d=d+Math.imul(Pe,de)|0,d=d+Math.imul(fe,ve)|0,P=P+Math.imul(fe,de)|0,N=N+Math.imul(Te,_e)|0,d=d+Math.imul(Te,Se)|0,d=d+Math.imul(Me,_e)|0,P=P+Math.imul(Me,Se)|0,N=N+Math.imul(K,Ie)|0,d=d+Math.imul(K,Fe)|0,d=d+Math.imul(le,Ie)|0,P=P+Math.imul(le,Fe)|0,N=N+Math.imul(Q,Ke)|0,d=d+Math.imul(Q,Qe)|0,d=d+Math.imul(W,Ke)|0,P=P+Math.imul(W,Qe)|0,N=N+Math.imul(U,Re)|0,d=d+Math.imul(U,Ue)|0,d=d+Math.imul(V,Re)|0,P=P+Math.imul(V,Ue)|0,N=N+Math.imul(y,Ne)|0,d=d+Math.imul(y,Xe)|0,d=d+Math.imul(B,Ne)|0,P=P+Math.imul(B,Xe)|0;var lc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(lc>>>26)|0,lc&=67108863,N=Math.imul(je,Ce),d=Math.imul(je,Ge),d=d+Math.imul(Ve,Ce)|0,P=Math.imul(Ve,Ge),N=N+Math.imul(He,Be)|0,d=d+Math.imul(He,We)|0,d=d+Math.imul(qe,Be)|0,P=P+Math.imul(qe,We)|0,N=N+Math.imul(ge,De)|0,d=d+Math.imul(ge,ne)|0,d=d+Math.imul($e,De)|0,P=P+Math.imul($e,ne)|0,N=N+Math.imul(he,ve)|0,d=d+Math.imul(he,de)|0,d=d+Math.imul(Le,ve)|0,P=P+Math.imul(Le,de)|0,N=N+Math.imul(Pe,_e)|0,d=d+Math.imul(Pe,Se)|0,d=d+Math.imul(fe,_e)|0,P=P+Math.imul(fe,Se)|0,N=N+Math.imul(Te,Ie)|0,d=d+Math.imul(Te,Fe)|0,d=d+Math.imul(Me,Ie)|0,P=P+Math.imul(Me,Fe)|0,N=N+Math.imul(K,Ke)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(le,Ke)|0,P=P+Math.imul(le,Qe)|0,N=N+Math.imul(Q,Re)|0,d=d+Math.imul(Q,Ue)|0,d=d+Math.imul(W,Re)|0,P=P+Math.imul(W,Ue)|0,N=N+Math.imul(U,Ne)|0,d=d+Math.imul(U,Xe)|0,d=d+Math.imul(V,Ne)|0,P=P+Math.imul(V,Xe)|0,N=N+Math.imul(y,Ze)|0,d=d+Math.imul(y,et)|0,d=d+Math.imul(B,Ze)|0,P=P+Math.imul(B,et)|0;var uc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(uc>>>26)|0,uc&=67108863,N=Math.imul(je,Be),d=Math.imul(je,We),d=d+Math.imul(Ve,Be)|0,P=Math.imul(Ve,We),N=N+Math.imul(He,De)|0,d=d+Math.imul(He,ne)|0,d=d+Math.imul(qe,De)|0,P=P+Math.imul(qe,ne)|0,N=N+Math.imul(ge,ve)|0,d=d+Math.imul(ge,de)|0,d=d+Math.imul($e,ve)|0,P=P+Math.imul($e,de)|0,N=N+Math.imul(he,_e)|0,d=d+Math.imul(he,Se)|0,d=d+Math.imul(Le,_e)|0,P=P+Math.imul(Le,Se)|0,N=N+Math.imul(Pe,Ie)|0,d=d+Math.imul(Pe,Fe)|0,d=d+Math.imul(fe,Ie)|0,P=P+Math.imul(fe,Fe)|0,N=N+Math.imul(Te,Ke)|0,d=d+Math.imul(Te,Qe)|0,d=d+Math.imul(Me,Ke)|0,P=P+Math.imul(Me,Qe)|0,N=N+Math.imul(K,Re)|0,d=d+Math.imul(K,Ue)|0,d=d+Math.imul(le,Re)|0,P=P+Math.imul(le,Ue)|0,N=N+Math.imul(Q,Ne)|0,d=d+Math.imul(Q,Xe)|0,d=d+Math.imul(W,Ne)|0,P=P+Math.imul(W,Xe)|0,N=N+Math.imul(U,Ze)|0,d=d+Math.imul(U,et)|0,d=d+Math.imul(V,Ze)|0,P=P+Math.imul(V,et)|0;var cc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(cc>>>26)|0,cc&=67108863,N=Math.imul(je,De),d=Math.imul(je,ne),d=d+Math.imul(Ve,De)|0,P=Math.imul(Ve,ne),N=N+Math.imul(He,ve)|0,d=d+Math.imul(He,de)|0,d=d+Math.imul(qe,ve)|0,P=P+Math.imul(qe,de)|0,N=N+Math.imul(ge,_e)|0,d=d+Math.imul(ge,Se)|0,d=d+Math.imul($e,_e)|0,P=P+Math.imul($e,Se)|0,N=N+Math.imul(he,Ie)|0,d=d+Math.imul(he,Fe)|0,d=d+Math.imul(Le,Ie)|0,P=P+Math.imul(Le,Fe)|0,N=N+Math.imul(Pe,Ke)|0,d=d+Math.imul(Pe,Qe)|0,d=d+Math.imul(fe,Ke)|0,P=P+Math.imul(fe,Qe)|0,N=N+Math.imul(Te,Re)|0,d=d+Math.imul(Te,Ue)|0,d=d+Math.imul(Me,Re)|0,P=P+Math.imul(Me,Ue)|0,N=N+Math.imul(K,Ne)|0,d=d+Math.imul(K,Xe)|0,d=d+Math.imul(le,Ne)|0,P=P+Math.imul(le,Xe)|0,N=N+Math.imul(Q,Ze)|0,d=d+Math.imul(Q,et)|0,d=d+Math.imul(W,Ze)|0,P=P+Math.imul(W,et)|0;var fc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(fc>>>26)|0,fc&=67108863,N=Math.imul(je,ve),d=Math.imul(je,de),d=d+Math.imul(Ve,ve)|0,P=Math.imul(Ve,de),N=N+Math.imul(He,_e)|0,d=d+Math.imul(He,Se)|0,d=d+Math.imul(qe,_e)|0,P=P+Math.imul(qe,Se)|0,N=N+Math.imul(ge,Ie)|0,d=d+Math.imul(ge,Fe)|0,d=d+Math.imul($e,Ie)|0,P=P+Math.imul($e,Fe)|0,N=N+Math.imul(he,Ke)|0,d=d+Math.imul(he,Qe)|0,d=d+Math.imul(Le,Ke)|0,P=P+Math.imul(Le,Qe)|0,N=N+Math.imul(Pe,Re)|0,d=d+Math.imul(Pe,Ue)|0,d=d+Math.imul(fe,Re)|0,P=P+Math.imul(fe,Ue)|0,N=N+Math.imul(Te,Ne)|0,d=d+Math.imul(Te,Xe)|0,d=d+Math.imul(Me,Ne)|0,P=P+Math.imul(Me,Xe)|0,N=N+Math.imul(K,Ze)|0,d=d+Math.imul(K,et)|0,d=d+Math.imul(le,Ze)|0,P=P+Math.imul(le,et)|0;var hc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(hc>>>26)|0,hc&=67108863,N=Math.imul(je,_e),d=Math.imul(je,Se),d=d+Math.imul(Ve,_e)|0,P=Math.imul(Ve,Se),N=N+Math.imul(He,Ie)|0,d=d+Math.imul(He,Fe)|0,d=d+Math.imul(qe,Ie)|0,P=P+Math.imul(qe,Fe)|0,N=N+Math.imul(ge,Ke)|0,d=d+Math.imul(ge,Qe)|0,d=d+Math.imul($e,Ke)|0,P=P+Math.imul($e,Qe)|0,N=N+Math.imul(he,Re)|0,d=d+Math.imul(he,Ue)|0,d=d+Math.imul(Le,Re)|0,P=P+Math.imul(Le,Ue)|0,N=N+Math.imul(Pe,Ne)|0,d=d+Math.imul(Pe,Xe)|0,d=d+Math.imul(fe,Ne)|0,P=P+Math.imul(fe,Xe)|0,N=N+Math.imul(Te,Ze)|0,d=d+Math.imul(Te,et)|0,d=d+Math.imul(Me,Ze)|0,P=P+Math.imul(Me,et)|0;var dc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(dc>>>26)|0,dc&=67108863,N=Math.imul(je,Ie),d=Math.imul(je,Fe),d=d+Math.imul(Ve,Ie)|0,P=Math.imul(Ve,Fe),N=N+Math.imul(He,Ke)|0,d=d+Math.imul(He,Qe)|0,d=d+Math.imul(qe,Ke)|0,P=P+Math.imul(qe,Qe)|0,N=N+Math.imul(ge,Re)|0,d=d+Math.imul(ge,Ue)|0,d=d+Math.imul($e,Re)|0,P=P+Math.imul($e,Ue)|0,N=N+Math.imul(he,Ne)|0,d=d+Math.imul(he,Xe)|0,d=d+Math.imul(Le,Ne)|0,P=P+Math.imul(Le,Xe)|0,N=N+Math.imul(Pe,Ze)|0,d=d+Math.imul(Pe,et)|0,d=d+Math.imul(fe,Ze)|0,P=P+Math.imul(fe,et)|0;var pc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(pc>>>26)|0,pc&=67108863,N=Math.imul(je,Ke),d=Math.imul(je,Qe),d=d+Math.imul(Ve,Ke)|0,P=Math.imul(Ve,Qe),N=N+Math.imul(He,Re)|0,d=d+Math.imul(He,Ue)|0,d=d+Math.imul(qe,Re)|0,P=P+Math.imul(qe,Ue)|0,N=N+Math.imul(ge,Ne)|0,d=d+Math.imul(ge,Xe)|0,d=d+Math.imul($e,Ne)|0,P=P+Math.imul($e,Xe)|0,N=N+Math.imul(he,Ze)|0,d=d+Math.imul(he,et)|0,d=d+Math.imul(Le,Ze)|0,P=P+Math.imul(Le,et)|0;var mc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(mc>>>26)|0,mc&=67108863,N=Math.imul(je,Re),d=Math.imul(je,Ue),d=d+Math.imul(Ve,Re)|0,P=Math.imul(Ve,Ue),N=N+Math.imul(He,Ne)|0,d=d+Math.imul(He,Xe)|0,d=d+Math.imul(qe,Ne)|0,P=P+Math.imul(qe,Xe)|0,N=N+Math.imul(ge,Ze)|0,d=d+Math.imul(ge,et)|0,d=d+Math.imul($e,Ze)|0,P=P+Math.imul($e,et)|0;var gc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(gc>>>26)|0,gc&=67108863,N=Math.imul(je,Ne),d=Math.imul(je,Xe),d=d+Math.imul(Ve,Ne)|0,P=Math.imul(Ve,Xe),N=N+Math.imul(He,Ze)|0,d=d+Math.imul(He,et)|0,d=d+Math.imul(qe,Ze)|0,P=P+Math.imul(qe,et)|0;var vc=(R+N|0)+((d&8191)<<13)|0;R=(P+(d>>>13)|0)+(vc>>>26)|0,vc&=67108863,N=Math.imul(je,Ze),d=Math.imul(je,et),d=d+Math.imul(Ve,Ze)|0,P=Math.imul(Ve,et);var yc=(R+N|0)+((d&8191)<<13)|0;return R=(P+(d>>>13)|0)+(yc>>>26)|0,yc&=67108863,I[0]=Kn,I[1]=Qn,I[2]=Jn,I[3]=Yn,I[4]=Xn,I[5]=oc,I[6]=sc,I[7]=ac,I[8]=lc,I[9]=uc,I[10]=cc,I[11]=fc,I[12]=hc,I[13]=dc,I[14]=pc,I[15]=mc,I[16]=gc,I[17]=vc,I[18]=yc,R!==0&&(I[19]=R,A.length++),A};Math.imul||(w=x);function E(C,f,m){m.negative=f.negative^C.negative,m.length=C.length+f.length;for(var A=0,k=0,_=0;_>>26)|0,k+=I>>>26,I&=67108863}m.words[_]=R,A=I,I=k}return A!==0?m.words[_]=A:m.length--,m._strip()}function T(C,f,m){return E(C,f,m)}o.prototype.mulTo=function(f,m){var A,k=this.length+f.length;return this.length===10&&f.length===10?A=w(this,f,m):k<63?A=x(this,f,m):k<1024?A=E(this,f,m):A=T(this,f,m),A},o.prototype.mul=function(f){var m=new o(null);return m.words=new Array(this.length+f.length),this.mulTo(f,m)},o.prototype.mulf=function(f){var m=new o(null);return m.words=new Array(this.length+f.length),T(this,f,m)},o.prototype.imul=function(f){return this.clone().mulTo(f,this)},o.prototype.imuln=function(f){var m=f<0;m&&(f=-f),n(typeof f=="number"),n(f<67108864);for(var A=0,k=0;k>=26,A+=_/67108864|0,A+=I>>>26,this.words[k]=I&67108863}return A!==0&&(this.words[k]=A,this.length++),m?this.ineg():this},o.prototype.muln=function(f){return this.clone().imuln(f)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(f){var m=S(f);if(m.length===0)return new o(1);for(var A=this,k=0;k=0);var m=f%26,A=(f-m)/26,k=67108863>>>26-m<<26-m,_;if(m!==0){var I=0;for(_=0;_>>26-m}I&&(this.words[_]=I,this.length++)}if(A!==0){for(_=this.length-1;_>=0;_--)this.words[_+A]=this.words[_];for(_=0;_=0);var k;m?k=(m-m%26)/26:k=0;var _=f%26,I=Math.min((f-_)/26,this.length),R=67108863^67108863>>>_<<_,N=A;if(k-=I,k=Math.max(0,k),N){for(var d=0;dI)for(this.length-=I,d=0;d=0&&(P!==0||d>=k);d--){var X=this.words[d]|0;this.words[d]=P<<26-_|X>>>_,P=X&R}return N&&P!==0&&(N.words[N.length++]=P),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(f,m,A){return n(this.negative===0),this.iushrn(f,m,A)},o.prototype.shln=function(f){return this.clone().ishln(f)},o.prototype.ushln=function(f){return this.clone().iushln(f)},o.prototype.shrn=function(f){return this.clone().ishrn(f)},o.prototype.ushrn=function(f){return this.clone().iushrn(f)},o.prototype.testn=function(f){n(typeof f=="number"&&f>=0);var m=f%26,A=(f-m)/26,k=1<=0);var m=f%26,A=(f-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=A)return this;if(m!==0&&A++,this.length=Math.min(A,this.length),m!==0){var k=67108863^67108863>>>m<=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},o.prototype.isubn=function(f){if(n(typeof f=="number"),n(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m>26)-(N/67108864|0),this.words[_+A]=I&67108863}for(;_>26,this.words[_+A]=I&67108863;if(R===0)return this._strip();for(n(R===-1),R=0,_=0;_>26,this.words[_]=I&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(f,m){var A=this.length-f.length,k=this.clone(),_=f,I=_.words[_.length-1]|0,R=this._countBits(I);A=26-R,A!==0&&(_=_.ushln(A),k.iushln(A),I=_.words[_.length-1]|0);var N=k.length-_.length,d;if(m!=="mod"){d=new o(null),d.length=N+1,d.words=new Array(d.length);for(var P=0;P=0;y--){var B=(k.words[_.length+y]|0)*67108864+(k.words[_.length+y-1]|0);for(B=Math.min(B/I|0,67108863),k._ishlnsubmul(_,B,y);k.negative!==0;)B--,k.negative=0,k._ishlnsubmul(_,1,y),k.isZero()||(k.negative^=1);d&&(d.words[y]=B)}return d&&d._strip(),k._strip(),m!=="div"&&A!==0&&k.iushrn(A),{div:d||null,mod:k}},o.prototype.divmod=function(f,m,A){if(n(!f.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var k,_,I;return this.negative!==0&&f.negative===0?(I=this.neg().divmod(f,m),m!=="mod"&&(k=I.div.neg()),m!=="div"&&(_=I.mod.neg(),A&&_.negative!==0&&_.iadd(f)),{div:k,mod:_}):this.negative===0&&f.negative!==0?(I=this.divmod(f.neg(),m),m!=="mod"&&(k=I.div.neg()),{div:k,mod:I.mod}):this.negative&f.negative?(I=this.neg().divmod(f.neg(),m),m!=="div"&&(_=I.mod.neg(),A&&_.negative!==0&&_.isub(f)),{div:I.div,mod:_}):f.length>this.length||this.cmp(f)<0?{div:new o(0),mod:this}:f.length===1?m==="div"?{div:this.divn(f.words[0]),mod:null}:m==="mod"?{div:null,mod:new o(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new o(this.modrn(f.words[0]))}:this._wordDiv(f,m)},o.prototype.div=function(f){return this.divmod(f,"div",!1).div},o.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},o.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},o.prototype.divRound=function(f){var m=this.divmod(f);if(m.mod.isZero())return m.div;var A=m.div.negative!==0?m.mod.isub(f):m.mod,k=f.ushrn(1),_=f.andln(1),I=A.cmp(k);return I<0||_===1&&I===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},o.prototype.modrn=function(f){var m=f<0;m&&(f=-f),n(f<=67108863);for(var A=(1<<26)%f,k=0,_=this.length-1;_>=0;_--)k=(A*k+(this.words[_]|0))%f;return m?-k:k},o.prototype.modn=function(f){return this.modrn(f)},o.prototype.idivn=function(f){var m=f<0;m&&(f=-f),n(f<=67108863);for(var A=0,k=this.length-1;k>=0;k--){var _=(this.words[k]|0)+A*67108864;this.words[k]=_/f|0,A=_%f}return this._strip(),m?this.ineg():this},o.prototype.divn=function(f){return this.clone().idivn(f)},o.prototype.egcd=function(f){n(f.negative===0),n(!f.isZero());var m=this,A=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var k=new o(1),_=new o(0),I=new o(0),R=new o(1),N=0;m.isEven()&&A.isEven();)m.iushrn(1),A.iushrn(1),++N;for(var d=A.clone(),P=m.clone();!m.isZero();){for(var X=0,y=1;!(m.words[0]&y)&&X<26;++X,y<<=1);if(X>0)for(m.iushrn(X);X-- >0;)(k.isOdd()||_.isOdd())&&(k.iadd(d),_.isub(P)),k.iushrn(1),_.iushrn(1);for(var B=0,F=1;!(A.words[0]&F)&&B<26;++B,F<<=1);if(B>0)for(A.iushrn(B);B-- >0;)(I.isOdd()||R.isOdd())&&(I.iadd(d),R.isub(P)),I.iushrn(1),R.iushrn(1);m.cmp(A)>=0?(m.isub(A),k.isub(I),_.isub(R)):(A.isub(m),I.isub(k),R.isub(_))}return{a:I,b:R,gcd:A.iushln(N)}},o.prototype._invmp=function(f){n(f.negative===0),n(!f.isZero());var m=this,A=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var k=new o(1),_=new o(0),I=A.clone();m.cmpn(1)>0&&A.cmpn(1)>0;){for(var R=0,N=1;!(m.words[0]&N)&&R<26;++R,N<<=1);if(R>0)for(m.iushrn(R);R-- >0;)k.isOdd()&&k.iadd(I),k.iushrn(1);for(var d=0,P=1;!(A.words[0]&P)&&d<26;++d,P<<=1);if(d>0)for(A.iushrn(d);d-- >0;)_.isOdd()&&_.iadd(I),_.iushrn(1);m.cmp(A)>=0?(m.isub(A),k.isub(_)):(A.isub(m),_.isub(k))}var X;return m.cmpn(1)===0?X=k:X=_,X.cmpn(0)<0&&X.iadd(f),X},o.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var m=this.clone(),A=f.clone();m.negative=0,A.negative=0;for(var k=0;m.isEven()&&A.isEven();k++)m.iushrn(1),A.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;A.isEven();)A.iushrn(1);var _=m.cmp(A);if(_<0){var I=m;m=A,A=I}else if(_===0||A.cmpn(1)===0)break;m.isub(A)}while(!0);return A.iushln(k)},o.prototype.invm=function(f){return this.egcd(f).a.umod(f)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(f){return this.words[0]&f},o.prototype.bincn=function(f){n(typeof f=="number");var m=f%26,A=(f-m)/26,k=1<>>26,R&=67108863,this.words[I]=R}return _!==0&&(this.words[I]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(f){var m=f<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var A;if(this.length>1)A=1;else{m&&(f=-f),n(f<=67108863,"Number is too big");var k=this.words[0]|0;A=k===f?0:kf.length)return 1;if(this.length=0;A--){var k=this.words[A]|0,_=f.words[A]|0;if(k!==_){k<_?m=-1:k>_&&(m=1);break}}return m},o.prototype.gtn=function(f){return this.cmpn(f)===1},o.prototype.gt=function(f){return this.cmp(f)===1},o.prototype.gten=function(f){return this.cmpn(f)>=0},o.prototype.gte=function(f){return this.cmp(f)>=0},o.prototype.ltn=function(f){return this.cmpn(f)===-1},o.prototype.lt=function(f){return this.cmp(f)===-1},o.prototype.lten=function(f){return this.cmpn(f)<=0},o.prototype.lte=function(f){return this.cmp(f)<=0},o.prototype.eqn=function(f){return this.cmpn(f)===0},o.prototype.eq=function(f){return this.cmp(f)===0},o.red=function(f){return new ie(f)},o.prototype.toRed=function(f){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(f){return this.red=f,this},o.prototype.forceRed=function(f){return n(!this.red,"Already a number in reduction context"),this._forceRed(f)},o.prototype.redAdd=function(f){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},o.prototype.redIAdd=function(f){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},o.prototype.redSub=function(f){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},o.prototype.redISub=function(f){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},o.prototype.redShl=function(f){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},o.prototype.redMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},o.prototype.redIMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(f){return n(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var j={k256:null,p224:null,p192:null,p25519:null};function D(C,f){this.name=C,this.p=new o(f,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var f=new o(null);return f.words=new Array(Math.ceil(this.n/13)),f},D.prototype.ireduce=function(f){var m=f,A;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),A=m.bitLength();while(A>this.n);var k=A0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},D.prototype.split=function(f,m){f.iushrn(this.n,0,m)},D.prototype.imulK=function(f){return f.imul(this.k)};function $(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i($,D),$.prototype.split=function(f,m){for(var A=4194303,k=Math.min(f.length,9),_=0;_>>22,I=R}I>>>=22,f.words[_-10]=I,I===0&&f.length>10?f.length-=10:f.length-=9},$.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var m=0,A=0;A>>=26,f.words[A]=_,m=k}return m!==0&&(f.words[f.length++]=m),f},o._prime=function(f){if(j[f])return j[f];var m;if(f==="k256")m=new $;else if(f==="p224")m=new H;else if(f==="p192")m=new J;else if(f==="p25519")m=new Y;else throw new Error("Unknown prime "+f);return j[f]=m,m};function ie(C){if(typeof C=="string"){var f=o._prime(C);this.m=f.p,this.prime=f}else n(C.gtn(1),"modulus must be greater than 1"),this.m=C,this.prime=null}ie.prototype._verify1=function(f){n(f.negative===0,"red works only with positives"),n(f.red,"red works only with red numbers")},ie.prototype._verify2=function(f,m){n((f.negative|m.negative)===0,"red works only with positives"),n(f.red&&f.red===m.red,"red works only with red numbers")},ie.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},ie.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},ie.prototype.add=function(f,m){this._verify2(f,m);var A=f.add(m);return A.cmp(this.m)>=0&&A.isub(this.m),A._forceRed(this)},ie.prototype.iadd=function(f,m){this._verify2(f,m);var A=f.iadd(m);return A.cmp(this.m)>=0&&A.isub(this.m),A},ie.prototype.sub=function(f,m){this._verify2(f,m);var A=f.sub(m);return A.cmpn(0)<0&&A.iadd(this.m),A._forceRed(this)},ie.prototype.isub=function(f,m){this._verify2(f,m);var A=f.isub(m);return A.cmpn(0)<0&&A.iadd(this.m),A},ie.prototype.shl=function(f,m){return this._verify1(f),this.imod(f.ushln(m))},ie.prototype.imul=function(f,m){return this._verify2(f,m),this.imod(f.imul(m))},ie.prototype.mul=function(f,m){return this._verify2(f,m),this.imod(f.mul(m))},ie.prototype.isqr=function(f){return this.imul(f,f.clone())},ie.prototype.sqr=function(f){return this.mul(f,f)},ie.prototype.sqrt=function(f){if(f.isZero())return f.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var A=this.m.add(new o(1)).iushrn(2);return this.pow(f,A)}for(var k=this.m.subn(1),_=0;!k.isZero()&&k.andln(1)===0;)_++,k.iushrn(1);n(!k.isZero());var I=new o(1).toRed(this),R=I.redNeg(),N=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new o(2*d*d).toRed(this);this.pow(d,N).cmp(R)!==0;)d.redIAdd(R);for(var P=this.pow(d,k),X=this.pow(f,k.addn(1).iushrn(1)),y=this.pow(f,k),B=_;y.cmp(I)!==0;){for(var F=y,U=0;F.cmp(I)!==0;U++)F=F.redSqr();n(U=0;_--){for(var P=m.words[_],X=d-1;X>=0;X--){var y=P>>X&1;if(I!==k[0]&&(I=this.sqr(I)),y===0&&R===0){N=0;continue}R<<=1,R|=y,N++,!(N!==A&&(_!==0||X!==0))&&(I=this.mul(I,k[R]),N=0,R=0)}d=26}return I},ie.prototype.convertTo=function(f){var m=f.umod(this.m);return m===f?m.clone():m},ie.prototype.convertFrom=function(f){var m=f.clone();return m.red=null,m},o.mont=function(f){return new ae(f)};function ae(C){ie.call(this,C),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}i(ae,ie),ae.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},ae.prototype.convertFrom=function(f){var m=this.imod(f.mul(this.rinv));return m.red=null,m},ae.prototype.imul=function(f,m){if(f.isZero()||m.isZero())return f.words[0]=0,f.length=1,f;var A=f.imul(m),k=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=A.isub(k).iushrn(this.shift),I=_;return _.cmp(this.m)>=0?I=_.isub(this.m):_.cmpn(0)<0&&(I=_.iadd(this.m)),I._forceRed(this)},ae.prototype.mul=function(f,m){if(f.isZero()||m.isZero())return new o(0)._forceRed(this);var A=f.mul(m),k=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=A.isub(k).iushrn(this.shift),I=_;return _.cmp(this.m)>=0?I=_.isub(this.m):_.cmpn(0)<0&&(I=_.iadd(this.m)),I._forceRed(this)},ae.prototype.invm=function(f){var m=this.imod(f._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,ze)})(Ld);var eE=Ld.exports;const ce=Si(eE),tE="logger/5.7.0";let xp=!1,bp=!1;const bl={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ep=bl.default,Gc=null;function rE(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const Ap=rE();var vh;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(vh||(vh={}));var Ur;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Ur||(Ur={}));const _p="0123456789abcdef";class O{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();bl[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Ep>bl[n])&&console.log.apply(console,r)}debug(...e){this._log(O.levels.DEBUG,e)}info(...e){this._log(O.levels.INFO,e)}warn(...e){this._log(O.levels.WARNING,e)}makeError(e,r,n){if(bp)return this.makeError("censored error",r,{});r||(r=O.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let c="";for(let h=0;h>4],c+=_p[u[h]&15];i.push(l+"=Uint8Array(0x"+c+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const o=e;let s="";switch(r){case Ur.NUMERIC_FAULT:{s="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":s+="-"+l;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case Ur.CALL_EXCEPTION:case Ur.INSUFFICIENT_FUNDS:case Ur.MISSING_NEW:case Ur.NONCE_EXPIRED:case Ur.REPLACEMENT_UNDERPRICED:case Ur.TRANSACTION_REPLACED:case Ur.UNPREDICTABLE_GAS_LIMIT:s=r;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,O.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){Ap&&this.throwError("platform missing String.prototype.normalize",O.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ap})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,O.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,O.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",O.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",O.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Gc||(Gc=new O(tE)),Gc}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),xp){if(!e)return;this.globalLogger().throwError("error censorship permanent",O.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}bp=!!e,xp=!!r}static setLogLevel(e){const r=bl[e.toLowerCase()];if(r==null){O.globalLogger().warn("invalid log level - "+e);return}Ep=r}static from(e){return new O(e)}}O.errors=Ur;O.levels=vh;const nE="bytes/5.7.0",dt=new O(nE);function E1(t){return!!t.toHexString}function Oo(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Oo(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function jd(t){return me(t)&&!(t.length%2)||zu(t)}function Sp(t){return typeof t=="number"&&t==t&&t%1===0}function zu(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Sp(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function se(t,e){if(e||(e={}),typeof t=="number"){dt.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Oo(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),E1(t)&&(t=t.toHexString()),me(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":dt.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ise(i)),r=e.reduce((i,o)=>i+o.length,0),n=new Uint8Array(r);return e.reduce((i,o)=>(n.set(o,i),i+o.length),0),Oo(n)}function Ho(t){let e=se(t);if(e.length===0)return e;let r=0;for(;re&&dt.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Oo(r)}function me(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Wc="0123456789abcdef";function re(t,e){if(e||(e={}),typeof t=="number"){dt.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Wc[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),E1(t))return t.toHexString();if(me(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":dt.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(zu(t)){let r="0x";for(let n=0;n>4]+Wc[i&15]}return r}return dt.throwArgumentError("invalid hexlify value","value",t)}function Un(t){if(typeof t!="string")t=re(t);else if(!me(t)||t.length%2)return null;return(t.length-2)/2}function Rt(t,e,r){return typeof t!="string"?t=re(t):(!me(t)||t.length%2)&&dt.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function er(t){let e="0x";return t.forEach(r=>{e+=re(r).substring(2)}),e}function $u(t){const e=iE(re(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function iE(t){typeof t!="string"&&(t=re(t)),me(t)||dt.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&dt.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Hu(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(jd(t)){let r=se(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=re(r.slice(0,32)),e.s=re(r.slice(32,64))):r.length===65?(e.r=re(r.slice(0,32)),e.s=re(r.slice(32,64)),e.v=r[64]):dt.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:dt.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=re(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=El(se(e._vs),32);e._vs=re(i);const o=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&dt.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const s=re(i);e.s==null?e.s=s:e.s!==s&&dt.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?dt.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&dt.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!me(e.r)?dt.throwArgumentError("signature missing or invalid r","signature",t):e.r=mt(e.r,32),e.s==null||!me(e.s)?dt.throwArgumentError("signature missing or invalid s","signature",t):e.s=mt(e.s,32);const r=se(e.s);r[0]>=128&&dt.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=re(r);e._vs&&(me(e._vs)||dt.throwArgumentError("signature invalid _vs","signature",t),e._vs=mt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&dt.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const oE="bignumber/5.7.0";var aa=ce.BN;const Sn=new O(oE),Kc={},kp=9007199254740991;let Np=!1;class G{constructor(e,r){e!==Kc&&Sn.throwError("cannot call constructor directly; use BigNumber.from",O.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Yt(ye(this).fromTwos(e))}toTwos(e){return Yt(ye(this).toTwos(e))}abs(){return this._hex[0]==="-"?G.from(this._hex.substring(1)):this}add(e){return Yt(ye(this).add(ye(e)))}sub(e){return Yt(ye(this).sub(ye(e)))}div(e){return G.from(e).isZero()&&Er("division-by-zero","div"),Yt(ye(this).div(ye(e)))}mul(e){return Yt(ye(this).mul(ye(e)))}mod(e){const r=ye(e);return r.isNeg()&&Er("division-by-zero","mod"),Yt(ye(this).umod(r))}pow(e){const r=ye(e);return r.isNeg()&&Er("negative-power","pow"),Yt(ye(this).pow(r))}and(e){const r=ye(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","and"),Yt(ye(this).and(r))}or(e){const r=ye(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","or"),Yt(ye(this).or(r))}xor(e){const r=ye(e);return(this.isNegative()||r.isNeg())&&Er("unbound-bitwise-result","xor"),Yt(ye(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Er("negative-width","mask"),Yt(ye(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Er("negative-width","shl"),Yt(ye(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Er("negative-width","shr"),Yt(ye(this).shrn(e))}eq(e){return ye(this).eq(ye(e))}lt(e){return ye(this).lt(ye(e))}lte(e){return ye(this).lte(ye(e))}gt(e){return ye(this).gt(ye(e))}gte(e){return ye(this).gte(ye(e))}isNegative(){return this._hex[0]==="-"}isZero(){return ye(this).isZero()}toNumber(){try{return ye(this).toNumber()}catch{Er("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Sn.throwError("this platform does not support BigInt",O.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Np||(Np=!0,Sn.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Sn.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",O.errors.UNEXPECTED_ARGUMENT,{}):Sn.throwError("BigNumber.toString does not accept parameters",O.errors.UNEXPECTED_ARGUMENT,{})),ye(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof G)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new G(Kc,la(e)):e.match(/^-?[0-9]+$/)?new G(Kc,la(new aa(e))):Sn.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Er("underflow","BigNumber.from",e),(e>=kp||e<=-kp)&&Er("overflow","BigNumber.from",e),G.from(String(e));const r=e;if(typeof r=="bigint")return G.from(r.toString());if(zu(r))return G.from(re(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return G.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(me(n)||n[0]==="-"&&me(n.substring(1))))return G.from(n)}return Sn.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function la(t){if(typeof t!="string")return la(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Sn.throwArgumentError("invalid hex","value",t),t=la(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Yt(t){return G.from(la(t))}function ye(t){const e=G.from(t).toHexString();return e[0]==="-"?new aa("-"+e.substring(3),16):new aa(e.substring(2),16)}function Er(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Sn.throwError(t,O.errors.NUMERIC_FAULT,n)}function sE(t){return new aa(t,36).toString(16)}function aE(t){return new aa(t,16).toString(36)}const lE="properties/5.7.0";var uE=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const nu=new O(lE);function z(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function dr(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function wt(t){return uE(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(o=>({key:n,value:o}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function cE(t,e){(!t||typeof t!="object")&&nu.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||nu.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function ot(t){const e={};for(const r in t)e[r]=t[r];return e}const fE={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function A1(t){if(t==null||fE[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;ror(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&z(e,r,or(n))}return e}return nu.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function or(t){return hE(t)}class ka{constructor(e){for(const r in e)this[r]=or(e[r])}}const Na="abi/5.7.0",be=new O(Na),Wi={};let Mp={calldata:!0,memory:!0,storage:!0},dE={calldata:!0,memory:!0};function Ja(t,e){if(t==="bytes"||t==="string"){if(Mp[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&dE[e])return!0;return(Mp[e]||e==="payable")&&be.throwArgumentError("invalid modifier","name",e),!1}function pE(t,e){let r=t;function n(a){be.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let o={type:"",name:"",state:{allowType:!0}},s=o;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==ke.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===ke.full?", ":",")+")"):r+=this.type,e!==ke.sighash&&(this.indexed===!0&&(r+=" indexed"),e===ke.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?kt.fromString(e,r):kt.fromObject(e)}static fromObject(e){return kt.isParamType(e)?e:new kt(Wi,{name:e.name||null,type:so(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(kt.fromObject):null})}static fromString(e,r){function n(i){return kt.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(pE(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function ua(t,e){return vE(t).map(r=>kt.fromString(r,e))}class On{constructor(e,r){e!==Wi&&be.throwError("use a static from method",O.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Al(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return On.isFragment(e)?e:typeof e=="string"?On.fromString(e):On.fromObject(e)}static fromObject(e){if(On.isFragment(e))return e;switch(e.type){case"function":return an.fromObject(e);case"event":return Pn.fromObject(e);case"constructor":return sn.fromObject(e);case"error":return si.fromObject(e);case"fallback":case"receive":return null}return be.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Pn.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?an.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?sn.fromString(e.trim()):e.split(" ")[0]==="error"?si.fromString(e.substring(5).trim()):be.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Pn extends On{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ke.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ",e!==ke.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Pn.fromString(e):Pn.fromObject(e)}static fromObject(e){if(Pn.isEventFragment(e))return e;e.type!=="event"&&be.throwArgumentError("invalid event object","value",e);const r={name:ca(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(kt.fromObject):[],type:"event"};return new Pn(Wi,r)}static fromString(e){let r=e.match(fa);r||be.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:be.warn("unknown modifier: "+i)}}),Pn.fromObject({name:r[1].trim(),anonymous:n,inputs:ua(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function _1(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&be.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||be.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=G.from(r[1]),r[0]):t}function S1(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function k1(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&be.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&be.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&be.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&be.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&be.throwArgumentError("unable to determine stateMutability","value",t),e}class sn extends On{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===ke.sighash&&be.throwError("cannot format a constructor for sighash",O.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?sn.fromString(e):sn.fromObject(e)}static fromObject(e){if(sn.isConstructorFragment(e))return e;e.type!=="constructor"&&be.throwArgumentError("invalid constructor object","value",e);let r=k1(e);r.constant&&be.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(kt.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?G.from(e.gas):null};return new sn(Wi,n)}static fromString(e){let r={type:"constructor"};e=_1(e,r);let n=e.match(fa);return(!n||n[1].trim()!=="constructor")&&be.throwArgumentError("invalid constructor string","value",e),r.inputs=ua(n[2].trim(),!1),S1(n[3].trim(),r),sn.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class an extends sn{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ke.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ",e!==ke.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?an.fromString(e):an.fromObject(e)}static fromObject(e){if(an.isFunctionFragment(e))return e;e.type!=="function"&&be.throwArgumentError("invalid function object","value",e);let r=k1(e);const n={type:e.type,name:ca(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(kt.fromObject):[],outputs:e.outputs?e.outputs.map(kt.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?G.from(e.gas):null};return new an(Wi,n)}static fromString(e){let r={type:"function"};e=_1(e,r);let n=e.split(" returns ");n.length>2&&be.throwArgumentError("invalid function string","value",e);let i=n[0].match(fa);if(i||be.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&ca(r.name),r.inputs=ua(i[2],!1),S1(i[3].trim(),r),n.length>1){let o=n[1].match(fa);(o[1].trim()!=""||o[3].trim()!="")&&be.throwArgumentError("unexpected tokens","value",e),r.outputs=ua(o[2],!1)}else r.outputs=[];return an.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function Pp(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&be.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class si extends On{format(e){if(e||(e=ke.sighash),ke[e]||be.throwArgumentError("invalid format type","format",e),e===ke.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==ke.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===ke.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?si.fromString(e):si.fromObject(e)}static fromObject(e){if(si.isErrorFragment(e))return e;e.type!=="error"&&be.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:ca(e.name),inputs:e.inputs?e.inputs.map(kt.fromObject):[]};return Pp(new si(Wi,r))}static fromString(e){let r={type:"error"},n=e.match(fa);return n||be.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&ca(r.name),r.inputs=ua(n[2],!1),Pp(si.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function so(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const gE=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function ca(t){return(!t||!t.match(gE))&&be.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const fa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function vE(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&Bd.throwError("value out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Ut([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class iu{constructor(e,r,n,i){z(this,"_data",se(e)),z(this,"wordSize",r||32),z(this,"_coerceFunc",n),z(this,"allowLoose",i),this._offset=0}get data(){return re(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):iu.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:Bd.throwError("data out-of-bounds",O.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new iu(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return G.from(this.readBytes(this.wordSize))}}var N1={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(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&typeof self=="object",s=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?i=ze:o&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),c=[31,7936,2031616,520093696],h=[4,1024,262144,67108864],p=[1,256,65536,16777216],g=[6,1536,393216,100663296],v=[0,8,16,24],b=[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],S=[224,256,384,512],x=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],E={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(y){return Object.prototype.toString.call(y)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(y){return typeof y=="object"&&y.buffer&&y.buffer.constructor===ArrayBuffer});for(var T=function(y,B,F){return function(U){return new d(y,B,y).update(U)[F]()}},j=function(y,B,F){return function(U,V){return new d(y,B,V).update(U)[F]()}},D=function(y,B,F){return function(U,V,oe,Q){return f["cshake"+y].update(U,V,oe,Q)[F]()}},$=function(y,B,F){return function(U,V,oe,Q){return f["kmac"+y].update(U,V,oe,Q)[F]()}},H=function(y,B,F,U){for(var V=0;V>5,this.byteCount=this.blockCount<<2,this.outputBlocks=F>>5,this.extraBytes=(F&31)>>3;for(var U=0;U<50;++U)this.s[U]=0}d.prototype.update=function(y){if(this.finalized)throw new Error(r);var B,F=typeof y;if(F!=="string"){if(F==="object"){if(y===null)throw new Error(e);if(l&&y.constructor===ArrayBuffer)y=new Uint8Array(y);else if(!Array.isArray(y)&&(!l||!ArrayBuffer.isView(y)))throw new Error(e)}else throw new Error(e);B=!0}for(var U=this.blocks,V=this.byteCount,oe=y.length,Q=this.blockCount,W=0,Ye=this.s,K,le;W>2]|=y[W]<>2]|=le<>2]|=(192|le>>6)<>2]|=(128|le&63)<=57344?(U[K>>2]|=(224|le>>12)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<>2]|=(240|le>>18)<>2]|=(128|le>>12&63)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<=V){for(this.start=K-V,this.block=U[Q],K=0;K>8,F=y&255;F>0;)V.unshift(F),y=y>>8,F=y&255,++U;return B?V.push(U):V.unshift(U),this.update(V),V.length},d.prototype.encodeString=function(y){var B,F=typeof y;if(F!=="string"){if(F==="object"){if(y===null)throw new Error(e);if(l&&y.constructor===ArrayBuffer)y=new Uint8Array(y);else if(!Array.isArray(y)&&(!l||!ArrayBuffer.isView(y)))throw new Error(e)}else throw new Error(e);B=!0}var U=0,V=y.length;if(B)U=V;else for(var oe=0;oe=57344?U+=3:(Q=65536+((Q&1023)<<10|y.charCodeAt(++oe)&1023),U+=4)}return U+=this.encode(U*8),this.update(y),U},d.prototype.bytepad=function(y,B){for(var F=this.encode(B),U=0;U>2]|=this.padding[B&3],this.lastByteIndex===this.byteCount)for(y[0]=y[F],B=1;B>4&15]+u[W&15]+u[W>>12&15]+u[W>>8&15]+u[W>>20&15]+u[W>>16&15]+u[W>>28&15]+u[W>>24&15];oe%y===0&&(X(B),V=0)}return U&&(W=B[V],Q+=u[W>>4&15]+u[W&15],U>1&&(Q+=u[W>>12&15]+u[W>>8&15]),U>2&&(Q+=u[W>>20&15]+u[W>>16&15])),Q},d.prototype.arrayBuffer=function(){this.finalize();var y=this.blockCount,B=this.s,F=this.outputBlocks,U=this.extraBytes,V=0,oe=0,Q=this.outputBits>>3,W;U?W=new ArrayBuffer(F+1<<2):W=new ArrayBuffer(Q);for(var Ye=new Uint32Array(W);oe>8&255,Q[W+2]=Ye>>16&255,Q[W+3]=Ye>>24&255;oe%y===0&&X(B)}return U&&(W=oe<<2,Ye=B[V],Q[W]=Ye&255,U>1&&(Q[W+1]=Ye>>8&255),U>2&&(Q[W+2]=Ye>>16&255)),Q};function P(y,B,F){d.call(this,y,B,F)}P.prototype=new d,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),d.prototype.finalize.call(this)};var X=function(y){var B,F,U,V,oe,Q,W,Ye,K,le,Yr,Te,Me,Xr,Pe,fe,xr,he,Le,Zr,ge,$e,bn,He,qe,qt,je,Ve,Or,Ce,Ge,En,Be,We,An,De,ne,st,ve,de,nt,_e,Se,Pt,Ie,Fe,Qt,Ke,Qe,Jt,Re,Ue,br,Ne,Xe,Ci,Ze,et,Kn,Qn,Jn,Yn,Xn;for(U=0;U<48;U+=2)V=y[0]^y[10]^y[20]^y[30]^y[40],oe=y[1]^y[11]^y[21]^y[31]^y[41],Q=y[2]^y[12]^y[22]^y[32]^y[42],W=y[3]^y[13]^y[23]^y[33]^y[43],Ye=y[4]^y[14]^y[24]^y[34]^y[44],K=y[5]^y[15]^y[25]^y[35]^y[45],le=y[6]^y[16]^y[26]^y[36]^y[46],Yr=y[7]^y[17]^y[27]^y[37]^y[47],Te=y[8]^y[18]^y[28]^y[38]^y[48],Me=y[9]^y[19]^y[29]^y[39]^y[49],B=Te^(Q<<1|W>>>31),F=Me^(W<<1|Q>>>31),y[0]^=B,y[1]^=F,y[10]^=B,y[11]^=F,y[20]^=B,y[21]^=F,y[30]^=B,y[31]^=F,y[40]^=B,y[41]^=F,B=V^(Ye<<1|K>>>31),F=oe^(K<<1|Ye>>>31),y[2]^=B,y[3]^=F,y[12]^=B,y[13]^=F,y[22]^=B,y[23]^=F,y[32]^=B,y[33]^=F,y[42]^=B,y[43]^=F,B=Q^(le<<1|Yr>>>31),F=W^(Yr<<1|le>>>31),y[4]^=B,y[5]^=F,y[14]^=B,y[15]^=F,y[24]^=B,y[25]^=F,y[34]^=B,y[35]^=F,y[44]^=B,y[45]^=F,B=Ye^(Te<<1|Me>>>31),F=K^(Me<<1|Te>>>31),y[6]^=B,y[7]^=F,y[16]^=B,y[17]^=F,y[26]^=B,y[27]^=F,y[36]^=B,y[37]^=F,y[46]^=B,y[47]^=F,B=le^(V<<1|oe>>>31),F=Yr^(oe<<1|V>>>31),y[8]^=B,y[9]^=F,y[18]^=B,y[19]^=F,y[28]^=B,y[29]^=F,y[38]^=B,y[39]^=F,y[48]^=B,y[49]^=F,Xr=y[0],Pe=y[1],Fe=y[11]<<4|y[10]>>>28,Qt=y[10]<<4|y[11]>>>28,Ve=y[20]<<3|y[21]>>>29,Or=y[21]<<3|y[20]>>>29,Qn=y[31]<<9|y[30]>>>23,Jn=y[30]<<9|y[31]>>>23,_e=y[40]<<18|y[41]>>>14,Se=y[41]<<18|y[40]>>>14,We=y[2]<<1|y[3]>>>31,An=y[3]<<1|y[2]>>>31,fe=y[13]<<12|y[12]>>>20,xr=y[12]<<12|y[13]>>>20,Ke=y[22]<<10|y[23]>>>22,Qe=y[23]<<10|y[22]>>>22,Ce=y[33]<<13|y[32]>>>19,Ge=y[32]<<13|y[33]>>>19,Yn=y[42]<<2|y[43]>>>30,Xn=y[43]<<2|y[42]>>>30,Ne=y[5]<<30|y[4]>>>2,Xe=y[4]<<30|y[5]>>>2,De=y[14]<<6|y[15]>>>26,ne=y[15]<<6|y[14]>>>26,he=y[25]<<11|y[24]>>>21,Le=y[24]<<11|y[25]>>>21,Jt=y[34]<<15|y[35]>>>17,Re=y[35]<<15|y[34]>>>17,En=y[45]<<29|y[44]>>>3,Be=y[44]<<29|y[45]>>>3,He=y[6]<<28|y[7]>>>4,qe=y[7]<<28|y[6]>>>4,Ci=y[17]<<23|y[16]>>>9,Ze=y[16]<<23|y[17]>>>9,st=y[26]<<25|y[27]>>>7,ve=y[27]<<25|y[26]>>>7,Zr=y[36]<<21|y[37]>>>11,ge=y[37]<<21|y[36]>>>11,Ue=y[47]<<24|y[46]>>>8,br=y[46]<<24|y[47]>>>8,Pt=y[8]<<27|y[9]>>>5,Ie=y[9]<<27|y[8]>>>5,qt=y[18]<<20|y[19]>>>12,je=y[19]<<20|y[18]>>>12,et=y[29]<<7|y[28]>>>25,Kn=y[28]<<7|y[29]>>>25,de=y[38]<<8|y[39]>>>24,nt=y[39]<<8|y[38]>>>24,$e=y[48]<<14|y[49]>>>18,bn=y[49]<<14|y[48]>>>18,y[0]=Xr^~fe&he,y[1]=Pe^~xr&Le,y[10]=He^~qt&Ve,y[11]=qe^~je&Or,y[20]=We^~De&st,y[21]=An^~ne&ve,y[30]=Pt^~Fe&Ke,y[31]=Ie^~Qt&Qe,y[40]=Ne^~Ci&et,y[41]=Xe^~Ze&Kn,y[2]=fe^~he&Zr,y[3]=xr^~Le&ge,y[12]=qt^~Ve&Ce,y[13]=je^~Or&Ge,y[22]=De^~st&de,y[23]=ne^~ve&nt,y[32]=Fe^~Ke&Jt,y[33]=Qt^~Qe&Re,y[42]=Ci^~et&Qn,y[43]=Ze^~Kn&Jn,y[4]=he^~Zr&$e,y[5]=Le^~ge&bn,y[14]=Ve^~Ce&En,y[15]=Or^~Ge&Be,y[24]=st^~de&_e,y[25]=ve^~nt&Se,y[34]=Ke^~Jt&Ue,y[35]=Qe^~Re&br,y[44]=et^~Qn&Yn,y[45]=Kn^~Jn&Xn,y[6]=Zr^~$e&Xr,y[7]=ge^~bn&Pe,y[16]=Ce^~En&He,y[17]=Ge^~Be&qe,y[26]=de^~_e&We,y[27]=nt^~Se&An,y[36]=Jt^~Ue&Pt,y[37]=Re^~br&Ie,y[46]=Qn^~Yn&Ne,y[47]=Jn^~Xn&Xe,y[8]=$e^~Xr&fe,y[9]=bn^~Pe&xr,y[18]=En^~He&qt,y[19]=Be^~qe&je,y[28]=_e^~We&De,y[29]=Se^~An&ne,y[38]=Ue^~Pt&Fe,y[39]=br^~Ie&Qt,y[48]=Yn^~Ne&Ci,y[49]=Xn^~Xe&Ze,y[0]^=b[U],y[1]^=b[U+1]};if(a)t.exports=f;else for(A=0;A>=8;return e}function Cp(t,e,r){let n=0;for(let i=0;ie+1+n&&nn.throwError("child data too short",O.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function M1(t,e){if(t.length===0&&nn.throwError("data too short",O.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&nn.throwError("data short segment too short",O.errors.BUFFER_OVERRUN,{});const n=Cp(t,e+1,r);return e+1+r+n>t.length&&nn.throwError("data long segment too short",O.errors.BUFFER_OVERRUN,{}),Ip(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{}),Ip(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const n=Cp(t,e+1,r);e+1+r+n>t.length&&nn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const i=re(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&nn.throwError("data too short",O.errors.BUFFER_OVERRUN,{});const n=re(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:re(t[e])}}function Dd(t){const e=se(t),r=M1(e,0);return r.consumed!==e.length&&nn.throwArgumentError("invalid rlp data","data",t),r.result}const EE="address/5.7.0",fi=new O(EE);function Rp(t){me(t,20)||fi.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=se(ct(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const AE=9007199254740991;function _E(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Fd={};for(let t=0;t<10;t++)Fd[String(t)]=String(t);for(let t=0;t<26;t++)Fd[String.fromCharCode(65+t)]=String(10+t);const Op=Math.floor(_E(AE));function P1(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Fd[n]).join("");for(;e.length>=Op;){let n=e.substring(0,Op);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function gt(t){let e=null;if(typeof t!="string"&&fi.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Rp(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fi.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==P1(t)&&fi.throwArgumentError("bad icap checksum","address",t),e=sE(t.substring(4));e.length<40;)e="0"+e;e=Rp("0x"+e)}else fi.throwArgumentError("invalid address","address",t);return e}function SE(t){try{return gt(t),!0}catch{}return!1}function kE(t){let e=aE(gt(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+P1("XE00"+e)+e}function Ud(t){let e=null;try{e=gt(t.from)}catch{fi.throwArgumentError("missing from address","transaction",t)}const r=Ho(se(G.from(t.nonce).toHexString()));return gt(Rt(ct(qu([e,r])),12))}function NE(t,e,r){return Un(e)!==32&&fi.throwArgumentError("salt must be 32 bytes","salt",e),Un(r)!==32&&fi.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),gt(Rt(ct(Ut(["0xff",gt(t),e,r])),12))}const ME=Object.freeze(Object.defineProperty({__proto__:null,getAddress:gt,getContractAddress:Ud,getCreate2Address:NE,getIcapAddress:kE,isAddress:SE},Symbol.toStringTag,{value:"Module"}));class PE extends qn{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=gt(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return gt(mt(e.readValue().toHexString(),20))}}class CE extends qn{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Eo=new O(Na);function C1(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const c=u.localName;return c||Eo.throwError("cannot encode object for signature with missing names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]&&Eo.throwError("cannot encode object for signature with duplicate names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]=!0,r[c]})}else Eo.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Eo.throwArgumentError("types/value length mismatch","tuple",r);let i=new yh(t.wordSize),o=new yh(t.wordSize),s=[];e.forEach((l,u)=>{let c=n[u];if(l.dynamic){let h=o.length;l.encode(o,c);let p=i.writeUpdatableValue();s.push(g=>{p(g+h)})}else l.encode(i,c)}),s.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(o),a}function I1(t,e){let r=[],n=t.subReader(0);e.forEach(o=>{let s=null;if(o.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{s=o.decode(l)}catch(u){if(u.code===O.errors.BUFFER_OVERRUN)throw u;s=u,s.baseType=o.name,s.name=o.localName,s.type=o.type}}else try{s=o.decode(t)}catch(a){if(a.code===O.errors.BUFFER_OVERRUN)throw a;s=a,s.baseType=o.name,s.name=o.localName,s.type=o.type}s!=null&&r.push(s)});const i=e.reduce((o,s)=>{const a=s.localName;return a&&(o[a]||(o[a]=0),o[a]++),o},{});e.forEach((o,s)=>{let a=o.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[s];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let o=0;o{throw s}})}return Object.freeze(r)}class IE extends qn{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",o=r===-1||e.dynamic;super("array",i,n,o),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Eo.throwError("insufficient data length",O.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;s++)o++;return o}return t===cr.OVERRUN?r.length-e-1:0}function qE(t,e,r,n,i){return t===cr.OVERLONG?(n.push(i),0):(n.push(65533),L1(t,e,r))}const VE=Object.freeze({error:HE,ignore:L1,replace:qE});function j1(t,e){e==null&&(e=VE.error),t=se(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let o=null,s=null;if((i&224)===192)o=1,s=127;else if((i&240)===224)o=2,s=2047;else if((i&248)===240)o=3,s=65535;else{(i&192)===128?n+=e(cr.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(cr.BAD_PREFIX,n-1,t,r);continue}if(n-1+o>=t.length){n+=e(cr.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-o-1)-1;for(let l=0;l1114111){n+=e(cr.OUT_OF_RANGE,n-1-o,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(cr.UTF16_SURROGATE,n-1-o,t,r,a);continue}if(a<=s){n+=e(cr.OVERLONG,n-1-o,t,r,a);continue}r.push(a)}}return r}function gr(t,e=ha.current){e!=ha.current&&(T1.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const o=t.charCodeAt(n);if(n>=t.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const s=65536+((i&1023)<<10)+(o&1023);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return se(r)}function GE(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ma(t,e){return GE(j1(t,e))}function WE(t,e=ha.current){return j1(gr(t,e))}class KE extends R1{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,gr(r))}decode(e){return Ma(super.decode(e))}}class Ya extends qn{constructor(e,r){let n=!1;const i=[];e.forEach(s=>{s.dynamic&&(n=!0),i.push(s.type)});const o="tuple("+i.join(",")+")";super("tuple",o,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const o=i.localName;return o&&(n[o]||(n[o]=0),n[o]++),n},{});return this.coders.forEach((n,i)=>{let o=n.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),e[o]==null&&(e[o]=e[i]))}),Object.freeze(e)}encode(e,r){return C1(e,this.coders,r)}decode(e){return e.coerce(this.name,I1(e,this.coders))}}const Xa=new O(Na),QE=new RegExp(/^bytes([0-9]*)$/),JE=new RegExp(/^(u?int)([0-9]*)$/);class YE{constructor(e){z(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new PE(e.name);case"bool":return new RE(e.name);case"string":return new KE(e.name);case"bytes":return new OE(e.name);case"array":return new IE(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Ya((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new LE(e.name)}let r=e.type.match(JE);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&Xa.throwArgumentError("invalid "+r[1]+" bit length","param",e),new zE(n/8,r[1]==="int",e.name)}if(r=e.type.match(QE),r){let n=parseInt(r[1]);return(n===0||n>32)&&Xa.throwArgumentError("invalid bytes length","param",e),new TE(n,e.name)}return Xa.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new iu(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new yh(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(kt.from(i)));return new Ya(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&Xa.throwError("types/values length mismatch",O.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(s=>this._getCoder(kt.from(s))),i=new Ya(n,"_"),o=this._getWriter();return i.encode(o,r),o.data}decode(e,r,n){const i=e.map(s=>this._getCoder(kt.from(s)));return new Ya(i,"_").decode(this._getReader(se(r),n))}}const XE=new YE;function Ao(t){return ct(gr(t))}const B1="hash/5.7.0";function D1(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,s-1):r.push(a)})};return i(t,e),r}function ZE(t){const e={};for(let r=0;r>--l&1}const h=31,p=Math.pow(2,h),g=p>>>1,v=g>>1,b=p-1;let S=0;for(let j=0;j1;){let Y=D+$>>>1;j>>1|c(),H=H<<1^g,J=(J^g)<<1|g|1;w=H,E=1+J-H}let T=n-4;return x.map(j=>{switch(j-T){case 3:return T+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return T+256+(t[a++]<<8|t[a++]);case 1:return T+t[a++];default:return j-1}})}function t3(t){let e=0;return()=>t[e++]}function r3(t){return t3(e3(t))}function n3(t){return t&1?~t>>1:t>>1}function i3(t,e){let r=Array(t);for(let n=0;ne[s]):r}function s3(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(l3(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(u3(r,t))}return ZE(U1(e))}function a3(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function z1(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[s].push(o));return n}function l3(t,e){let r=1+e(),n=e(),i=a3(e),o=z1(i.length,1+t,e);return U1(o.map((s,a)=>{const l=s[0],u=s.slice(1);return Array(i[a]).fill(void 0).map((c,h)=>{let p=h*n;return[l+h*r,u.map(g=>g+p)]})}))}function u3(t,e){let r=1+e();return z1(r,1+t,e).map(i=>[i[0],i.slice(1)])}function c3(t){let e=ou(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=ou(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,c)=>c.set.size-u.set.size);let i=t(),o=i%3;i=i/3|0;let s=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:o,fe0f:s,save:a,check:l}}}function f3(){return r3(D1("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Vu=f3(),h3=new Set(ou(Vu)),d3=new Set(ou(Vu)),p3=s3(Vu),m3=c3(Vu),Lp=45,jp=95;function $1(t){return WE(t)}function g3(t){return t.filter(e=>e!=65039)}function H1(t){for(let e of t.split(".")){let r=$1(e);try{for(let n=r.lastIndexOf(jp)-1;n>=0;n--)if(r[n]!==jp)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===Lp&&r[3]===Lp)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function v3(t){return H1(y3(t,g3))}function y3(t,e){let r=$1(t).reverse(),n=[];for(;r.length;){let i=x3(r);if(i){n.push(...e(i));continue}let o=r.pop();if(h3.has(o)){n.push(o);continue}if(d3.has(o))continue;let s=p3[o];if(s){n.push(...s);continue}throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return H1(w3(String.fromCodePoint(...n)))}function w3(t){return t.normalize("NFC")}function x3(t,e){var r;let n=m3,i,o,s=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)o=l;else if(n.check&&l===o)break;s.push(l),n.fe0f&&(s.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=s.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const b3=new O(B1),q1=new Uint8Array(32);q1.fill(0);function Bp(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function V1(t){const e=gr(v3(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(Bp(e.slice(n))),r}function _l(t){typeof t!="string"&&b3.throwArgumentError("invalid ENS name; not a string","name",t);let e=q1;const r=V1(t);for(;r.length;)e=ct(Ut([e,ct(r.pop())]));return re(e)}function E3(t){return re(Ut(V1(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var A3=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const lt=new O(B1),G1=new Uint8Array(32);G1.fill(0);const _3=G.from(-1),W1=G.from(0),K1=G.from(1),S3=G.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function k3(t){const e=se(t),r=e.length%32;return r?er([e,G1.slice(r)]):re(e)}const N3=mt(K1.toHexString(),32),M3=mt(W1.toHexString(),32),Dp={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Qc=["name","version","chainId","verifyingContract","salt"];function Fp(t){return function(e){return typeof e!="string"&<.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const P3={name:Fp("name"),version:Fp("version"),chainId:function(t){try{return G.from(t).toString()}catch{}return lt.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}return lt.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=se(t);if(e.length!==32)throw new Error("bad length");return re(e)}catch{}return lt.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Jc(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&<.throwArgumentError("invalid numeric width","type",t);const i=S3.mask(r?n-1:n),o=r?i.add(K1).mul(_3):W1;return function(s){const a=G.from(s);return(a.lt(o)||a.gt(i))&<.throwArgumentError(`value out-of-bounds for ${t}`,"value",s),mt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&<.throwArgumentError("invalid bytes width","type",t),function(n){return se(n).length!==r&<.throwArgumentError(`invalid length for ${t}`,"value",n),k3(n)}}}switch(t){case"address":return function(e){return mt(gt(e),32)};case"bool":return function(e){return e?N3:M3};case"bytes":return function(e){return ct(e)};case"string":return function(e){return Ao(e)}}return null}function Up(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class lr{constructor(e){z(this,"types",Object.freeze(or(e))),z(this,"_encoderCache",{}),z(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&<.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const c=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];c===a&<.throwArgumentError(`circular type reference to ${JSON.stringify(c)}`,"types",e),!Jc(c)&&(n[c]||lt.throwArgumentError(`unknown type ${JSON.stringify(c)}`,"types",e),n[c].push(a),r[a][c]=!0)})}const o=Object.keys(n).filter(a=>n[a].length===0);o.length===0?lt.throwArgumentError("missing primary type","types",e):o.length>1&<.throwArgumentError(`ambiguous primary types or unused types: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),z(this,"primaryType",o[0]);function s(a,l){l[a]&<.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(s(u,l),Object.keys(l).forEach(c=>{i[c][u]=!0}))}),delete l[a]}s(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=Up(a,e[a])+l.map(u=>Up(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Jc(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],o=this.getEncoder(i),s=parseInt(r[3]);return a=>{s>=0&&a.length!==s&<.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(o);return this._types[i]&&(l=l.map(ct)),ct(er(l))}}const n=this.types[e];if(n){const i=Ao(this._types[e]);return o=>{const s=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(o[a]);return this._types[l]?ct(u):u});return s.unshift(i),er(s)}}return lt.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||lt.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return ct(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Jc(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const s=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&<.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(s,l,n))}const o=this.types[e];return o?o.reduce((s,{name:a,type:l})=>(s[a]=this._visit(l,r[a],n),s),{}):lt.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new lr(e)}static getPrimaryType(e){return lr.from(e).primaryType}static hashStruct(e,r,n){return lr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=Dp[n];i||lt.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Qc.indexOf(n.name)-Qc.indexOf(i.name)),lr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return er(["0x1901",lr.hashDomain(e),lr.from(r).hash(n)])}static hash(e,r,n){return ct(lr.encode(e,r,n))}static resolveNames(e,r,n,i){return A3(this,void 0,void 0,function*(){e=ot(e);const o={};e.verifyingContract&&!me(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const s=lr.from(r);s.visit(n,(a,l)=>(a==="address"&&!me(l,20)&&(o[l]="0x"),l));for(const a in o)o[a]=yield i(a);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),n=s.visit(n,(a,l)=>a==="address"&&o[l]?o[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){lr.hashDomain(e);const i={},o=[];Qc.forEach(l=>{const u=e[l];u!=null&&(i[l]=P3[l](u),o.push({name:l,type:Dp[l]}))});const s=lr.from(r),a=ot(r);return a.EIP712Domain?lt.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=o,s.encode(n),{types:a,domain:i,primaryType:s.primaryType,message:s.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return re(se(u));if(l.match(/^u?int/))return G.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&<.throwArgumentError("invalid string","value",u),u}return lt.throwArgumentError("unsupported type","type",l)})}}}const at=new O(Na);class C3 extends ka{}class I3 extends ka{}class R3 extends ka{}class wh extends ka{static isIndexed(e){return!!(e&&e._isIndexed)}}const O3={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function zp(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class xh{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,z(this,"fragments",r.map(n=>On.from(n)).filter(n=>n!=null)),z(this,"_abiCoder",dr(new.target,"getAbiCoder")()),z(this,"functions",{}),z(this,"errors",{}),z(this,"events",{}),z(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){at.warn("duplicate definition - constructor");return}z(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let o=n.format();if(i[o]){at.warn("duplicate definition - "+o);return}i[o]=n}),this.deploy||z(this,"deploy",an.from({payable:!1,type:"constructor"})),z(this,"_isInterface",!0)}format(e){e||(e=ke.full),e===ke.sighash&&at.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===ke.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return XE}static getAddress(e){return gt(e)}static getSighash(e){return Rt(Ao(e.format()),0,4)}static getEventTopic(e){return Ao(e.format())}getFunction(e){if(me(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];at.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(o=>o.split("(")[0]===n);return i.length===0?at.throwArgumentError("no matching function","name",n):i.length>1&&at.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[ln.fromString(e).format()];return r||at.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(me(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];at.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(o=>o.split("(")[0]===n);return i.length===0?at.throwArgumentError("no matching event","name",n):i.length>1&&at.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Pn.fromString(e).format()];return r||at.throwArgumentError("no matching event","signature",e),r}getError(e){if(me(e)){const n=dr(this.constructor,"getSighash");for(const i in this.errors){const o=this.errors[i];if(e===n(o))return this.errors[i]}at.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(o=>o.split("(")[0]===n);return i.length===0?at.throwArgumentError("no matching error","name",n):i.length>1&&at.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[ln.fromString(e).format()];return r||at.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return dr(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),dr(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=se(r);return re(n.slice(0,4))!==this.getSighash(e)&&at.throwArgumentError(`data signature does not match error ${e.name}.`,"data",re(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),re(Ut([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=se(r);return re(n.slice(0,4))!==this.getSighash(e)&&at.throwArgumentError(`data signature does not match function ${e.name}.`,"data",re(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),re(Ut([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=se(r),i=null,o="",s=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=re(n.slice(0,4)),c=O3[u];if(c)s=this._abiCoder.decode(c.inputs,n.slice(4)),a=c.name,l=c.signature,c.reason&&(i=s[0]),a==="Error"?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:a==="Panic"&&(o=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const h=this.getError(u);s=this._abiCoder.decode(h.inputs,n.slice(4)),a=h.name,l=h.format()}catch{}break}}return at.throwError("call revert exception"+o,O.errors.CALL_EXCEPTION,{method:e.format(),data:re(r),errorArgs:s,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),re(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&at.throwError("too many arguments for "+e.format(),O.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(o,s)=>o.type==="string"?Ao(s):o.type==="bytes"?ct(re(s)):(o.type==="bool"&&typeof s=="boolean"&&(s=s?"0x01":"0x00"),o.type.match(/^u?int/)&&(s=G.from(s).toHexString()),o.type==="address"&&this._abiCoder.encode(["address"],[s]),mt(re(s),32));for(r.forEach((o,s)=>{let a=e.inputs[s];if(!a.indexed){o!=null&&at.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,o);return}o==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?at.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,o):Array.isArray(o)?n.push(o.map(l=>i(a,l))):n.push(i(a,o))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&at.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((s,a)=>{const l=r[a];if(s.indexed)if(s.type==="string")n.push(Ao(l));else if(s.type==="bytes")n.push(ct(l));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([s.type],[l]))}else i.push(s),o.push(l)}),{data:this._abiCoder.encode(i,o),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let p=this.getEventTopic(e);(!me(n[0],32)||n[0].toLowerCase()!==p)&&at.throwError("fragment/topic mismatch",O.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:p,value:n[0]}),n=n.slice(1)}let i=[],o=[],s=[];e.inputs.forEach((p,g)=>{p.indexed?p.type==="string"||p.type==="bytes"||p.baseType==="tuple"||p.baseType==="array"?(i.push(kt.fromObject({type:"bytes32",name:p.name})),s.push(!0)):(i.push(p),s.push(!1)):(o.push(p),s.push(!1))});let a=n!=null?this._abiCoder.decode(i,Ut(n)):null,l=this._abiCoder.decode(o,r,!0),u=[],c=0,h=0;e.inputs.forEach((p,g)=>{if(p.indexed)if(a==null)u[g]=new wh({_isIndexed:!0,hash:null});else if(s[g])u[g]=new wh({_isIndexed:!0,hash:a[h++]});else try{u[g]=a[h++]}catch(v){u[g]=v}else try{u[g]=l[c++]}catch(v){u[g]=v}if(p.name&&u[p.name]==null){const v=u[g];v instanceof Error?Object.defineProperty(u,p.name,{enumerable:!0,get:()=>{throw zp(`property ${JSON.stringify(p.name)}`,v)}}):u[p.name]=v}});for(let p=0;p{throw zp(`index ${p}`,g)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new I3({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:G.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new C3({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=re(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new R3({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const T3="abstract-provider/5.7.0";var L3=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const j3=new O(T3);class B3 extends ka{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class es{constructor(){j3.checkAbstract(new.target,es),z(this,"_isProvider",!0)}getFeeData(){return L3(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield wt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(s=>null)});let n=null,i=null,o=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,o=G.from("1500000000"),i=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:o,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const D3="abstract-signer/5.7.0";var Lr=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ar=new O(D3),F3=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],U3=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];class Pa{constructor(){Ar.checkAbstract(new.target,Pa),z(this,"_isSigner",!0)}getBalance(e){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Lr(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield wt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Lr(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield wt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Lr(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Lr(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)F3.indexOf(n)===-1&&Ar.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=ot(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Ar.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Lr(this,void 0,void 0,function*(){const r=yield wt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Lr(this,void 0,void 0,function*(){if(i==null)return null;const o=yield this.resolveName(i);return o==null&&Ar.throwArgumentError("provided ENS name resolves to null","tx.to",i),o})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Ar.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ar.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const o=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Ar.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ar.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(U3.indexOf(i.code)>=0)throw i;return Ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Ar.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield wt(r)})}_checkProvider(e){this.provider||Ar.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class zd extends Pa{constructor(e,r){super(),z(this,"address",e),z(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ar.throwError(e,O.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new zd(this.address,e)}}var Q1={},xe={},Ca=J1;function J1(t,e){if(!t)throw new Error(e||"Assertion failed")}J1.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var bh={exports:{}};typeof Object.create=="function"?bh.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:bh.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var z3=bh.exports,$3=Ca,H3=z3;xe.inherits=H3;function q3(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function V3(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=o&63|128):q3(t,i)?(o=65536+((o&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}xe.htonl=Y1;function W3(t,e){for(var r="",n=0;n>>0}return o}xe.join32=K3;function Q3(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}xe.split32=Q3;function J3(t,e){return t>>>e|t<<32-e}xe.rotr32=J3;function Y3(t,e){return t<>>32-e}xe.rotl32=Y3;function X3(t,e){return t+e>>>0}xe.sum32=X3;function Z3(t,e,r){return t+e+r>>>0}xe.sum32_3=Z3;function eA(t,e,r,n){return t+e+r+n>>>0}xe.sum32_4=eA;function tA(t,e,r,n,i){return t+e+r+n+i>>>0}xe.sum32_5=tA;function rA(t,e,r,n){var i=t[e],o=t[e+1],s=n+o>>>0,a=(s>>0,t[e+1]=s}xe.sum64=rA;function nA(t,e,r,n){var i=e+n>>>0,o=(i>>0}xe.sum64_hi=nA;function iA(t,e,r,n){var i=e+n;return i>>>0}xe.sum64_lo=iA;function oA(t,e,r,n,i,o,s,a){var l=0,u=e;u=u+n>>>0,l+=u>>0,l+=u>>0,l+=u>>0}xe.sum64_4_hi=oA;function sA(t,e,r,n,i,o,s,a){var l=e+n+o+a;return l>>>0}xe.sum64_4_lo=sA;function aA(t,e,r,n,i,o,s,a,l,u){var c=0,h=e;h=h+n>>>0,c+=h>>0,c+=h>>0,c+=h>>0,c+=h>>0}xe.sum64_5_hi=aA;function lA(t,e,r,n,i,o,s,a,l,u){var c=e+n+o+a+u;return c>>>0}xe.sum64_5_lo=lA;function uA(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}xe.rotr64_hi=uA;function cA(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}xe.rotr64_lo=cA;function fA(t,e,r){return t>>>r}xe.shr64_hi=fA;function hA(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}xe.shr64_lo=hA;var ts={},$p=xe,dA=Ca;function Gu(){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}ts.BlockHash=Gu;Gu.prototype.update=function(e,r){if(e=$p.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=$p.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[o++]=e>>>16&255,i[o++]=e>>>8&255,i[o++]=e&255}else for(i[o++]=e&255,i[o++]=e>>>8&255,i[o++]=e>>>16&255,i[o++]=e>>>24&255,i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=0,s=8;s>>3}xn.g0_256=yA;function wA(t){return hn(t,17)^hn(t,19)^t>>>10}xn.g1_256=wA;var qo=xe,xA=ts,bA=xn,Yc=qo.rotl32,ps=qo.sum32,EA=qo.sum32_5,AA=bA.ft_1,ny=xA.BlockHash,_A=[1518500249,1859775393,2400959708,3395469782];function vn(){if(!(this instanceof vn))return new vn;ny.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}qo.inherits(vn,ny);var SA=vn;vn.blockSize=512;vn.outSize=160;vn.hmacStrength=80;vn.padLength=64;vn.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),h5(e.length<=this.blockSize);for(var r=e.length;r>8,p=c&255;h?l.push(h,p):l.push(p)}return l}r.toArray=n;function i(s){return s.length===1?"0"+s:s}r.zero2=i;function o(s){for(var a="",l=0;l(p>>1)-1?b=(p>>1)-S:b=S,g.isubn(b)):b=0,h[v]=b,g.iushrn(1)}return h}r.getNAF=n;function i(l,u){var c=[[],[]];l=l.clone(),u=u.clone();for(var h=0,p=0,g;l.cmpn(-h)>0||u.cmpn(-p)>0;){var v=l.andln(3)+h&3,b=u.andln(3)+p&3;v===3&&(v=-1),b===3&&(b=-1);var S;v&1?(g=l.andln(7)+h&7,(g===3||g===5)&&b===2?S=-v:S=v):S=0,c[0].push(S);var x;b&1?(g=u.andln(7)+p&7,(g===3||g===5)&&v===2?x=-b:x=b):x=0,c[1].push(x),2*h===S+1&&(h=1-h),2*p===x+1&&(p=1-p),l.iushrn(1),u.iushrn(1)}return c}r.getJSF=i;function o(l,u,c){var h="_"+u;l.prototype[u]=function(){return this[h]!==void 0?this[h]:this[h]=c.call(this)}}r.cachedProperty=o;function s(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=s;function a(l){return new ce(l,"hex","le")}r.intFromLE=a}),su=wr.getNAF,m5=wr.getJSF,au=wr.assert;function Pi(t,e){this.type=t,this.p=new ce(e.p,16),this.red=e.prime?ce.red(e.prime):ce.mont(this.p),this.zero=new ce(0).toRed(this.red),this.one=new ce(1).toRed(this.red),this.two=new ce(2).toRed(this.red),this.n=e.n&&new ce(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Zi=Pi;Pi.prototype.point=function(){throw new Error("Not implemented")};Pi.prototype.validate=function(){throw new Error("Not implemented")};Pi.prototype._fixedNafMul=function(e,r){au(e.precomputed);var n=e._getDoubles(),i=su(r,1,this._bitLength),o=(1<=a;u--)l=(l<<1)+i[u];s.push(l)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),p=o;p>0;p--){for(a=0;a=0;l--){for(var u=0;l>=0&&s[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var c=s[l];au(c!==0),e.type==="affine"?c>0?a=a.mixedAdd(o[c-1>>1]):a=a.mixedAdd(o[-c-1>>1].neg()):c>0?a=a.add(o[c-1>>1]):a=a.add(o[-c-1>>1].neg())}return e.type==="affine"?a.toP():a};Pi.prototype._wnafMulAdd=function(e,r,n,i,o){var s=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,c,h,p;for(c=0;c=1;c-=2){var v=c-1,b=c;if(s[v]!==1||s[b]!==1){l[v]=su(n[v],s[v],this._bitLength),l[b]=su(n[b],s[b],this._bitLength),u=Math.max(l[v].length,u),u=Math.max(l[b].length,u);continue}var S=[r[v],null,null,r[b]];r[v].y.cmp(r[b].y)===0?(S[1]=r[v].add(r[b]),S[2]=r[v].toJ().mixedAdd(r[b].neg())):r[v].y.cmp(r[b].y.redNeg())===0?(S[1]=r[v].toJ().mixedAdd(r[b]),S[2]=r[v].add(r[b].neg())):(S[1]=r[v].toJ().mixedAdd(r[b]),S[2]=r[v].toJ().mixedAdd(r[b].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],w=m5(n[v],n[b]);for(u=Math.max(w[0].length,u),l[v]=new Array(u),l[b]=new Array(u),h=0;h=0;c--){for(var $=0;c>=0;){var H=!0;for(h=0;h=0&&$++,j=j.dblp($),c<0)break;for(h=0;h0?p=a[h][J-1>>1]:J<0&&(p=a[h][-J-1>>1].neg()),p.type==="affine"?j=j.mixedAdd(p):j=j.add(p))}}for(c=0;c=Math.ceil((e.bitLength()+1)/r.step):!1};Ir.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,o=0;o=0&&(g=u,v=c),h.negative&&(h=h.neg(),p=p.neg()),g.negative&&(g=g.neg(),v=v.neg()),[{a:h,b:p},{a:g,b:v}]};Rr.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],o=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),a=o.mul(n.a),l=s.mul(i.a),u=o.mul(n.b),c=s.mul(i.b),h=e.sub(a).sub(l),p=u.add(c).neg();return{k1:h,k2:p}};Rr.prototype.pointFromX=function(e,r){e=new ce(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(e,i)};Rr.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0};Rr.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,o=this._endoWnafT2,s=0;s":""};Mt.prototype.isInfinity=function(){return this.inf};Mt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Mt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)};Mt.prototype.getX=function(){return this.x.fromRed()};Mt.prototype.getY=function(){return this.y.fromRed()};Mt.prototype.mul=function(e){return e=new ce(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Mt.prototype.mulAdd=function(e,r,n){var i=[this,r],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};Mt.prototype.jmulAdd=function(e,r,n){var i=[this,r],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};Mt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Mt.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(o){return o.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Mt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Lt(t,e,r,n){Zi.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ce(0)):(this.x=new ce(e,16),this.y=new ce(r,16),this.z=new ce(n,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}Hd(Lt,Zi.BasePoint);Rr.prototype.jpoint=function(e,r,n){return new Lt(this,e,r,n)};Lt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};Lt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Lt.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),o=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(o),u=s.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=l.redSqr(),h=c.redMul(l),p=i.redMul(c),g=u.redSqr().redIAdd(h).redISub(p).redISub(p),v=u.redMul(p.redISub(g)).redISub(s.redMul(h)),b=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,v,b)};Lt.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),o=this.y,s=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=o.redSub(s);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),p=l.redSqr().redIAdd(c).redISub(h).redISub(h),g=l.redMul(h.redISub(p)).redISub(o.redMul(c)),v=this.z.redMul(a);return this.curve.jpoint(p,g,v)};Lt.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}};Lt.prototype.inspect=function(){return this.isInfinity()?"":""};Lt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Sl=is(function(t,e){var r=e;r.base=Zi,r.short=v5,r.mont=null,r.edwards=null}),kl=is(function(t,e){var r=e,n=wr.assert;function i(a){a.type==="short"?this.curve=new Sl.short(a):a.type==="edwards"?this.curve=new Sl.edwards(a):this.curve=new Sl.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function o(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}o("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:rn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:rn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:rn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:rn.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"]}),o("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:rn.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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:rn.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:rn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}o("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:rn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function Ai(t){if(!(this instanceof Ai))return new Ai(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=qr.toArray(t.entropy,t.entropyEnc||"hex"),r=qr.toArray(t.nonce,t.nonceEnc||"hex"),n=qr.toArray(t.pers,t.persEnc||"hex");$d(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var my=Ai;Ai.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ai.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=qr.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length"};var y5=wr.assert;function Wu(t,e){if(t instanceof Wu)return t;this._importDER(t,e)||(y5(t.r&&t.s,"Signature without r or s"),this.r=new ce(t.r,16),this.s=new ce(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Ku=Wu;function w5(){this.place=0}function ef(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return i<=127?!1:(e.place=s,i)}function Gp(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Wu.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Gp(r),n=Gp(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];tf(i,r.length),i=i.concat(r),i.push(2),tf(i,n.length);var o=i.concat(n),s=[48];return tf(s,o.length),s=s.concat(o),wr.encode(s,e)};var x5=function(){throw new Error("unsupported")},gy=wr.assert;function Cr(t){if(!(this instanceof Cr))return new Cr(t);typeof t=="string"&&(gy(Object.prototype.hasOwnProperty.call(kl,t),"Unknown curve "+t),t=kl[t]),t instanceof kl.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var b5=Cr;Cr.prototype.keyPair=function(e){return new qd(this,e)};Cr.prototype.keyFromPrivate=function(e,r){return qd.fromPrivate(this,e,r)};Cr.prototype.keyFromPublic=function(e,r){return qd.fromPublic(this,e,r)};Cr.prototype.genKeyPair=function(e){e||(e={});for(var r=new my({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||x5(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ce(2));;){var o=new ce(r.generate(n));if(!(o.cmp(i)>0))return o.iaddn(1),this.keyFromPrivate(o)}};Cr.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Cr.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ce(e,16));for(var o=this.n.byteLength(),s=r.getPrivate().toArray("be",o),a=e.toArray("be",o),l=new my({hash:this.hash,entropy:s,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new ce(1)),c=0;;c++){var h=i.k?i.k(c):new ce(l.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(u)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var g=p.getX(),v=g.umod(this.n);if(v.cmpn(0)!==0){var b=h.invm(this.n).mul(v.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var S=(p.getY().isOdd()?1:0)|(g.cmp(v)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),S^=1),new Ku({r:v,s:b,recoveryParam:S})}}}}}};Cr.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ce(e,16)),n=this.keyFromPublic(n,i),r=new Ku(r,"hex");var o=r.r,s=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a=s.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(o).umod(this.n),c;return this.curve._maxwellTrick?(c=this.g.jmulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.eqXToP(o)):(c=this.g.mulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.getX().umod(this.n).cmp(o)===0)};Cr.prototype.recoverPubKey=function(t,e,r,n){gy((3&r)===r,"The recovery param is more than two bits"),e=new Ku(e,n);var i=this.n,o=new ce(t),s=e.r,a=e.s,l=r&1,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var c=e.r.invm(i),h=i.sub(o).mul(c).umod(i),p=a.mul(c).umod(i);return this.g.mulAdd(h,s,p)};Cr.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Ku(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var E5=is(function(t,e){var r=e;r.version="6.5.4",r.utils=wr,r.rand=function(){throw new Error("unsupported")},r.curve=Sl,r.curves=kl,r.ec=b5,r.eddsa=null}),A5=E5.ec;const _5="signing-key/5.7.0",Sh=new O(_5);let rf=null;function on(){return rf||(rf=new A5("secp256k1")),rf}class S5{constructor(e){z(this,"curve","secp256k1"),z(this,"privateKey",re(e)),Un(this.privateKey)!==32&&Sh.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=on().keyFromPrivate(se(this.privateKey));z(this,"publicKey","0x"+r.getPublic(!1,"hex")),z(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),z(this,"_isSigningKey",!0)}_addPoint(e){const r=on().keyFromPublic(se(this.publicKey)),n=on().keyFromPublic(se(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=on().keyFromPrivate(se(this.privateKey)),n=se(e);n.length!==32&&Sh.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Hu({recoveryParam:i.recoveryParam,r:mt("0x"+i.r.toString(16),32),s:mt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=on().keyFromPrivate(se(this.privateKey)),n=on().keyFromPublic(se(vy(e)));return mt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function k5(t,e){const r=Hu(e),n={r:se(r.r),s:se(r.s)};return"0x"+on().recoverPubKey(se(t),n,r.recoveryParam).encode("hex",!1)}function vy(t,e){const r=se(t);if(r.length===32){const n=new S5(r);return e?"0x"+on().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?re(r):"0x"+on().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+on().keyFromPublic(r).getPublic(!0,"hex"):re(r)}return Sh.throwArgumentError("invalid public or private key","key","[REDACTED]")}const N5="transactions/5.7.0",Vn=new O(N5);var Wp;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Wp||(Wp={}));function Vd(t){return t==="0x"?null:gt(t)}function Ft(t){return t==="0x"?O1:G.from(t)}function M5(t){const e=vy(t);return gt(Rt(ct(Rt(e,1)),12))}function yy(t,e){return M5(k5(se(t),e))}function fr(t,e){const r=Ho(G.from(t).toHexString());return r.length>32&&Vn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function nf(t,e){return{address:gt(t),storageKeys:(e||[]).map((r,n)=>(Un(r)!==32&&Vn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function eo(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Vn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),nf(r[0],r[1])):nf(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,o)=>(i[o]=!0,i),{});return nf(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function wy(t){return eo(t).map(e=>[e.address,e.storageKeys])}function P5(t,e){if(t.gasPrice!=null){const n=G.from(t.gasPrice),i=G.from(t.maxFeePerGas||0);n.eq(i)||Vn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[fr(t.chainId||0,"chainId"),fr(t.nonce||0,"nonce"),fr(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fr(t.maxFeePerGas||0,"maxFeePerGas"),fr(t.gasLimit||0,"gasLimit"),t.to!=null?gt(t.to):"0x",fr(t.value||0,"value"),t.data||"0x",wy(t.accessList||[])];if(e){const n=Hu(e);r.push(fr(n.recoveryParam,"recoveryParam")),r.push(Ho(n.r)),r.push(Ho(n.s))}return er(["0x02",qu(r)])}function C5(t,e){const r=[fr(t.chainId||0,"chainId"),fr(t.nonce||0,"nonce"),fr(t.gasPrice||0,"gasPrice"),fr(t.gasLimit||0,"gasLimit"),t.to!=null?gt(t.to):"0x",fr(t.value||0,"value"),t.data||"0x",wy(t.accessList||[])];if(e){const n=Hu(e);r.push(fr(n.recoveryParam,"recoveryParam")),r.push(Ho(n.r)),r.push(Ho(n.s))}return er(["0x01",qu(r)])}function xy(t,e,r){try{const n=Ft(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Vn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=mt(e[1],32),t.s=mt(e[2],32);try{const n=ct(r(t));t.from=yy(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function I5(t){const e=Dd(t.slice(1));e.length!==9&&e.length!==12&&Vn.throwArgumentError("invalid component count for transaction type: 2","payload",re(t));const r=Ft(e[2]),n=Ft(e[3]),i={type:2,chainId:Ft(e[0]).toNumber(),nonce:Ft(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ft(e[4]),to:Vd(e[5]),value:Ft(e[6]),data:e[7],accessList:eo(e[8])};return e.length===9||(i.hash=ct(t),xy(i,e.slice(9),P5)),i}function R5(t){const e=Dd(t.slice(1));e.length!==8&&e.length!==11&&Vn.throwArgumentError("invalid component count for transaction type: 1","payload",re(t));const r={type:1,chainId:Ft(e[0]).toNumber(),nonce:Ft(e[1]).toNumber(),gasPrice:Ft(e[2]),gasLimit:Ft(e[3]),to:Vd(e[4]),value:Ft(e[5]),data:e[6],accessList:eo(e[7])};return e.length===8||(r.hash=ct(t),xy(r,e.slice(8),C5)),r}function O5(t){const e=Dd(t);e.length!==9&&e.length!==6&&Vn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Ft(e[0]).toNumber(),gasPrice:Ft(e[1]),gasLimit:Ft(e[2]),to:Vd(e[3]),value:Ft(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=G.from(e[6]).toNumber()}catch{return r}if(r.r=mt(e[7],32),r.s=mt(e[8],32),G.from(r.r).isZero()&&G.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(re(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const o=ct(qu(i));try{r.from=yy(o,{r:re(r.r),s:re(r.s),recoveryParam:n})}catch{}r.hash=ct(t)}return r.type=null,r}function T5(t){const e=se(t);if(e[0]>127)return O5(e);switch(e[0]){case 1:return R5(e);case 2:return I5(e)}return Vn.throwError(`unsupported transaction type: ${e[0]}`,O.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const L5="contracts/5.7.0";var Qi=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const vt=new O(L5);function lu(t,e){return Qi(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&vt.throwArgumentError("invalid address or ENS name","name",r);try{return gt(r)}catch{}t||vt.throwError("a provider or signer is needed to resolve ENS names",O.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&vt.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Nl(t,e,r){return Qi(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Nl(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield lu(t,e):r.type==="tuple"?yield Nl(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Nl(t,n,r.arrayChildren))):Promise.reject(vt.makeError("invalid value for array",O.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Qu(t,e,r){return Qi(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=ot(r.pop())),vt.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=wt({override:lu(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>Qi(this,void 0,void 0,function*(){return gt(u.signer)!==u.override&&vt.throwError("Contract with a Signer cannot override from",O.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=lu(t.provider,n.from));const i=yield wt({args:Nl(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:wt(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(a.nonce!=null&&(s.nonce=G.from(a.nonce).toNumber()),a.gasLimit!=null&&(s.gasLimit=G.from(a.gasLimit)),a.gasPrice!=null&&(s.gasPrice=G.from(a.gasPrice)),a.maxFeePerGas!=null&&(s.maxFeePerGas=G.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=G.from(a.maxPriorityFeePerGas)),a.from!=null&&(s.from=a.from),a.type!=null&&(s.type=a.type),a.accessList!=null&&(s.accessList=eo(a.accessList)),s.gasLimit==null&&e.gas!=null){let u=21e3;const c=se(o);for(let h=0;hn[u]!=null);return l.length&&vt.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,O.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),s})}function j5(t,e){return function(...r){return Qu(t,e,r)}}function B5(t,e){const r=t.signer||t.provider;return function(...n){return Qi(this,void 0,void 0,function*(){r||vt.throwError("estimate require a provider or signer",O.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Qu(t,e,n);return yield r.estimateGas(i)})}}function D5(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(o=>{let s=or(o),a=null;try{a=t.interface.parseLog(o)}catch{}return a&&(s.args=a.args,s.decode=(l,u)=>t.interface.decodeEventLog(a.eventFragment,l,u),s.event=a.name,s.eventSignature=a.signature),s.removeListener=()=>t.provider,s.getBlock=()=>t.provider.getBlock(i.blockHash),s.getTransaction=()=>t.provider.getTransaction(i.transactionHash),s.getTransactionReceipt=()=>Promise.resolve(i),s}),i))}function by(t,e,r){const n=t.signer||t.provider;return function(...i){return Qi(this,void 0,void 0,function*(){let o;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=ot(i.pop());l.blockTag!=null&&(o=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(o));const s=yield Qu(t,e,i),a=yield n.call(s,o);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===O.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=s),l}})}}function F5(t,e){return function(...r){return Qi(this,void 0,void 0,function*(){t.signer||vt.throwError("sending a transaction requires a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Qu(t,e,r),i=yield t.signer.sendTransaction(n);return D5(t,i),i})}}function Kp(t,e,r){return e.constant?by(t,e,r):F5(t,e)}function Ey(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class da{constructor(e,r){z(this,"tag",e),z(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class U5 extends da{constructor(){super("error",null)}}class Qp extends da{constructor(e,r,n,i){const o={address:e};let s=r.getEventTopic(n);i?(s!==i[0]&&vt.throwArgumentError("topic mismatch","topics",i),o.topics=i.slice()):o.topics=[s],super(Ey(o),o),z(this,"address",e),z(this,"interface",r),z(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=yE(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class Jp extends da{constructor(e,r){super("*",{address:e}),z(this,"address",e),z(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class z5{constructor(e,r,n){z(this,"interface",dr(new.target,"getInterface")(r)),n==null?(z(this,"provider",null),z(this,"signer",null)):Pa.isSigner(n)?(z(this,"provider",n.provider||null),z(this,"signer",n)):es.isProvider(n)?(z(this,"provider",n),z(this,"signer",null)):vt.throwArgumentError("invalid signer or provider","signerOrProvider",n),z(this,"callStatic",{}),z(this,"estimateGas",{}),z(this,"functions",{}),z(this,"populateTransaction",{}),z(this,"filters",{});{const s={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];z(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),s[l.name]||(s[l.name]=[]),s[l.name].push(a)}),Object.keys(s).forEach(a=>{const l=s[a];l.length===1?z(this.filters,a,this.filters[l[0]]):vt.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(z(this,"_runningEvents",{}),z(this,"_wrappedEmits",{}),e==null&&vt.throwArgumentError("invalid contract address or ENS name","addressOrName",e),z(this,"address",e),this.provider)z(this,"resolvedAddress",lu(this.provider,e));else try{z(this,"resolvedAddress",Promise.resolve(gt(e)))}catch{vt.throwError("provider is required to use ENS name as contract address",O.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(s=>{});const i={},o={};Object.keys(this.interface.functions).forEach(s=>{const a=this.interface.functions[s];if(o[s]){vt.warn(`Duplicate ABI entry for ${JSON.stringify(s)}`);return}o[s]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(s)}this[s]==null&&z(this,s,Kp(this,a,!0)),this.functions[s]==null&&z(this.functions,s,Kp(this,a,!1)),this.callStatic[s]==null&&z(this.callStatic,s,by(this,a,!0)),this.populateTransaction[s]==null&&z(this.populateTransaction,s,j5(this,a)),this.estimateGas[s]==null&&z(this.estimateGas,s,B5(this,a))}),Object.keys(i).forEach(s=>{const a=i[s];if(a.length>1)return;s=s.substring(1);const l=a[0];try{this[s]==null&&z(this,s,this[l])}catch{}this.functions[s]==null&&z(this.functions,s,this.functions[l]),this.callStatic[s]==null&&z(this.callStatic,s,this.callStatic[l]),this.populateTransaction[s]==null&&z(this.populateTransaction,s,this.populateTransaction[l]),this.estimateGas[s]==null&&z(this.estimateGas,s,this.estimateGas[l])})}static getContractAddress(e){return Ud(e)}static getInterface(e){return xh.isInterface(e)?e:new xh(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&vt.throwError("contract not deployed",O.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||vt.throwError("sending a transactions require a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=ot(e||{});return["from","to"].forEach(function(n){r[n]!=null&&vt.throwError("cannot override "+n,O.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new zd(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&z(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return wh.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new U5);if(e==="event")return this._normalizeRunningEvent(new da("event",null));if(e==="*")return this._normalizeRunningEvent(new Jp(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new Qp(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new Qp(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new da(Ey(r),r))}return this._normalizeRunningEvent(new Jp(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=or(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||vt.throwError("events require a provider or a signer with a provider",O.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=o=>{let s=this._wrapEvent(e,o,r);if(s.decodeError==null)try{const a=e.getEmit(s);this.emit(e.filter,...a)}catch(a){s.decodeError=a.error}e.filter!=null&&this.emit("event",s),s.decodeError!=null&&this.emit("error",s.decodeError,s)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),o=ot(i.filter);return typeof r=="string"&&me(r,32)?(n!=null&&vt.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),o.blockHash=r):(o.fromBlock=r??0,o.toBlock=n??"latest"),this.provider.getLogs(o).then(s=>s.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class $5 extends z5{}class Ay{constructor(e){z(this,"alphabet",e),z(this,"base",e.length),z(this,"_alphabetMap",{}),z(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(s%this.base),s=s/this.base|0}let i="";for(let o=0;r[o]===0&&o=0;--o)i+=this.alphabet[n[o]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;o>0;)r.push(o&255),o>>=8}for(let n=0;e[n]===this._leader&&n0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}const q5="networks/5.7.1",Xp=new O(q5);function V5(t){return t&&typeof t.renetwork=="function"}function Mn(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const o=["goerli","ropsten","rinkeby","sepolia"];try{const s=new r.PocketProvider(t,n.pocket);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const o=["ropsten"],s=new r.AnkrProvider(t,n.ankr);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let o=1;return n.quorum!=null?o=n.quorum:t==="homestead"&&(o=2),new r.FallbackProvider(i,o)}return i[0]};return e.renetwork=function(r){return Mn(r)},e}function uu(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return uu(t,n)},r}const Zp={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Mn("homestead")},em={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Mn("ropsten")},tm={chainId:63,name:"classicMordor",_defaultProvider:uu("https://www.ethercluster.com/mordor","classicMordor")},el={unspecified:{chainId:0,name:"unspecified"},homestead:Zp,mainnet:Zp,morden:{chainId:2,name:"morden"},ropsten:em,testnet:em,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Mn("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Mn("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Mn("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Mn("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:uu("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:tm,classicTestnet:tm,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:uu("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Mn("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Mn("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Gd(t){if(t==null)return null;if(typeof t=="number"){for(const n in el){const i=el[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=el[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=el[t.name];if(!e)return typeof t.chainId!="number"&&Xp.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&Xp.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(V5(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const G5="web/5.7.1";var W5=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};function K5(t,e){return W5(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const s=e.fetchOptions;s.mode&&(r.mode=s.mode),s.cache&&(r.cache=s.cache),s.credentials&&(r.credentials=s.credentials),s.redirect&&(r.redirect=s.redirect),s.referrer&&(r.referrer=s.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach((s,a)=>{o[a.toLowerCase()]=s}):n.headers.keys().forEach(s=>{o[s.toLowerCase()]=n.headers.get(s)}),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:se(new Uint8Array(i))}})}var Q5=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Br=new O(G5);function rm(t){return new Promise(e=>{setTimeout(e,t)})}function ti(t,e){if(t==null)return null;if(typeof t=="string")return t;if(jd(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Ma(t)}catch{}return re(t)}return t}function J5(t){return gr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function Y5(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Br.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,o=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Br.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let c=!1,h=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&Br.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(h=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(c=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&Br.throwError("basic authentication requires a secure https url",O.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+F1(gr(x))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=ot(t.fetchOptions))}const p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=l?l.match(p):null;if(g)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?D1(g[3]):J5(g[3])};let w=x.body;return r&&(w=r(x.body,x)),Promise.resolve(w)}catch(x){Br.throwError("processing response error",O.errors.SERVER_ERROR,{body:ti(g[1],g[2]),error:x,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const v={};Object.keys(a).forEach(x=>{const w=a[x];v[w.key]=w.value}),u.headers=v;const b=function(){let x=null;return{promise:new Promise(function(T,j){h&&(x=setTimeout(()=>{x!=null&&(x=null,j(Br.makeError("timeout",O.errors.TIMEOUT,{requestBody:ti(u.body,v["content-type"]),requestMethod:u.method,timeout:h,url:l})))},h))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),S=function(){return Q5(this,void 0,void 0,function*(){for(let x=0;x=300)&&(b.cancel(),Br.throwError("bad response",O.errors.SERVER_ERROR,{status:w.statusCode,headers:w.headers,body:ti(E,w.headers?w.headers["content-type"]:null),requestBody:ti(u.body,v["content-type"]),requestMethod:u.method,url:l})),r)try{const T=yield r(E,w);return b.cancel(),T}catch(T){if(T.throttleRetry&&x{let a=null;if(o!=null)try{a=JSON.parse(Ma(o))}catch(l){Br.throwError("invalid JSON",O.errors.SERVER_ERROR,{body:o,error:l})}return r&&(a=r(a,s)),a},i=null;if(e!=null){i=gr(e);const o=typeof t=="string"?{url:t}:ot(t);o.headers?Object.keys(o.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(o.headers=ot(o.headers),o.headers["content-type"]="application/json"):o.headers={"content-type":"application/json"},t=o}return Y5(t,i,n)}function _o(t,e){return e||(e={}),e=ot(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,o=!1;const s=()=>o?!1:(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(c){if(c!==void 0)s()&&r(c);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!o){if(l++,l>a){s()&&n(new Error("retry limit reached"));return}let h=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));he.ceiling&&(h=e.ceiling),setTimeout(u,h)}return null},function(c){s()&&n(c)})}u()})}var cu="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Nh={};for(var tl=0;tl>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function _y(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=To(e)^n>>5}for(e=To(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=_y(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",o=0;o>5)throw new Error("Non 5-bit word");n=To(n)^s,i+=cu.charAt(s)}for(o=0;o<6;++o)n=To(n);for(n^=1,o=0;o<6;++o){var a=n>>(5-o)*5&31;i+=cu.charAt(a)}return i}function Sy(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=_y(o);if(typeof a=="string")return a;for(var l=[],u=0;u=s.length)&&l.push(h)}return a!==1?"Invalid checksum for "+t:{prefix:o,words:l}}function Z5(){var t=Sy.apply(null,arguments);if(typeof t=="object")return t}function e_(t){var e=Sy.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Ju(t,e,r,n){for(var i=0,o=0,s=(1<=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<=e)return"Excess padding";if(i<this.data(h,!0);return e.transaction={hash:s,type:u,accessList:ee.allowNull(this.accessList.bind(this),null),blockHash:ee.allowNull(s,null),blockNumber:ee.allowNull(l,null),transactionIndex:ee.allowNull(l,null),confirmations:ee.allowNull(l,null),from:r,gasPrice:ee.allowNull(n),maxPriorityFeePerGas:ee.allowNull(n),maxFeePerGas:ee.allowNull(n),gasLimit:n,to:ee.allowNull(r,null),value:n,nonce:l,data:o,r:ee.allowNull(this.uint256),s:ee.allowNull(this.uint256),v:ee.allowNull(l),creates:ee.allowNull(r,null),raw:ee.allowNull(o)},e.transactionRequest={from:ee.allowNull(r),nonce:ee.allowNull(l),gasLimit:ee.allowNull(n),gasPrice:ee.allowNull(n),maxPriorityFeePerGas:ee.allowNull(n),maxFeePerGas:ee.allowNull(n),to:ee.allowNull(r),value:ee.allowNull(n),data:ee.allowNull(c),type:ee.allowNull(l),accessList:ee.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:s,address:r,topics:ee.arrayOf(s),data:o,logIndex:l,blockHash:s},e.receipt={to:ee.allowNull(this.address,null),from:ee.allowNull(this.address,null),contractAddress:ee.allowNull(r,null),transactionIndex:l,root:ee.allowNull(a),gasUsed:n,logsBloom:ee.allowNull(o),blockHash:s,transactionHash:s,logs:ee.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:ee.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:ee.allowNull(n),status:ee.allowNull(l),type:u},e.block={hash:ee.allowNull(s),parentHash:s,number:l,timestamp:l,nonce:ee.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:ee.allowNull(r),extraData:o,transactions:ee.allowNull(ee.arrayOf(s)),baseFeePerGas:ee.allowNull(n)},e.blockWithTransactions=ot(e.block),e.blockWithTransactions.transactions=ee.allowNull(ee.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:ee.allowNull(i,void 0),toBlock:ee.allowNull(i,void 0),blockHash:ee.allowNull(s,void 0),address:ee.allowNull(r,void 0),topics:ee.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:ee.allowNull(l),blockHash:ee.allowNull(s),transactionIndex:l,removed:ee.allowNull(this.boolean.bind(this)),address:r,data:ee.allowFalsish(o,"0x"),topics:ee.arrayOf(s),transactionHash:s,logIndex:l},e}accessList(e){return eo(e||[])}number(e){return e==="0x"?0:G.from(e).toNumber()}type(e){return e==="0x"||e==null?0:G.from(e).toNumber()}bigNumber(e){return G.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),me(e))?e.toLowerCase():gs.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return gt(e)}callAddress(e){if(!me(e,32))return null;const r=gt(Rt(e,12));return r===jE?null:r}contractAddress(e){return Ud(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||me(e))return $u(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Un(n)!==32?gs.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=G.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!me(e))throw new Error("invalid uint256");return mt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=ee.check(r,e);return i._difficulty=n==null?null:G.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return ee.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&G.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=ee.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;me(n)&&(n=G.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),me(n)&&(n=G.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return T5(e)}receiptLog(e){return ee.check(this.formats.receiptLog,e)}receipt(e){const r=ee.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=G.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&gs.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):gs.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&gs.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return ee.check(this.formats.filter,e)}filterLog(e){return ee.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const o=e[i](r[i]);o!==void 0&&(n[i]=o)}catch(o){throw o.checkKey=i,o.checkValue=r[i],o}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function ky(t){return t&&typeof t.isCommunityResource=="function"}function Mh(t){return ky(t)&&t.isCommunityResource()}let im=!1;function Ra(){im||(im=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var ue=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const pe=new O(Ht),s_=10;function om(t){return t==null?"null":(Un(t)!==32&&pe.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function sm(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[om(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return om(e)}).join("&")}function a_(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function ro(t){if(typeof t=="string"){if(t=t.toLowerCase(),Un(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+sm(t);if(B3.isForkEvent(t))throw pe.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+sm(t.topics||[])}throw new Error("invalid event - "+t)}function vs(){return new Date().getTime()}function am(t){return new Promise(e=>{setTimeout(e,t)})}const l_=["block","network","pending","poll"];class u_{constructor(e,r,n){z(this,"tag",e),z(this,"listener",r),z(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=a_(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||l_.indexOf(this.tag)>=0}}const c_={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function sf(t){return mt(G.from(t).toHexString(),32)}function lm(t){return kh.encode(Ut([t,Rt(Yp(Yp(t)),0,4)]))}const Ny=new RegExp("^(ipfs)://(.*)$","i"),um=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Ny,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Ml(t,e){try{return Ma(pa(t,e))}catch{}return null}function pa(t,e){if(t==="0x")return null;const r=G.from(Rt(t,e,e+32)).toNumber(),n=G.from(Rt(t,r,r+32)).toNumber();return Rt(t,r+32,r+32+n)}function af(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):pe.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function cm(t){const e=se(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function f_(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function My(t){const e=[];let r=0;for(let n=0;nG.from(e).eq(1)).catch(e=>{if(e.code===O.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return ue(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:er([e,_l(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=er(["0x9061b923",My([E3(this.name),n.data])]));try{let o=yield this.provider.call(n);return se(o).length%32===4&&pe.throwError("resolver threw error",O.errors.CALL_EXCEPTION,{transaction:n,data:o}),i&&(o=pa(o,0)),o}catch(o){if(o.code===O.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(e,r){return ue(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?pa(n,0):null})}_getAddress(e,r){const n=c_[String(e)];if(n==null&&pe.throwError(`unsupported coin type: ${e}`,O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=se(r);if(n.p2pkh!=null){const o=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return lm(Ut([[n.p2pkh],"0x"+o[2]]))}}if(n.p2sh!=null){const o=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return lm(Ut([[n.p2sh],"0x"+o[2]]))}}if(n.prefix!=null){const o=i[1];let s=i[0];if(s===0?o!==20&&o!==32&&(s=-1):s=-1,s>=0&&i.length===2+o&&o>=1&&o<=75){const a=nm.toWords(i.slice(2));return a.unshift(s),nm.encode(n.prefix,a)}}return null}getAddress(e){return ue(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===UE?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===O.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",sf(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&pe.throwError("invalid or unsupported coin data",O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return ue(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;ns[l])}return pe.throwError("invalid or unsupported content hash data",O.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return ue(this,void 0,void 0,function*(){let r=gr(e);r=Ut([sf(64),sf(r.length),r]),r.length%32!==0&&(r=Ut([r,mt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",re(r));return n==null||n==="0x"?null:Ma(n)})}}let lf=null,h_=1;class Yu extends es{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),z(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=dr(new.target,"getNetwork")(e);r?(z(this,"_network",r),this.emit("network",r,null)):pe.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ue(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||pe.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:z(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return _o(()=>this._ready().then(e=>e,e=>{if(!(e.code===O.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return lf==null&&(lf=new ee),lf}static getNetwork(e){return Gd(e??"homestead")}ccipReadFetch(e,r,n){return ue(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),o=r.toLowerCase(),s=[];for(let a=0;a=0?null:JSON.stringify({data:o,sender:i}),h=yield Ia({url:u,errorPassThrough:!0},c,(g,v)=>(g.status=v.statusCode,g));if(h.data)return h.data;const p=h.message||"unknown error";if(h.status>=400&&h.status<500)return pe.throwError(`response not found during CCIP fetch: ${p}`,O.errors.SERVER_ERROR,{url:l,errorMessage:p});s.push(p)}return pe.throwError(`error encountered during CCIP fetch: ${s.map(a=>JSON.stringify(a)).join(", ")}`,O.errors.SERVER_ERROR,{urls:n,errorMessages:s})})}_getInternalBlockNumber(e){return ue(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const o=yield i;if(vs()-o.respTime<=e)return o.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=vs(),n=wt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:o})=>{if(o)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),o;const s=vs();return i=G.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return ue(this,void 0,void 0,function*(){const e=h_++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)pe.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",pe.makeError("network block skew detected",O.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const o=this._emitted[i];o!=="pending"&&n-o>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const o=i.hash;let s=this.getTransactionReceipt(o).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+o]=a.blockNumber,this.emit(o,a)),null)).catch(a=>{this.emit("error",a)});r.push(s);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const o=i.filter;o.fromBlock=i._lastBlockNumber+1,o.toBlock=n;const s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);const a=this.getLogs(o).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(o,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ue(this,void 0,void 0,function*(){return pe.throwError("provider does not support network detection",O.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ue(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield am(0),this._network;const n=pe.makeError("underlying network changed",O.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=vs();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return ue(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return ue(this,void 0,void 0,function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=r?o:new Promise((s,a)=>{const l=[];let u=!1;const c=function(){return u?!0:(u=!0,l.forEach(p=>{p()}),!1)},h=p=>{p.confirmations{this.removeListener(e,h)}),i){let p=i.startBlock,g=null;const v=b=>ue(this,void 0,void 0,function*(){u||(yield am(1e3),this.getTransactionCount(i.from).then(S=>ue(this,void 0,void 0,function*(){if(!u){if(S<=i.nonce)p=b;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(g==null&&(g=p-3,g{u||this.once("block",v)}))});if(u)return;this.once("block",v),l.push(()=>{this.removeListener("block",v)})}if(typeof n=="number"&&n>0){const p=setTimeout(()=>{c()||a(pe.makeError("timeout exceeded",O.errors.TIMEOUT,{timeout:n}))},n);p.unref&&p.unref(),l.push(()=>{clearTimeout(p)})}})})}getBlockNumber(){return ue(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return G.from(e)}catch(r){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return G.from(i)}catch(o){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:o})}})}getTransactionCount(e,r){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return G.from(i).toNumber()}catch(o){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:o})}})}getCode(e,r){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return re(i)}catch(o){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:o})}})}getStorageAt(e,r,n){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(s=>$u(s))}),o=yield this.perform("getStorageAt",i);try{return re(o)}catch(s){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:s})}})}_wrapTransaction(e,r,n){if(r!=null&&Un(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&pe.throwError("Transaction hash mismatch from Provider.sendTransaction.",O.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(o,s)=>ue(this,void 0,void 0,function*(){o==null&&(o=1),s==null&&(s=0);let a;o!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,o,s,a);return l==null&&o===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&pe.throwError("transaction failed",O.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(o=>re(o)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const o=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,o,i)}catch(o){throw o.transaction=n,o.transactionHash=n.hash,o}})}_getTransactionRequest(e){return ue(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o?this._getAddress(o):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o?G.from(o):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o?re(o):null))}),this.formatter.transactionRequest(yield wt(n))})}_getFilter(e){return ue(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield wt(r))})}_call(e,r,n){return ue(this,void 0,void 0,function*(){n>=s_&&pe.throwError("CCIP read exceeded maximum redirections",O.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,o=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&o.substring(0,10)==="0x556f1830"&&Un(o)%32===4)try{const s=Rt(o,4),a=Rt(s,0,32);G.from(a).eq(i)||pe.throwError("CCIP Read sender did not match",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const l=[],u=G.from(Rt(s,32,64)).toNumber(),c=G.from(Rt(s,u,u+32)).toNumber(),h=Rt(s,u+32);for(let x=0;xue(this,void 0,void 0,function*(){const o=yield this.perform("getBlock",i);if(o==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let s=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(o)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return _o(()=>ue(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return _o(()=>ue(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return i}),{oncePoll:this})})}getLogs(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield wt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),ee.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return ue(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return ue(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&pe.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return ue(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new Ph(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return ue(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||pe.throwError("network does not support ENS",O.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+_l(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return ue(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(me(e))throw n}typeof e!="string"&&pe.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return ue(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Ml(yield this.call({to:n,data:"0x691f3431"+_l(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return ue(this,void 0,void 0,function*(){let r=null;if(me(e)){const o=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(o,"getAvatar");if(!s)return null;r=new Ph(this,s,o);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a}try{const a=Ml(yield this.call({to:s,data:"0x691f3431"+_l(o).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return pe.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new u_(ro(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],o=ro(e);return this._events=this._events.filter(s=>s.tag!==o?!0:(setTimeout(()=>{s.listener.apply(this,r)},0),n=!0,s.once?(i.push(s),!1):!0)),i.forEach(s=>{this._stopEvent(s)}),n}listenerCount(e){if(!e)return this._events.length;let r=ro(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=ro(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,o=ro(e);return this._events=this._events.filter(s=>s.tag!==o||s.listener!=r||i?!0:(i=!0,n.push(s),!1)),n.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=ro(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var kn=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const xt=new O(Ht),d_=["call","estimateGas"];function Bs(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=me(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Bs(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Bs(JSON.parse(t),e)}catch{}return null}function Py(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const o=Bs(e,!0);if(o)return o.data;xt.throwError("missing revert data in call exception; Transaction reverted without a reason string",O.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let o=Bs(e.body,!1);o==null&&(o=Bs(e,!1)),o&&xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===O.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&xt.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&xt.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&xt.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&xt.throwError("legacy pre-eip-155 transactions not supported",O.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),d_.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function fm(t){return new Promise(function(e){setTimeout(e,t)})}function p_(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function ys(t){return t&&t.toLowerCase()}const Ch={};class Wd extends Pa{constructor(e,r,n){if(super(),e!==Ch)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");z(this,"provider",r),n==null&&(n=0),typeof n=="string"?(z(this,"_address",this.provider.formatter.address(n)),z(this,"_index",null)):typeof n=="number"?(z(this,"_index",n),z(this,"_address",null)):xt.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return xt.throwError("cannot alter JSON-RPC Signer connection",O.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new m_(Ch,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&xt.throwError("unknown account #"+this._index,O.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=ot(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=ot(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>kn(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&xt.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),wt({tx:wt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&xt.throwArgumentError("from address mismatch","transaction",e):n.from=i;const o=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&xt.throwError("user rejected transaction",O.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Py("sendTransaction",s,o)))})}signTransaction(e){return xt.throwError("signing transactions is unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return kn(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield _o(()=>kn(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return kn(this,void 0,void 0,function*(){const r=typeof e=="string"?gr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[re(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return kn(this,void 0,void 0,function*(){const r=typeof e=="string"?gr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),re(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return kn(this,void 0,void 0,function*(){const i=yield lr.resolveNames(e,r,n,s=>this.provider.resolveName(s)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(lr.getPayload(i.domain,r,i.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:r,value:i.value}}),s}})}unlock(e){return kn(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class m_ extends Wd{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const g_={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class _i extends Yu{constructor(e,r){let n=r;n==null&&(n=new Promise((i,o)=>{setTimeout(()=>{this.detectNetwork().then(s=>{i(s)},s=>{o(s)})},0)})),super(n),e||(e=dr(this.constructor,"defaultUrl")()),typeof e=="string"?z(this,"connection",Object.freeze({url:e})):z(this,"connection",Object.freeze(ot(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return kn(this,void 0,void 0,function*(){yield fm(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=dr(this.constructor,"getNetwork");try{return r(G.from(e).toNumber())}catch(n){return xt.throwError("could not detect network",O.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return xt.throwError("could not detect network",O.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new Wd(Ch,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:or(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const o=Ia(this.connection,JSON.stringify(n),p_).then(s=>(this.emit("debug",{action:"response",request:n,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:n,provider:this}),s});return i&&(this._cache[e]=o,setTimeout(()=>{this._cache[e]=null},0)),o}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[ys(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[ys(r.address),r.blockTag]];case"getCode":return["eth_getCode",[ys(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[ys(r.address),mt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[dr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[dr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=ys(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return kn(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&G.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const o=yield this.getFeeData();o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(r=ot(r),r.transaction=ot(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&xt.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return Py(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(o){if(e._pendingFilter!=r)return null;let s=Promise.resolve();return o.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),s.then(function(){return fm(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(o=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=ot(g_);if(r)for(const o in r)r[o]&&(n[o]=!0);cE(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(o){if(e[o]==null)return;const s=$u(G.from(e[o]));o==="gasLimit"&&(o="gas"),i[o]=s}),["from","to","data"].forEach(function(o){e[o]!=null&&(i[o]=re(e[o]))}),e.accessList&&(i.accessList=eo(e.accessList)),i}}let Ds=null;try{if(Ds=WebSocket,Ds==null)throw new Error("inject please")}catch{const e=new O(Ht);Ds=function(){e.throwError("WebSockets not supported in this environment",O.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var uf=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const rl=new O(Ht);let v_=1;class Xu extends _i{constructor(e,r){r==="any"&&rl.throwError("WebSocketProvider does not support 'any' network yet",O.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof e=="string"?super(e,r):super("_websocket",r),this._pollingInterval=-1,this._wsReady=!1,typeof e=="string"?z(this,"_websocket",new Ds(this.connection.url)):z(this,"_websocket",e),z(this,"_requests",{}),z(this,"_subs",{}),z(this,"_subIds",{}),z(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(i=>{this.websocket.send(this._requests[i].payload)})},this.websocket.onmessage=i=>{const o=i.data,s=JSON.parse(o);if(s.id!=null){const a=String(s.id),l=this._requests[a];if(delete this._requests[a],s.result!==void 0)l.callback(null,s.result),this.emit("debug",{action:"response",request:JSON.parse(l.payload),response:s.result,provider:this});else{let u=null;s.error?(u=new Error(s.error.message||"unknown error"),z(u,"code",s.error.code||null),z(u,"response",o)):u=new Error("unknown error"),l.callback(u,void 0),this.emit("debug",{action:"response",error:u,request:JSON.parse(l.payload),provider:this})}}else if(s.method==="eth_subscription"){const a=this._subs[s.params.subscription];a&&a.processFunc(s.params.result)}else console.warn("this should not happen")};const n=setInterval(()=>{this.emit("poll")},1e3);n.unref&&n.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){rl.throwError("cannot reset events block on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){rl.throwError("cannot set polling interval on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return uf(this,void 0,void 0,function*(){return null})}set polling(e){e&&rl.throwError("cannot set polling on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,r){const n=v_++;return new Promise((i,o)=>{function s(l,u){return l?o(l):i(u)}const a=JSON.stringify({method:e,params:r,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(n)]={callback:s,payload:a},this._wsReady&&this.websocket.send(a)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,r,n){return uf(this,void 0,void 0,function*(){let i=this._subIds[e];i==null&&(i=Promise.all(r).then(s=>this.send("eth_subscribe",s)),this._subIds[e]=i);const o=yield i;this._subs[o]={tag:e,processFunc:n}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],r=>{const n=G.from(r.number).toNumber();this._emitted.block=n,this.emit("block",n)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(e.filter,this.formatter.filterLog(r))});break;case"tx":{const r=n=>{const i=n.hash;this.getTransactionReceipt(i).then(o=>{o&&this.emit(i,o)})};r(e),this._subscribe("tx",["newHeads"],n=>{this._events.filter(i=>i.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}}_stopEvent(e){let r=e.tag;if(e.type==="tx"){if(this._events.filter(i=>i.type==="tx").length)return;r="tx"}else if(this.listenerCount(e.event))return;const n=this._subIds[r];n&&(delete this._subIds[r],n.then(i=>{this._subs[i]&&(delete this._subs[i],this.send("eth_unsubscribe",[i]))}))}destroy(){return uf(this,void 0,void 0,function*(){this.websocket.readyState===Ds.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}}var y_=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ss=new O(Ht);class Cy extends _i{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return y_(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||Ss.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(z(this,"_network",r),this.emit("network",r,null))),r})}}class Gn extends Cy{constructor(e,r){Ss.checkAbstract(new.target,Gn),e=dr(new.target,"getNetwork")(e),r=dr(new.target,"getApiKey")(r);const n=dr(new.target,"getUrl")(e,r);super(n,e),typeof r=="string"?z(this,"apiKey",r):r!=null&&Object.keys(r).forEach(i=>{z(this,i,r[i])})}_startPending(){Ss.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return Ss.throwError("API provider does not support signing",O.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,r){return Ss.throwError("not implemented; sub-classes must override getUrl",O.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const hm=new O(Ht),Pl="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class Iy extends Xu{constructor(e,r){const n=new Kd(e,r),i=n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(i,n.network),z(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===Pl}}class Kd extends Gn{static getWebSocketProvider(e,r){return new Iy(e,r)}static getApiKey(e){return e==null?Pl:(e&&typeof e!="string"&&hm.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:hm.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+r,throttleCallback:(i,o)=>(r===Pl&&Ra(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===Pl}}const w_=new O(Ht),nl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function x_(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return w_.throwArgumentError("unsupported network","name",t)}class Ry extends Gn{isCommunityResource(){return this.apiKey===nl}static getApiKey(e){return e??nl}static getUrl(e,r){r==null&&(r=nl);const n={allowGzip:!0,url:"https://"+x_(e.name)+r,throttleCallback:(i,o)=>(r.apiKey===nl&&Ra(),Promise.resolve(!0))};return r.projectSecret!=null&&(n.user="",n.password=r.projectSecret),n}}var b_=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const dm=new O(Ht);class Oy extends Gn{static getApiKey(e){return e!=null&&dm.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="https://cloudflare-eth.com/";break;default:dm.throwArgumentError("unsupported network","network",arguments[0])}return n}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return b_(this,void 0,void 0,function*(){return e==="getBlockNumber"?(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number:n.perform.call(this,e,r)})}}var il=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const ai=new O(Ht);function pm(t){const e={};for(let r in t){if(t[r]==null)continue;let n=t[r];r==="type"&&n===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?n=$u(re(n)):r==="accessList"?n="["+eo(n).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]":n=re(n),e[r]=n)}return e}function E_(t){if(t.status==0&&(t.message==="No records found"||t.message==="No transactions found"))return t.result;if(t.status!=1||typeof t.message!="string"||!t.message.match(/^OK/)){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function mm(t){if(t&&t.status==0&&t.message=="NOTOK"&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if(t.jsonrpc!="2.0"){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function gm(t){if(t==="pending")throw new Error("pending not supported");return t==="latest"?t:parseInt(t.substring(2),16)}function cf(t,e,r){if(t==="call"&&e.code===O.errors.SERVER_ERROR){const i=e.error;if(i&&(i.message.match(/reverted/i)||i.message.match(/VM execution error/i))){let o=i.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),me(o))return o;ai.throwError("missing revert data in call exception",O.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===O.errors.SERVER_ERROR&&(e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&ai.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ai.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&ai.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&ai.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class Ty extends Yu{constructor(e,r){super(e),z(this,"baseUrl",this.getBaseUrl()),z(this,"apiKey",r||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return ai.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,r){const n=Object.keys(r).reduce((o,s)=>{const a=r[s];return a!=null&&(o+=`&${s}=${a}`),o},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${n}${i}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}fetch(e,r,n){return il(this,void 0,void 0,function*(){const i=n?this.getPostUrl():this.getUrl(e,r),o=n?this.getPostData(e,r):null,s=e==="proxy"?mm:E_;this.emit("debug",{action:"request",request:i,provider:this});const a={url:i,throttleSlotInterval:1e3,throttleCallback:(c,h)=>(this.isCommunityResource()&&Ra(),Promise.resolve(!0))};let l=null;o&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},l=Object.keys(o).map(c=>`${c}=${o[c]}`).join("&"));const u=yield Ia(a,l,s||mm);return this.emit("debug",{action:"response",request:i,response:or(u),provider:this}),u})}detectNetwork(){return il(this,void 0,void 0,function*(){return this.network})}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return il(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(i=>cf("sendTransaction",i,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const i=pm(r.transaction);i.module="proxy",i.action="eth_call";try{return yield this.fetch("proxy",i,!0)}catch(o){return cf("call",o,r.transaction)}}case"estimateGas":{const i=pm(r.transaction);i.module="proxy",i.action="eth_estimateGas";try{return yield this.fetch("proxy",i,!0)}catch(o){return cf("estimateGas",o,r.transaction)}}case"getLogs":{const i={action:"getLogs"};if(r.filter.fromBlock&&(i.fromBlock=gm(r.filter.fromBlock)),r.filter.toBlock&&(i.toBlock=gm(r.filter.toBlock)),r.filter.address&&(i.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&ai.throwError("unsupported topic count",O.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){const a=r.filter.topics[0];(typeof a!="string"||a.length!==66)&&ai.throwError("unsupported topic format",O.errors.UNSUPPORTED_OPERATION,{topic0:a}),i.topic0=a}const o=yield this.fetch("logs",i);let s={};for(let a=0;a{["contractAddress","to"].forEach(function(l){s[l]==""&&delete s[l]}),s.creates==null&&s.contractAddress!=null&&(s.creates=s.contractAddress);const a=this.formatter.transactionResponse(s);return s.timeStamp&&(a.timestamp=parseInt(s.timeStamp)),a})})}isCommunityResource(){return this.apiKey==null}}var fu=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Oi=new O(Ht);function ol(){return new Date().getTime()}function vm(t){let e=null;for(let r=0;re?null:(n+i)/2}function So(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(G.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>So(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=So(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let A_=1;function wm(t){let e=null,r=null,n=new Promise(s=>{e=function(){r&&(clearTimeout(r),r=null),s()},r=setTimeout(e,t)});const i=s=>(n=n.then(s),n);function o(){return n}return{cancel:e,getPromise:o,wait:i}}const __=[O.errors.CALL_EXCEPTION,O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED,O.errors.UNPREDICTABLE_GAS_LIMIT],S_=["address","args","errorArgs","errorSignature","method","transaction"];function sl(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function k_(t,e){return function(r){const n={};r.forEach(o=>{const s=t(o.result);n[s]||(n[s]={count:0,result:o.result}),n[s].count++});const i=Object.keys(n);for(let o=0;o=e)return s.result}}}function N_(t,e,r){let n=So;switch(e){case"getBlockNumber":return function(i){const o=i.map(a=>a.result);let s=ym(i.map(a=>a.result),2);if(s!=null)return s=Math.ceil(s),o.indexOf(s+1)>=0&&s++,s>=t._highestBlockNumber&&(t._highestBlockNumber=s),t._highestBlockNumber};case"getGasPrice":return function(i){const o=i.map(s=>s.result);return o.sort(),o[Math.floor(o.length/2)]};case"getEtherPrice":return function(i){return ym(i.map(o=>o.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=ot(i),i.confirmations=-1,So(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=ot(i),i.transactions=i.transactions.map(o=>(o=ot(o),o.confirmations=-1,o)),So(i))}:n=function(i){return i==null?null:So(i)};break;default:throw new Error("unknown method: "+e)}return k_(n,t.quorum)}function ws(t,e){return fu(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:_o(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function M_(t,e,r,n){return fu(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let o=n.filter;return(o.fromBlock&&me(o.fromBlock)||o.toBlock&&me(o.toBlock))&&(i=yield ws(t,e)),i.getLogs(o)}}return Oi.throwError("unknown method error",O.errors.UNKNOWN_ERROR,{method:r,params:n})})}class Ly extends Yu{constructor(e,r){e.length===0&&Oi.throwArgumentError("missing providers","providers",e);const n=e.map((s,a)=>{if(es.isProvider(s)){const c=Mh(s)?2e3:750;return Object.freeze({provider:s,weight:1,stallTimeout:c,priority:1})}const l=ot(s);l.priority==null&&(l.priority=1),l.stallTimeout==null&&(l.stallTimeout=Mh(s)?2e3:750),l.weight==null&&(l.weight=1);const u=l.weight;return(u%1||u>512||u<1)&&Oi.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,u),Object.freeze(l)}),i=n.reduce((s,a)=>s+a.weight,0);r==null?r=i/2:r>i&&Oi.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let o=vm(n.map(s=>s.provider.network));o==null&&(o=new Promise((s,a)=>{setTimeout(()=>{this.detectNetwork().then(s,a)},0)})),super(o),z(this,"providerConfigs",Object.freeze(n)),z(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return fu(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return vm(e)})}perform(e,r){return fu(this,void 0,void 0,function*(){if(e==="sendTransaction"){const l=yield Promise.all(this.providerConfigs.map(u=>u.provider.sendTransaction(r.signedTransaction).then(c=>c.hash,c=>c)));for(let u=0;ul.priority-u.priority);const o=this._highestBlockNumber;let s=0,a=!0;for(;;){const l=ol();let u=i.filter(g=>g.runner&&l-g.startg+v.weight,0);for(;u{g.staller=null}),g.runner=M_(g,o,e,r).then(b=>{g.done=!0,g.result=b,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:v,backend:sl(g,ol()),request:{method:e,params:or(r)},provider:this})},b=>{g.done=!0,g.error=b,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:v,backend:sl(g,ol()),request:{method:e,params:or(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:v,backend:sl(g,null),request:{method:e,params:or(r)},provider:this}),u+=g.weight}const c=[];i.forEach(g=>{g.done||!g.runner||(c.push(g.runner),g.staller&&c.push(g.staller.getPromise()))}),c.length&&(yield Promise.race(c));const h=i.filter(g=>g.done&&g.error==null);if(h.length>=this.quorum){const g=n(h);if(g!==void 0)return i.forEach(v=>{v.staller&&v.staller.cancel(),v.cancelled=!0}),g;a||(yield wm(100).getPromise()),a=!1}const p=i.reduce((g,v)=>{if(!v.done||v.error==null)return g;const b=v.error.code;return __.indexOf(b)>=0&&(g[b]||(g[b]={error:v.error,weight:0}),g[b].weight+=v.weight),g},{});if(Object.keys(p).forEach(g=>{const v=p[g];if(v.weight{x.staller&&x.staller.cancel(),x.cancelled=!0});const b=v.error,S={};S_.forEach(x=>{b[x]!=null&&(S[x]=b[x])}),Oi.throwError(b.reason||b.message,g,S)}),i.filter(g=>!g.done).length===0)break}return i.forEach(l=>{l.staller&&l.staller.cancel(),l.cancelled=!0}),Oi.throwError("failed to meet quorum",O.errors.SERVER_ERROR,{method:e,params:r,results:i.map(l=>sl(l)),provider:this})})}}const jy=null,Cl=new O(Ht),ks="84842078b09946638c03157f83405213";class By extends Xu{constructor(e,r){const n=new Qd(e,r),i=n.connection;i.password&&Cl.throwError("INFURA WebSocket project secrets unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});const o=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,e),z(this,"apiKey",n.projectId),z(this,"projectId",n.projectId),z(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===ks}}class Qd extends Gn{static getWebSocketProvider(e,r){return new By(e,r)}static getApiKey(e){const r={apiKey:ks,projectId:ks,projectSecret:null};return e==null||(typeof e=="string"?r.projectId=e:e.projectSecret!=null?(Cl.assertArgument(typeof e.projectId=="string","projectSecret requires a projectId","projectId",e.projectId),Cl.assertArgument(typeof e.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),r.projectId=e.projectId,r.projectSecret=e.projectSecret):e.projectId&&(r.projectId=e.projectId),r.apiKey=r.projectId),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"goerli":n="goerli.infura.io";break;case"sepolia":n="sepolia.infura.io";break;case"matic":n="polygon-mainnet.infura.io";break;case"maticmum":n="polygon-mumbai.infura.io";break;case"optimism":n="optimism-mainnet.infura.io";break;case"optimism-goerli":n="optimism-goerli.infura.io";break;case"arbitrum":n="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":n="arbitrum-goerli.infura.io";break;default:Cl.throwError("unsupported network",O.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const i={allowGzip:!0,url:"https://"+n+"/v3/"+r.projectId,throttleCallback:(o,s)=>(r.projectId===ks&&Ra(),Promise.resolve(!0))};return r.projectSecret!=null&&(i.user="",i.password=r.projectSecret),i}isCommunityResource(){return this.projectId===ks}}class P_ extends _i{send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);const i={request:n,resolve:null,reject:null},o=new Promise((s,a)=>{i.resolve=s,i.reject=a});return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{const s=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const a=s.map(l=>l.request);return this.emit("debug",{action:"requestBatch",request:or(a),provider:this}),Ia(this.connection,JSON.stringify(a)).then(l=>{this.emit("debug",{action:"response",request:a,response:l,provider:this}),s.forEach((u,c)=>{const h=l[c];if(h.error){const p=new Error(h.error.message);p.code=h.error.code,p.data=h.error.data,u.reject(p)}else u.resolve(h.result)})},l=>{this.emit("debug",{action:"response",error:l,request:a,provider:this}),s.forEach(u=>{u.reject(l)})})},10)),o}}const ff=new O(Ht),C_="ETHERS_JS_SHARED";class Dy extends Gn{static getApiKey(e){return e&&typeof e!="string"&&ff.throwArgumentError("invalid apiKey","apiKey",e),e||C_}static getUrl(e,r){ff.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let n=null;switch(e.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:ff.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+r}}const xm=new O(Ht),bm="62e1ad51b37b8e00394bda3b";class Fy extends Gn{static getApiKey(e){const r={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return e==null?r.applicationId=bm:typeof e=="string"?r.applicationId=e:e.applicationSecretKey!=null?(r.applicationId=e.applicationId,r.applicationSecretKey=e.applicationSecretKey):e.applicationId?r.applicationId=e.applicationId:xm.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"goerli":n="eth-goerli.gateway.pokt.network";break;case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"kovan":n="poa-kovan.gateway.pokt.network";break;case"matic":n="poly-mainnet.gateway.pokt.network";break;case"maticmum":n="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;default:xm.throwError("unsupported network",O.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const i=`https://${n}/v1/lb/${r.applicationId}`,o={headers:{},url:i};return r.applicationSecretKey!=null&&(o.user="",o.password=r.applicationSecretKey),o}isCommunityResource(){return this.applicationId===bm}}const Em=new O(Ht);let I_=1;function Am(t,e){const r="Web3LegacyFetcher";return function(n,i){const o={method:n,params:i,id:I_++,jsonrpc:"2.0"};return new Promise((s,a)=>{this.emit("debug",{action:"request",fetcher:r,request:or(o),provider:this}),e(o,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:o,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:u,provider:this}),u.error){const c=new Error(u.error.message);return c.code=u.error.code,c.data=u.error.data,a(c)}s(u.result)})})}}function R_(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:or(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class Uy extends _i{constructor(e,r){e==null&&Em.throwArgumentError("missing provider","provider",e);let n=null,i=null,o=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),o=e,e.request?(n===""&&(n="eip-1193:"),i=R_(e)):e.sendAsync?i=Am(e,e.sendAsync.bind(e)):e.send?i=Am(e,e.send.bind(e)):Em.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),z(this,"jsonRpcFetchFunc",i),z(this,"provider",o)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const _m=new O(Ht);function O_(t,e){if(t==null&&(t="homestead"),typeof t=="string"){const n=t.match(/^(ws|http)s?:/i);if(n)switch(n[1].toLowerCase()){case"http":case"https":return new _i(t);case"ws":case"wss":return new Xu(t);default:_m.throwArgumentError("unsupported URL scheme","network",t)}}const r=Gd(t);return(!r||!r._defaultProvider)&&_m.throwError("unsupported getDefaultProvider network",O.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:Ly,AlchemyProvider:Kd,AnkrProvider:Ry,CloudflareProvider:Oy,EtherscanProvider:Ty,InfuraProvider:Qd,JsonRpcProvider:_i,NodesmithProvider:Dy,PocketProvider:Fy,Web3Provider:Uy,IpcProvider:jy},e)}const T_=Object.freeze(Object.defineProperty({__proto__:null,AlchemyProvider:Kd,AlchemyWebSocketProvider:Iy,AnkrProvider:Ry,BaseProvider:Yu,CloudflareProvider:Oy,EtherscanProvider:Ty,FallbackProvider:Ly,Formatter:ee,InfuraProvider:Qd,InfuraWebSocketProvider:By,IpcProvider:jy,JsonRpcBatchProvider:P_,JsonRpcProvider:_i,JsonRpcSigner:Wd,NodesmithProvider:Dy,PocketProvider:Fy,Provider:es,Resolver:Ph,StaticJsonRpcProvider:Cy,UrlJsonRpcProvider:Gn,Web3Provider:Uy,WebSocketProvider:Xu,getDefaultProvider:O_,getNetwork:Gd,isCommunityResourcable:ky,isCommunityResource:Mh,showThrottleMessage:Ra},Symbol.toStringTag,{value:"Module"})),L_="solidity/5.7.0",j_=new RegExp("^bytes([0-9]+)$"),B_=new RegExp("^(u?int)([0-9]*)$"),D_=new RegExp("^(.*)\\[([0-9]*)\\]$"),F_="0000000000000000000000000000000000000000000000000000000000000000",ao=new O(L_);function zy(t,e,r){switch(t){case"address":return r?El(e,32):se(e);case"string":return gr(e);case"bytes":return se(e);case"bool":return e=e?"0x01":"0x00",r?El(e,32):se(e)}let n=t.match(B_);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&ao.throwArgumentError("invalid number type","type",t),r&&(i=256),e=G.from(e).toTwos(i),El(e,i/8)}if(n=t.match(j_),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&ao.throwArgumentError("invalid bytes type","type",t),se(e).byteLength!==i&&ao.throwArgumentError(`invalid value for ${t}`,"value",e),r?se((e+F_).substring(0,66)):e}if(n=t.match(D_),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&ao.throwArgumentError(`invalid array length for ${t}`,"value",e);const s=[];return e.forEach(function(a){s.push(zy(i,a,!0))}),Ut(s)}return ao.throwArgumentError("invalid type","type",t)}function U_(t,e){t.length!=e.length&&ao.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(zy(n,e[i]))}),re(Ut(r))}function z_(t,e){return ct(U_(t,e))}var Zu={},Ln={},$y={};const $_=Qo(ME);var H_={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Sm=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(p=>p(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(H_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},Hy=t=>t?Sm(t):Sm;var qy={exports:{}},Vy={},Gy={exports:{}},Wy={};/** + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&typeof self=="object",s=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?i=ze:o&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),c=[31,7936,2031616,520093696],h=[4,1024,262144,67108864],p=[1,256,65536,16777216],g=[6,1536,393216,100663296],v=[0,8,16,24],b=[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],S=[224,256,384,512],x=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],E={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(y){return Object.prototype.toString.call(y)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(y){return typeof y=="object"&&y.buffer&&y.buffer.constructor===ArrayBuffer});for(var T=function(y,B,F){return function(U){return new d(y,B,y).update(U)[F]()}},j=function(y,B,F){return function(U,V){return new d(y,B,V).update(U)[F]()}},D=function(y,B,F){return function(U,V,oe,Q){return f["cshake"+y].update(U,V,oe,Q)[F]()}},$=function(y,B,F){return function(U,V,oe,Q){return f["kmac"+y].update(U,V,oe,Q)[F]()}},H=function(y,B,F,U){for(var V=0;V>5,this.byteCount=this.blockCount<<2,this.outputBlocks=F>>5,this.extraBytes=(F&31)>>3;for(var U=0;U<50;++U)this.s[U]=0}d.prototype.update=function(y){if(this.finalized)throw new Error(r);var B,F=typeof y;if(F!=="string"){if(F==="object"){if(y===null)throw new Error(e);if(l&&y.constructor===ArrayBuffer)y=new Uint8Array(y);else if(!Array.isArray(y)&&(!l||!ArrayBuffer.isView(y)))throw new Error(e)}else throw new Error(e);B=!0}for(var U=this.blocks,V=this.byteCount,oe=y.length,Q=this.blockCount,W=0,Ye=this.s,K,le;W>2]|=y[W]<>2]|=le<>2]|=(192|le>>6)<>2]|=(128|le&63)<=57344?(U[K>>2]|=(224|le>>12)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<>2]|=(240|le>>18)<>2]|=(128|le>>12&63)<>2]|=(128|le>>6&63)<>2]|=(128|le&63)<=V){for(this.start=K-V,this.block=U[Q],K=0;K>8,F=y&255;F>0;)V.unshift(F),y=y>>8,F=y&255,++U;return B?V.push(U):V.unshift(U),this.update(V),V.length},d.prototype.encodeString=function(y){var B,F=typeof y;if(F!=="string"){if(F==="object"){if(y===null)throw new Error(e);if(l&&y.constructor===ArrayBuffer)y=new Uint8Array(y);else if(!Array.isArray(y)&&(!l||!ArrayBuffer.isView(y)))throw new Error(e)}else throw new Error(e);B=!0}var U=0,V=y.length;if(B)U=V;else for(var oe=0;oe=57344?U+=3:(Q=65536+((Q&1023)<<10|y.charCodeAt(++oe)&1023),U+=4)}return U+=this.encode(U*8),this.update(y),U},d.prototype.bytepad=function(y,B){for(var F=this.encode(B),U=0;U>2]|=this.padding[B&3],this.lastByteIndex===this.byteCount)for(y[0]=y[F],B=1;B>4&15]+u[W&15]+u[W>>12&15]+u[W>>8&15]+u[W>>20&15]+u[W>>16&15]+u[W>>28&15]+u[W>>24&15];oe%y===0&&(X(B),V=0)}return U&&(W=B[V],Q+=u[W>>4&15]+u[W&15],U>1&&(Q+=u[W>>12&15]+u[W>>8&15]),U>2&&(Q+=u[W>>20&15]+u[W>>16&15])),Q},d.prototype.arrayBuffer=function(){this.finalize();var y=this.blockCount,B=this.s,F=this.outputBlocks,U=this.extraBytes,V=0,oe=0,Q=this.outputBits>>3,W;U?W=new ArrayBuffer(F+1<<2):W=new ArrayBuffer(Q);for(var Ye=new Uint32Array(W);oe>8&255,Q[W+2]=Ye>>16&255,Q[W+3]=Ye>>24&255;oe%y===0&&X(B)}return U&&(W=oe<<2,Ye=B[V],Q[W]=Ye&255,U>1&&(Q[W+1]=Ye>>8&255),U>2&&(Q[W+2]=Ye>>16&255)),Q};function P(y,B,F){d.call(this,y,B,F)}P.prototype=new d,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),d.prototype.finalize.call(this)};var X=function(y){var B,F,U,V,oe,Q,W,Ye,K,le,Jr,Te,Me,Yr,Pe,fe,xr,he,Le,Xr,ge,$e,bn,He,qe,qt,je,Ve,Or,Ce,Ge,En,Be,We,An,De,ne,st,ve,de,nt,_e,Se,Pt,Ie,Fe,Qt,Ke,Qe,Jt,Re,Ue,br,Ne,Xe,Ci,Ze,et,Kn,Qn,Jn,Yn,Xn;for(U=0;U<48;U+=2)V=y[0]^y[10]^y[20]^y[30]^y[40],oe=y[1]^y[11]^y[21]^y[31]^y[41],Q=y[2]^y[12]^y[22]^y[32]^y[42],W=y[3]^y[13]^y[23]^y[33]^y[43],Ye=y[4]^y[14]^y[24]^y[34]^y[44],K=y[5]^y[15]^y[25]^y[35]^y[45],le=y[6]^y[16]^y[26]^y[36]^y[46],Jr=y[7]^y[17]^y[27]^y[37]^y[47],Te=y[8]^y[18]^y[28]^y[38]^y[48],Me=y[9]^y[19]^y[29]^y[39]^y[49],B=Te^(Q<<1|W>>>31),F=Me^(W<<1|Q>>>31),y[0]^=B,y[1]^=F,y[10]^=B,y[11]^=F,y[20]^=B,y[21]^=F,y[30]^=B,y[31]^=F,y[40]^=B,y[41]^=F,B=V^(Ye<<1|K>>>31),F=oe^(K<<1|Ye>>>31),y[2]^=B,y[3]^=F,y[12]^=B,y[13]^=F,y[22]^=B,y[23]^=F,y[32]^=B,y[33]^=F,y[42]^=B,y[43]^=F,B=Q^(le<<1|Jr>>>31),F=W^(Jr<<1|le>>>31),y[4]^=B,y[5]^=F,y[14]^=B,y[15]^=F,y[24]^=B,y[25]^=F,y[34]^=B,y[35]^=F,y[44]^=B,y[45]^=F,B=Ye^(Te<<1|Me>>>31),F=K^(Me<<1|Te>>>31),y[6]^=B,y[7]^=F,y[16]^=B,y[17]^=F,y[26]^=B,y[27]^=F,y[36]^=B,y[37]^=F,y[46]^=B,y[47]^=F,B=le^(V<<1|oe>>>31),F=Jr^(oe<<1|V>>>31),y[8]^=B,y[9]^=F,y[18]^=B,y[19]^=F,y[28]^=B,y[29]^=F,y[38]^=B,y[39]^=F,y[48]^=B,y[49]^=F,Yr=y[0],Pe=y[1],Fe=y[11]<<4|y[10]>>>28,Qt=y[10]<<4|y[11]>>>28,Ve=y[20]<<3|y[21]>>>29,Or=y[21]<<3|y[20]>>>29,Qn=y[31]<<9|y[30]>>>23,Jn=y[30]<<9|y[31]>>>23,_e=y[40]<<18|y[41]>>>14,Se=y[41]<<18|y[40]>>>14,We=y[2]<<1|y[3]>>>31,An=y[3]<<1|y[2]>>>31,fe=y[13]<<12|y[12]>>>20,xr=y[12]<<12|y[13]>>>20,Ke=y[22]<<10|y[23]>>>22,Qe=y[23]<<10|y[22]>>>22,Ce=y[33]<<13|y[32]>>>19,Ge=y[32]<<13|y[33]>>>19,Yn=y[42]<<2|y[43]>>>30,Xn=y[43]<<2|y[42]>>>30,Ne=y[5]<<30|y[4]>>>2,Xe=y[4]<<30|y[5]>>>2,De=y[14]<<6|y[15]>>>26,ne=y[15]<<6|y[14]>>>26,he=y[25]<<11|y[24]>>>21,Le=y[24]<<11|y[25]>>>21,Jt=y[34]<<15|y[35]>>>17,Re=y[35]<<15|y[34]>>>17,En=y[45]<<29|y[44]>>>3,Be=y[44]<<29|y[45]>>>3,He=y[6]<<28|y[7]>>>4,qe=y[7]<<28|y[6]>>>4,Ci=y[17]<<23|y[16]>>>9,Ze=y[16]<<23|y[17]>>>9,st=y[26]<<25|y[27]>>>7,ve=y[27]<<25|y[26]>>>7,Xr=y[36]<<21|y[37]>>>11,ge=y[37]<<21|y[36]>>>11,Ue=y[47]<<24|y[46]>>>8,br=y[46]<<24|y[47]>>>8,Pt=y[8]<<27|y[9]>>>5,Ie=y[9]<<27|y[8]>>>5,qt=y[18]<<20|y[19]>>>12,je=y[19]<<20|y[18]>>>12,et=y[29]<<7|y[28]>>>25,Kn=y[28]<<7|y[29]>>>25,de=y[38]<<8|y[39]>>>24,nt=y[39]<<8|y[38]>>>24,$e=y[48]<<14|y[49]>>>18,bn=y[49]<<14|y[48]>>>18,y[0]=Yr^~fe&he,y[1]=Pe^~xr&Le,y[10]=He^~qt&Ve,y[11]=qe^~je&Or,y[20]=We^~De&st,y[21]=An^~ne&ve,y[30]=Pt^~Fe&Ke,y[31]=Ie^~Qt&Qe,y[40]=Ne^~Ci&et,y[41]=Xe^~Ze&Kn,y[2]=fe^~he&Xr,y[3]=xr^~Le&ge,y[12]=qt^~Ve&Ce,y[13]=je^~Or&Ge,y[22]=De^~st&de,y[23]=ne^~ve&nt,y[32]=Fe^~Ke&Jt,y[33]=Qt^~Qe&Re,y[42]=Ci^~et&Qn,y[43]=Ze^~Kn&Jn,y[4]=he^~Xr&$e,y[5]=Le^~ge&bn,y[14]=Ve^~Ce&En,y[15]=Or^~Ge&Be,y[24]=st^~de&_e,y[25]=ve^~nt&Se,y[34]=Ke^~Jt&Ue,y[35]=Qe^~Re&br,y[44]=et^~Qn&Yn,y[45]=Kn^~Jn&Xn,y[6]=Xr^~$e&Yr,y[7]=ge^~bn&Pe,y[16]=Ce^~En&He,y[17]=Ge^~Be&qe,y[26]=de^~_e&We,y[27]=nt^~Se&An,y[36]=Jt^~Ue&Pt,y[37]=Re^~br&Ie,y[46]=Qn^~Yn&Ne,y[47]=Jn^~Xn&Xe,y[8]=$e^~Yr&fe,y[9]=bn^~Pe&xr,y[18]=En^~He&qt,y[19]=Be^~qe&je,y[28]=_e^~We&De,y[29]=Se^~An&ne,y[38]=Ue^~Pt&Fe,y[39]=br^~Ie&Qt,y[48]=Yn^~Ne&Ci,y[49]=Xn^~Xe&Ze,y[0]^=b[U],y[1]^=b[U+1]};if(a)t.exports=f;else for(A=0;A>=8;return e}function Ip(t,e,r){let n=0;for(let i=0;ie+1+n&&rn.throwError("child data too short",O.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function P1(t,e){if(t.length===0&&rn.throwError("data too short",O.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&rn.throwError("data short segment too short",O.errors.BUFFER_OVERRUN,{});const n=Ip(t,e+1,r);return e+1+r+n>t.length&&rn.throwError("data long segment too short",O.errors.BUFFER_OVERRUN,{}),Rp(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&rn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{}),Rp(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&rn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const n=Ip(t,e+1,r);e+1+r+n>t.length&&rn.throwError("data array too short",O.errors.BUFFER_OVERRUN,{});const i=re(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&rn.throwError("data too short",O.errors.BUFFER_OVERRUN,{});const n=re(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:re(t[e])}}function Dd(t){const e=se(t),r=P1(e,0);return r.consumed!==e.length&&rn.throwArgumentError("invalid rlp data","data",t),r.result}const EE="address/5.7.0",fi=new O(EE);function Op(t){me(t,20)||fi.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=se(ct(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const AE=9007199254740991;function _E(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const Fd={};for(let t=0;t<10;t++)Fd[String(t)]=String(t);for(let t=0;t<26;t++)Fd[String.fromCharCode(65+t)]=String(10+t);const Tp=Math.floor(_E(AE));function C1(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>Fd[n]).join("");for(;e.length>=Tp;){let n=e.substring(0,Tp);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function gt(t){let e=null;if(typeof t!="string"&&fi.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Op(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fi.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==C1(t)&&fi.throwArgumentError("bad icap checksum","address",t),e=sE(t.substring(4));e.length<40;)e="0"+e;e=Op("0x"+e)}else fi.throwArgumentError("invalid address","address",t);return e}function SE(t){try{return gt(t),!0}catch{}return!1}function kE(t){let e=aE(gt(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+C1("XE00"+e)+e}function Ud(t){let e=null;try{e=gt(t.from)}catch{fi.throwArgumentError("missing from address","transaction",t)}const r=Ho(se(G.from(t.nonce).toHexString()));return gt(Rt(ct(qu([e,r])),12))}function NE(t,e,r){return Un(e)!==32&&fi.throwArgumentError("salt must be 32 bytes","salt",e),Un(r)!==32&&fi.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),gt(Rt(ct(Ut(["0xff",gt(t),e,r])),12))}const ME=Object.freeze(Object.defineProperty({__proto__:null,getAddress:gt,getContractAddress:Ud,getCreate2Address:NE,getIcapAddress:kE,isAddress:SE},Symbol.toStringTag,{value:"Module"}));class PE extends qn{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=gt(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return gt(mt(e.readValue().toHexString(),20))}}class CE extends qn{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Eo=new O(Na);function I1(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const c=u.localName;return c||Eo.throwError("cannot encode object for signature with missing names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]&&Eo.throwError("cannot encode object for signature with duplicate names",O.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]=!0,r[c]})}else Eo.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Eo.throwArgumentError("types/value length mismatch","tuple",r);let i=new yh(t.wordSize),o=new yh(t.wordSize),s=[];e.forEach((l,u)=>{let c=n[u];if(l.dynamic){let h=o.length;l.encode(o,c);let p=i.writeUpdatableValue();s.push(g=>{p(g+h)})}else l.encode(i,c)}),s.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(o),a}function R1(t,e){let r=[],n=t.subReader(0);e.forEach(o=>{let s=null;if(o.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{s=o.decode(l)}catch(u){if(u.code===O.errors.BUFFER_OVERRUN)throw u;s=u,s.baseType=o.name,s.name=o.localName,s.type=o.type}}else try{s=o.decode(t)}catch(a){if(a.code===O.errors.BUFFER_OVERRUN)throw a;s=a,s.baseType=o.name,s.name=o.localName,s.type=o.type}s!=null&&r.push(s)});const i=e.reduce((o,s)=>{const a=s.localName;return a&&(o[a]||(o[a]=0),o[a]++),o},{});e.forEach((o,s)=>{let a=o.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[s];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let o=0;o{throw s}})}return Object.freeze(r)}class IE extends qn{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",o=r===-1||e.dynamic;super("array",i,n,o),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Eo.throwError("insufficient data length",O.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;s++)o++;return o}return t===cr.OVERRUN?r.length-e-1:0}function qE(t,e,r,n,i){return t===cr.OVERLONG?(n.push(i),0):(n.push(65533),j1(t,e,r))}const VE=Object.freeze({error:HE,ignore:j1,replace:qE});function B1(t,e){e==null&&(e=VE.error),t=se(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let o=null,s=null;if((i&224)===192)o=1,s=127;else if((i&240)===224)o=2,s=2047;else if((i&248)===240)o=3,s=65535;else{(i&192)===128?n+=e(cr.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(cr.BAD_PREFIX,n-1,t,r);continue}if(n-1+o>=t.length){n+=e(cr.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-o-1)-1;for(let l=0;l1114111){n+=e(cr.OUT_OF_RANGE,n-1-o,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(cr.UTF16_SURROGATE,n-1-o,t,r,a);continue}if(a<=s){n+=e(cr.OVERLONG,n-1-o,t,r,a);continue}r.push(a)}}return r}function gr(t,e=ha.current){e!=ha.current&&(L1.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const o=t.charCodeAt(n);if(n>=t.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");const s=65536+((i&1023)<<10)+(o&1023);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return se(r)}function GE(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ma(t,e){return GE(B1(t,e))}function WE(t,e=ha.current){return B1(gr(t,e))}class KE extends O1{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,gr(r))}decode(e){return Ma(super.decode(e))}}class Ya extends qn{constructor(e,r){let n=!1;const i=[];e.forEach(s=>{s.dynamic&&(n=!0),i.push(s.type)});const o="tuple("+i.join(",")+")";super("tuple",o,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const o=i.localName;return o&&(n[o]||(n[o]=0),n[o]++),n},{});return this.coders.forEach((n,i)=>{let o=n.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),e[o]==null&&(e[o]=e[i]))}),Object.freeze(e)}encode(e,r){return I1(e,this.coders,r)}decode(e){return e.coerce(this.name,R1(e,this.coders))}}const Xa=new O(Na),QE=new RegExp(/^bytes([0-9]*)$/),JE=new RegExp(/^(u?int)([0-9]*)$/);class YE{constructor(e){z(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new PE(e.name);case"bool":return new RE(e.name);case"string":return new KE(e.name);case"bytes":return new OE(e.name);case"array":return new IE(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Ya((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new LE(e.name)}let r=e.type.match(JE);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&Xa.throwArgumentError("invalid "+r[1]+" bit length","param",e),new zE(n/8,r[1]==="int",e.name)}if(r=e.type.match(QE),r){let n=parseInt(r[1]);return(n===0||n>32)&&Xa.throwArgumentError("invalid bytes length","param",e),new TE(n,e.name)}return Xa.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new iu(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new yh(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(kt.from(i)));return new Ya(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&Xa.throwError("types/values length mismatch",O.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(s=>this._getCoder(kt.from(s))),i=new Ya(n,"_"),o=this._getWriter();return i.encode(o,r),o.data}decode(e,r,n){const i=e.map(s=>this._getCoder(kt.from(s)));return new Ya(i,"_").decode(this._getReader(se(r),n))}}const XE=new YE;function Ao(t){return ct(gr(t))}const D1="hash/5.7.0";function F1(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,s-1):r.push(a)})};return i(t,e),r}function ZE(t){const e={};for(let r=0;r>--l&1}const h=31,p=Math.pow(2,h),g=p>>>1,v=g>>1,b=p-1;let S=0;for(let j=0;j1;){let Y=D+$>>>1;j>>1|c(),H=H<<1^g,J=(J^g)<<1|g|1;w=H,E=1+J-H}let T=n-4;return x.map(j=>{switch(j-T){case 3:return T+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return T+256+(t[a++]<<8|t[a++]);case 1:return T+t[a++];default:return j-1}})}function tA(t){let e=0;return()=>t[e++]}function rA(t){return tA(eA(t))}function nA(t){return t&1?~t>>1:t>>1}function iA(t,e){let r=Array(t);for(let n=0;ne[s]):r}function sA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(lA(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(uA(r,t))}return ZE(z1(e))}function aA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function $1(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[s].push(o));return n}function lA(t,e){let r=1+e(),n=e(),i=aA(e),o=$1(i.length,1+t,e);return z1(o.map((s,a)=>{const l=s[0],u=s.slice(1);return Array(i[a]).fill(void 0).map((c,h)=>{let p=h*n;return[l+h*r,u.map(g=>g+p)]})}))}function uA(t,e){let r=1+e();return $1(r,1+t,e).map(i=>[i[0],i.slice(1)])}function cA(t){let e=ou(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=ou(t,e);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,c)=>c.set.size-u.set.size);let i=t(),o=i%3;i=i/3|0;let s=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:o,fe0f:s,save:a,check:l}}}function fA(){return rA(F1("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Vu=fA(),hA=new Set(ou(Vu)),dA=new Set(ou(Vu)),pA=sA(Vu),mA=cA(Vu),jp=45,Bp=95;function H1(t){return WE(t)}function gA(t){return t.filter(e=>e!=65039)}function q1(t){for(let e of t.split(".")){let r=H1(e);try{for(let n=r.lastIndexOf(Bp)-1;n>=0;n--)if(r[n]!==Bp)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===jp&&r[3]===jp)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function vA(t){return q1(yA(t,gA))}function yA(t,e){let r=H1(t).reverse(),n=[];for(;r.length;){let i=xA(r);if(i){n.push(...e(i));continue}let o=r.pop();if(hA.has(o)){n.push(o);continue}if(dA.has(o))continue;let s=pA[o];if(s){n.push(...s);continue}throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return q1(wA(String.fromCodePoint(...n)))}function wA(t){return t.normalize("NFC")}function xA(t,e){var r;let n=mA,i,o,s=[],a=t.length;for(e&&(e.length=0);a;){let l=t[--a];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)o=l;else if(n.check&&l===o)break;s.push(l),n.fe0f&&(s.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=s.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const bA=new O(D1),V1=new Uint8Array(32);V1.fill(0);function Dp(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function G1(t){const e=gr(vA(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(Dp(e.slice(n))),r}function _l(t){typeof t!="string"&&bA.throwArgumentError("invalid ENS name; not a string","name",t);let e=V1;const r=G1(t);for(;r.length;)e=ct(Ut([e,ct(r.pop())]));return re(e)}function EA(t){return re(Ut(G1(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var AA=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const lt=new O(D1),W1=new Uint8Array(32);W1.fill(0);const _A=G.from(-1),K1=G.from(0),Q1=G.from(1),SA=G.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function kA(t){const e=se(t),r=e.length%32;return r?er([e,W1.slice(r)]):re(e)}const NA=mt(Q1.toHexString(),32),MA=mt(K1.toHexString(),32),Fp={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Qc=["name","version","chainId","verifyingContract","salt"];function Up(t){return function(e){return typeof e!="string"&<.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const PA={name:Up("name"),version:Up("version"),chainId:function(t){try{return G.from(t).toString()}catch{}return lt.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}return lt.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=se(t);if(e.length!==32)throw new Error("bad length");return re(e)}catch{}return lt.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Jc(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&<.throwArgumentError("invalid numeric width","type",t);const i=SA.mask(r?n-1:n),o=r?i.add(Q1).mul(_A):K1;return function(s){const a=G.from(s);return(a.lt(o)||a.gt(i))&<.throwArgumentError(`value out-of-bounds for ${t}`,"value",s),mt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&<.throwArgumentError("invalid bytes width","type",t),function(n){return se(n).length!==r&<.throwArgumentError(`invalid length for ${t}`,"value",n),kA(n)}}}switch(t){case"address":return function(e){return mt(gt(e),32)};case"bool":return function(e){return e?NA:MA};case"bytes":return function(e){return ct(e)};case"string":return function(e){return Ao(e)}}return null}function zp(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class lr{constructor(e){z(this,"types",Object.freeze(or(e))),z(this,"_encoderCache",{}),z(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(u=>{l[u.name]&<.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(a)}`,"types",e),l[u.name]=!0;const c=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];c===a&<.throwArgumentError(`circular type reference to ${JSON.stringify(c)}`,"types",e),!Jc(c)&&(n[c]||lt.throwArgumentError(`unknown type ${JSON.stringify(c)}`,"types",e),n[c].push(a),r[a][c]=!0)})}const o=Object.keys(n).filter(a=>n[a].length===0);o.length===0?lt.throwArgumentError("missing primary type","types",e):o.length>1&<.throwArgumentError(`ambiguous primary types or unused types: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),z(this,"primaryType",o[0]);function s(a,l){l[a]&<.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(u=>{n[u]&&(s(u,l),Object.keys(l).forEach(c=>{i[c][u]=!0}))}),delete l[a]}s(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=zp(a,e[a])+l.map(u=>zp(u,e[u])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Jc(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],o=this.getEncoder(i),s=parseInt(r[3]);return a=>{s>=0&&a.length!==s&<.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(o);return this._types[i]&&(l=l.map(ct)),ct(er(l))}}const n=this.types[e];if(n){const i=Ao(this._types[e]);return o=>{const s=n.map(({name:a,type:l})=>{const u=this.getEncoder(l)(o[a]);return this._types[l]?ct(u):u});return s.unshift(i),er(s)}}return lt.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||lt.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return ct(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Jc(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const s=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&<.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(s,l,n))}const o=this.types[e];return o?o.reduce((s,{name:a,type:l})=>(s[a]=this._visit(l,r[a],n),s),{}):lt.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new lr(e)}static getPrimaryType(e){return lr.from(e).primaryType}static hashStruct(e,r,n){return lr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=Fp[n];i||lt.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Qc.indexOf(n.name)-Qc.indexOf(i.name)),lr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return er(["0x1901",lr.hashDomain(e),lr.from(r).hash(n)])}static hash(e,r,n){return ct(lr.encode(e,r,n))}static resolveNames(e,r,n,i){return AA(this,void 0,void 0,function*(){e=ot(e);const o={};e.verifyingContract&&!me(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const s=lr.from(r);s.visit(n,(a,l)=>(a==="address"&&!me(l,20)&&(o[l]="0x"),l));for(const a in o)o[a]=yield i(a);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),n=s.visit(n,(a,l)=>a==="address"&&o[l]?o[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){lr.hashDomain(e);const i={},o=[];Qc.forEach(l=>{const u=e[l];u!=null&&(i[l]=PA[l](u),o.push({name:l,type:Fp[l]}))});const s=lr.from(r),a=ot(r);return a.EIP712Domain?lt.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=o,s.encode(n),{types:a,domain:i,primaryType:s.primaryType,message:s.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return re(se(u));if(l.match(/^u?int/))return G.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&<.throwArgumentError("invalid string","value",u),u}return lt.throwArgumentError("unsupported type","type",l)})}}}const at=new O(Na);class CA extends ka{}class IA extends ka{}class RA extends ka{}class wh extends ka{static isIndexed(e){return!!(e&&e._isIndexed)}}const OA={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function $p(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class xh{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,z(this,"fragments",r.map(n=>On.from(n)).filter(n=>n!=null)),z(this,"_abiCoder",dr(new.target,"getAbiCoder")()),z(this,"functions",{}),z(this,"errors",{}),z(this,"events",{}),z(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){at.warn("duplicate definition - constructor");return}z(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let o=n.format();if(i[o]){at.warn("duplicate definition - "+o);return}i[o]=n}),this.deploy||z(this,"deploy",sn.from({payable:!1,type:"constructor"})),z(this,"_isInterface",!0)}format(e){e||(e=ke.full),e===ke.sighash&&at.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===ke.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return XE}static getAddress(e){return gt(e)}static getSighash(e){return Rt(Ao(e.format()),0,4)}static getEventTopic(e){return Ao(e.format())}getFunction(e){if(me(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];at.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(o=>o.split("(")[0]===n);return i.length===0?at.throwArgumentError("no matching function","name",n):i.length>1&&at.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[an.fromString(e).format()];return r||at.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(me(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];at.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(o=>o.split("(")[0]===n);return i.length===0?at.throwArgumentError("no matching event","name",n):i.length>1&&at.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Pn.fromString(e).format()];return r||at.throwArgumentError("no matching event","signature",e),r}getError(e){if(me(e)){const n=dr(this.constructor,"getSighash");for(const i in this.errors){const o=this.errors[i];if(e===n(o))return this.errors[i]}at.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(o=>o.split("(")[0]===n);return i.length===0?at.throwArgumentError("no matching error","name",n):i.length>1&&at.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[an.fromString(e).format()];return r||at.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return dr(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),dr(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=se(r);return re(n.slice(0,4))!==this.getSighash(e)&&at.throwArgumentError(`data signature does not match error ${e.name}.`,"data",re(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),re(Ut([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=se(r);return re(n.slice(0,4))!==this.getSighash(e)&&at.throwArgumentError(`data signature does not match function ${e.name}.`,"data",re(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),re(Ut([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=se(r),i=null,o="",s=null,a=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const u=re(n.slice(0,4)),c=OA[u];if(c)s=this._abiCoder.decode(c.inputs,n.slice(4)),a=c.name,l=c.signature,c.reason&&(i=s[0]),a==="Error"?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:a==="Panic"&&(o=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const h=this.getError(u);s=this._abiCoder.decode(h.inputs,n.slice(4)),a=h.name,l=h.format()}catch{}break}}return at.throwError("call revert exception"+o,O.errors.CALL_EXCEPTION,{method:e.format(),data:re(r),errorArgs:s,errorName:a,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),re(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&at.throwError("too many arguments for "+e.format(),O.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(o,s)=>o.type==="string"?Ao(s):o.type==="bytes"?ct(re(s)):(o.type==="bool"&&typeof s=="boolean"&&(s=s?"0x01":"0x00"),o.type.match(/^u?int/)&&(s=G.from(s).toHexString()),o.type==="address"&&this._abiCoder.encode(["address"],[s]),mt(re(s),32));for(r.forEach((o,s)=>{let a=e.inputs[s];if(!a.indexed){o!=null&&at.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,o);return}o==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?at.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,o):Array.isArray(o)?n.push(o.map(l=>i(a,l))):n.push(i(a,o))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&at.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((s,a)=>{const l=r[a];if(s.indexed)if(s.type==="string")n.push(Ao(l));else if(s.type==="bytes")n.push(ct(l));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([s.type],[l]))}else i.push(s),o.push(l)}),{data:this._abiCoder.encode(i,o),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let p=this.getEventTopic(e);(!me(n[0],32)||n[0].toLowerCase()!==p)&&at.throwError("fragment/topic mismatch",O.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:p,value:n[0]}),n=n.slice(1)}let i=[],o=[],s=[];e.inputs.forEach((p,g)=>{p.indexed?p.type==="string"||p.type==="bytes"||p.baseType==="tuple"||p.baseType==="array"?(i.push(kt.fromObject({type:"bytes32",name:p.name})),s.push(!0)):(i.push(p),s.push(!1)):(o.push(p),s.push(!1))});let a=n!=null?this._abiCoder.decode(i,Ut(n)):null,l=this._abiCoder.decode(o,r,!0),u=[],c=0,h=0;e.inputs.forEach((p,g)=>{if(p.indexed)if(a==null)u[g]=new wh({_isIndexed:!0,hash:null});else if(s[g])u[g]=new wh({_isIndexed:!0,hash:a[h++]});else try{u[g]=a[h++]}catch(v){u[g]=v}else try{u[g]=l[c++]}catch(v){u[g]=v}if(p.name&&u[p.name]==null){const v=u[g];v instanceof Error?Object.defineProperty(u,p.name,{enumerable:!0,get:()=>{throw $p(`property ${JSON.stringify(p.name)}`,v)}}):u[p.name]=v}});for(let p=0;p{throw $p(`index ${p}`,g)}})}return Object.freeze(u)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new IA({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:G.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new CA({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=re(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new RA({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const TA="abstract-provider/5.7.0";var LA=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const jA=new O(TA);class BA extends ka{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class es{constructor(){jA.checkAbstract(new.target,es),z(this,"_isProvider",!0)}getFeeData(){return LA(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield wt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(s=>null)});let n=null,i=null,o=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,o=G.from("1500000000"),i=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:o,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const DA="abstract-signer/5.7.0";var Lr=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ar=new O(DA),FA=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],UA=[O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED];class Pa{constructor(){Ar.checkAbstract(new.target,Pa),z(this,"_isSigner",!0)}getBalance(e){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Lr(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield wt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Lr(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield wt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Lr(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Lr(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Lr(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)FA.indexOf(n)===-1&&Ar.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=ot(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Ar.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Lr(this,void 0,void 0,function*(){const r=yield wt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Lr(this,void 0,void 0,function*(){if(i==null)return null;const o=yield this.resolveName(i);return o==null&&Ar.throwArgumentError("provided ENS name resolves to null","tx.to",i),o})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Ar.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ar.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const o=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Ar.throwError("network does not support EIP-1559",O.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ar.throwError("failed to get consistent fee data",O.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(UA.indexOf(i.code)>=0)throw i;return Ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Ar.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield wt(r)})}_checkProvider(e){this.provider||Ar.throwError("missing provider",O.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class zd extends Pa{constructor(e,r){super(),z(this,"address",e),z(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ar.throwError(e,O.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new zd(this.address,e)}}var J1={},xe={},Ca=Y1;function Y1(t,e){if(!t)throw new Error(e||"Assertion failed")}Y1.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var bh={exports:{}};typeof Object.create=="function"?bh.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:bh.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var zA=bh.exports,$A=Ca,HA=zA;xe.inherits=HA;function qA(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function VA(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=o&63|128):qA(t,i)?(o=65536+((o&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}xe.htonl=X1;function WA(t,e){for(var r="",n=0;n>>0}return o}xe.join32=KA;function QA(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}xe.split32=QA;function JA(t,e){return t>>>e|t<<32-e}xe.rotr32=JA;function YA(t,e){return t<>>32-e}xe.rotl32=YA;function XA(t,e){return t+e>>>0}xe.sum32=XA;function ZA(t,e,r){return t+e+r>>>0}xe.sum32_3=ZA;function e3(t,e,r,n){return t+e+r+n>>>0}xe.sum32_4=e3;function t3(t,e,r,n,i){return t+e+r+n+i>>>0}xe.sum32_5=t3;function r3(t,e,r,n){var i=t[e],o=t[e+1],s=n+o>>>0,a=(s>>0,t[e+1]=s}xe.sum64=r3;function n3(t,e,r,n){var i=e+n>>>0,o=(i>>0}xe.sum64_hi=n3;function i3(t,e,r,n){var i=e+n;return i>>>0}xe.sum64_lo=i3;function o3(t,e,r,n,i,o,s,a){var l=0,u=e;u=u+n>>>0,l+=u>>0,l+=u>>0,l+=u>>0}xe.sum64_4_hi=o3;function s3(t,e,r,n,i,o,s,a){var l=e+n+o+a;return l>>>0}xe.sum64_4_lo=s3;function a3(t,e,r,n,i,o,s,a,l,u){var c=0,h=e;h=h+n>>>0,c+=h>>0,c+=h>>0,c+=h>>0,c+=h>>0}xe.sum64_5_hi=a3;function l3(t,e,r,n,i,o,s,a,l,u){var c=e+n+o+a+u;return c>>>0}xe.sum64_5_lo=l3;function u3(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}xe.rotr64_hi=u3;function c3(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}xe.rotr64_lo=c3;function f3(t,e,r){return t>>>r}xe.shr64_hi=f3;function h3(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}xe.shr64_lo=h3;var ts={},Hp=xe,d3=Ca;function Gu(){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}ts.BlockHash=Gu;Gu.prototype.update=function(e,r){if(e=Hp.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Hp.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[o++]=e>>>16&255,i[o++]=e>>>8&255,i[o++]=e&255}else for(i[o++]=e&255,i[o++]=e>>>8&255,i[o++]=e>>>16&255,i[o++]=e>>>24&255,i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=0,s=8;s>>3}wn.g0_256=y3;function w3(t){return fn(t,17)^fn(t,19)^t>>>10}wn.g1_256=w3;var qo=xe,x3=ts,b3=wn,Yc=qo.rotl32,ps=qo.sum32,E3=qo.sum32_5,A3=b3.ft_1,iy=x3.BlockHash,_3=[1518500249,1859775393,2400959708,3395469782];function gn(){if(!(this instanceof gn))return new gn;iy.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}qo.inherits(gn,iy);var S3=gn;gn.blockSize=512;gn.outSize=160;gn.hmacStrength=80;gn.padLength=64;gn.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),h5(e.length<=this.blockSize);for(var r=e.length;r>8,p=c&255;h?l.push(h,p):l.push(p)}return l}r.toArray=n;function i(s){return s.length===1?"0"+s:s}r.zero2=i;function o(s){for(var a="",l=0;l(p>>1)-1?b=(p>>1)-S:b=S,g.isubn(b)):b=0,h[v]=b,g.iushrn(1)}return h}r.getNAF=n;function i(l,u){var c=[[],[]];l=l.clone(),u=u.clone();for(var h=0,p=0,g;l.cmpn(-h)>0||u.cmpn(-p)>0;){var v=l.andln(3)+h&3,b=u.andln(3)+p&3;v===3&&(v=-1),b===3&&(b=-1);var S;v&1?(g=l.andln(7)+h&7,(g===3||g===5)&&b===2?S=-v:S=v):S=0,c[0].push(S);var x;b&1?(g=u.andln(7)+p&7,(g===3||g===5)&&v===2?x=-b:x=b):x=0,c[1].push(x),2*h===S+1&&(h=1-h),2*p===x+1&&(p=1-p),l.iushrn(1),u.iushrn(1)}return c}r.getJSF=i;function o(l,u,c){var h="_"+u;l.prototype[u]=function(){return this[h]!==void 0?this[h]:this[h]=c.call(this)}}r.cachedProperty=o;function s(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=s;function a(l){return new ce(l,"hex","le")}r.intFromLE=a}),su=wr.getNAF,m5=wr.getJSF,au=wr.assert;function Pi(t,e){this.type=t,this.p=new ce(e.p,16),this.red=e.prime?ce.red(e.prime):ce.mont(this.p),this.zero=new ce(0).toRed(this.red),this.one=new ce(1).toRed(this.red),this.two=new ce(2).toRed(this.red),this.n=e.n&&new ce(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Zi=Pi;Pi.prototype.point=function(){throw new Error("Not implemented")};Pi.prototype.validate=function(){throw new Error("Not implemented")};Pi.prototype._fixedNafMul=function(e,r){au(e.precomputed);var n=e._getDoubles(),i=su(r,1,this._bitLength),o=(1<=a;u--)l=(l<<1)+i[u];s.push(l)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),p=o;p>0;p--){for(a=0;a=0;l--){for(var u=0;l>=0&&s[l]===0;l--)u++;if(l>=0&&u++,a=a.dblp(u),l<0)break;var c=s[l];au(c!==0),e.type==="affine"?c>0?a=a.mixedAdd(o[c-1>>1]):a=a.mixedAdd(o[-c-1>>1].neg()):c>0?a=a.add(o[c-1>>1]):a=a.add(o[-c-1>>1].neg())}return e.type==="affine"?a.toP():a};Pi.prototype._wnafMulAdd=function(e,r,n,i,o){var s=this._wnafT1,a=this._wnafT2,l=this._wnafT3,u=0,c,h,p;for(c=0;c=1;c-=2){var v=c-1,b=c;if(s[v]!==1||s[b]!==1){l[v]=su(n[v],s[v],this._bitLength),l[b]=su(n[b],s[b],this._bitLength),u=Math.max(l[v].length,u),u=Math.max(l[b].length,u);continue}var S=[r[v],null,null,r[b]];r[v].y.cmp(r[b].y)===0?(S[1]=r[v].add(r[b]),S[2]=r[v].toJ().mixedAdd(r[b].neg())):r[v].y.cmp(r[b].y.redNeg())===0?(S[1]=r[v].toJ().mixedAdd(r[b]),S[2]=r[v].add(r[b].neg())):(S[1]=r[v].toJ().mixedAdd(r[b]),S[2]=r[v].toJ().mixedAdd(r[b].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],w=m5(n[v],n[b]);for(u=Math.max(w[0].length,u),l[v]=new Array(u),l[b]=new Array(u),h=0;h=0;c--){for(var $=0;c>=0;){var H=!0;for(h=0;h=0&&$++,j=j.dblp($),c<0)break;for(h=0;h0?p=a[h][J-1>>1]:J<0&&(p=a[h][-J-1>>1].neg()),p.type==="affine"?j=j.mixedAdd(p):j=j.add(p))}}for(c=0;c=Math.ceil((e.bitLength()+1)/r.step):!1};Ir.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,o=0;o=0&&(g=u,v=c),h.negative&&(h=h.neg(),p=p.neg()),g.negative&&(g=g.neg(),v=v.neg()),[{a:h,b:p},{a:g,b:v}]};Rr.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],o=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),a=o.mul(n.a),l=s.mul(i.a),u=o.mul(n.b),c=s.mul(i.b),h=e.sub(a).sub(l),p=u.add(c).neg();return{k1:h,k2:p}};Rr.prototype.pointFromX=function(e,r){e=new ce(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(e,i)};Rr.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0};Rr.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,o=this._endoWnafT2,s=0;s":""};Mt.prototype.isInfinity=function(){return this.inf};Mt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Mt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)};Mt.prototype.getX=function(){return this.x.fromRed()};Mt.prototype.getY=function(){return this.y.fromRed()};Mt.prototype.mul=function(e){return e=new ce(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Mt.prototype.mulAdd=function(e,r,n){var i=[this,r],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};Mt.prototype.jmulAdd=function(e,r,n){var i=[this,r],o=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};Mt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Mt.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(o){return o.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Mt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Lt(t,e,r,n){Zi.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ce(0)):(this.x=new ce(e,16),this.y=new ce(r,16),this.z=new ce(n,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}Hd(Lt,Zi.BasePoint);Rr.prototype.jpoint=function(e,r,n){return new Lt(this,e,r,n)};Lt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};Lt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Lt.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),o=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(o),u=s.redSub(a);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=l.redSqr(),h=c.redMul(l),p=i.redMul(c),g=u.redSqr().redIAdd(h).redISub(p).redISub(p),v=u.redMul(p.redISub(g)).redISub(s.redMul(h)),b=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,v,b)};Lt.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),o=this.y,s=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=o.redSub(s);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),p=l.redSqr().redIAdd(c).redISub(h).redISub(h),g=l.redMul(h.redISub(p)).redISub(o.redMul(c)),v=this.z.redMul(a);return this.curve.jpoint(p,g,v)};Lt.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}};Lt.prototype.inspect=function(){return this.isInfinity()?"":""};Lt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Sl=is(function(t,e){var r=e;r.base=Zi,r.short=v5,r.mont=null,r.edwards=null}),kl=is(function(t,e){var r=e,n=wr.assert;function i(a){a.type==="short"?this.curve=new Sl.short(a):a.type==="edwards"?this.curve=new Sl.edwards(a):this.curve=new Sl.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function o(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:u}),u}})}o("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:tn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:tn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:tn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:tn.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"]}),o("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:tn.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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:tn.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:tn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}o("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:tn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function Ai(t){if(!(this instanceof Ai))return new Ai(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=qr.toArray(t.entropy,t.entropyEnc||"hex"),r=qr.toArray(t.nonce,t.nonceEnc||"hex"),n=qr.toArray(t.pers,t.persEnc||"hex");$d(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var gy=Ai;Ai.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ai.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=qr.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length"};var y5=wr.assert;function Wu(t,e){if(t instanceof Wu)return t;this._importDER(t,e)||(y5(t.r&&t.s,"Signature without r or s"),this.r=new ce(t.r,16),this.s=new ce(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Ku=Wu;function w5(){this.place=0}function ef(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return i<=127?!1:(e.place=s,i)}function Wp(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Wu.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Wp(r),n=Wp(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];tf(i,r.length),i=i.concat(r),i.push(2),tf(i,n.length);var o=i.concat(n),s=[48];return tf(s,o.length),s=s.concat(o),wr.encode(s,e)};var x5=function(){throw new Error("unsupported")},vy=wr.assert;function Cr(t){if(!(this instanceof Cr))return new Cr(t);typeof t=="string"&&(vy(Object.prototype.hasOwnProperty.call(kl,t),"Unknown curve "+t),t=kl[t]),t instanceof kl.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var b5=Cr;Cr.prototype.keyPair=function(e){return new qd(this,e)};Cr.prototype.keyFromPrivate=function(e,r){return qd.fromPrivate(this,e,r)};Cr.prototype.keyFromPublic=function(e,r){return qd.fromPublic(this,e,r)};Cr.prototype.genKeyPair=function(e){e||(e={});for(var r=new gy({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||x5(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ce(2));;){var o=new ce(r.generate(n));if(!(o.cmp(i)>0))return o.iaddn(1),this.keyFromPrivate(o)}};Cr.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Cr.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ce(e,16));for(var o=this.n.byteLength(),s=r.getPrivate().toArray("be",o),a=e.toArray("be",o),l=new gy({hash:this.hash,entropy:s,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new ce(1)),c=0;;c++){var h=i.k?i.k(c):new ce(l.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(u)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var g=p.getX(),v=g.umod(this.n);if(v.cmpn(0)!==0){var b=h.invm(this.n).mul(v.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var S=(p.getY().isOdd()?1:0)|(g.cmp(v)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),S^=1),new Ku({r:v,s:b,recoveryParam:S})}}}}}};Cr.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ce(e,16)),n=this.keyFromPublic(n,i),r=new Ku(r,"hex");var o=r.r,s=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a=s.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(o).umod(this.n),c;return this.curve._maxwellTrick?(c=this.g.jmulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.eqXToP(o)):(c=this.g.mulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.getX().umod(this.n).cmp(o)===0)};Cr.prototype.recoverPubKey=function(t,e,r,n){vy((3&r)===r,"The recovery param is more than two bits"),e=new Ku(e,n);var i=this.n,o=new ce(t),s=e.r,a=e.s,l=r&1,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var c=e.r.invm(i),h=i.sub(o).mul(c).umod(i),p=a.mul(c).umod(i);return this.g.mulAdd(h,s,p)};Cr.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Ku(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var E5=is(function(t,e){var r=e;r.version="6.5.4",r.utils=wr,r.rand=function(){throw new Error("unsupported")},r.curve=Sl,r.curves=kl,r.ec=b5,r.eddsa=null}),A5=E5.ec;const _5="signing-key/5.7.0",Sh=new O(_5);let rf=null;function nn(){return rf||(rf=new A5("secp256k1")),rf}class S5{constructor(e){z(this,"curve","secp256k1"),z(this,"privateKey",re(e)),Un(this.privateKey)!==32&&Sh.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=nn().keyFromPrivate(se(this.privateKey));z(this,"publicKey","0x"+r.getPublic(!1,"hex")),z(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),z(this,"_isSigningKey",!0)}_addPoint(e){const r=nn().keyFromPublic(se(this.publicKey)),n=nn().keyFromPublic(se(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=nn().keyFromPrivate(se(this.privateKey)),n=se(e);n.length!==32&&Sh.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Hu({recoveryParam:i.recoveryParam,r:mt("0x"+i.r.toString(16),32),s:mt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=nn().keyFromPrivate(se(this.privateKey)),n=nn().keyFromPublic(se(yy(e)));return mt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function k5(t,e){const r=Hu(e),n={r:se(r.r),s:se(r.s)};return"0x"+nn().recoverPubKey(se(t),n,r.recoveryParam).encode("hex",!1)}function yy(t,e){const r=se(t);if(r.length===32){const n=new S5(r);return e?"0x"+nn().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?re(r):"0x"+nn().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+nn().keyFromPublic(r).getPublic(!0,"hex"):re(r)}return Sh.throwArgumentError("invalid public or private key","key","[REDACTED]")}const N5="transactions/5.7.0",Vn=new O(N5);var Kp;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Kp||(Kp={}));function Vd(t){return t==="0x"?null:gt(t)}function Ft(t){return t==="0x"?T1:G.from(t)}function M5(t){const e=yy(t);return gt(Rt(ct(Rt(e,1)),12))}function wy(t,e){return M5(k5(se(t),e))}function fr(t,e){const r=Ho(G.from(t).toHexString());return r.length>32&&Vn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function nf(t,e){return{address:gt(t),storageKeys:(e||[]).map((r,n)=>(Un(r)!==32&&Vn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function eo(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Vn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),nf(r[0],r[1])):nf(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,o)=>(i[o]=!0,i),{});return nf(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function xy(t){return eo(t).map(e=>[e.address,e.storageKeys])}function P5(t,e){if(t.gasPrice!=null){const n=G.from(t.gasPrice),i=G.from(t.maxFeePerGas||0);n.eq(i)||Vn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[fr(t.chainId||0,"chainId"),fr(t.nonce||0,"nonce"),fr(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fr(t.maxFeePerGas||0,"maxFeePerGas"),fr(t.gasLimit||0,"gasLimit"),t.to!=null?gt(t.to):"0x",fr(t.value||0,"value"),t.data||"0x",xy(t.accessList||[])];if(e){const n=Hu(e);r.push(fr(n.recoveryParam,"recoveryParam")),r.push(Ho(n.r)),r.push(Ho(n.s))}return er(["0x02",qu(r)])}function C5(t,e){const r=[fr(t.chainId||0,"chainId"),fr(t.nonce||0,"nonce"),fr(t.gasPrice||0,"gasPrice"),fr(t.gasLimit||0,"gasLimit"),t.to!=null?gt(t.to):"0x",fr(t.value||0,"value"),t.data||"0x",xy(t.accessList||[])];if(e){const n=Hu(e);r.push(fr(n.recoveryParam,"recoveryParam")),r.push(Ho(n.r)),r.push(Ho(n.s))}return er(["0x01",qu(r)])}function by(t,e,r){try{const n=Ft(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Vn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=mt(e[1],32),t.s=mt(e[2],32);try{const n=ct(r(t));t.from=wy(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function I5(t){const e=Dd(t.slice(1));e.length!==9&&e.length!==12&&Vn.throwArgumentError("invalid component count for transaction type: 2","payload",re(t));const r=Ft(e[2]),n=Ft(e[3]),i={type:2,chainId:Ft(e[0]).toNumber(),nonce:Ft(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ft(e[4]),to:Vd(e[5]),value:Ft(e[6]),data:e[7],accessList:eo(e[8])};return e.length===9||(i.hash=ct(t),by(i,e.slice(9),P5)),i}function R5(t){const e=Dd(t.slice(1));e.length!==8&&e.length!==11&&Vn.throwArgumentError("invalid component count for transaction type: 1","payload",re(t));const r={type:1,chainId:Ft(e[0]).toNumber(),nonce:Ft(e[1]).toNumber(),gasPrice:Ft(e[2]),gasLimit:Ft(e[3]),to:Vd(e[4]),value:Ft(e[5]),data:e[6],accessList:eo(e[7])};return e.length===8||(r.hash=ct(t),by(r,e.slice(8),C5)),r}function O5(t){const e=Dd(t);e.length!==9&&e.length!==6&&Vn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Ft(e[0]).toNumber(),gasPrice:Ft(e[1]),gasLimit:Ft(e[2]),to:Vd(e[3]),value:Ft(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=G.from(e[6]).toNumber()}catch{return r}if(r.r=mt(e[7],32),r.s=mt(e[8],32),G.from(r.r).isZero()&&G.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(re(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const o=ct(qu(i));try{r.from=wy(o,{r:re(r.r),s:re(r.s),recoveryParam:n})}catch{}r.hash=ct(t)}return r.type=null,r}function T5(t){const e=se(t);if(e[0]>127)return O5(e);switch(e[0]){case 1:return R5(e);case 2:return I5(e)}return Vn.throwError(`unsupported transaction type: ${e[0]}`,O.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const L5="contracts/5.7.0";var Qi=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const vt=new O(L5);function lu(t,e){return Qi(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&vt.throwArgumentError("invalid address or ENS name","name",r);try{return gt(r)}catch{}t||vt.throwError("a provider or signer is needed to resolve ENS names",O.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&vt.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Nl(t,e,r){return Qi(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Nl(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield lu(t,e):r.type==="tuple"?yield Nl(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Nl(t,n,r.arrayChildren))):Promise.reject(vt.makeError("invalid value for array",O.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Qu(t,e,r){return Qi(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=ot(r.pop())),vt.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=wt({override:lu(t.signer,n.from),signer:t.signer.getAddress()}).then(u=>Qi(this,void 0,void 0,function*(){return gt(u.signer)!==u.override&&vt.throwError("Contract with a Signer cannot override from",O.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=t.signer.getAddress():n.from&&(n.from=lu(t.provider,n.from));const i=yield wt({args:Nl(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:wt(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(a.nonce!=null&&(s.nonce=G.from(a.nonce).toNumber()),a.gasLimit!=null&&(s.gasLimit=G.from(a.gasLimit)),a.gasPrice!=null&&(s.gasPrice=G.from(a.gasPrice)),a.maxFeePerGas!=null&&(s.maxFeePerGas=G.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=G.from(a.maxPriorityFeePerGas)),a.from!=null&&(s.from=a.from),a.type!=null&&(s.type=a.type),a.accessList!=null&&(s.accessList=eo(a.accessList)),s.gasLimit==null&&e.gas!=null){let u=21e3;const c=se(o);for(let h=0;hn[u]!=null);return l.length&&vt.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,O.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),s})}function j5(t,e){return function(...r){return Qu(t,e,r)}}function B5(t,e){const r=t.signer||t.provider;return function(...n){return Qi(this,void 0,void 0,function*(){r||vt.throwError("estimate require a provider or signer",O.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Qu(t,e,n);return yield r.estimateGas(i)})}}function D5(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(o=>{let s=or(o),a=null;try{a=t.interface.parseLog(o)}catch{}return a&&(s.args=a.args,s.decode=(l,u)=>t.interface.decodeEventLog(a.eventFragment,l,u),s.event=a.name,s.eventSignature=a.signature),s.removeListener=()=>t.provider,s.getBlock=()=>t.provider.getBlock(i.blockHash),s.getTransaction=()=>t.provider.getTransaction(i.transactionHash),s.getTransactionReceipt=()=>Promise.resolve(i),s}),i))}function Ey(t,e,r){const n=t.signer||t.provider;return function(...i){return Qi(this,void 0,void 0,function*(){let o;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=ot(i.pop());l.blockTag!=null&&(o=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(o));const s=yield Qu(t,e,i),a=yield n.call(s,o);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===O.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=s),l}})}}function F5(t,e){return function(...r){return Qi(this,void 0,void 0,function*(){t.signer||vt.throwError("sending a transaction requires a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Qu(t,e,r),i=yield t.signer.sendTransaction(n);return D5(t,i),i})}}function Qp(t,e,r){return e.constant?Ey(t,e,r):F5(t,e)}function Ay(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class da{constructor(e,r){z(this,"tag",e),z(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class U5 extends da{constructor(){super("error",null)}}class Jp extends da{constructor(e,r,n,i){const o={address:e};let s=r.getEventTopic(n);i?(s!==i[0]&&vt.throwArgumentError("topic mismatch","topics",i),o.topics=i.slice()):o.topics=[s],super(Ay(o),o),z(this,"address",e),z(this,"interface",r),z(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=yE(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class Yp extends da{constructor(e,r){super("*",{address:e}),z(this,"address",e),z(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class z5{constructor(e,r,n){z(this,"interface",dr(new.target,"getInterface")(r)),n==null?(z(this,"provider",null),z(this,"signer",null)):Pa.isSigner(n)?(z(this,"provider",n.provider||null),z(this,"signer",n)):es.isProvider(n)?(z(this,"provider",n),z(this,"signer",null)):vt.throwArgumentError("invalid signer or provider","signerOrProvider",n),z(this,"callStatic",{}),z(this,"estimateGas",{}),z(this,"functions",{}),z(this,"populateTransaction",{}),z(this,"filters",{});{const s={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];z(this.filters,a,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),s[l.name]||(s[l.name]=[]),s[l.name].push(a)}),Object.keys(s).forEach(a=>{const l=s[a];l.length===1?z(this.filters,a,this.filters[l[0]]):vt.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(z(this,"_runningEvents",{}),z(this,"_wrappedEmits",{}),e==null&&vt.throwArgumentError("invalid contract address or ENS name","addressOrName",e),z(this,"address",e),this.provider)z(this,"resolvedAddress",lu(this.provider,e));else try{z(this,"resolvedAddress",Promise.resolve(gt(e)))}catch{vt.throwError("provider is required to use ENS name as contract address",O.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(s=>{});const i={},o={};Object.keys(this.interface.functions).forEach(s=>{const a=this.interface.functions[s];if(o[s]){vt.warn(`Duplicate ABI entry for ${JSON.stringify(s)}`);return}o[s]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(s)}this[s]==null&&z(this,s,Qp(this,a,!0)),this.functions[s]==null&&z(this.functions,s,Qp(this,a,!1)),this.callStatic[s]==null&&z(this.callStatic,s,Ey(this,a,!0)),this.populateTransaction[s]==null&&z(this.populateTransaction,s,j5(this,a)),this.estimateGas[s]==null&&z(this.estimateGas,s,B5(this,a))}),Object.keys(i).forEach(s=>{const a=i[s];if(a.length>1)return;s=s.substring(1);const l=a[0];try{this[s]==null&&z(this,s,this[l])}catch{}this.functions[s]==null&&z(this.functions,s,this.functions[l]),this.callStatic[s]==null&&z(this.callStatic,s,this.callStatic[l]),this.populateTransaction[s]==null&&z(this.populateTransaction,s,this.populateTransaction[l]),this.estimateGas[s]==null&&z(this.estimateGas,s,this.estimateGas[l])})}static getContractAddress(e){return Ud(e)}static getInterface(e){return xh.isInterface(e)?e:new xh(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&vt.throwError("contract not deployed",O.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||vt.throwError("sending a transactions require a signer",O.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=ot(e||{});return["from","to"].forEach(function(n){r[n]!=null&&vt.throwError("cannot override "+n,O.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new zd(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&z(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return wh.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new U5);if(e==="event")return this._normalizeRunningEvent(new da("event",null));if(e==="*")return this._normalizeRunningEvent(new Yp(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new Jp(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new Jp(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new da(Ay(r),r))}return this._normalizeRunningEvent(new Yp(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=or(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||vt.throwError("events require a provider or a signer with a provider",O.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=o=>{let s=this._wrapEvent(e,o,r);if(s.decodeError==null)try{const a=e.getEmit(s);this.emit(e.filter,...a)}catch(a){s.decodeError=a.error}e.filter!=null&&this.emit("event",s),s.decodeError!=null&&this.emit("error",s.decodeError,s)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),o=ot(i.filter);return typeof r=="string"&&me(r,32)?(n!=null&&vt.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),o.blockHash=r):(o.fromBlock=r??0,o.toBlock=n??"latest"),this.provider.getLogs(o).then(s=>s.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class $5 extends z5{}class _y{constructor(e){z(this,"alphabet",e),z(this,"base",e.length),z(this,"_alphabetMap",{}),z(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(s%this.base),s=s/this.base|0}let i="";for(let o=0;r[o]===0&&o=0;--o)i+=this.alphabet[n[o]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;o>0;)r.push(o&255),o>>=8}for(let n=0;e[n]===this._leader&&n0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}const q5="networks/5.7.1",Zp=new O(q5);function V5(t){return t&&typeof t.renetwork=="function"}function Mn(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const o=["goerli","ropsten","rinkeby","sepolia"];try{const s=new r.PocketProvider(t,n.pocket);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const o=["ropsten"],s=new r.AnkrProvider(t,n.ankr);s.network&&o.indexOf(s.network.name)===-1&&i.push(s)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let o=1;return n.quorum!=null?o=n.quorum:t==="homestead"&&(o=2),new r.FallbackProvider(i,o)}return i[0]};return e.renetwork=function(r){return Mn(r)},e}function uu(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return uu(t,n)},r}const em={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Mn("homestead")},tm={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Mn("ropsten")},rm={chainId:63,name:"classicMordor",_defaultProvider:uu("https://www.ethercluster.com/mordor","classicMordor")},el={unspecified:{chainId:0,name:"unspecified"},homestead:em,mainnet:em,morden:{chainId:2,name:"morden"},ropsten:tm,testnet:tm,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Mn("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Mn("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Mn("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Mn("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:uu("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:rm,classicTestnet:rm,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:uu("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Mn("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Mn("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Gd(t){if(t==null)return null;if(typeof t=="number"){for(const n in el){const i=el[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=el[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=el[t.name];if(!e)return typeof t.chainId!="number"&&Zp.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&Zp.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(V5(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const G5="web/5.7.1";var W5=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};function K5(t,e){return W5(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const s=e.fetchOptions;s.mode&&(r.mode=s.mode),s.cache&&(r.cache=s.cache),s.credentials&&(r.credentials=s.credentials),s.redirect&&(r.redirect=s.redirect),s.referrer&&(r.referrer=s.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach((s,a)=>{o[a.toLowerCase()]=s}):n.headers.keys().forEach(s=>{o[s.toLowerCase()]=n.headers.get(s)}),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:se(new Uint8Array(i))}})}var Q5=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Br=new O(G5);function nm(t){return new Promise(e=>{setTimeout(e,t)})}function ti(t,e){if(t==null)return null;if(typeof t=="string")return t;if(jd(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Ma(t)}catch{}return re(t)}return t}function J5(t){return gr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function Y5(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Br.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,o=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Br.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s=typeof t=="object"?!!t.errorPassThrough:!1,a={};let l=null;const u={method:"GET"};let c=!1,h=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&Br.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(h=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(c=!0);if(u.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&Br.throwError("basic authentication requires a secure https url",O.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+U1(gr(x))}}t.skipFetchSetup!=null&&(u.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(u.fetchOptions=ot(t.fetchOptions))}const p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=l?l.match(p):null;if(g)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?F1(g[3]):J5(g[3])};let w=x.body;return r&&(w=r(x.body,x)),Promise.resolve(w)}catch(x){Br.throwError("processing response error",O.errors.SERVER_ERROR,{body:ti(g[1],g[2]),error:x,requestBody:null,requestMethod:"GET",url:l})}e&&(u.method="POST",u.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const v={};Object.keys(a).forEach(x=>{const w=a[x];v[w.key]=w.value}),u.headers=v;const b=function(){let x=null;return{promise:new Promise(function(T,j){h&&(x=setTimeout(()=>{x!=null&&(x=null,j(Br.makeError("timeout",O.errors.TIMEOUT,{requestBody:ti(u.body,v["content-type"]),requestMethod:u.method,timeout:h,url:l})))},h))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),S=function(){return Q5(this,void 0,void 0,function*(){for(let x=0;x=300)&&(b.cancel(),Br.throwError("bad response",O.errors.SERVER_ERROR,{status:w.statusCode,headers:w.headers,body:ti(E,w.headers?w.headers["content-type"]:null),requestBody:ti(u.body,v["content-type"]),requestMethod:u.method,url:l})),r)try{const T=yield r(E,w);return b.cancel(),T}catch(T){if(T.throttleRetry&&x{let a=null;if(o!=null)try{a=JSON.parse(Ma(o))}catch(l){Br.throwError("invalid JSON",O.errors.SERVER_ERROR,{body:o,error:l})}return r&&(a=r(a,s)),a},i=null;if(e!=null){i=gr(e);const o=typeof t=="string"?{url:t}:ot(t);o.headers?Object.keys(o.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(o.headers=ot(o.headers),o.headers["content-type"]="application/json"):o.headers={"content-type":"application/json"},t=o}return Y5(t,i,n)}function _o(t,e){return e||(e={}),e=ot(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,o=!1;const s=()=>o?!1:(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function u(){return t().then(function(c){if(c!==void 0)s()&&r(c);else if(e.oncePoll)e.oncePoll.once("poll",u);else if(e.onceBlock)e.onceBlock.once("block",u);else if(!o){if(l++,l>a){s()&&n(new Error("retry limit reached"));return}let h=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));he.ceiling&&(h=e.ceiling),setTimeout(u,h)}return null},function(c){s()&&n(c)})}u()})}var cu="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Nh={};for(var tl=0;tl>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function Sy(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=To(e)^n>>5}for(e=To(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=Sy(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",o=0;o>5)throw new Error("Non 5-bit word");n=To(n)^s,i+=cu.charAt(s)}for(o=0;o<6;++o)n=To(n);for(n^=1,o=0;o<6;++o){var a=n>>(5-o)*5&31;i+=cu.charAt(a)}return i}function ky(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=Sy(o);if(typeof a=="string")return a;for(var l=[],u=0;u=s.length)&&l.push(h)}return a!==1?"Invalid checksum for "+t:{prefix:o,words:l}}function Z5(){var t=ky.apply(null,arguments);if(typeof t=="object")return t}function e_(t){var e=ky.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Ju(t,e,r,n){for(var i=0,o=0,s=(1<=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<=e)return"Excess padding";if(i<this.data(h,!0);return e.transaction={hash:s,type:u,accessList:ee.allowNull(this.accessList.bind(this),null),blockHash:ee.allowNull(s,null),blockNumber:ee.allowNull(l,null),transactionIndex:ee.allowNull(l,null),confirmations:ee.allowNull(l,null),from:r,gasPrice:ee.allowNull(n),maxPriorityFeePerGas:ee.allowNull(n),maxFeePerGas:ee.allowNull(n),gasLimit:n,to:ee.allowNull(r,null),value:n,nonce:l,data:o,r:ee.allowNull(this.uint256),s:ee.allowNull(this.uint256),v:ee.allowNull(l),creates:ee.allowNull(r,null),raw:ee.allowNull(o)},e.transactionRequest={from:ee.allowNull(r),nonce:ee.allowNull(l),gasLimit:ee.allowNull(n),gasPrice:ee.allowNull(n),maxPriorityFeePerGas:ee.allowNull(n),maxFeePerGas:ee.allowNull(n),to:ee.allowNull(r),value:ee.allowNull(n),data:ee.allowNull(c),type:ee.allowNull(l),accessList:ee.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:s,address:r,topics:ee.arrayOf(s),data:o,logIndex:l,blockHash:s},e.receipt={to:ee.allowNull(this.address,null),from:ee.allowNull(this.address,null),contractAddress:ee.allowNull(r,null),transactionIndex:l,root:ee.allowNull(a),gasUsed:n,logsBloom:ee.allowNull(o),blockHash:s,transactionHash:s,logs:ee.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:ee.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:ee.allowNull(n),status:ee.allowNull(l),type:u},e.block={hash:ee.allowNull(s),parentHash:s,number:l,timestamp:l,nonce:ee.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:ee.allowNull(r),extraData:o,transactions:ee.allowNull(ee.arrayOf(s)),baseFeePerGas:ee.allowNull(n)},e.blockWithTransactions=ot(e.block),e.blockWithTransactions.transactions=ee.allowNull(ee.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:ee.allowNull(i,void 0),toBlock:ee.allowNull(i,void 0),blockHash:ee.allowNull(s,void 0),address:ee.allowNull(r,void 0),topics:ee.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:ee.allowNull(l),blockHash:ee.allowNull(s),transactionIndex:l,removed:ee.allowNull(this.boolean.bind(this)),address:r,data:ee.allowFalsish(o,"0x"),topics:ee.arrayOf(s),transactionHash:s,logIndex:l},e}accessList(e){return eo(e||[])}number(e){return e==="0x"?0:G.from(e).toNumber()}type(e){return e==="0x"||e==null?0:G.from(e).toNumber()}bigNumber(e){return G.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),me(e))?e.toLowerCase():gs.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return gt(e)}callAddress(e){if(!me(e,32))return null;const r=gt(Rt(e,12));return r===jE?null:r}contractAddress(e){return Ud(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||me(e))return $u(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Un(n)!==32?gs.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=G.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!me(e))throw new Error("invalid uint256");return mt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=ee.check(r,e);return i._difficulty=n==null?null:G.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return ee.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&G.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=ee.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;me(n)&&(n=G.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),me(n)&&(n=G.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return T5(e)}receiptLog(e){return ee.check(this.formats.receiptLog,e)}receipt(e){const r=ee.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=G.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&gs.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):gs.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&gs.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return ee.check(this.formats.filter,e)}filterLog(e){return ee.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const o=e[i](r[i]);o!==void 0&&(n[i]=o)}catch(o){throw o.checkKey=i,o.checkValue=r[i],o}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function Ny(t){return t&&typeof t.isCommunityResource=="function"}function Mh(t){return Ny(t)&&t.isCommunityResource()}let om=!1;function Ra(){om||(om=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var ue=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const pe=new O(Ht),s_=10;function sm(t){return t==null?"null":(Un(t)!==32&&pe.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function am(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[sm(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return sm(e)}).join("&")}function a_(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function ro(t){if(typeof t=="string"){if(t=t.toLowerCase(),Un(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+am(t);if(BA.isForkEvent(t))throw pe.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+am(t.topics||[])}throw new Error("invalid event - "+t)}function vs(){return new Date().getTime()}function lm(t){return new Promise(e=>{setTimeout(e,t)})}const l_=["block","network","pending","poll"];class u_{constructor(e,r,n){z(this,"tag",e),z(this,"listener",r),z(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=a_(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||l_.indexOf(this.tag)>=0}}const c_={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function sf(t){return mt(G.from(t).toHexString(),32)}function um(t){return kh.encode(Ut([t,Rt(Xp(Xp(t)),0,4)]))}const My=new RegExp("^(ipfs)://(.*)$","i"),cm=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),My,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Ml(t,e){try{return Ma(pa(t,e))}catch{}return null}function pa(t,e){if(t==="0x")return null;const r=G.from(Rt(t,e,e+32)).toNumber(),n=G.from(Rt(t,r,r+32)).toNumber();return Rt(t,r+32,r+32+n)}function af(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):pe.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function fm(t){const e=se(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function f_(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function Py(t){const e=[];let r=0;for(let n=0;nG.from(e).eq(1)).catch(e=>{if(e.code===O.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return ue(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:er([e,_l(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=er(["0x9061b923",Py([EA(this.name),n.data])]));try{let o=yield this.provider.call(n);return se(o).length%32===4&&pe.throwError("resolver threw error",O.errors.CALL_EXCEPTION,{transaction:n,data:o}),i&&(o=pa(o,0)),o}catch(o){if(o.code===O.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(e,r){return ue(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?pa(n,0):null})}_getAddress(e,r){const n=c_[String(e)];if(n==null&&pe.throwError(`unsupported coin type: ${e}`,O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=se(r);if(n.p2pkh!=null){const o=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return um(Ut([[n.p2pkh],"0x"+o[2]]))}}if(n.p2sh!=null){const o=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){const s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return um(Ut([[n.p2sh],"0x"+o[2]]))}}if(n.prefix!=null){const o=i[1];let s=i[0];if(s===0?o!==20&&o!==32&&(s=-1):s=-1,s>=0&&i.length===2+o&&o>=1&&o<=75){const a=im.toWords(i.slice(2));return a.unshift(s),im.encode(n.prefix,a)}}return null}getAddress(e){return ue(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===UE?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===O.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",sf(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&pe.throwError("invalid or unsupported coin data",O.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return ue(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;ns[l])}return pe.throwError("invalid or unsupported content hash data",O.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return ue(this,void 0,void 0,function*(){let r=gr(e);r=Ut([sf(64),sf(r.length),r]),r.length%32!==0&&(r=Ut([r,mt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",re(r));return n==null||n==="0x"?null:Ma(n)})}}let lf=null,h_=1;class Yu extends es{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),z(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=dr(new.target,"getNetwork")(e);r?(z(this,"_network",r),this.emit("network",r,null)):pe.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ue(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||pe.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:z(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return _o(()=>this._ready().then(e=>e,e=>{if(!(e.code===O.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return lf==null&&(lf=new ee),lf}static getNetwork(e){return Gd(e??"homestead")}ccipReadFetch(e,r,n){return ue(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),o=r.toLowerCase(),s=[];for(let a=0;a=0?null:JSON.stringify({data:o,sender:i}),h=yield Ia({url:u,errorPassThrough:!0},c,(g,v)=>(g.status=v.statusCode,g));if(h.data)return h.data;const p=h.message||"unknown error";if(h.status>=400&&h.status<500)return pe.throwError(`response not found during CCIP fetch: ${p}`,O.errors.SERVER_ERROR,{url:l,errorMessage:p});s.push(p)}return pe.throwError(`error encountered during CCIP fetch: ${s.map(a=>JSON.stringify(a)).join(", ")}`,O.errors.SERVER_ERROR,{urls:n,errorMessages:s})})}_getInternalBlockNumber(e){return ue(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const o=yield i;if(vs()-o.respTime<=e)return o.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=vs(),n=wt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:o})=>{if(o)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),o;const s=vs();return i=G.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return ue(this,void 0,void 0,function*(){const e=h_++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)pe.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",pe.makeError("network block skew detected",O.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const o=this._emitted[i];o!=="pending"&&n-o>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const o=i.hash;let s=this.getTransactionReceipt(o).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+o]=a.blockNumber,this.emit(o,a)),null)).catch(a=>{this.emit("error",a)});r.push(s);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const o=i.filter;o.fromBlock=i._lastBlockNumber+1,o.toBlock=n;const s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);const a=this.getLogs(o).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(o,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ue(this,void 0,void 0,function*(){return pe.throwError("provider does not support network detection",O.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ue(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield lm(0),this._network;const n=pe.makeError("underlying network changed",O.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=vs();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return ue(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return ue(this,void 0,void 0,function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=r?o:new Promise((s,a)=>{const l=[];let u=!1;const c=function(){return u?!0:(u=!0,l.forEach(p=>{p()}),!1)},h=p=>{p.confirmations{this.removeListener(e,h)}),i){let p=i.startBlock,g=null;const v=b=>ue(this,void 0,void 0,function*(){u||(yield lm(1e3),this.getTransactionCount(i.from).then(S=>ue(this,void 0,void 0,function*(){if(!u){if(S<=i.nonce)p=b;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(g==null&&(g=p-3,g{u||this.once("block",v)}))});if(u)return;this.once("block",v),l.push(()=>{this.removeListener("block",v)})}if(typeof n=="number"&&n>0){const p=setTimeout(()=>{c()||a(pe.makeError("timeout exceeded",O.errors.TIMEOUT,{timeout:n}))},n);p.unref&&p.unref(),l.push(()=>{clearTimeout(p)})}})})}getBlockNumber(){return ue(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return G.from(e)}catch(r){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return G.from(i)}catch(o){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:o})}})}getTransactionCount(e,r){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return G.from(i).toNumber()}catch(o){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:o})}})}getCode(e,r){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return re(i)}catch(o){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:o})}})}getStorageAt(e,r,n){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield wt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(s=>$u(s))}),o=yield this.perform("getStorageAt",i);try{return re(o)}catch(s){return pe.throwError("bad result from backend",O.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:s})}})}_wrapTransaction(e,r,n){if(r!=null&&Un(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&pe.throwError("Transaction hash mismatch from Provider.sendTransaction.",O.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(o,s)=>ue(this,void 0,void 0,function*(){o==null&&(o=1),s==null&&(s=0);let a;o!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,o,s,a);return l==null&&o===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&pe.throwError("transaction failed",O.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(o=>re(o)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const o=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,o,i)}catch(o){throw o.transaction=n,o.transactionHash=n.hash,o}})}_getTransactionRequest(e){return ue(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o?this._getAddress(o):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o?G.from(o):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(o=>o?re(o):null))}),this.formatter.transactionRequest(yield wt(n))})}_getFilter(e){return ue(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield wt(r))})}_call(e,r,n){return ue(this,void 0,void 0,function*(){n>=s_&&pe.throwError("CCIP read exceeded maximum redirections",O.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,o=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&o.substring(0,10)==="0x556f1830"&&Un(o)%32===4)try{const s=Rt(o,4),a=Rt(s,0,32);G.from(a).eq(i)||pe.throwError("CCIP Read sender did not match",O.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const l=[],u=G.from(Rt(s,32,64)).toNumber(),c=G.from(Rt(s,u,u+32)).toNumber(),h=Rt(s,u+32);for(let x=0;xue(this,void 0,void 0,function*(){const o=yield this.perform("getBlock",i);if(o==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let s=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(o)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return _o(()=>ue(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return _o(()=>ue(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return i}),{oncePoll:this})})}getLogs(e){return ue(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield wt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),ee.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return ue(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return ue(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&pe.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return ue(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new Ph(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return ue(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||pe.throwError("network does not support ENS",O.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+_l(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return ue(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(me(e))throw n}typeof e!="string"&&pe.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return ue(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Ml(yield this.call({to:n,data:"0x691f3431"+_l(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return ue(this,void 0,void 0,function*(){let r=null;if(me(e)){const o=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(o,"getAvatar");if(!s)return null;r=new Ph(this,s,o);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a}try{const a=Ml(yield this.call({to:s,data:"0x691f3431"+_l(o).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==O.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return pe.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new u_(ro(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],o=ro(e);return this._events=this._events.filter(s=>s.tag!==o?!0:(setTimeout(()=>{s.listener.apply(this,r)},0),n=!0,s.once?(i.push(s),!1):!0)),i.forEach(s=>{this._stopEvent(s)}),n}listenerCount(e){if(!e)return this._events.length;let r=ro(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=ro(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,o=ro(e);return this._events=this._events.filter(s=>s.tag!==o||s.listener!=r||i?!0:(i=!0,n.push(s),!1)),n.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=ro(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var kn=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const xt=new O(Ht),d_=["call","estimateGas"];function Bs(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=me(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Bs(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Bs(JSON.parse(t),e)}catch{}return null}function Cy(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const o=Bs(e,!0);if(o)return o.data;xt.throwError("missing revert data in call exception; Transaction reverted without a reason string",O.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let o=Bs(e.body,!1);o==null&&(o=Bs(e,!1)),o&&xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===O.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&xt.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&xt.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&xt.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&xt.throwError("legacy pre-eip-155 transactions not supported",O.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),d_.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function hm(t){return new Promise(function(e){setTimeout(e,t)})}function p_(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function ys(t){return t&&t.toLowerCase()}const Ch={};class Wd extends Pa{constructor(e,r,n){if(super(),e!==Ch)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");z(this,"provider",r),n==null&&(n=0),typeof n=="string"?(z(this,"_address",this.provider.formatter.address(n)),z(this,"_index",null)):typeof n=="number"?(z(this,"_index",n),z(this,"_address",null)):xt.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return xt.throwError("cannot alter JSON-RPC Signer connection",O.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new m_(Ch,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&xt.throwError("unknown account #"+this._index,O.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=ot(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=ot(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>kn(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&xt.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),wt({tx:wt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&xt.throwArgumentError("from address mismatch","transaction",e):n.from=i;const o=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&xt.throwError("user rejected transaction",O.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Cy("sendTransaction",s,o)))})}signTransaction(e){return xt.throwError("signing transactions is unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return kn(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield _o(()=>kn(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return kn(this,void 0,void 0,function*(){const r=typeof e=="string"?gr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[re(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return kn(this,void 0,void 0,function*(){const r=typeof e=="string"?gr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),re(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return kn(this,void 0,void 0,function*(){const i=yield lr.resolveNames(e,r,n,s=>this.provider.resolveName(s)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(lr.getPayload(i.domain,r,i.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&xt.throwError("user rejected signing",O.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:r,value:i.value}}),s}})}unlock(e){return kn(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class m_ extends Wd{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const g_={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class _i extends Yu{constructor(e,r){let n=r;n==null&&(n=new Promise((i,o)=>{setTimeout(()=>{this.detectNetwork().then(s=>{i(s)},s=>{o(s)})},0)})),super(n),e||(e=dr(this.constructor,"defaultUrl")()),typeof e=="string"?z(this,"connection",Object.freeze({url:e})):z(this,"connection",Object.freeze(ot(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return kn(this,void 0,void 0,function*(){yield hm(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=dr(this.constructor,"getNetwork");try{return r(G.from(e).toNumber())}catch(n){return xt.throwError("could not detect network",O.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return xt.throwError("could not detect network",O.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new Wd(Ch,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:or(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const o=Ia(this.connection,JSON.stringify(n),p_).then(s=>(this.emit("debug",{action:"response",request:n,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:n,provider:this}),s});return i&&(this._cache[e]=o,setTimeout(()=>{this._cache[e]=null},0)),o}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[ys(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[ys(r.address),r.blockTag]];case"getCode":return["eth_getCode",[ys(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[ys(r.address),mt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[dr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[dr(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=ys(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return kn(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&G.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const o=yield this.getFeeData();o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(r=ot(r),r.transaction=ot(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&xt.throwError(e+" not implemented",O.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return Cy(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(o){if(e._pendingFilter!=r)return null;let s=Promise.resolve();return o.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),s.then(function(){return hm(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(o=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=ot(g_);if(r)for(const o in r)r[o]&&(n[o]=!0);cE(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(o){if(e[o]==null)return;const s=$u(G.from(e[o]));o==="gasLimit"&&(o="gas"),i[o]=s}),["from","to","data"].forEach(function(o){e[o]!=null&&(i[o]=re(e[o]))}),e.accessList&&(i.accessList=eo(e.accessList)),i}}let Ds=null;try{if(Ds=WebSocket,Ds==null)throw new Error("inject please")}catch{const e=new O(Ht);Ds=function(){e.throwError("WebSockets not supported in this environment",O.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var uf=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const rl=new O(Ht);let v_=1;class Xu extends _i{constructor(e,r){r==="any"&&rl.throwError("WebSocketProvider does not support 'any' network yet",O.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof e=="string"?super(e,r):super("_websocket",r),this._pollingInterval=-1,this._wsReady=!1,typeof e=="string"?z(this,"_websocket",new Ds(this.connection.url)):z(this,"_websocket",e),z(this,"_requests",{}),z(this,"_subs",{}),z(this,"_subIds",{}),z(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(i=>{this.websocket.send(this._requests[i].payload)})},this.websocket.onmessage=i=>{const o=i.data,s=JSON.parse(o);if(s.id!=null){const a=String(s.id),l=this._requests[a];if(delete this._requests[a],s.result!==void 0)l.callback(null,s.result),this.emit("debug",{action:"response",request:JSON.parse(l.payload),response:s.result,provider:this});else{let u=null;s.error?(u=new Error(s.error.message||"unknown error"),z(u,"code",s.error.code||null),z(u,"response",o)):u=new Error("unknown error"),l.callback(u,void 0),this.emit("debug",{action:"response",error:u,request:JSON.parse(l.payload),provider:this})}}else if(s.method==="eth_subscription"){const a=this._subs[s.params.subscription];a&&a.processFunc(s.params.result)}else console.warn("this should not happen")};const n=setInterval(()=>{this.emit("poll")},1e3);n.unref&&n.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){rl.throwError("cannot reset events block on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){rl.throwError("cannot set polling interval on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return uf(this,void 0,void 0,function*(){return null})}set polling(e){e&&rl.throwError("cannot set polling on WebSocketProvider",O.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,r){const n=v_++;return new Promise((i,o)=>{function s(l,u){return l?o(l):i(u)}const a=JSON.stringify({method:e,params:r,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(n)]={callback:s,payload:a},this._wsReady&&this.websocket.send(a)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,r,n){return uf(this,void 0,void 0,function*(){let i=this._subIds[e];i==null&&(i=Promise.all(r).then(s=>this.send("eth_subscribe",s)),this._subIds[e]=i);const o=yield i;this._subs[o]={tag:e,processFunc:n}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],r=>{const n=G.from(r.number).toNumber();this._emitted.block=n,this.emit("block",n)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(e.filter,this.formatter.filterLog(r))});break;case"tx":{const r=n=>{const i=n.hash;this.getTransactionReceipt(i).then(o=>{o&&this.emit(i,o)})};r(e),this._subscribe("tx",["newHeads"],n=>{this._events.filter(i=>i.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}}_stopEvent(e){let r=e.tag;if(e.type==="tx"){if(this._events.filter(i=>i.type==="tx").length)return;r="tx"}else if(this.listenerCount(e.event))return;const n=this._subIds[r];n&&(delete this._subIds[r],n.then(i=>{this._subs[i]&&(delete this._subs[i],this.send("eth_unsubscribe",[i]))}))}destroy(){return uf(this,void 0,void 0,function*(){this.websocket.readyState===Ds.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}}var y_=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Ss=new O(Ht);class Iy extends _i{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return y_(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||Ss.throwError("no network detected",O.errors.UNKNOWN_ERROR,{}),this._network==null&&(z(this,"_network",r),this.emit("network",r,null))),r})}}class Gn extends Iy{constructor(e,r){Ss.checkAbstract(new.target,Gn),e=dr(new.target,"getNetwork")(e),r=dr(new.target,"getApiKey")(r);const n=dr(new.target,"getUrl")(e,r);super(n,e),typeof r=="string"?z(this,"apiKey",r):r!=null&&Object.keys(r).forEach(i=>{z(this,i,r[i])})}_startPending(){Ss.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return Ss.throwError("API provider does not support signing",O.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,r){return Ss.throwError("not implemented; sub-classes must override getUrl",O.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const dm=new O(Ht),Pl="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class Ry extends Xu{constructor(e,r){const n=new Kd(e,r),i=n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(i,n.network),z(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===Pl}}class Kd extends Gn{static getWebSocketProvider(e,r){return new Ry(e,r)}static getApiKey(e){return e==null?Pl:(e&&typeof e!="string"&&dm.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:dm.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+r,throttleCallback:(i,o)=>(r===Pl&&Ra(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===Pl}}const w_=new O(Ht),nl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function x_(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return w_.throwArgumentError("unsupported network","name",t)}class Oy extends Gn{isCommunityResource(){return this.apiKey===nl}static getApiKey(e){return e??nl}static getUrl(e,r){r==null&&(r=nl);const n={allowGzip:!0,url:"https://"+x_(e.name)+r,throttleCallback:(i,o)=>(r.apiKey===nl&&Ra(),Promise.resolve(!0))};return r.projectSecret!=null&&(n.user="",n.password=r.projectSecret),n}}var b_=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const pm=new O(Ht);class Ty extends Gn{static getApiKey(e){return e!=null&&pm.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="https://cloudflare-eth.com/";break;default:pm.throwArgumentError("unsupported network","network",arguments[0])}return n}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return b_(this,void 0,void 0,function*(){return e==="getBlockNumber"?(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number:n.perform.call(this,e,r)})}}var il=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const ai=new O(Ht);function mm(t){const e={};for(let r in t){if(t[r]==null)continue;let n=t[r];r==="type"&&n===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?n=$u(re(n)):r==="accessList"?n="["+eo(n).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]":n=re(n),e[r]=n)}return e}function E_(t){if(t.status==0&&(t.message==="No records found"||t.message==="No transactions found"))return t.result;if(t.status!=1||typeof t.message!="string"||!t.message.match(/^OK/)){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function gm(t){if(t&&t.status==0&&t.message=="NOTOK"&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if(t.jsonrpc!="2.0"){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function vm(t){if(t==="pending")throw new Error("pending not supported");return t==="latest"?t:parseInt(t.substring(2),16)}function cf(t,e,r){if(t==="call"&&e.code===O.errors.SERVER_ERROR){const i=e.error;if(i&&(i.message.match(/reverted/i)||i.message.match(/VM execution error/i))){let o=i.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),me(o))return o;ai.throwError("missing revert data in call exception",O.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===O.errors.SERVER_ERROR&&(e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&ai.throwError("insufficient funds for intrinsic transaction cost",O.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ai.throwError("nonce has already been used",O.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&ai.throwError("replacement fee too low",O.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&ai.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",O.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class Ly extends Yu{constructor(e,r){super(e),z(this,"baseUrl",this.getBaseUrl()),z(this,"apiKey",r||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return ai.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,r){const n=Object.keys(r).reduce((o,s)=>{const a=r[s];return a!=null&&(o+=`&${s}=${a}`),o},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${n}${i}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}fetch(e,r,n){return il(this,void 0,void 0,function*(){const i=n?this.getPostUrl():this.getUrl(e,r),o=n?this.getPostData(e,r):null,s=e==="proxy"?gm:E_;this.emit("debug",{action:"request",request:i,provider:this});const a={url:i,throttleSlotInterval:1e3,throttleCallback:(c,h)=>(this.isCommunityResource()&&Ra(),Promise.resolve(!0))};let l=null;o&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},l=Object.keys(o).map(c=>`${c}=${o[c]}`).join("&"));const u=yield Ia(a,l,s||gm);return this.emit("debug",{action:"response",request:i,response:or(u),provider:this}),u})}detectNetwork(){return il(this,void 0,void 0,function*(){return this.network})}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return il(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(i=>cf("sendTransaction",i,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const i=mm(r.transaction);i.module="proxy",i.action="eth_call";try{return yield this.fetch("proxy",i,!0)}catch(o){return cf("call",o,r.transaction)}}case"estimateGas":{const i=mm(r.transaction);i.module="proxy",i.action="eth_estimateGas";try{return yield this.fetch("proxy",i,!0)}catch(o){return cf("estimateGas",o,r.transaction)}}case"getLogs":{const i={action:"getLogs"};if(r.filter.fromBlock&&(i.fromBlock=vm(r.filter.fromBlock)),r.filter.toBlock&&(i.toBlock=vm(r.filter.toBlock)),r.filter.address&&(i.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&ai.throwError("unsupported topic count",O.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){const a=r.filter.topics[0];(typeof a!="string"||a.length!==66)&&ai.throwError("unsupported topic format",O.errors.UNSUPPORTED_OPERATION,{topic0:a}),i.topic0=a}const o=yield this.fetch("logs",i);let s={};for(let a=0;a{["contractAddress","to"].forEach(function(l){s[l]==""&&delete s[l]}),s.creates==null&&s.contractAddress!=null&&(s.creates=s.contractAddress);const a=this.formatter.transactionResponse(s);return s.timeStamp&&(a.timestamp=parseInt(s.timeStamp)),a})})}isCommunityResource(){return this.apiKey==null}}var fu=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};const Oi=new O(Ht);function ol(){return new Date().getTime()}function ym(t){let e=null;for(let r=0;re?null:(n+i)/2}function So(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(G.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>So(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=So(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let A_=1;function xm(t){let e=null,r=null,n=new Promise(s=>{e=function(){r&&(clearTimeout(r),r=null),s()},r=setTimeout(e,t)});const i=s=>(n=n.then(s),n);function o(){return n}return{cancel:e,getPromise:o,wait:i}}const __=[O.errors.CALL_EXCEPTION,O.errors.INSUFFICIENT_FUNDS,O.errors.NONCE_EXPIRED,O.errors.REPLACEMENT_UNDERPRICED,O.errors.UNPREDICTABLE_GAS_LIMIT],S_=["address","args","errorArgs","errorSignature","method","transaction"];function sl(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function k_(t,e){return function(r){const n={};r.forEach(o=>{const s=t(o.result);n[s]||(n[s]={count:0,result:o.result}),n[s].count++});const i=Object.keys(n);for(let o=0;o=e)return s.result}}}function N_(t,e,r){let n=So;switch(e){case"getBlockNumber":return function(i){const o=i.map(a=>a.result);let s=wm(i.map(a=>a.result),2);if(s!=null)return s=Math.ceil(s),o.indexOf(s+1)>=0&&s++,s>=t._highestBlockNumber&&(t._highestBlockNumber=s),t._highestBlockNumber};case"getGasPrice":return function(i){const o=i.map(s=>s.result);return o.sort(),o[Math.floor(o.length/2)]};case"getEtherPrice":return function(i){return wm(i.map(o=>o.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=ot(i),i.confirmations=-1,So(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=ot(i),i.transactions=i.transactions.map(o=>(o=ot(o),o.confirmations=-1,o)),So(i))}:n=function(i){return i==null?null:So(i)};break;default:throw new Error("unknown method: "+e)}return k_(n,t.quorum)}function ws(t,e){return fu(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:_o(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function M_(t,e,r,n){return fu(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&me(n.blockTag)&&(i=yield ws(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let o=n.filter;return(o.fromBlock&&me(o.fromBlock)||o.toBlock&&me(o.toBlock))&&(i=yield ws(t,e)),i.getLogs(o)}}return Oi.throwError("unknown method error",O.errors.UNKNOWN_ERROR,{method:r,params:n})})}class jy extends Yu{constructor(e,r){e.length===0&&Oi.throwArgumentError("missing providers","providers",e);const n=e.map((s,a)=>{if(es.isProvider(s)){const c=Mh(s)?2e3:750;return Object.freeze({provider:s,weight:1,stallTimeout:c,priority:1})}const l=ot(s);l.priority==null&&(l.priority=1),l.stallTimeout==null&&(l.stallTimeout=Mh(s)?2e3:750),l.weight==null&&(l.weight=1);const u=l.weight;return(u%1||u>512||u<1)&&Oi.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,u),Object.freeze(l)}),i=n.reduce((s,a)=>s+a.weight,0);r==null?r=i/2:r>i&&Oi.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let o=ym(n.map(s=>s.provider.network));o==null&&(o=new Promise((s,a)=>{setTimeout(()=>{this.detectNetwork().then(s,a)},0)})),super(o),z(this,"providerConfigs",Object.freeze(n)),z(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return fu(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return ym(e)})}perform(e,r){return fu(this,void 0,void 0,function*(){if(e==="sendTransaction"){const l=yield Promise.all(this.providerConfigs.map(u=>u.provider.sendTransaction(r.signedTransaction).then(c=>c.hash,c=>c)));for(let u=0;ul.priority-u.priority);const o=this._highestBlockNumber;let s=0,a=!0;for(;;){const l=ol();let u=i.filter(g=>g.runner&&l-g.startg+v.weight,0);for(;u{g.staller=null}),g.runner=M_(g,o,e,r).then(b=>{g.done=!0,g.result=b,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:v,backend:sl(g,ol()),request:{method:e,params:or(r)},provider:this})},b=>{g.done=!0,g.error=b,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:v,backend:sl(g,ol()),request:{method:e,params:or(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:v,backend:sl(g,null),request:{method:e,params:or(r)},provider:this}),u+=g.weight}const c=[];i.forEach(g=>{g.done||!g.runner||(c.push(g.runner),g.staller&&c.push(g.staller.getPromise()))}),c.length&&(yield Promise.race(c));const h=i.filter(g=>g.done&&g.error==null);if(h.length>=this.quorum){const g=n(h);if(g!==void 0)return i.forEach(v=>{v.staller&&v.staller.cancel(),v.cancelled=!0}),g;a||(yield xm(100).getPromise()),a=!1}const p=i.reduce((g,v)=>{if(!v.done||v.error==null)return g;const b=v.error.code;return __.indexOf(b)>=0&&(g[b]||(g[b]={error:v.error,weight:0}),g[b].weight+=v.weight),g},{});if(Object.keys(p).forEach(g=>{const v=p[g];if(v.weight{x.staller&&x.staller.cancel(),x.cancelled=!0});const b=v.error,S={};S_.forEach(x=>{b[x]!=null&&(S[x]=b[x])}),Oi.throwError(b.reason||b.message,g,S)}),i.filter(g=>!g.done).length===0)break}return i.forEach(l=>{l.staller&&l.staller.cancel(),l.cancelled=!0}),Oi.throwError("failed to meet quorum",O.errors.SERVER_ERROR,{method:e,params:r,results:i.map(l=>sl(l)),provider:this})})}}const By=null,Cl=new O(Ht),ks="84842078b09946638c03157f83405213";class Dy extends Xu{constructor(e,r){const n=new Qd(e,r),i=n.connection;i.password&&Cl.throwError("INFURA WebSocket project secrets unsupported",O.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});const o=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,e),z(this,"apiKey",n.projectId),z(this,"projectId",n.projectId),z(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===ks}}class Qd extends Gn{static getWebSocketProvider(e,r){return new Dy(e,r)}static getApiKey(e){const r={apiKey:ks,projectId:ks,projectSecret:null};return e==null||(typeof e=="string"?r.projectId=e:e.projectSecret!=null?(Cl.assertArgument(typeof e.projectId=="string","projectSecret requires a projectId","projectId",e.projectId),Cl.assertArgument(typeof e.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),r.projectId=e.projectId,r.projectSecret=e.projectSecret):e.projectId&&(r.projectId=e.projectId),r.apiKey=r.projectId),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"goerli":n="goerli.infura.io";break;case"sepolia":n="sepolia.infura.io";break;case"matic":n="polygon-mainnet.infura.io";break;case"maticmum":n="polygon-mumbai.infura.io";break;case"optimism":n="optimism-mainnet.infura.io";break;case"optimism-goerli":n="optimism-goerli.infura.io";break;case"arbitrum":n="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":n="arbitrum-goerli.infura.io";break;default:Cl.throwError("unsupported network",O.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const i={allowGzip:!0,url:"https://"+n+"/v3/"+r.projectId,throttleCallback:(o,s)=>(r.projectId===ks&&Ra(),Promise.resolve(!0))};return r.projectSecret!=null&&(i.user="",i.password=r.projectSecret),i}isCommunityResource(){return this.projectId===ks}}class P_ extends _i{send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);const i={request:n,resolve:null,reject:null},o=new Promise((s,a)=>{i.resolve=s,i.reject=a});return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{const s=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const a=s.map(l=>l.request);return this.emit("debug",{action:"requestBatch",request:or(a),provider:this}),Ia(this.connection,JSON.stringify(a)).then(l=>{this.emit("debug",{action:"response",request:a,response:l,provider:this}),s.forEach((u,c)=>{const h=l[c];if(h.error){const p=new Error(h.error.message);p.code=h.error.code,p.data=h.error.data,u.reject(p)}else u.resolve(h.result)})},l=>{this.emit("debug",{action:"response",error:l,request:a,provider:this}),s.forEach(u=>{u.reject(l)})})},10)),o}}const ff=new O(Ht),C_="ETHERS_JS_SHARED";class Fy extends Gn{static getApiKey(e){return e&&typeof e!="string"&&ff.throwArgumentError("invalid apiKey","apiKey",e),e||C_}static getUrl(e,r){ff.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let n=null;switch(e.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:ff.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+r}}const bm=new O(Ht),Em="62e1ad51b37b8e00394bda3b";class Uy extends Gn{static getApiKey(e){const r={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return e==null?r.applicationId=Em:typeof e=="string"?r.applicationId=e:e.applicationSecretKey!=null?(r.applicationId=e.applicationId,r.applicationSecretKey=e.applicationSecretKey):e.applicationId?r.applicationId=e.applicationId:bm.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"goerli":n="eth-goerli.gateway.pokt.network";break;case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"kovan":n="poa-kovan.gateway.pokt.network";break;case"matic":n="poly-mainnet.gateway.pokt.network";break;case"maticmum":n="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;default:bm.throwError("unsupported network",O.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const i=`https://${n}/v1/lb/${r.applicationId}`,o={headers:{},url:i};return r.applicationSecretKey!=null&&(o.user="",o.password=r.applicationSecretKey),o}isCommunityResource(){return this.applicationId===Em}}const Am=new O(Ht);let I_=1;function _m(t,e){const r="Web3LegacyFetcher";return function(n,i){const o={method:n,params:i,id:I_++,jsonrpc:"2.0"};return new Promise((s,a)=>{this.emit("debug",{action:"request",fetcher:r,request:or(o),provider:this}),e(o,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:o,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:u,provider:this}),u.error){const c=new Error(u.error.message);return c.code=u.error.code,c.data=u.error.data,a(c)}s(u.result)})})}}function R_(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:or(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class zy extends _i{constructor(e,r){e==null&&Am.throwArgumentError("missing provider","provider",e);let n=null,i=null,o=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),o=e,e.request?(n===""&&(n="eip-1193:"),i=R_(e)):e.sendAsync?i=_m(e,e.sendAsync.bind(e)):e.send?i=_m(e,e.send.bind(e)):Am.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),z(this,"jsonRpcFetchFunc",i),z(this,"provider",o)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const Sm=new O(Ht);function O_(t,e){if(t==null&&(t="homestead"),typeof t=="string"){const n=t.match(/^(ws|http)s?:/i);if(n)switch(n[1].toLowerCase()){case"http":case"https":return new _i(t);case"ws":case"wss":return new Xu(t);default:Sm.throwArgumentError("unsupported URL scheme","network",t)}}const r=Gd(t);return(!r||!r._defaultProvider)&&Sm.throwError("unsupported getDefaultProvider network",O.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:jy,AlchemyProvider:Kd,AnkrProvider:Oy,CloudflareProvider:Ty,EtherscanProvider:Ly,InfuraProvider:Qd,JsonRpcProvider:_i,NodesmithProvider:Fy,PocketProvider:Uy,Web3Provider:zy,IpcProvider:By},e)}const T_=Object.freeze(Object.defineProperty({__proto__:null,AlchemyProvider:Kd,AlchemyWebSocketProvider:Ry,AnkrProvider:Oy,BaseProvider:Yu,CloudflareProvider:Ty,EtherscanProvider:Ly,FallbackProvider:jy,Formatter:ee,InfuraProvider:Qd,InfuraWebSocketProvider:Dy,IpcProvider:By,JsonRpcBatchProvider:P_,JsonRpcProvider:_i,JsonRpcSigner:Wd,NodesmithProvider:Fy,PocketProvider:Uy,Provider:es,Resolver:Ph,StaticJsonRpcProvider:Iy,UrlJsonRpcProvider:Gn,Web3Provider:zy,WebSocketProvider:Xu,getDefaultProvider:O_,getNetwork:Gd,isCommunityResourcable:Ny,isCommunityResource:Mh,showThrottleMessage:Ra},Symbol.toStringTag,{value:"Module"})),L_="solidity/5.7.0",j_=new RegExp("^bytes([0-9]+)$"),B_=new RegExp("^(u?int)([0-9]*)$"),D_=new RegExp("^(.*)\\[([0-9]*)\\]$"),F_="0000000000000000000000000000000000000000000000000000000000000000",ao=new O(L_);function $y(t,e,r){switch(t){case"address":return r?El(e,32):se(e);case"string":return gr(e);case"bytes":return se(e);case"bool":return e=e?"0x01":"0x00",r?El(e,32):se(e)}let n=t.match(B_);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&ao.throwArgumentError("invalid number type","type",t),r&&(i=256),e=G.from(e).toTwos(i),El(e,i/8)}if(n=t.match(j_),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&ao.throwArgumentError("invalid bytes type","type",t),se(e).byteLength!==i&&ao.throwArgumentError(`invalid value for ${t}`,"value",e),r?se((e+F_).substring(0,66)):e}if(n=t.match(D_),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&ao.throwArgumentError(`invalid array length for ${t}`,"value",e);const s=[];return e.forEach(function(a){s.push($y(i,a,!0))}),Ut(s)}return ao.throwArgumentError("invalid type","type",t)}function U_(t,e){t.length!=e.length&&ao.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push($y(n,e[i]))}),re(Ut(r))}function z_(t,e){return ct(U_(t,e))}var Zu={},Ln={},Hy={};const $_=Qo(ME);var H_={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const km=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(p=>p(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(H_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},qy=t=>t?km(t):km;var Vy={exports:{}},Gy={},Wy={exports:{}},Ky={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -79,7 +79,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Wo=L;function q_(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var V_=typeof Object.is=="function"?Object.is:q_,G_=Wo.useState,W_=Wo.useEffect,K_=Wo.useLayoutEffect,Q_=Wo.useDebugValue;function J_(t,e){var r=e(),n=G_({inst:{value:r,getSnapshot:e}}),i=n[0].inst,o=n[1];return K_(function(){i.value=r,i.getSnapshot=e,hf(i)&&o({inst:i})},[t,r,e]),W_(function(){return hf(i)&&o({inst:i}),t(function(){hf(i)&&o({inst:i})})},[t]),Q_(r),r}function hf(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!V_(t,r)}catch{return!0}}function Y_(t,e){return e()}var X_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Y_:J_;Wy.useSyncExternalStore=Wo.useSyncExternalStore!==void 0?Wo.useSyncExternalStore:X_;Gy.exports=Wy;var Z_=Gy.exports;/** + */var Wo=L;function q_(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var V_=typeof Object.is=="function"?Object.is:q_,G_=Wo.useState,W_=Wo.useEffect,K_=Wo.useLayoutEffect,Q_=Wo.useDebugValue;function J_(t,e){var r=e(),n=G_({inst:{value:r,getSnapshot:e}}),i=n[0].inst,o=n[1];return K_(function(){i.value=r,i.getSnapshot=e,hf(i)&&o({inst:i})},[t,r,e]),W_(function(){return hf(i)&&o({inst:i}),t(function(){hf(i)&&o({inst:i})})},[t]),Q_(r),r}function hf(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!V_(t,r)}catch{return!0}}function Y_(t,e){return e()}var X_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Y_:J_;Ky.useSyncExternalStore=Wo.useSyncExternalStore!==void 0?Wo.useSyncExternalStore:X_;Wy.exports=Ky;var Z_=Wy.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -87,8 +87,8 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ec=L,eS=Z_;function tS(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var rS=typeof Object.is=="function"?Object.is:tS,nS=eS.useSyncExternalStore,iS=ec.useRef,oS=ec.useEffect,sS=ec.useMemo,aS=ec.useDebugValue;Vy.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var o=iS(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=sS(function(){function l(g){if(!u){if(u=!0,c=g,g=n(g),i!==void 0&&s.hasValue){var v=s.value;if(i(v,g))return h=v}return h=g}if(v=h,rS(c,g))return v;var b=n(g);return i!==void 0&&i(v,b)?v:(c=g,h=b)}var u=!1,c,h,p=r===void 0?null:r;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,r,n,i]);var a=nS(t,o[0],o[1]);return oS(function(){s.hasValue=!0,s.value=a},[a]),aS(a),a};qy.exports=Vy;var lS=qy.exports;const tc=Si(lS),{useSyncExternalStoreWithSelector:uS}=tc;function Ky(t,e=t.getState,r){const n=uS(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const km=t=>{const e=typeof t=="function"?Hy(t):t,r=(n,i)=>Ky(e,n,i);return Object.assign(r,e),r},Qy=t=>t?km(t):km;var cS=t=>Qy(t);const fS=Object.freeze(Object.defineProperty({__proto__:null,create:Qy,createStore:Hy,default:cS,useStore:Ky},Symbol.toStringTag,{value:"Module"})),hS=Qo(fS);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createWeb3ReactStoreAndActions=t.MAX_SAFE_CHAIN_ID=void 0;const e=$_,r=hS;t.MAX_SAFE_CHAIN_ID=0xfffffffffffec;function n(a){if(!Number.isInteger(a)||a<=0||a>t.MAX_SAFE_CHAIN_ID)throw new Error(`Invalid chainId ${a}`)}function i(a){return(0,e.getAddress)(a)}const o={chainId:void 0,accounts:void 0,activating:!1};function s(){const a=(0,r.createStore)()(()=>o);let l=0;function u(){const p=++l;return a.setState(Object.assign(Object.assign({},o),{activating:!0})),()=>{l===p&&a.setState({activating:!1})}}function c(p){if(p.chainId!==void 0&&n(p.chainId),p.accounts!==void 0)for(let g=0;g{var v,b;const S=(v=p.chainId)!==null&&v!==void 0?v:g.chainId,x=(b=p.accounts)!==null&&b!==void 0?b:g.accounts;let w=g.activating;return w&&S&&x&&(w=!1),{chainId:S,accounts:x,activating:w}})}function h(){l++,a.setState(o)}return[a,{startActivation:u,update:c,resetState:h}]}t.createWeb3ReactStoreAndActions=s})($y);var dS={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Nm=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(p=>p(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(dS?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},Jd=t=>t?Nm(t):Nm,{useSyncExternalStoreWithSelector:pS}=tc;function Jy(t,e=t.getState,r){const n=pS(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const Mm=t=>{const e=typeof t=="function"?Jd(t):t,r=(n,i)=>Jy(e,n,i);return Object.assign(r,e),r},Yy=t=>t?Mm(t):Mm;var mS=t=>Yy(t);const gS=Object.freeze(Object.defineProperty({__proto__:null,create:Yy,createStore:Jd,default:mS,useStore:Jy},Symbol.toStringTag,{value:"Module"})),vS=Qo(gS),{useSyncExternalStoreWithSelector:yS}=tc;function Xy(t,e=t.getState,r){const n=yS(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const Pm=(t,e)=>{const r=Jd(t),n=(i,o=e)=>Xy(r,i,o);return Object.assign(n,r),n},wS=(t,e)=>t?Pm(t,e):Pm,xS=Object.freeze(Object.defineProperty({__proto__:null,createWithEqualityFn:wS,useStoreWithEqualityFn:Xy},Symbol.toStringTag,{value:"Module"})),bS=Qo(xS),ES=Qo(T_);var AS=ze&&ze.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_S=ze&&ze.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),SS=ze&&ze.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&AS(e,t,r);return _S(e,t),e},kS=ze&&ze.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.getPriorityConnector=Ln.getSelectedConnector=Ln.initializeConnector=void 0;const NS=$y,ko=L,Cm=vS,MS=bS;let Lo;function PS(){return kS(this,void 0,void 0,function*(){if(Lo===void 0)try{const{Web3Provider:t}=yield Promise.resolve().then(()=>SS(ES));Lo=t}catch{console.debug("@ethersproject/providers not available"),Lo=null}})}function CS(t){const[e,r]=(0,NS.createWeb3ReactStoreAndActions)(),n=t(r),i=BS(e),o=DS(i),s=FS(n,i,o);return[n,Object.assign(Object.assign(Object.assign({},i),o),s),e]}Ln.initializeConnector=CS;function IS({chainId:t,accounts:e,activating:r}){return!!(t&&e&&!r)}function Zy(...t){function e(h){const p=t.findIndex(([g])=>h===g);if(p===-1)throw new Error("Connector not found");return p}function r(h){const p=t[e(h)][2];if(!p)throw new Error("Stores not passed");return p}function n(h){return t.map(([,{useChainId:g}])=>g())[e(h)]}function i(h){return t.map(([,{useAccounts:g}])=>g())[e(h)]}function o(h){return t.map(([,{useIsActivating:g}])=>g())[e(h)]}function s(h){return t.map(([,{useAccount:g}])=>g())[e(h)]}function a(h){return t.map(([,{useIsActive:g}])=>g())[e(h)]}function l(h,p){const g=e(h);return t.map(([,{useProvider:b}],S)=>b(p,S===g))[g]}function u(h,p){const g=e(h);return t.map(([,{useENSNames:b}],S)=>b(S===g?p:void 0))[g]}function c(h,p){const g=e(h);return t.map(([,{useENSName:b}],S)=>b(S===g?p:void 0))[g]}return{useSelectedStore:r,useSelectedChainId:n,useSelectedAccounts:i,useSelectedIsActivating:o,useSelectedAccount:s,useSelectedIsActive:a,useSelectedProvider:l,useSelectedENSNames:u,useSelectedENSName:c}}Ln.getSelectedConnector=Zy;function RS(...t){const{useSelectedStore:e,useSelectedChainId:r,useSelectedAccounts:n,useSelectedIsActivating:i,useSelectedAccount:o,useSelectedIsActive:s,useSelectedProvider:a,useSelectedENSNames:l,useSelectedENSName:u}=Zy(...t);function c(){const j=t.map(([,{useIsActive:D}])=>D()).findIndex(D=>D);return t[j===-1?0:j][0]}function h(){return e(c())}function p(){return r(c())}function g(){return n(c())}function v(){return i(c())}function b(){return o(c())}function S(){return s(c())}function x(T){return a(c(),T)}function w(T){return l(c(),T)}function E(T){return u(c(),T)}return{useSelectedStore:e,useSelectedChainId:r,useSelectedAccounts:n,useSelectedIsActivating:i,useSelectedAccount:o,useSelectedIsActive:s,useSelectedProvider:a,useSelectedENSNames:l,useSelectedENSName:u,usePriorityConnector:c,usePriorityStore:h,usePriorityChainId:p,usePriorityAccounts:g,usePriorityIsActivating:v,usePriorityAccount:b,usePriorityIsActive:S,usePriorityProvider:x,usePriorityENSNames:w,usePriorityENSName:E}}Ln.getPriorityConnector=RS;const OS=({chainId:t})=>t,TS=({accounts:t})=>t,LS=({activating:t})=>t,jS=(t,e)=>t===void 0&&e===void 0||t!==void 0&&t.length===(e==null?void 0:e.length)&&t.every((r,n)=>r===e[n]);function BS(t){function e(){return(0,Cm.useStore)(t,OS)}function r(){return(0,MS.useStoreWithEqualityFn)(t,TS,jS)}function n(){return(0,Cm.useStore)(t,LS)}return{useChainId:e,useAccounts:r,useIsActivating:n}}function DS({useChainId:t,useAccounts:e,useIsActivating:r}){function n(){var o;return(o=e())===null||o===void 0?void 0:o[0]}function i(){const o=t(),s=e(),a=r();return IS({chainId:o,accounts:s,activating:a})}return{useAccount:n,useIsActive:i}}function Im(t,e=[]){const[r,n]=(0,ko.useState)();return(0,ko.useEffect)(()=>{if(t&&e.length){let i=!1;return Promise.all(e.map(o=>t.lookupAddress(o))).then(o=>{i||n(o)}).catch(o=>{i||(console.debug("Could not fetch ENS names",o),n(new Array(e.length).fill(null)))}),()=>{i=!0,n(void 0)}}},[t,e]),r??new Array(e.length).fill(void 0)}function FS(t,{useAccounts:e,useChainId:r},{useAccount:n,useIsActive:i}){function o(l,u=!0){const c=i(),h=r(),[p,g]=(0,ko.useState)(Lo!==void 0);return(0,ko.useEffect)(()=>{if(p)return;let v=!1;return PS().then(()=>{v||g(!0)}),()=>{v=!0}},[p]),(0,ko.useMemo)(()=>{if(u){if(t.customProvider)return t.customProvider;if(Lo&&t.provider)return new Lo(t.provider,l)}},[p,u,c,h,l])}function s(l){const u=e();return Im(l,u)}function a(l){var u;const c=n(),h=(0,ko.useMemo)(()=>c===void 0?void 0:[c],[c]);return(u=Im(l,h))===null||u===void 0?void 0:u[0]}return{useProvider:o,useENSNames:s,useENSName:a}}var rc={},e2={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,h,p){if(typeof c!="function")throw new TypeError("The listener must be a function");var g=new i(c,h||l,p),v=r?r+u:u;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],g]:l._events[v].push(g):(l._events[v]=g,l._eventsCount++),l}function s(l,u){--l._eventsCount===0?l._events=new n:delete l._events[u]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)e.call(c,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=r?r+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,g=h.length,v=new Array(g);pe),this.eth_accounts=jest.fn(e=>e),this.eth_requestAccounts=jest.fn(e=>e)}request(e){if(!this.chainId)return Promise.reject(new Error);switch(e.method){case"eth_chainId":return Promise.resolve(this.eth_chainId(this.chainId));case"eth_accounts":return Promise.resolve(this.eth_accounts(this.accounts));case"eth_requestAccounts":return Promise.resolve(this.eth_requestAccounts(this.accounts));default:throw new Error(`Method not supported on mock: ${JSON.stringify(e)}`)}}emitConnect(e){this.emit("connect",{chainId:e})}emitDisconnect(e){this.emit("disconnect",e)}emitChainChanged(e){this.emit("chainChanged",e)}emitAccountsChanged(e){this.emit("accountsChanged",e)}}rc.MockEIP1193Provider=$S;var Ko={},HS=ze&&ze.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qS=ze&&ze.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VS=ze&&ze.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&HS(e,t,r);return qS(e,t),e};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.useWeb3React=Ko.Web3ReactProvider=void 0;const hu=VS(L),GS=Ln,t2=(0,hu.createContext)(void 0);function WS({children:t,connectors:e,connectorOverride:r,network:n,lookupENS:i=!0}){const o=(0,hu.useRef)(e);if(e.length!=o.current.length||e.some((Y,ie)=>{const ae=o.current[ie];return Y[0]!==ae[0]}))throw new Error("The connectors prop passed to Web3ReactProvider must be referentially static. If connectors is changing, try providing a key prop to Web3ReactProvider that changes every time connectors changes.");const s=(0,GS.getPriorityConnector)(...e),{usePriorityConnector:a,useSelectedChainId:l,useSelectedAccounts:u,useSelectedIsActivating:c,useSelectedAccount:h,useSelectedIsActive:p,useSelectedProvider:g,useSelectedENSNames:v,useSelectedENSName:b}=s,S=a(),x=r??S,w=l(x),E=u(x),T=c(x),j=h(x),D=p(x),$=g(x,n),H=v(x,i?$:void 0),J=b(x,i?$:void 0);return hu.default.createElement(t2.Provider,{value:{connector:x,chainId:w,accounts:E,isActivating:T,account:j,isActive:D,provider:$,ENSNames:H,ENSName:J,hooks:s}},t)}Ko.Web3ReactProvider=WS;function KS(){const t=(0,hu.useContext)(t2);if(!t)throw Error("useWeb3React can only be used within the Web3ReactProvider component");return t}Ko.useWeb3React=KS;(function(t){var e=ze&&ze.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,a)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=ze&&ze.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&e(i,n,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ln,t),r(rc,t),r(Ko,t)})(Zu);const df=[{type:"function",name:"UPGRADE_INTERFACE_VERSION",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"approve",inputs:[{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"apps",inputs:[{name:"",type:"uint256",internalType:"uint256"}],outputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"balanceOf",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"contractURI",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"getApproved",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getInitializedVersion",inputs:[],outputs:[{name:"",type:"uint64",internalType:"uint64"}],stateMutability:"view"},{type:"function",name:"getPackageId",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"pure"},{type:"function",name:"getPackageInfo",inputs:[{name:"package",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct IKinodeAppStore.PackageInfo",components:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}]}],stateMutability:"view"},{type:"function",name:"getPackageInfo",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"tuple",internalType:"struct IKinodeAppStore.PackageInfo",components:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}]}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_knsResolver",type:"address",internalType:"contract KNSRegistryResolver"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isApprovedForAll",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"operator",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"knsResolver",inputs:[],outputs:[{name:"",type:"address",internalType:"contract KNSRegistryResolver"}],stateMutability:"view"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"owner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"ownerOf",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"proxiableUUID",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"registerApp",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"safeTransferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"safeTransferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setApprovalForAll",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"approved",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"symbol",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"tokenURI",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"transferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"unlistPacakge",inputs:[{name:"package",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateContractURI",inputs:[{name:"uri",type:"string",internalType:"string"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateMetadata",inputs:[{name:"package",type:"uint256",internalType:"uint256"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"upgradeToAndCall",inputs:[{name:"newImplementation",type:"address",internalType:"address"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"event",name:"AppMetadataUpdated",inputs:[{name:"package",type:"uint256",indexed:!0,internalType:"uint256"},{name:"metadataUrl",type:"string",indexed:!1,internalType:"string"},{name:"metadataHash",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"AppRegistered",inputs:[{name:"package",type:"uint256",indexed:!0,internalType:"uint256"},{name:"packageName",type:"string",indexed:!1,internalType:"string"},{name:"publisherName",type:"bytes",indexed:!1,internalType:"bytes"},{name:"metadataUrl",type:"string",indexed:!1,internalType:"string"},{name:"metadataHash",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"approved",type:"address",indexed:!0,internalType:"address"},{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"ApprovalForAll",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"operator",type:"address",indexed:!0,internalType:"address"},{name:"approved",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"Initialized",inputs:[{name:"version",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"error",name:"AddressEmptyCode",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{name:"implementation",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC721IncorrectOwner",inputs:[{name:"sender",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InsufficientApproval",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC721InvalidApprover",inputs:[{name:"approver",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidOperator",inputs:[{name:"operator",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidReceiver",inputs:[{name:"receiver",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ERC721NonexistentToken",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"OwnableInvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"OwnableUnauthorizedAccount",inputs:[{name:"account",type:"address",internalType:"address"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{name:"slot",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"Unauthorized",inputs:[]}];class Ih{static createInterface(){return new xh(df)}static connect(e,r){return new $5(e,df,r)}}t0(Ih,"abi",df);var r2={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Rm=Vr.createContext&&Vr.createContext(r2),QS=["attr","size","title"];function JS(t,e){if(t==null)return{};var r=YS(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function YS(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o=0)&&(r[i]=t[i]);return r}function du(){return du=Object.assign?Object.assign.bind():function(t){for(var e=1;eVr.createElement(e.tag,pu({key:r},e.attr),n2(e.child)))}function Jr(t){return e=>Vr.createElement(t4,du({attr:pu({},t.attr)},e),n2(t.child))}function t4(t){var e=r=>{var{attr:n,size:i,title:o}=t,s=JS(t,QS),a=i||r.size||"1em",l;return r.className&&(l=r.className),t.className&&(l=(l?l+" ":"")+t.className),Vr.createElement("svg",du({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:l,style:pu(pu({color:t.color||r.color},r.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&Vr.createElement("title",null,o),t.children)};return Rm!==void 0?Vr.createElement(Rm.Consumer,null,r=>e(r)):e(r2)}function r4(t){return Jr({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(t)}function n4(t){return Jr({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(t)}function i4(t){return Jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"},child:[]}]})(t)}function o4(t){return Jr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(t)}function s4(t){return Jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(t)}var a4={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Tm=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??(typeof c!="object"||c===null)?c:Object.assign({},e,c),r.forEach(p=>p(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(a4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},l4=t=>t?Tm(t):Tm;var i2={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:u4}=Vr,{useSyncExternalStoreWithSelector:c4}=tc;let Lm=!1;function f4(t,e=t.getState,r){(i2?"production":void 0)!=="production"&&r&&!Lm&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Lm=!0);const n=c4(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return u4(n),n}const jm=t=>{(i2?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?l4(t):t,r=(n,i)=>f4(e,n,i);return Object.assign(r,e),r},h4=t=>t?jm(t):jm;var d4={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function o2(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,e==null?void 0:e.reviver),a=(o=r.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>r.setItem(i,JSON.stringify(o,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const ma=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return ma(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return ma(n)(r)}}}},p4=(t,e)=>(r,n,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:S=>S,version:0,merge:(S,x)=>({...x,...S}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return t((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...S)},n,i);const c=ma(o.serialize),h=()=>{const S=o.partialize({...n()});let x;const w=c({state:S,version:o.version}).then(E=>u.setItem(o.name,E)).catch(E=>{x=E});if(x)throw x;return w},p=i.setState;i.setState=(S,x)=>{p(S,x),h()};const g=t((...S)=>{r(...S),h()},n,i);let v;const b=()=>{var S;if(!u)return;s=!1,a.forEach(w=>w(n()));const x=((S=o.onRehydrateStorage)==null?void 0:S.call(o,n()))||void 0;return ma(u.getItem.bind(u))(o.name).then(w=>{if(w)return o.deserialize(w)}).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==o.version){if(o.migrate)return o.migrate(w.state,w.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return w.state}).then(w=>{var E;return v=o.merge(w,(E=n())!=null?E:g),r(v,!0),h()}).then(()=>{x==null||x(v,void 0),s=!0,l.forEach(w=>w(v))}).catch(w=>{x==null||x(void 0,w)})};return i.persist={setOptions:S=>{o={...o,...S},S.getStorage&&(u=S.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:S=>(a.add(S),()=>{a.delete(S)}),onFinishHydration:S=>(l.add(S),()=>{l.delete(S)})},b(),v||g},m4=(t,e)=>(r,n,i)=>{let o={storage:o2(()=>localStorage),partialize:b=>b,version:0,merge:(b,S)=>({...S,...b}),...e},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return t((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...b)},n,i);const c=()=>{const b=o.partialize({...n()});return u.setItem(o.name,{state:b,version:o.version})},h=i.setState;i.setState=(b,S)=>{h(b,S),c()};const p=t((...b)=>{r(...b),c()},n,i);let g;const v=()=>{var b,S;if(!u)return;s=!1,a.forEach(w=>{var E;return w((E=n())!=null?E:p)});const x=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(b=n())!=null?b:p))||void 0;return ma(u.getItem.bind(u))(o.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==o.version){if(o.migrate)return o.migrate(w.state,w.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return w.state}).then(w=>{var E;return g=o.merge(w,(E=n())!=null?E:p),r(g,!0),c()}).then(()=>{x==null||x(g,void 0),g=n(),s=!0,l.forEach(w=>w(g))}).catch(w=>{x==null||x(void 0,w)})};return i.persist={setOptions:b=>{o={...o,...b},b.storage&&(u=b.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(l.add(b),()=>{l.delete(b)})},o.skipHydration||v(),g||p},g4=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((d4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),p4(t,e)):m4(t,e),v4=g4;var Dr=(t=>(t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t))(Dr||{});const Ee=t=>`${t.package}:${t.publisher}`,no=t=>{var e;return((e=t.metadata)==null?void 0:e.name)||Ee(t)},pf=t=>{var e,r;return t.publisher==="sys"?"system":(e=t.state)!=null&&e.our_version&&!((r=t.state)!=null&&r.capsApproved)?"downloaded":t.metadata?"installed":"local"},ar="/main:app_store:sys",al=(t,e)=>t.package===e.package&&t.publisher===e.publisher,os=h4()(v4((t,e)=>({myApps:{downloaded:[],installed:[],local:[],system:[]},listedApps:[],searchResults:[],query:"",getMyApps:async()=>{const i=(await(await fetch(`${ar}/apps`)).json()).reduce((o,s)=>{const a=pf(s);return o[a].push(s),o},{downloaded:[],installed:[],local:[],system:[]});return t(()=>({myApps:i})),i},getListedApps:async()=>{const n=await(await fetch(`${ar}/apps/listed`)).json();return t({listedApps:n}),n},getMyApp:async r=>{const i=await(await fetch(`${ar}/apps/${Ee(r)}`)).json(),o=pf(i),s=e().myApps;s[o]=s[o].map(l=>al(l,i)?i:l);const a=[...e().listedApps].map(l=>al(l,i)?i:l);return t({myApps:s,listedApps:a}),i},installApp:async r=>{if((await fetch(`${ar}/apps/${Ee(r)}/caps`,{method:"POST"})).status!==Dr.OK)throw new Error(`Failed to approve caps for app: ${Ee(r)}`);if((await fetch(`${ar}/apps/${Ee(r)}`,{method:"POST"})).status!==Dr.CREATED)throw new Error(`Failed to install app: ${Ee(r)}`)},updateApp:async r=>{if((await fetch(`${ar}/apps/${Ee(r)}`,{method:"PUT"})).status!==Dr.NO_CONTENT)throw new Error(`Failed to update app: ${Ee(r)}`)},uninstallApp:async r=>{if(!confirm(`Are you sure you want to remove ${Ee(r)}?`))return;if((await fetch(`${ar}/apps/${Ee(r)}`,{method:"DELETE"})).status!==Dr.NO_CONTENT)throw new Error(`Failed to remove app: ${Ee(r)}`);const i={...e().myApps},o=pf(r);i[o]=i[o].filter(a=>!al(a,r));const s=e().listedApps.map(a=>al(a,r)?{...a,state:void 0,installed:!1}:a);t({myApps:i,listedApps:s})},getListedApp:async r=>{const n=await fetch(`${ar}/apps/listed/${r}`);if(n.status!==Dr.OK)throw new Error(`Failed to get app: ${r}`);return await n.json()},downloadApp:async(r,n)=>{if((await fetch(`${ar}/apps/listed/${Ee(r)}`,{method:"POST",body:JSON.stringify({download_from:n})})).status!==Dr.CREATED)throw new Error(`Failed to get app: ${Ee(r)}`)},getCaps:async r=>{const n=await fetch(`${ar}/apps/${Ee(r)}/caps`);if(n.status!==Dr.OK)throw new Error(`Failed to get app: ${Ee(r)}`);return(await n.json())[0]},approveCaps:async r=>{if((await fetch(`${ar}/apps/${Ee(r)}/caps`,{method:"POST"})).status!==Dr.OK)throw new Error(`Failed to get app: ${Ee(r)}`)},setMirroring:async(r,n)=>{if((await fetch(`${ar}/apps/${Ee(r)}/mirror`,{method:n?"PUT":"DELETE"})).status!==Dr.OK)throw new Error(`Failed to start mirror: ${Ee(r)}`);e().getMyApp(r)},setAutoUpdate:async(r,n)=>{if((await fetch(`${ar}/apps/${Ee(r)}/auto-update`,{method:n?"PUT":"DELETE"})).status!==Dr.OK)throw new Error(`Failed to change auto update: ${Ee(r)}`);e().getMyApp(r)},get:e,set:t}),{name:"app_store",storage:o2(()=>sessionStorage)}));var s2={exports:{}};/*! + */var ec=L,eS=Z_;function tS(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var rS=typeof Object.is=="function"?Object.is:tS,nS=eS.useSyncExternalStore,iS=ec.useRef,oS=ec.useEffect,sS=ec.useMemo,aS=ec.useDebugValue;Gy.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var o=iS(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=sS(function(){function l(g){if(!u){if(u=!0,c=g,g=n(g),i!==void 0&&s.hasValue){var v=s.value;if(i(v,g))return h=v}return h=g}if(v=h,rS(c,g))return v;var b=n(g);return i!==void 0&&i(v,b)?v:(c=g,h=b)}var u=!1,c,h,p=r===void 0?null:r;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,r,n,i]);var a=nS(t,o[0],o[1]);return oS(function(){s.hasValue=!0,s.value=a},[a]),aS(a),a};Vy.exports=Gy;var lS=Vy.exports;const tc=Si(lS),{useSyncExternalStoreWithSelector:uS}=tc;function Qy(t,e=t.getState,r){const n=uS(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const Nm=t=>{const e=typeof t=="function"?qy(t):t,r=(n,i)=>Qy(e,n,i);return Object.assign(r,e),r},Jy=t=>t?Nm(t):Nm;var cS=t=>Jy(t);const fS=Object.freeze(Object.defineProperty({__proto__:null,create:Jy,createStore:qy,default:cS,useStore:Qy},Symbol.toStringTag,{value:"Module"})),hS=Qo(fS);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createWeb3ReactStoreAndActions=t.MAX_SAFE_CHAIN_ID=void 0;const e=$_,r=hS;t.MAX_SAFE_CHAIN_ID=0xfffffffffffec;function n(a){if(!Number.isInteger(a)||a<=0||a>t.MAX_SAFE_CHAIN_ID)throw new Error(`Invalid chainId ${a}`)}function i(a){return(0,e.getAddress)(a)}const o={chainId:void 0,accounts:void 0,activating:!1};function s(){const a=(0,r.createStore)()(()=>o);let l=0;function u(){const p=++l;return a.setState(Object.assign(Object.assign({},o),{activating:!0})),()=>{l===p&&a.setState({activating:!1})}}function c(p){if(p.chainId!==void 0&&n(p.chainId),p.accounts!==void 0)for(let g=0;g{var v,b;const S=(v=p.chainId)!==null&&v!==void 0?v:g.chainId,x=(b=p.accounts)!==null&&b!==void 0?b:g.accounts;let w=g.activating;return w&&S&&x&&(w=!1),{chainId:S,accounts:x,activating:w}})}function h(){l++,a.setState(o)}return[a,{startActivation:u,update:c,resetState:h}]}t.createWeb3ReactStoreAndActions=s})(Hy);var dS={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Mm=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??typeof c!="object"?c:Object.assign({},e,c),r.forEach(p=>p(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(dS?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},Jd=t=>t?Mm(t):Mm,{useSyncExternalStoreWithSelector:pS}=tc;function Yy(t,e=t.getState,r){const n=pS(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const Pm=t=>{const e=typeof t=="function"?Jd(t):t,r=(n,i)=>Yy(e,n,i);return Object.assign(r,e),r},Xy=t=>t?Pm(t):Pm;var mS=t=>Xy(t);const gS=Object.freeze(Object.defineProperty({__proto__:null,create:Xy,createStore:Jd,default:mS,useStore:Yy},Symbol.toStringTag,{value:"Module"})),vS=Qo(gS),{useSyncExternalStoreWithSelector:yS}=tc;function Zy(t,e=t.getState,r){const n=yS(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return L.useDebugValue(n),n}const Cm=(t,e)=>{const r=Jd(t),n=(i,o=e)=>Zy(r,i,o);return Object.assign(n,r),n},wS=(t,e)=>t?Cm(t,e):Cm,xS=Object.freeze(Object.defineProperty({__proto__:null,createWithEqualityFn:wS,useStoreWithEqualityFn:Zy},Symbol.toStringTag,{value:"Module"})),bS=Qo(xS),ES=Qo(T_);var AS=ze&&ze.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_S=ze&&ze.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),SS=ze&&ze.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&AS(e,t,r);return _S(e,t),e},kS=ze&&ze.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.getPriorityConnector=Ln.getSelectedConnector=Ln.initializeConnector=void 0;const NS=Hy,ko=L,Im=vS,MS=bS;let Lo;function PS(){return kS(this,void 0,void 0,function*(){if(Lo===void 0)try{const{Web3Provider:t}=yield Promise.resolve().then(()=>SS(ES));Lo=t}catch{console.debug("@ethersproject/providers not available"),Lo=null}})}function CS(t){const[e,r]=(0,NS.createWeb3ReactStoreAndActions)(),n=t(r),i=BS(e),o=DS(i),s=FS(n,i,o);return[n,Object.assign(Object.assign(Object.assign({},i),o),s),e]}Ln.initializeConnector=CS;function IS({chainId:t,accounts:e,activating:r}){return!!(t&&e&&!r)}function e2(...t){function e(h){const p=t.findIndex(([g])=>h===g);if(p===-1)throw new Error("Connector not found");return p}function r(h){const p=t[e(h)][2];if(!p)throw new Error("Stores not passed");return p}function n(h){return t.map(([,{useChainId:g}])=>g())[e(h)]}function i(h){return t.map(([,{useAccounts:g}])=>g())[e(h)]}function o(h){return t.map(([,{useIsActivating:g}])=>g())[e(h)]}function s(h){return t.map(([,{useAccount:g}])=>g())[e(h)]}function a(h){return t.map(([,{useIsActive:g}])=>g())[e(h)]}function l(h,p){const g=e(h);return t.map(([,{useProvider:b}],S)=>b(p,S===g))[g]}function u(h,p){const g=e(h);return t.map(([,{useENSNames:b}],S)=>b(S===g?p:void 0))[g]}function c(h,p){const g=e(h);return t.map(([,{useENSName:b}],S)=>b(S===g?p:void 0))[g]}return{useSelectedStore:r,useSelectedChainId:n,useSelectedAccounts:i,useSelectedIsActivating:o,useSelectedAccount:s,useSelectedIsActive:a,useSelectedProvider:l,useSelectedENSNames:u,useSelectedENSName:c}}Ln.getSelectedConnector=e2;function RS(...t){const{useSelectedStore:e,useSelectedChainId:r,useSelectedAccounts:n,useSelectedIsActivating:i,useSelectedAccount:o,useSelectedIsActive:s,useSelectedProvider:a,useSelectedENSNames:l,useSelectedENSName:u}=e2(...t);function c(){const j=t.map(([,{useIsActive:D}])=>D()).findIndex(D=>D);return t[j===-1?0:j][0]}function h(){return e(c())}function p(){return r(c())}function g(){return n(c())}function v(){return i(c())}function b(){return o(c())}function S(){return s(c())}function x(T){return a(c(),T)}function w(T){return l(c(),T)}function E(T){return u(c(),T)}return{useSelectedStore:e,useSelectedChainId:r,useSelectedAccounts:n,useSelectedIsActivating:i,useSelectedAccount:o,useSelectedIsActive:s,useSelectedProvider:a,useSelectedENSNames:l,useSelectedENSName:u,usePriorityConnector:c,usePriorityStore:h,usePriorityChainId:p,usePriorityAccounts:g,usePriorityIsActivating:v,usePriorityAccount:b,usePriorityIsActive:S,usePriorityProvider:x,usePriorityENSNames:w,usePriorityENSName:E}}Ln.getPriorityConnector=RS;const OS=({chainId:t})=>t,TS=({accounts:t})=>t,LS=({activating:t})=>t,jS=(t,e)=>t===void 0&&e===void 0||t!==void 0&&t.length===(e==null?void 0:e.length)&&t.every((r,n)=>r===e[n]);function BS(t){function e(){return(0,Im.useStore)(t,OS)}function r(){return(0,MS.useStoreWithEqualityFn)(t,TS,jS)}function n(){return(0,Im.useStore)(t,LS)}return{useChainId:e,useAccounts:r,useIsActivating:n}}function DS({useChainId:t,useAccounts:e,useIsActivating:r}){function n(){var o;return(o=e())===null||o===void 0?void 0:o[0]}function i(){const o=t(),s=e(),a=r();return IS({chainId:o,accounts:s,activating:a})}return{useAccount:n,useIsActive:i}}function Rm(t,e=[]){const[r,n]=(0,ko.useState)();return(0,ko.useEffect)(()=>{if(t&&e.length){let i=!1;return Promise.all(e.map(o=>t.lookupAddress(o))).then(o=>{i||n(o)}).catch(o=>{i||(console.debug("Could not fetch ENS names",o),n(new Array(e.length).fill(null)))}),()=>{i=!0,n(void 0)}}},[t,e]),r??new Array(e.length).fill(void 0)}function FS(t,{useAccounts:e,useChainId:r},{useAccount:n,useIsActive:i}){function o(l,u=!0){const c=i(),h=r(),[p,g]=(0,ko.useState)(Lo!==void 0);return(0,ko.useEffect)(()=>{if(p)return;let v=!1;return PS().then(()=>{v||g(!0)}),()=>{v=!0}},[p]),(0,ko.useMemo)(()=>{if(u){if(t.customProvider)return t.customProvider;if(Lo&&t.provider)return new Lo(t.provider,l)}},[p,u,c,h,l])}function s(l){const u=e();return Rm(l,u)}function a(l){var u;const c=n(),h=(0,ko.useMemo)(()=>c===void 0?void 0:[c],[c]);return(u=Rm(l,h))===null||u===void 0?void 0:u[0]}return{useProvider:o,useENSNames:s,useENSName:a}}var rc={},t2={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,h,p){if(typeof c!="function")throw new TypeError("The listener must be a function");var g=new i(c,h||l,p),v=r?r+u:u;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],g]:l._events[v].push(g):(l._events[v]=g,l._eventsCount++),l}function s(l,u){--l._eventsCount===0?l._events=new n:delete l._events[u]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)e.call(c,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=r?r+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,g=h.length,v=new Array(g);pe),this.eth_accounts=jest.fn(e=>e),this.eth_requestAccounts=jest.fn(e=>e)}request(e){if(!this.chainId)return Promise.reject(new Error);switch(e.method){case"eth_chainId":return Promise.resolve(this.eth_chainId(this.chainId));case"eth_accounts":return Promise.resolve(this.eth_accounts(this.accounts));case"eth_requestAccounts":return Promise.resolve(this.eth_requestAccounts(this.accounts));default:throw new Error(`Method not supported on mock: ${JSON.stringify(e)}`)}}emitConnect(e){this.emit("connect",{chainId:e})}emitDisconnect(e){this.emit("disconnect",e)}emitChainChanged(e){this.emit("chainChanged",e)}emitAccountsChanged(e){this.emit("accountsChanged",e)}}rc.MockEIP1193Provider=$S;var Ko={},HS=ze&&ze.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qS=ze&&ze.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VS=ze&&ze.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&HS(e,t,r);return qS(e,t),e};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.useWeb3React=Ko.Web3ReactProvider=void 0;const hu=VS(L),GS=Ln,r2=(0,hu.createContext)(void 0);function WS({children:t,connectors:e,connectorOverride:r,network:n,lookupENS:i=!0}){const o=(0,hu.useRef)(e);if(e.length!=o.current.length||e.some((Y,ie)=>{const ae=o.current[ie];return Y[0]!==ae[0]}))throw new Error("The connectors prop passed to Web3ReactProvider must be referentially static. If connectors is changing, try providing a key prop to Web3ReactProvider that changes every time connectors changes.");const s=(0,GS.getPriorityConnector)(...e),{usePriorityConnector:a,useSelectedChainId:l,useSelectedAccounts:u,useSelectedIsActivating:c,useSelectedAccount:h,useSelectedIsActive:p,useSelectedProvider:g,useSelectedENSNames:v,useSelectedENSName:b}=s,S=a(),x=r??S,w=l(x),E=u(x),T=c(x),j=h(x),D=p(x),$=g(x,n),H=v(x,i?$:void 0),J=b(x,i?$:void 0);return hu.default.createElement(r2.Provider,{value:{connector:x,chainId:w,accounts:E,isActivating:T,account:j,isActive:D,provider:$,ENSNames:H,ENSName:J,hooks:s}},t)}Ko.Web3ReactProvider=WS;function KS(){const t=(0,hu.useContext)(r2);if(!t)throw Error("useWeb3React can only be used within the Web3ReactProvider component");return t}Ko.useWeb3React=KS;(function(t){var e=ze&&ze.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,a)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=ze&&ze.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&e(i,n,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ln,t),r(rc,t),r(Ko,t)})(Zu);const df=[{type:"function",name:"UPGRADE_INTERFACE_VERSION",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"approve",inputs:[{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"apps",inputs:[{name:"",type:"uint256",internalType:"uint256"}],outputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"balanceOf",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"contractURI",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"getApproved",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getInitializedVersion",inputs:[],outputs:[{name:"",type:"uint64",internalType:"uint64"}],stateMutability:"view"},{type:"function",name:"getPackageId",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"pure"},{type:"function",name:"getPackageInfo",inputs:[{name:"package",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct IKinodeAppStore.PackageInfo",components:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}]}],stateMutability:"view"},{type:"function",name:"getPackageInfo",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"tuple",internalType:"struct IKinodeAppStore.PackageInfo",components:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherKnsNodeId",type:"bytes32",internalType:"bytes32"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}]}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_knsResolver",type:"address",internalType:"contract KNSRegistryResolver"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isApprovedForAll",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"operator",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"knsResolver",inputs:[],outputs:[{name:"",type:"address",internalType:"contract KNSRegistryResolver"}],stateMutability:"view"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"owner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"ownerOf",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"proxiableUUID",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"registerApp",inputs:[{name:"packageName",type:"string",internalType:"string"},{name:"publisherName",type:"bytes",internalType:"bytes"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"safeTransferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"safeTransferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setApprovalForAll",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"approved",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"symbol",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"tokenURI",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"transferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"unlistPacakge",inputs:[{name:"package",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateContractURI",inputs:[{name:"uri",type:"string",internalType:"string"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"updateMetadata",inputs:[{name:"package",type:"uint256",internalType:"uint256"},{name:"metadataUrl",type:"string",internalType:"string"},{name:"metadataHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"upgradeToAndCall",inputs:[{name:"newImplementation",type:"address",internalType:"address"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"event",name:"AppMetadataUpdated",inputs:[{name:"package",type:"uint256",indexed:!0,internalType:"uint256"},{name:"metadataUrl",type:"string",indexed:!1,internalType:"string"},{name:"metadataHash",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"AppRegistered",inputs:[{name:"package",type:"uint256",indexed:!0,internalType:"uint256"},{name:"packageName",type:"string",indexed:!1,internalType:"string"},{name:"publisherName",type:"bytes",indexed:!1,internalType:"bytes"},{name:"metadataUrl",type:"string",indexed:!1,internalType:"string"},{name:"metadataHash",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"approved",type:"address",indexed:!0,internalType:"address"},{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"ApprovalForAll",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"operator",type:"address",indexed:!0,internalType:"address"},{name:"approved",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"Initialized",inputs:[{name:"version",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"error",name:"AddressEmptyCode",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{name:"implementation",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC721IncorrectOwner",inputs:[{name:"sender",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InsufficientApproval",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC721InvalidApprover",inputs:[{name:"approver",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidOperator",inputs:[{name:"operator",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidReceiver",inputs:[{name:"receiver",type:"address",internalType:"address"}]},{type:"error",name:"ERC721InvalidSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ERC721NonexistentToken",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"OwnableInvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"OwnableUnauthorizedAccount",inputs:[{name:"account",type:"address",internalType:"address"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{name:"slot",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"Unauthorized",inputs:[]}];class Ih{static createInterface(){return new xh(df)}static connect(e,r){return new $5(e,df,r)}}r0(Ih,"abi",df);var n2={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Om=Vr.createContext&&Vr.createContext(n2),QS=["attr","size","title"];function JS(t,e){if(t==null)return{};var r=YS(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function YS(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o=0)&&(r[i]=t[i]);return r}function du(){return du=Object.assign?Object.assign.bind():function(t){for(var e=1;eVr.createElement(e.tag,pu({key:r},e.attr),i2(e.child)))}function xn(t){return e=>Vr.createElement(t4,du({attr:pu({},t.attr)},e),i2(t.child))}function t4(t){var e=r=>{var{attr:n,size:i,title:o}=t,s=JS(t,QS),a=i||r.size||"1em",l;return r.className&&(l=r.className),t.className&&(l=(l?l+" ":"")+t.className),Vr.createElement("svg",du({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:l,style:pu(pu({color:t.color||r.color},r.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&Vr.createElement("title",null,o),t.children)};return Om!==void 0?Vr.createElement(Om.Consumer,null,r=>e(r)):e(n2)}function r4(t){return xn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(t)}function n4(t){return xn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(t)}function i4(t){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"},child:[]}]})(t)}function o4(t){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(t)}var s4={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Lm=t=>{let e;const r=new Set,n=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const h=e;e=u??(typeof c!="object"||c===null)?c:Object.assign({},e,c),r.forEach(p=>p(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(s4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},a4=t=>t?Lm(t):Lm;var o2={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:l4}=Vr,{useSyncExternalStoreWithSelector:u4}=tc;let jm=!1;function c4(t,e=t.getState,r){(o2?"production":void 0)!=="production"&&r&&!jm&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),jm=!0);const n=u4(t.subscribe,t.getState,t.getServerState||t.getState,e,r);return l4(n),n}const Bm=t=>{(o2?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?a4(t):t,r=(n,i)=>c4(e,n,i);return Object.assign(r,e),r},f4=t=>t?Bm(t):Bm;var h4={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function s2(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,e==null?void 0:e.reviver),a=(o=r.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>r.setItem(i,JSON.stringify(o,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const ma=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return ma(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return ma(n)(r)}}}},d4=(t,e)=>(r,n,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:S=>S,version:0,merge:(S,x)=>({...x,...S}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return t((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...S)},n,i);const c=ma(o.serialize),h=()=>{const S=o.partialize({...n()});let x;const w=c({state:S,version:o.version}).then(E=>u.setItem(o.name,E)).catch(E=>{x=E});if(x)throw x;return w},p=i.setState;i.setState=(S,x)=>{p(S,x),h()};const g=t((...S)=>{r(...S),h()},n,i);let v;const b=()=>{var S;if(!u)return;s=!1,a.forEach(w=>w(n()));const x=((S=o.onRehydrateStorage)==null?void 0:S.call(o,n()))||void 0;return ma(u.getItem.bind(u))(o.name).then(w=>{if(w)return o.deserialize(w)}).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==o.version){if(o.migrate)return o.migrate(w.state,w.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return w.state}).then(w=>{var E;return v=o.merge(w,(E=n())!=null?E:g),r(v,!0),h()}).then(()=>{x==null||x(v,void 0),s=!0,l.forEach(w=>w(v))}).catch(w=>{x==null||x(void 0,w)})};return i.persist={setOptions:S=>{o={...o,...S},S.getStorage&&(u=S.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:S=>(a.add(S),()=>{a.delete(S)}),onFinishHydration:S=>(l.add(S),()=>{l.delete(S)})},b(),v||g},p4=(t,e)=>(r,n,i)=>{let o={storage:s2(()=>localStorage),partialize:b=>b,version:0,merge:(b,S)=>({...S,...b}),...e},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return t((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...b)},n,i);const c=()=>{const b=o.partialize({...n()});return u.setItem(o.name,{state:b,version:o.version})},h=i.setState;i.setState=(b,S)=>{h(b,S),c()};const p=t((...b)=>{r(...b),c()},n,i);let g;const v=()=>{var b,S;if(!u)return;s=!1,a.forEach(w=>{var E;return w((E=n())!=null?E:p)});const x=((S=o.onRehydrateStorage)==null?void 0:S.call(o,(b=n())!=null?b:p))||void 0;return ma(u.getItem.bind(u))(o.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==o.version){if(o.migrate)return o.migrate(w.state,w.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return w.state}).then(w=>{var E;return g=o.merge(w,(E=n())!=null?E:p),r(g,!0),c()}).then(()=>{x==null||x(g,void 0),g=n(),s=!0,l.forEach(w=>w(g))}).catch(w=>{x==null||x(void 0,w)})};return i.persist={setOptions:b=>{o={...o,...b},b.storage&&(u=b.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(l.add(b),()=>{l.delete(b)})},o.skipHydration||v(),g||p},m4=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((h4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),d4(t,e)):p4(t,e),g4=m4;var Dr=(t=>(t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t))(Dr||{});const Ee=t=>`${t.package}:${t.publisher}`,no=t=>{var e;return((e=t.metadata)==null?void 0:e.name)||Ee(t)},pf=t=>{var e,r;return t.publisher==="sys"?"system":(e=t.state)!=null&&e.our_version&&!((r=t.state)!=null&&r.capsApproved)?"downloaded":t.metadata?"installed":"local"},ar="/main:app_store:sys",al=(t,e)=>t.package===e.package&&t.publisher===e.publisher,os=f4()(g4((t,e)=>({myApps:{downloaded:[],installed:[],local:[],system:[]},listedApps:[],searchResults:[],query:"",getMyApps:async()=>{const i=(await(await fetch(`${ar}/apps`)).json()).reduce((o,s)=>{const a=pf(s);return o[a].push(s),o},{downloaded:[],installed:[],local:[],system:[]});return t(()=>({myApps:i})),i},getListedApps:async()=>{const n=await(await fetch(`${ar}/apps/listed`)).json();return t({listedApps:n}),n},getMyApp:async r=>{const i=await(await fetch(`${ar}/apps/${Ee(r)}`)).json(),o=pf(i),s=e().myApps;s[o]=s[o].map(l=>al(l,i)?i:l);const a=[...e().listedApps].map(l=>al(l,i)?i:l);return t({myApps:s,listedApps:a}),i},installApp:async r=>{if((await fetch(`${ar}/apps/${Ee(r)}/caps`,{method:"POST"})).status!==Dr.OK)throw new Error(`Failed to approve caps for app: ${Ee(r)}`);if((await fetch(`${ar}/apps/${Ee(r)}`,{method:"POST"})).status!==Dr.CREATED)throw new Error(`Failed to install app: ${Ee(r)}`)},updateApp:async r=>{if((await fetch(`${ar}/apps/${Ee(r)}`,{method:"PUT"})).status!==Dr.NO_CONTENT)throw new Error(`Failed to update app: ${Ee(r)}`)},uninstallApp:async r=>{if(!confirm(`Are you sure you want to remove ${Ee(r)}?`))return;if((await fetch(`${ar}/apps/${Ee(r)}`,{method:"DELETE"})).status!==Dr.NO_CONTENT)throw new Error(`Failed to remove app: ${Ee(r)}`);const i={...e().myApps},o=pf(r);i[o]=i[o].filter(a=>!al(a,r));const s=e().listedApps.map(a=>al(a,r)?{...a,state:void 0,installed:!1}:a);t({myApps:i,listedApps:s})},getListedApp:async r=>{const n=await fetch(`${ar}/apps/listed/${r}`);if(n.status!==Dr.OK)throw new Error(`Failed to get app: ${r}`);return await n.json()},downloadApp:async(r,n)=>{if((await fetch(`${ar}/apps/listed/${Ee(r)}`,{method:"POST",body:JSON.stringify({download_from:n})})).status!==Dr.CREATED)throw new Error(`Failed to get app: ${Ee(r)}`)},getCaps:async r=>{const n=await fetch(`${ar}/apps/${Ee(r)}/caps`);if(n.status!==Dr.OK)throw new Error(`Failed to get app: ${Ee(r)}`);return(await n.json())[0]},approveCaps:async r=>{if((await fetch(`${ar}/apps/${Ee(r)}/caps`,{method:"POST"})).status!==Dr.OK)throw new Error(`Failed to get app: ${Ee(r)}`)},setMirroring:async(r,n)=>{if((await fetch(`${ar}/apps/${Ee(r)}/mirror`,{method:n?"PUT":"DELETE"})).status!==Dr.OK)throw new Error(`Failed to start mirror: ${Ee(r)}`);e().getMyApp(r)},setAutoUpdate:async(r,n)=>{if((await fetch(`${ar}/apps/${Ee(r)}/auto-update`,{method:n?"PUT":"DELETE"})).status!==Dr.OK)throw new Error(`Failed to change auto update: ${Ee(r)}`);e().getMyApp(r)},get:e,set:t}),{name:"app_store",storage:s2(()=>sessionStorage)}));var a2={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var o="",s=0;sn(`/app-details/${Ee(t)}`),children:[M.jsx("img",{src:((i=t.metadata)==null?void 0:i.image)||"https://png.pngtree.com/png-vector/20190215/ourmid/pngtree-vector-question-mark-icon-png-image_515448.jpg",alt:"app icon",className:xi("mr-2",{"h-32 rounded-md":e==="large","h-12 rounded":e!=="large"})}),M.jsxs("div",{className:"flex flex-col w-full",children:[M.jsx("div",{className:xi("whitespace-nowrap overflow-hidden text-ellipsis",{"text-3xl":e==="large"}),children:((o=t.metadata)==null?void 0:o.name)||Ee(t)}),((s=t.metadata)==null?void 0:s.description)&&e!=="large"&&M.jsx("div",{className:"whitespace-nowrap overflow-hidden text-ellipsis",children:(l=(a=t.metadata)==null?void 0:a.description)==null?void 0:l.slice(0,100)})]})]})}const w4=({show:t,hide:e,hideClose:r=!1,title:n,...i})=>{const o=s=>{s.stopPropagation()};return t?M.jsx("div",{className:xi("bg-black/25 fixed top-0 bottom-0 left-0 right-0 flex flex-col c z-30 min-h-[10em] min-w-[20em]",{show:t}),onClick:e,children:M.jsxs("div",{...i,className:`flex flex-col relative bg-black/90 rounded-lg p-6 ${i.className||""}`,onClick:o,children:[!!n&&M.jsx("h4",{className:"mt-0 mb-2",children:n}),!r&&M.jsx("button",{className:"icon",onClick:e,children:M.jsx(o4,{})}),M.jsx("div",{className:"flex flex-col items-center w-full",onClick:o,children:i.children})]})}):null};function Rh({msg:t}){return M.jsxs("div",{id:"loading",className:"flex flex-col text-center",children:[M.jsx("h4",{children:t}),M.jsxs("div",{id:"loader",children:[" ",M.jsx("div",{})," ",M.jsx("div",{})," ",M.jsx("div",{})," ",M.jsx("div",{})," "]})]})}function l2({app:t,...e}){var Y,ie,ae,C,f,m,A;const{updateApp:r,downloadApp:n,installApp:i,getCaps:o,getMyApp:s}=os(),[a,l]=L.useState(!1),[u,c]=L.useState(((ae=(ie=(Y=t.metadata)==null?void 0:Y.properties)==null?void 0:ie.mirrors)==null?void 0:ae[0])||"Other"),[h,p]=L.useState(""),[g,v]=L.useState([]),[b,S]=L.useState(""),{clean:x,installed:w,downloaded:E,updatable:T}=L.useMemo(()=>{var d,P,X,y;const _=(Object.entries(((P=(d=t==null?void 0:t.metadata)==null?void 0:d.properties)==null?void 0:P.code_hashes)||{}).find(([B])=>{var F,U;return B===((U=(F=t.metadata)==null?void 0:F.properties)==null?void 0:U.current_version)})||[])[1],I=t.installed,R=!!t.state,N=!!((X=t.state)!=null&&X.our_version&&_)&&((y=t.state)==null?void 0:y.our_version)!==_&&t.publisher!==window.our.node;return{clean:!I&&!R&&!N,installed:I,downloaded:R,updatable:N}},[t]);L.useEffect(()=>{var k,_,I;c(((I=(_=(k=t.metadata)==null?void 0:k.properties)==null?void 0:_.mirrors)==null?void 0:I[0])||"Other")},[(f=(C=t.metadata)==null?void 0:C.properties)==null?void 0:f.mirrors]);const j=L.useCallback(async()=>{w&&!T?window.alert("App is installed"):(E&&o(t).then(k=>{v(k.request_capabilities)}),l(!0))},[t,w,E,T,l,o]),D=L.useCallback(async k=>{k.preventDefault(),k.stopPropagation();const _=u==="Other"?h:u;if(!_){window.alert("Please select a mirror");return}try{S(`Downloading ${no(t)}...`),await n(t,_);const I=setInterval(()=>{s(t).then(()=>{S(""),l(!1),clearInterval(I)}).catch(console.log)},2e3)}catch(I){console.error(I),window.alert(`Failed to download app from ${_}, please try a different mirror.`),S("")}},[u,h,t,n,s]),$=L.useCallback(async()=>{try{S(`Installing ${no(t)}...`),await i(t);const k=setInterval(()=>{s(t).then(_=>{_.installed&&(S(""),l(!1),clearInterval(k))}).catch(console.log)},2e3)}catch(k){console.error(k),window.alert("Failed to install, please try again."),S("")}},[t,i,s]),H=L.useCallback(async()=>{try{S(`Updating ${no(t)}...`),await r(t);const k=setInterval(()=>{s(t).then(_=>{_.installed&&(S(""),l(!1),clearInterval(k))}).catch(console.log)},2e3)}catch(k){console.error(k),window.alert("Failed to update, please try again."),S("")}},[t,r,s]),J=no(t);return M.jsxs(M.Fragment,{children:[M.jsx("button",{...e,type:"button",className:xi("text-sm min-w-[100px] px-2 py-1 self-start",e.className),onClick:j,children:w&&T?"Update":w?"Installed":E?"Install":"Download"}),M.jsx(w4,{show:a,hide:()=>l(!1),children:b?M.jsx(Rh,{msg:b}):x?M.jsxs("form",{className:"flex flex-col items-center gap-2",onSubmit:D,children:[M.jsxs("h4",{children:["Download '",J,"'"]}),M.jsx("h5",{style:{margin:0},children:"Select Mirror"}),M.jsx("select",{value:u,onChange:k=>c(k.target.value),children:(((A=(m=t.metadata)==null?void 0:m.properties)==null?void 0:A.mirrors)||[]).concat(["Other"]).map(k=>M.jsx("option",{value:k,children:k},k))}),u==="Other"&&M.jsx("input",{type:"text",value:h,onChange:k=>p(k.target.value),placeholder:"Mirror, i.e. 'template.os'",className:"p-1 max-w-[240px] w-full",required:!0,autoFocus:!0}),M.jsx("button",{type:"submit",children:"Download"})]}):E?M.jsxs(M.Fragment,{children:[M.jsx("h4",{children:"Approve App Permissions"}),M.jsxs("h5",{className:"m-0",children:[no(t)," needs the following permissions:"]}),M.jsx("ul",{className:"flex flex-col items-start",children:g.map(k=>M.jsx("li",{children:k},k))}),M.jsx("button",{type:"button",onClick:$,children:"Approve & Install"})]}):M.jsxs(M.Fragment,{children:[M.jsx("h4",{children:"Approve App Permissions"}),M.jsxs("h5",{className:"m-0",children:[no(t)," needs the following permissions:"]}),M.jsx("br",{}),M.jsx("ul",{className:"flex flex-col items-start",children:g.map(k=>M.jsx("li",{children:k},k))}),M.jsx("button",{type:"button",onClick:H,children:"Approve & Update"})]})})]})}const u2=t=>!!t&&t[0]==="o",Bm=ia.unstable_batchedUpdates||(t=>t()),io=(t,e,r=1e-4)=>Math.abs(t-e)t===!0||!!(t&&t[e]),mn=(t,e)=>typeof t=="function"?t(e):t,c2="_szhsinMenu",x4=t=>t[c2],b4=(t,e)=>Object.defineProperty(e,c2,{value:t}),Yd=(t,e)=>(e&&Object.keys(e).forEach(r=>{const n=t[r],i=e[r];typeof i=="function"&&n?t[r]=(...o)=>{i(...o),n(...o)}:t[r]=i}),t),E4=t=>{if(typeof t!="string")return{top:0,right:0,bottom:0,left:0};const e=t.trim().split(/\s+/,4).map(parseFloat),r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?r:e[1];return{top:r,right:n,bottom:isNaN(e[2])?r:e[2],left:isNaN(e[3])?n:e[3]}},mf=t=>{for(;t;){if(t=t.parentNode,!t||t===document.body||!t.parentNode)return;const{overflow:e,overflowX:r,overflowY:n}=getComputedStyle(t);if(/auto|scroll|overlay|hidden/.test(e+n+r))return t}};function A4(t,e){return{"aria-disabled":t||void 0,tabIndex:e?0:-1}}function Dm(t,e){for(let r=0;rL.useMemo(()=>{const i=e?`${t}__${e}`:t;let o=i;r&&Object.keys(r).forEach(a=>{const l=r[a];l&&(o+=` ${i}--${l===!0?a:`${a}-${l}`}`)});let s=typeof n=="function"?n(r):n;return typeof s=="string"&&(s=s.trim(),s&&(o+=` ${s}`)),o},[t,e,r,n]),_4="szh-menu-container",gf="szh-menu",S4="szh-menu-button",k4="arrow",N4=L.createContext(),M4=L.createContext({}),Fm=L.createContext({}),P4=L.createContext({}),f2=L.createContext({}),Cn=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),It=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),va=Object.freeze({CLICK:"click",CANCEL:"cancel",BLUR:"blur",SCROLL:"scroll"}),Fs=Object.freeze({FIRST:"first",LAST:"last"}),C4=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),vf="absolute",I4="menuitem",Um={"aria-hidden":!0,role:I4},R4=b4("MenuButton",L.forwardRef(function({className:e,isOpen:r,disabled:n,children:i,...o},s){const a=L.useMemo(()=>({open:r}),[r]);return M.jsx("button",{"aria-haspopup":!0,"aria-expanded":r,"aria-disabled":n||void 0,type:"button",disabled:n,...o,ref:s,className:mu({block:S4,modifiers:a,className:e}),children:i})})),O4=({className:t,containerRef:e,containerProps:r,children:n,isOpen:i,theming:o,transition:s,onClose:a})=>{const l=ga(s,"item"),u=({key:h})=>{switch(h){case Cn.ESC:mn(a,{key:h,reason:va.CANCEL});break}},c=h=>{i&&!h.currentTarget.contains(h.relatedTarget)&&mn(a,{reason:va.BLUR})};return M.jsx("div",{...Yd({onKeyDown:u,onBlur:c},r),className:mu({block:_4,modifiers:L.useMemo(()=>({theme:o,itemTransition:l}),[o,l]),className:t}),style:{position:"absolute",...r==null?void 0:r.style},ref:e,children:n})},T4=()=>{let t,e=0;return{toggle:r=>{r?e++:e--,e=Math.max(e,0)},on:(r,n,i)=>{e?t||(t=setTimeout(()=>{t=0,n()},r)):i==null||i()},off:()=>{t&&(clearTimeout(t),t=0)}}},L4=(t,e)=>{const[r,n]=L.useState(),o=L.useRef({items:[],hoverIndex:-1,sorted:!1}).current,s=L.useCallback((l,u)=>{const{items:c}=o;if(!l)o.items=[];else if(u)c.push(l);else{const h=c.indexOf(l);h>-1&&(c.splice(h,1),l.contains(document.activeElement)&&(e.current.focus(),n()))}o.hoverIndex=-1,o.sorted=!1},[o,e]),a=L.useCallback((l,u,c)=>{const{items:h,hoverIndex:p}=o,g=()=>{if(o.sorted)return;const S=t.current.querySelectorAll(".szh-menu__item");h.sort((x,w)=>Dm(S,x)-Dm(S,w)),o.sorted=!0};let v=-1,b;switch(l){case It.RESET:break;case It.SET:b=u;break;case It.UNSET:b=S=>S===u?void 0:S;break;case It.FIRST:g(),v=0,b=h[v];break;case It.LAST:g(),v=h.length-1,b=h[v];break;case It.SET_INDEX:g(),v=c,b=h[v];break;case It.INCREASE:g(),v=p,v<0&&(v=h.indexOf(u)),v++,v>=h.length&&(v=0),b=h[v];break;case It.DECREASE:g(),v=p,v<0&&(v=h.indexOf(u)),v--,v<0&&(v=h.length-1),b=h[v];break}b||(v=-1),n(b),o.hoverIndex=v},[t,o]);return{hoverItem:r,dispatch:a,updateItems:s}},j4=(t,e,r,n)=>{const i=e.current.getBoundingClientRect(),o=t.current.getBoundingClientRect(),s=r===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:r.getBoundingClientRect(),a=E4(n),l=v=>v+o.left-s.left-a.left,u=v=>v+o.left+i.width-s.right+a.right,c=v=>v+o.top-s.top-a.top,h=v=>v+o.top+i.height-s.bottom+a.bottom;return{menuRect:i,containerRect:o,getLeftOverflow:l,getRightOverflow:u,getTopOverflow:c,getBottomOverflow:h,confineHorizontally:v=>{let b=l(v);if(b<0)v-=b;else{const S=u(v);S>0&&(v-=S,b=l(v),b<0&&(v-=b))}return v},confineVertically:v=>{let b=c(v);if(b<0)v-=b;else{const S=h(v);S>0&&(v-=S,b=c(v),b<0&&(v-=b))}return v}}},B4=({arrowRef:t,menuY:e,anchorRect:r,containerRect:n,menuRect:i})=>{let o=r.top-n.top-e+r.height/2;const s=t.current.offsetHeight*1.25;return o=Math.max(s,o),o=Math.min(o,i.height-s),o},D4=({anchorRect:t,containerRect:e,menuRect:r,placeLeftorRightY:n,placeLeftX:i,placeRightX:o,getLeftOverflow:s,getRightOverflow:a,confineHorizontally:l,confineVertically:u,arrowRef:c,arrow:h,direction:p,position:g})=>{let v=p,b=n;g!=="initial"&&(b=u(b),g==="anchor"&&(b=Math.min(b,t.bottom-e.top),b=Math.max(b,t.top-e.top-r.height)));let S,x,w;return v==="left"?(S=i,g!=="initial"&&(x=s(S),x<0&&(w=a(o),(w<=0||-x>w)&&(S=o,v="right")))):(S=o,g!=="initial"&&(w=a(S),w>0&&(x=s(i),(x>=0||-x{let o=r.left-n.left-e+r.width/2;const s=t.current.offsetWidth*1.25;return o=Math.max(s,o),o=Math.min(o,i.width-s),o},U4=({anchorRect:t,containerRect:e,menuRect:r,placeToporBottomX:n,placeTopY:i,placeBottomY:o,getTopOverflow:s,getBottomOverflow:a,confineHorizontally:l,confineVertically:u,arrowRef:c,arrow:h,direction:p,position:g})=>{let v=p==="top"?"top":"bottom",b=n;g!=="initial"&&(b=l(b),g==="anchor"&&(b=Math.min(b,t.right-e.left),b=Math.max(b,t.left-e.left-r.width)));let S,x,w;return v==="top"?(S=i,g!=="initial"&&(x=s(S),x<0&&(w=a(o),(w<=0||-x>w)&&(S=o,v="bottom")))):(S=o,g!=="initial"&&(w=a(S),w>0&&(x=s(i),(x>=0||-x{const{menuRect:u,containerRect:c}=l,h=r==="left"||r==="right";let p=h?n:i,g=h?i:n;if(t){const j=a.current;h?p+=j.offsetWidth:g+=j.offsetHeight}const v=s.left-c.left-u.width-p,b=s.right-c.left+p,S=s.top-c.top-u.height-g,x=s.bottom-c.top+g;let w,E;e==="end"?(w=s.right-c.left-u.width,E=s.bottom-c.top-u.height):e==="center"?(w=s.left-c.left-(u.width-s.width)/2,E=s.top-c.top-(u.height-s.height)/2):(w=s.left-c.left,E=s.top-c.top),w+=p,E+=g;const T={...l,anchorRect:s,placeLeftX:v,placeRightX:b,placeLeftorRightY:E,placeTopY:S,placeBottomY:x,placeToporBottomX:w,arrowRef:a,arrow:t,direction:r,position:o};switch(r){case"left":case"right":return D4(T);case"top":case"bottom":default:return U4(T)}},yf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?L.useLayoutEffect:L.useEffect;function zm(t,e){typeof t=="function"?t(e):t.current=e}const h2=(t,e)=>L.useMemo(()=>t?e?r=>{zm(t,r),zm(e,r)}:t:e,[t,e]),$m=-9999,$4=({ariaLabel:t,menuClassName:e,menuStyle:r,arrow:n,arrowProps:i={},anchorPoint:o,anchorRef:s,containerRef:a,containerProps:l,focusProps:u,externalRef:c,parentScrollingRef:h,align:p="start",direction:g="bottom",position:v="auto",overflow:b="visible",setDownOverflow:S,repositionFlag:x,captureFocus:w=!0,state:E,endTransition:T,isDisabled:j,menuItemFocus:D,gap:$=0,shift:H=0,children:J,onClose:Y,...ie})=>{const[ae,C]=L.useState({x:$m,y:$m}),[f,m]=L.useState({}),[A,k]=L.useState(),[_,I]=L.useState(g),[R]=L.useState(T4),[N,d]=L.useReducer(ne=>ne+1,1),{transition:P,boundingBoxRef:X,boundingBoxPadding:y,rootMenuRef:B,rootAnchorRef:F,scrollNodesRef:U,reposition:V,viewScroll:oe,submenuCloseDelay:Q}=L.useContext(f2),{submenuCtx:W,reposSubmenu:Ye=x}=L.useContext(Fm),K=L.useRef(null),le=L.useRef(),Yr=L.useRef(),Te=L.useRef(!1),Me=L.useRef({width:0,height:0}),Xr=L.useRef(()=>{}),{hoverItem:Pe,dispatch:fe,updateItems:xr}=L4(K,le),he=u2(E),Le=ga(P,"open"),Zr=ga(P,"close"),ge=U.current,$e=ne=>{switch(ne.key){case Cn.HOME:fe(It.FIRST);break;case Cn.END:fe(It.LAST);break;case Cn.UP:fe(It.DECREASE,Pe);break;case Cn.DOWN:fe(It.INCREASE,Pe);break;case Cn.SPACE:ne.target&&ne.target.className.indexOf(gf)!==-1&&ne.preventDefault();return;default:return}ne.preventDefault(),ne.stopPropagation()},bn=()=>{E==="closing"&&k(),mn(T)},He=ne=>{ne.stopPropagation(),R.on(Q,()=>{fe(It.RESET),le.current.focus()})},qe=ne=>{ne.target===ne.currentTarget&&R.off()},qt=L.useCallback(ne=>{var st;const ve=s?(st=s.current)==null?void 0:st.getBoundingClientRect():o?{left:o.x,right:o.x,top:o.y,bottom:o.y,width:0,height:0}:null;if(!ve)return;ge.menu||(ge.menu=(X?X.current:mf(B.current))||window);const de=j4(a,K,ge.menu,y);let{arrowX:nt,arrowY:_e,x:Se,y:Pt,computedDirection:Ie}=z4({arrow:n,align:p,direction:g,gap:$,shift:H,position:v,anchorRect:ve,arrowRef:Yr,positionHelpers:de});const{menuRect:Fe}=de;let Qt=Fe.height;if(!ne&&b!=="visible"){const{getTopOverflow:Ke,getBottomOverflow:Qe}=de;let Jt,Re;const Ue=Me.current.height,br=Qe(Pt);if(br>0||io(br,0)&&io(Qt,Ue))Jt=Qt-br,Re=br;else{const Ne=Ke(Pt);(Ne<0||io(Ne,0)&&io(Qt,Ue))&&(Jt=Qt+Ne,Re=0-Ne,Jt>=0&&(Pt-=Ne))}Jt>=0?(Qt=Jt,k({height:Jt,overflowAmt:Re})):k()}n&&m({x:nt,y:_e}),C({x:Se,y:Pt}),I(Ie),Me.current={width:Fe.width,height:Qt}},[n,p,y,g,$,H,v,b,o,s,a,X,B,ge]);yf(()=>{he&&(qt(),Te.current&&d()),Te.current=he,Xr.current=qt},[he,qt,Ye]),yf(()=>{A&&!S&&(K.current.scrollTop=0)},[A,S]),yf(()=>xr,[xr]),L.useEffect(()=>{let{menu:ne}=ge;if(!he||!ne)return;if(ne=ne.addEventListener?ne:window,!ge.anchors){ge.anchors=[];let nt=mf(F&&F.current);for(;nt&&nt!==ne;)ge.anchors.push(nt),nt=mf(nt)}let st=oe;if(ge.anchors.length&&st==="initial"&&(st="auto"),st==="initial")return;const ve=()=>{st==="auto"?Bm(()=>qt(!0)):mn(Y,{reason:va.SCROLL})},de=ge.anchors.concat(oe!=="initial"?ne:[]);return de.forEach(nt=>nt.addEventListener("scroll",ve)),()=>de.forEach(nt=>nt.removeEventListener("scroll",ve))},[F,ge,he,Y,oe,qt]);const je=!!A&&A.overflowAmt>0;L.useEffect(()=>{if(je||!he||!h)return;const ne=()=>Bm(qt),st=h.current;return st.addEventListener("scroll",ne),()=>st.removeEventListener("scroll",ne)},[he,je,h,qt]),L.useEffect(()=>{if(typeof ResizeObserver!="function"||V==="initial")return;const ne=new ResizeObserver(([ve])=>{const{borderBoxSize:de,target:nt}=ve;let _e,Se;if(de){const{inlineSize:Pt,blockSize:Ie}=de[0]||de;_e=Pt,Se=Ie}else{const Pt=nt.getBoundingClientRect();_e=Pt.width,Se=Pt.height}_e===0||Se===0||io(_e,Me.current.width,1)&&io(Se,Me.current.height,1)||ia.flushSync(()=>{Xr.current(),d()})}),st=K.current;return ne.observe(st,{box:"border-box"}),()=>ne.unobserve(st)},[V]),L.useEffect(()=>{if(!he){fe(It.RESET),Zr||k();return}const{position:ne,alwaysUpdate:st}=D||{},ve=()=>{ne===Fs.FIRST?fe(It.FIRST):ne===Fs.LAST?fe(It.LAST):ne>=-1&&fe(It.SET_INDEX,void 0,ne)};if(st)ve();else if(w){const de=setTimeout(()=>{const nt=K.current;nt&&!nt.contains(document.activeElement)&&(le.current.focus(),ve())},Le?170:100);return()=>clearTimeout(de)}},[he,Le,Zr,w,D,fe]);const Ve=L.useMemo(()=>({isParentOpen:he,submenuCtx:R,dispatch:fe,updateItems:xr}),[he,R,fe,xr]);let Or,Ce;A&&(S?Ce=A.overflowAmt:Or=A.height);const Ge=L.useMemo(()=>({reposSubmenu:N,submenuCtx:R,overflow:b,overflowAmt:Ce,parentMenuRef:K,parentDir:_}),[N,R,b,Ce,_]),En=Or>=0?{maxHeight:Or,overflow:b}:void 0,Be=L.useMemo(()=>({state:E,dir:_}),[E,_]),We=L.useMemo(()=>({dir:_}),[_]),An=mu({block:gf,element:k4,modifiers:We,className:i.className}),De=M.jsxs("ul",{role:"menu","aria-label":t,...A4(j),...Yd({onPointerEnter:W==null?void 0:W.off,onPointerMove:He,onPointerLeave:qe,onKeyDown:$e,onAnimationEnd:bn},ie),ref:h2(c,K),className:mu({block:gf,modifiers:Be,className:e}),style:{...r,...En,margin:0,display:E==="closed"?"none":void 0,position:vf,left:ae.x,top:ae.y},children:[M.jsx("li",{tabIndex:-1,style:{position:vf,left:0,top:0,display:"block",outline:"none"},ref:le,...Um,...u}),n&&M.jsx("li",{...Um,...i,className:An,style:{display:"block",position:vf,left:f.x,top:f.y,...i.style},ref:Yr}),M.jsx(Fm.Provider,{value:Ge,children:M.jsx(M4.Provider,{value:Ve,children:M.jsx(N4.Provider,{value:Pe,children:mn(J,Be)})})})]});return l?M.jsx(O4,{...l,isOpen:he,children:De}):De},H4=L.forwardRef(function({"aria-label":e,className:r,containerProps:n,initialMounted:i,unmountOnClose:o,transition:s,transitionTimeout:a,boundingBoxRef:l,boundingBoxPadding:u,reposition:c="auto",submenuOpenDelay:h=300,submenuCloseDelay:p=150,viewScroll:g="initial",portal:v,theming:b,onItemClick:S,...x},w){const E=L.useRef(null),T=L.useRef({}),{anchorRef:j,state:D,onClose:$}=x,H=L.useMemo(()=>({initialMounted:i,unmountOnClose:o,transition:s,transitionTimeout:a,boundingBoxRef:l,boundingBoxPadding:u,rootMenuRef:E,rootAnchorRef:j,scrollNodesRef:T,reposition:c,viewScroll:g,submenuOpenDelay:h,submenuCloseDelay:p}),[i,o,s,a,j,l,u,c,g,h,p]),J=L.useMemo(()=>({handleClick(ie,ae){ie.stopPropagation||mn(S,ie);let C=ie.keepOpen;C===void 0&&(C=ae&&ie.key===Cn.SPACE),C||mn($,{value:ie.value,key:ie.key,reason:va.CLICK})},handleClose(ie){mn($,{key:ie,reason:va.CLICK})}}),[S,$]);if(!D)return null;const Y=M.jsx(f2.Provider,{value:H,children:M.jsx(P4.Provider,{value:J,children:M.jsx($4,{...x,ariaLabel:e||"Menu",externalRef:w,containerRef:E,containerProps:{className:r,containerRef:E,containerProps:n,theming:b,transition:s,onClose:$}})})});return v===!0&&typeof document<"u"?ia.createPortal(Y,document.body):v?v.target?ia.createPortal(Y,v.target):v.stablePosition?null:Y:Y}),Oh=0,Th=1,gu=2,vu=3,yu=4,q4=5,d2=6,V4=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],p2=t=>({_s:t,status:V4[t],isEnter:tyu}),Lh=t=>t?d2:q4,G4=(t,e)=>{switch(t){case Th:case Oh:return gu;case yu:case vu:return Lh(e)}},W4=t=>typeof t=="object"?[t.enter,t.exit]:[t,t],K4=(t,e)=>setTimeout(()=>{isNaN(document.body.offsetTop)||t(e+1)},0),Hm=(t,e,r,n,i)=>{clearTimeout(n.current);const o=p2(t);e(o),r.current=o,i&&i({current:o})},Q4=({enter:t=!0,exit:e=!0,preEnter:r,preExit:n,timeout:i,initialEntered:o,mountOnEnter:s,unmountOnExit:a,onStateChange:l}={})=>{const[u,c]=L.useState(()=>p2(o?gu:Lh(s))),h=L.useRef(u),p=L.useRef(),[g,v]=W4(i),b=L.useCallback(()=>{const x=G4(h.current._s,a);x&&Hm(x,c,h,p,l)},[l,a]),S=L.useCallback(x=>{const w=T=>{switch(Hm(T,c,h,p,l),T){case Th:g>=0&&(p.current=setTimeout(b,g));break;case yu:v>=0&&(p.current=setTimeout(b,v));break;case Oh:case vu:p.current=K4(w,T);break}},E=h.current.isEnter;typeof x!="boolean"&&(x=!E),x?!E&&w(t?r?Oh:Th:gu):E&&w(e?n?vu:yu:Lh(a))},[b,l,t,e,r,n,g,v,a]);return L.useEffect(()=>()=>clearTimeout(p.current),[]),[u,S,b]},J4=({initialOpen:t,initialMounted:e,unmountOnClose:r,transition:n,transitionTimeout:i=500}={})=>{const[{status:o},s,a]=Q4({initialEntered:t,mountOnEnter:!e,unmountOnExit:r,timeout:i,enter:ga(n,"open"),exit:ga(n,"close")});return[{state:C4[o],endTransition:a},s]},Y4=t=>{const[e,r]=J4(t),[n,i]=L.useState(),o=(s,a)=>{i({position:s,alwaysUpdate:a}),r(!0)};return[{menuItemFocus:n,...e},r,o]},X4=(t,e)=>{const[r]=L.useState({});return{onMouseDown:()=>{r.v=t&&t!=="closed"},onClick:n=>r.v?r.v=!1:e(!0,n)}},Z4=(t,e)=>{const r=L.useRef(e);L.useEffect(()=>{r.current!==e&&mn(t,{open:e}),r.current=e},[t,e])},ek=L.forwardRef(function({"aria-label":e,captureFocus:r,initialOpen:n,menuButton:i,instanceRef:o,onMenuChange:s,...a},l){const[u,c,h]=Y4(a),{state:p}=u,g=u2(p),v=L.useRef(null),b=X4(p,(j,D)=>h(D.detail?void 0:Fs.FIRST)),S=L.useCallback(j=>{c(!1),j.key&&v.current.focus()},[c]),x=j=>{switch(j.key){case Cn.UP:h(Fs.LAST);break;case Cn.DOWN:h(Fs.FIRST);break;default:return}j.preventDefault()},w=mn(i,{open:g});if(!w||!w.type)throw new Error("Menu requires a menuButton prop.");const E={ref:h2(w.ref,v),...Yd({onKeyDown:x,...b},w.props)};x4(w.type)==="MenuButton"&&(E.isOpen=g);const T=L.cloneElement(w,E);return Z4(s,g),L.useImperativeHandle(o,()=>({openMenu:h,closeMenu:()=>c(!1)})),M.jsxs(L.Fragment,{children:[T,M.jsx(H4,{...a,...u,"aria-label":e||(typeof w.props.children=="string"?w.props.children:"Menu"),anchorRef:v,ref:l,onClose:S})]})});function qm({...t}){return M.jsx(ek,{...t,unmountOnClose:!0,className:xi("relative",t.className),menuButton:M.jsx(R4,{className:"small",children:M.jsx(i4,{className:"-mb-1"})}),children:t.children})}function tk({app:t,className:e}){var a,l,u,c,h;const{uninstallApp:r,setMirroring:n,setAutoUpdate:i}=os(),o=Sa();return!t.state?t.metadata?M.jsx(qm,{className:e,children:M.jsxs("div",{className:"flex flex-col bg-black/50 p-2 rounded-lg",children:[((a=t.metadata)==null?void 0:a.description)&&M.jsx("button",{className:"my-1 whitespace-nowrap clear",onClick:()=>o(`/app-details/${Ee(t)}`),children:"View Details"}),((l=t.metadata)==null?void 0:l.external_url)&&M.jsx("a",{target:"_blank",href:(u=t.metadata)==null?void 0:u.external_url,className:"mb-1 whitespace-nowrap button clear",children:"View Site"})]})}):M.jsx(M.Fragment,{}):M.jsx(qm,{className:e,children:M.jsxs("div",{className:"flex flex-col bg-black/50 p-2 rounded-lg",children:[M.jsx("button",{className:"my-1 whitespace-nowrap clear",onClick:()=>o(`/app-details/${Ee(t)}`),children:"View Details"}),t.installed&&M.jsxs(M.Fragment,{children:[M.jsx("button",{className:"mb-1 whitespace-nowrap clear",onClick:()=>r(t),children:"Uninstall"}),M.jsxs("button",{className:"mb-1 whitespace-nowrap clear",onClick:()=>{var p;return n(t,!((p=t.state)!=null&&p.mirroring))},children:[(c=t.state)!=null&&c.mirroring?"Stop":"Start"," Mirroring"]}),M.jsxs("button",{className:"mb-1 whitespace-nowrap clear",onClick:()=>{var p;return i(t,!((p=t.state)!=null&&p.auto_update))},children:[(h=t.state)!=null&&h.auto_update?"Disable":"Enable"," Auto Update"]})]})]})})}function Ns({app:t,...e}){var r;return L.createElement("div",{...e,key:Ee(t),className:"flex justify-between w-full rounded hover:bg-white/10 card"},M.jsx(a2,{app:t,size:"small"}),M.jsxs("div",{className:"flex mr-1 items-start",children:[!((r=t.state)!=null&&r.caps_approved)&&M.jsx(l2,{app:t,className:"mr-2"}),M.jsx(tk,{app:t})]}))}function rk(t){return Jr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"},child:[]}]})(t)}function nk(t){return Jr({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"},child:[]}]})(t)}function ik(t){return Jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"},child:[]}]})(t)}function ok(t){return Jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"},child:[]}]})(t)}function sk(t){return Jr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 109.3V352c0 17.7-14.3 32-32 32s-32-14.3-32-32V109.3l-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352H192c0 35.3 28.7 64 64 64s64-28.7 64-64H448c35.3 0 64 28.7 64 64v32c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V416c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"},child:[]}]})(t)}function m2(t){return Jr({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"},child:[]}]})(t)}const jh="/my-apps";function nc({value:t="",onChange:e=()=>null,onBack:r,hideSearch:n=!1}){const i=Sa(),o=Uu(),s=Vr.useRef(null),a=o.key!=="default",l=o.pathname===jh;return M.jsxs("div",{className:"flex justify-between",children:[o.pathname!=="/"?M.jsx("button",{className:"flex flex-col c mr-1 icon",onClick:()=>{r?r():i(a?-1:"/")},children:M.jsx(rk,{})}):M.jsx("button",{className:"flex flex-col c mr-1 alt",onClick:()=>i("/publish"),children:M.jsx(sk,{})}),!n&&M.jsxs("div",{className:"flex mx-2 flex-1 rounded-md",children:[M.jsx("button",{className:"icon",type:"button",onClick:()=>{var u;return(u=s.current)==null?void 0:u.focus()},children:M.jsx(ok,{})}),M.jsx("input",{type:"text",ref:s,onChange:u=>e(u.target.value),value:t,placeholder:"Search for apps...",className:"w-full ml-2"}),t.length>0&&M.jsx("button",{className:"icon ml-2",onClick:()=>e(""),children:M.jsx(m2,{})})]}),M.jsx("div",{className:"flex",children:M.jsxs("button",{className:xi("flex ml-1 alt"),onClick:()=>i(l?-1:jh),children:[M.jsx(ik,{className:"mr-1"}),"My Apps"]})})]})}function ak(t){const{listedApps:e,getListedApps:r}=os(),[n,i]=L.useState("Recently published"),[o,s]=L.useState(""),[a,l]=L.useState(e),[u,c]=L.useState(1),h=L.useMemo(()=>Array.from({length:Math.ceil(a.length/10)},(v,b)=>b+1),[a]);L.useEffect(()=>{const v=(u-1)*10,b=v+10;l(e.slice(v,b))},[e]),L.useEffect(()=>{r().then(v=>{l(Object.values(v))}).catch(v=>console.error(v))},[]);const p=L.useCallback(async v=>{},[]),g=L.useCallback(v=>{s(v);const b=e.filter(S=>{var x,w,E,T;return S.package.toLowerCase().includes(v.toLowerCase())||((w=(x=S.metadata)==null?void 0:x.description)==null?void 0:w.toLowerCase().includes(v.toLowerCase()))||((T=(E=S.metadata)==null?void 0:E.description)==null?void 0:T.toLowerCase().includes(v.toLowerCase()))},[e]);l(b)},[e]);return M.jsxs("div",{className:"max-w-[900px] w-full",children:[M.jsx(nc,{value:o,onChange:g}),M.jsxs("div",{className:"flex justify-between items-center my-2 mx-0",children:[M.jsx("h4",{children:"New"}),M.jsxs("select",{value:n,onChange:v=>{i(v.target.value),p(v.target.value)},children:[M.jsx("option",{children:"Recently published"}),M.jsx("option",{children:"Most popular"}),M.jsx("option",{children:"Best rating"}),M.jsx("option",{children:"Recently updated"})]})]}),M.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto gap-2",children:[a.map(v=>{var b;return M.jsx(Ns,{app:v},Ee(v)+(((b=v.state)==null?void 0:b.our_version)||""))}),h.length>1&&M.jsxs("div",{className:"flex self-center",children:[u!==h[0]&&M.jsx(r4,{onClick:()=>c(u-1)}),h.map(v=>M.jsx("div",{className:xi("my-1 mx-2",{"font-bold":v===u}),onClick:()=>c(v),children:v},`page-${v}`)),u!==h[h.length-1]&&M.jsx(n4,{onClick:()=>c(u+1)})]})]})]})}function lk(t){const{myApps:e,getMyApps:r}=os(),n=Sa(),[i,o]=L.useState(""),[s,a]=L.useState(e);L.useEffect(()=>{r().then(a).catch(u=>console.error(u))},[]);const l=L.useCallback(u=>{o(u);const c=Object.keys(e).reduce((h,p)=>(h[p]=e[p].filter(g=>{var v,b,S,x;return g.package.toLowerCase().includes(u.toLowerCase())||((b=(v=g.metadata)==null?void 0:v.description)==null?void 0:b.toLowerCase().includes(u.toLowerCase()))||((x=(S=g.metadata)==null?void 0:S.description)==null?void 0:x.toLowerCase().includes(u.toLowerCase()))}),h),{downloaded:[],installed:[],local:[],system:[]});a(c)},[e]);return L.useEffect(()=>{i?l(i):a(e)},[e]),M.jsxs("div",{className:"flex flex-col w-full max-w-[900px]",children:[M.jsx(nc,{value:i,onChange:l}),M.jsxs("div",{className:"flex justify-between items-center mt-2",children:[M.jsx("h4",{className:"mb-2",children:"My Packages"}),M.jsxs("button",{onClick:()=>n("/publish"),children:[M.jsx(s4,{className:"mr-2"}),"Publish Package"]})]}),M.jsxs("div",{className:"flex flex-col card gap-2 mt-2",children:[M.jsx("h4",{children:"Downloaded"}),(s.downloaded||[]).map(u=>M.jsx(Ns,{app:u},Ee(u))),M.jsx("h4",{children:"Installed"}),(s.installed||[]).map(u=>M.jsx(Ns,{app:u},Ee(u))),M.jsx("h4",{children:"Local"}),(s.local||[]).map(u=>M.jsx(Ns,{app:u},Ee(u))),M.jsx("h4",{children:"System"}),(s.system||[]).map(u=>M.jsx(Ns,{app:u},Ee(u)))]})]})}function uk(t){var p,g,v,b,S,x,w,E;const{myApps:e,listedApps:r,getListedApp:n}=os(),i=Sa(),o=Ob(),[s,a]=L.useState(void 0);L.useEffect(()=>{const T=e.local.find(j=>Ee(j)===o.id);if(T)return a(T);if(o.id){const j=r.find(D=>Ee(D)===o.id);j?a(j):n(o.id).then(D=>a(D)).catch(console.error)}},[o.id]);const l=L.useCallback(()=>{i("/publish",{state:{app:s}})},[s,i]),u=L.useMemo(()=>{var T,j;return((j=(T=s==null?void 0:s.metadata)==null?void 0:T.properties)==null?void 0:j.current_version)||"Unknown"},[s]),c=Object.entries(((g=(p=s==null?void 0:s.metadata)==null?void 0:p.properties)==null?void 0:g.code_hashes)||{}),h=((v=s==null?void 0:s.state)==null?void 0:v.our_version)||(c[(c.length||1)-1]||["",""])[1];return M.jsxs("div",{className:"flex flex-col w-full max-w-[900px]",children:[M.jsx(nc,{value:"",onChange:()=>null,hideSearch:!0}),M.jsx("div",{className:"card mt1",children:s?M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex justify-between",children:[M.jsx(a2,{app:s,size:"large"}),M.jsx(l2,{app:s,className:"mr-1"})]}),M.jsxs("div",{className:"flex flex-col mt-2",children:[M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Description"}),M.jsx("div",{className:"mb-1 w-3/4",children:(((b=s.metadata)==null?void 0:b.description)||"No description given").slice(0,2e3)})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Publisher"}),M.jsx("div",{className:"mb-1 w-3/4",children:s.publisher})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Version"}),M.jsx("div",{className:"mb-1 w-3/4",children:u})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Mirrors"}),M.jsx("div",{className:"w-3/4 flex flex-col",children:(((x=(S=s.metadata)==null?void 0:S.properties)==null?void 0:x.mirrors)||[]).map((T,j)=>M.jsx("div",{className:"mb-1",children:T},j+T))})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Hash"}),M.jsx("div",{className:"w-3/4 break-all",children:h})]})]}),M.jsx("div",{className:"app-screenshots flex mt-2 overflow-x-auto max-w-full",children:(((E=(w=s.metadata)==null?void 0:w.properties)==null?void 0:E.screenshots)||[]).map((T,j)=>M.jsx("img",{src:T,className:"mr-2 max-h-20 max-w-full rounded border border-black"},j+T))}),s.installed&&M.jsx("button",{type:"button",onClick:l,children:"Publish"})]}):M.jsxs(M.Fragment,{children:[M.jsx("h4",{children:"App details not found for "}),M.jsx("h4",{children:o.id})]})})]})}var Il=(t=>(t[t.SEPOLIA=11155111]="SEPOLIA",t[t.OPTIMISM=10]="OPTIMISM",t[t.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",t[t.LOCAL=1337]="LOCAL",t))(Il||{});const wu="0xaa36a7",Vm="0xa",Gm={11155111:"0x18c39eB547A0060C6034f8bEaFB947D1C16eADF1"},ck="4902",Wm={[wu]:{chainId:wu,chainName:"Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://rpc.sepolia.org"],blockExplorerUrls:["https://sepolia.etherscan.io"]},[Vm]:{chainId:Vm,chainName:"Optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://mainnet.optimism.io"],blockExplorerUrls:["https://optimistic.etherscan.io"]}},fk=t=>{switch(t){case"1":case"0x1":return"Ethereum";case"10":case"a":case"0xa":return"Optimism";case"42161":return"Arbitrum";case"11155111":case"aa36a7":case"0xaa36a7":return"Sepolia";default:return"Unknown"}},Km=async t=>{var r,n,i;let e=await((r=window.ethereum)==null?void 0:r.request({method:"net_version"}).catch(()=>"1"));if(e="0x"+(typeof e=="string"?e.replace(/^0x/,""):e.toString(16)),!Wm[t]){console.error(`Invalid chain ID: ${t}`);return}if(t!==e)try{await((n=window.ethereum)==null?void 0:n.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}))}catch(o){if(String(o).includes(ck))await((i=window.ethereum)==null?void 0:i.request({method:"wallet_addEthereumChain",params:[Wm[t]]}));else throw window.alert(`You must enable the ${fk(t)} network in your wallet.`),new Error(`User cancelled connection to ${t}`)}};var ya={},ic={};Object.defineProperty(ic,"__esModule",{value:!0});ic.Connector=void 0;class hk{constructor(e,r){this.actions=e,this.onError=r}resetState(){this.actions.resetState()}}ic.Connector=hk;var wf,Qm;function dk(){if(Qm)return wf;Qm=1;function t({mustBeMetaMask:e=!1,silent:r=!1,timeout:n=3e3}={}){o();let i=!1;return new Promise(s=>{window.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},n));function a(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",a);const{ethereum:l}=window;l&&(!e||l.isMetaMask)?s(l):(!r&&console.error("@metamask/detect-provider:",e&&l?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),s(null))}});function o(){if(typeof e!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof r!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof n!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}return wf=t,wf}var pk=ze&&ze.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),mk=ze&&ze.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gk=ze&&ze.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&pk(e,t,r);return mk(e,t),e},oo=ze&&ze.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(ya,"__esModule",{value:!0});var g2=ya.MetaMask=ya.NoMetaMaskError=void 0;const vk=ic;class wa extends Error{constructor(){super("MetaMask not installed"),this.name=wa.name,Object.setPrototypeOf(this,wa.prototype)}}ya.NoMetaMaskError=wa;function ll(t){return Number.parseInt(t,16)}class yk extends vk.Connector{constructor({actions:e,options:r,onError:n}){super(e,n),this.options=r}isomorphicInitialize(){return oo(this,void 0,void 0,function*(){if(!this.eagerConnection)return this.eagerConnection=Promise.resolve().then(()=>gk(dk())).then(e=>oo(this,void 0,void 0,function*(){var r,n;const i=yield e.default(this.options);i&&(this.provider=i,!((r=this.provider.providers)===null||r===void 0)&&r.length&&(this.provider=(n=this.provider.providers.find(o=>o.isMetaMask))!==null&&n!==void 0?n:this.provider.providers[0]),this.provider.on("connect",({chainId:o})=>{this.actions.update({chainId:ll(o)})}),this.provider.on("disconnect",o=>{var s;if(o.code===1013){console.debug('MetaMask logged connection error 1013: "Try again later"');return}this.actions.resetState(),(s=this.onError)===null||s===void 0||s.call(this,o)}),this.provider.on("chainChanged",o=>{this.actions.update({chainId:ll(o)})}),this.provider.on("accountsChanged",o=>{o.length===0?this.actions.resetState():this.actions.update({accounts:o})}))}))})}connectEagerly(){return oo(this,void 0,void 0,function*(){const e=this.actions.startActivation();try{if(yield this.isomorphicInitialize(),!this.provider)return e();const r=yield this.provider.request({method:"eth_accounts"});if(!r.length)throw new Error("No accounts returned");const n=yield this.provider.request({method:"eth_chainId"});this.actions.update({chainId:ll(n),accounts:r})}catch(r){console.debug("Could not connect eagerly",r),this.actions.resetState()}})}activate(e){var r,n;return oo(this,void 0,void 0,function*(){let i;return!((n=(r=this.provider)===null||r===void 0?void 0:r.isConnected)===null||n===void 0)&&n.call(r)||(i=this.actions.startActivation()),this.isomorphicInitialize().then(()=>oo(this,void 0,void 0,function*(){if(!this.provider)throw new wa;const o=yield this.provider.request({method:"eth_requestAccounts"}),s=yield this.provider.request({method:"eth_chainId"}),a=ll(s),l=typeof e=="number"?e:e==null?void 0:e.chainId;if(!l||a===l)return this.actions.update({chainId:a,accounts:o});const u=`0x${l.toString(16)}`;return this.provider.request({method:"wallet_switchEthereumChain",params:[{chainId:u}]}).catch(c=>{var h,p;if((((p=(h=c.data)===null||h===void 0?void 0:h.originalError)===null||p===void 0?void 0:p.code)||c.code)===4902&&typeof e!="number"){if(!this.provider)throw new Error("No provider");return this.provider.request({method:"wallet_addEthereumChain",params:[Object.assign(Object.assign({},e),{chainId:u})]})}throw c}).then(()=>this.activate(l))})).catch(o=>{throw i==null||i(),o})})}watchAsset({address:e,symbol:r,decimals:n,image:i}){return oo(this,void 0,void 0,function*(){if(!this.provider)throw new Error("No provider");return this.provider.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,symbol:r,decimals:n,image:i}}}).then(o=>{if(!o)throw new Error("Rejected");return!0})})}}g2=ya.MetaMask=yk;const[v2,Xd]=Zu.initializeConnector(t=>new g2({actions:t}));function wk(t){const e=t.split("."),r=new Uint8Array(t.length+e.length);let n=0;for(const i of e){const o=i.length;r[n]=o,n++;for(let s=0;si.toString(16).padStart(2,"0")).join("")}`}const Jm=/^\d+\.\d+\.\d+$/,xk=({app:t,packageName:e,publisherId:r,goBack:n})=>{var h,p,g,v,b,S,x,w;const[i,o]=L.useState({name:((h=t==null?void 0:t.metadata)==null?void 0:h.name)||"",description:((p=t==null?void 0:t.metadata)==null?void 0:p.description)||"",image:((g=t==null?void 0:t.metadata)==null?void 0:g.image)||"",external_url:((v=t==null?void 0:t.metadata)==null?void 0:v.external_url)||"",animation_url:((b=t==null?void 0:t.metadata)==null?void 0:b.animation_url)||"",package_name:e,current_version:"",publisher:r,mirrors:[r]}),[s,a]=L.useState(Object.entries(((x=(S=t==null?void 0:t.metadata)==null?void 0:S.properties)==null?void 0:x.code_hashes)||{}).concat([["",((w=t==null?void 0:t.state)==null?void 0:w.our_version)||""]])),l=(E,T)=>{o({...i,[E]:T})};L.useEffect(()=>{l("package_name",e)},[e]),L.useEffect(()=>{l("publisher",r)},[r]);const u=L.useCallback(()=>{const E=s.reduce((H,[J,Y])=>(H[J]=Y,H),{});if(Jm.test(i.current_version))if(E[i.current_version]){if(!Object.keys(E).reduce((H,J)=>H&&Jm.test(J),!0)){window.alert("Code hashes must be a JSON object with valid version keys");return}}else{window.alert(`Code hashes must include current version (${i.current_version})`);return}else{window.alert("Current version must be in the format x.y.z");return}const T=JSON.stringify({name:i.name,description:i.description,image:i.image,external_url:i.external_url,animation_url:i.animation_url,properties:{package_name:i.package_name,current_version:i.current_version,publisher:i.publisher,mirrors:i.mirrors,code_hashes:E}}),j=new Blob([T],{type:"application/json"}),D=URL.createObjectURL(j),$=document.createElement("a");$.href=D,$.download=i.package_name+"_"+i.publisher+"_metadata.json",$.click(),URL.revokeObjectURL(D)},[i,s]),c=()=>{o({name:"",description:"",image:"",external_url:"",animation_url:"",package_name:"",current_version:"",publisher:"",mirrors:[]}),a([])};return M.jsxs("form",{className:"flex flex-col card mt-2 gap-2",children:[M.jsx("h4",{children:"Fill out metadata"}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Name"}),M.jsx("input",{type:"text",placeholder:"Name",value:i.name,onChange:E=>l("name",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Description"}),M.jsx("input",{type:"text",placeholder:"Description",value:i.description,onChange:E=>l("description",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Image URL"}),M.jsx("input",{type:"text",placeholder:"Image URL",value:i.image,onChange:E=>l("image",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"External URL"}),M.jsx("input",{type:"text",placeholder:"External URL",value:i.external_url,onChange:E=>l("external_url",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Animation URL"}),M.jsx("input",{type:"text",placeholder:"Animation URL",value:i.animation_url,onChange:E=>l("animation_url",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Package Name"}),M.jsx("input",{type:"text",placeholder:"Package Name",value:i.package_name,onChange:E=>l("package_name",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Current Version"}),M.jsx("input",{type:"text",placeholder:"Current Version",value:i.current_version,onChange:E=>l("current_version",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Publisher"}),M.jsx("input",{type:"text",placeholder:"Publisher",value:i.publisher,onChange:E=>l("publisher",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Mirrors (separated by commas)"}),M.jsx("input",{type:"text",placeholder:"Mirrors (separated by commas)",value:i.mirrors.join(","),onChange:E=>l("mirrors",E.target.value.split(",").map(T=>T.trim()))})]}),M.jsxs("div",{className:"flex flex-col w-3/4 gap-2",children:[M.jsxs("div",{className:"flex gap-2 mt-0 justify-between w-full",children:[M.jsx("h5",{className:"m-0",children:"Code Hashes"}),M.jsx("button",{type:"button",onClick:()=>a([...s,["",""]]),className:"clear",children:"Add code hash"})]}),s.map(([E,T],j,D)=>M.jsxs("div",{className:"flex gap-2 mt-0 w-full",children:[M.jsx("input",{type:"text",placeholder:"Version",value:E,onChange:$=>a(H=>{const J=[...H];return J[j][0]=$.target.value,J}),className:"flex-1"}),M.jsx("input",{type:"text",placeholder:"Hash",value:T,onChange:$=>a(H=>{const J=[...H];return J[j][1]=$.target.value,J}),className:"flex-5"}),D.length>1&&M.jsx("button",{type:"button",onClick:()=>a($=>$.filter((H,J)=>J!==j)),className:"icon",children:M.jsx(m2,{})})]},j+"_code_hash"))]}),M.jsxs("div",{className:"flex gap-2 my-4",children:[M.jsx("button",{type:"button",onClick:u,className:"alt",children:"Download JSON"}),M.jsx("button",{type:"button",onClick:c,className:"clear",children:"Clear Form"}),M.jsx("button",{type:"button",onClick:n,children:"Done"})]})]})};function bk({readOnly:t=!1,checked:e,setChecked:r}){return M.jsxs("div",{className:"relative",children:[M.jsx("input",{type:"checkbox",id:"checked",name:"checked",checked:e,onChange:n=>r&&r(n.target.checked),autoFocus:!0,readOnly:t}),e&&M.jsx(nk,{className:"absolute left-1 top-1 cursor-pointer",onClick:()=>r&&r(!1)})]})}var Wn=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};Wn.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Wn.prototype.init_by_array=function(t,e){var r,n,i;for(this.init_seed(19650218),r=1,n=0,i=this.N>e?this.N:e;i;i--){var o=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+t[n]+n,this.mt[r]>>>=0,r++,n++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1),n>=e&&(n=0)}for(i=this.N-1;i;i--){var o=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-r,this.mt[r]>>>=0,r++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1)}this.mt[0]=2147483648};Wn.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_seed(5489),r=0;r>>1^e[t&1];for(;r>>1^e[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};Wn.prototype.random_int31=function(){return this.random_int()>>>1};Wn.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Wn.prototype.random=function(){return this.random_int()*(1/4294967296)};Wn.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Wn.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var Ek=Wn;function Ak(t,e){var r=document.createElement("div");return r.style.borderRadius="50px",r.style.overflow="hidden",r.style.padding="0px",r.style.margin="0px",r.style.width=""+t+"px",r.style.height=""+t+"px",r.style.display="inline-block",r.style.background=e,{container:r}}var _k=Ak,y2={exports:{}};(function(t){var e=function(){function r(l,u,c,h){typeof u=="object"&&(c=u.depth,h=u.prototype,u.filter,u=u.circular);var p=[],g=[],v=typeof Buffer<"u";typeof u>"u"&&(u=!0),typeof c>"u"&&(c=1/0);function b(S,x){if(S===null)return null;if(x==0)return S;var w,E;if(typeof S!="object")return S;if(r.__isArray(S))w=[];else if(r.__isRegExp(S))w=new RegExp(S.source,a(S)),S.lastIndex&&(w.lastIndex=S.lastIndex);else if(r.__isDate(S))w=new Date(S.getTime());else{if(v&&Buffer.isBuffer(S))return Buffer.allocUnsafe?w=Buffer.allocUnsafe(S.length):w=new Buffer(S.length),S.copy(w),w;typeof h>"u"?(E=Object.getPrototypeOf(S),w=Object.create(E)):(w=Object.create(h),E=h)}if(u){var T=p.indexOf(S);if(T!=-1)return g[T];p.push(S),g.push(w)}for(var j in S){var D;E&&(D=Object.getOwnPropertyDescriptor(E,j)),!(D&&D.set==null)&&(w[j]=b(S[j],x-1))}return w}return b(l,c)}r.clonePrototype=function(u){if(u===null)return null;var c=function(){};return c.prototype=u,new c};function n(l){return Object.prototype.toString.call(l)}r.__objToStr=n;function i(l){return typeof l=="object"&&n(l)==="[object Date]"}r.__isDate=i;function o(l){return typeof l=="object"&&n(l)==="[object Array]"}r.__isArray=o;function s(l){return typeof l=="object"&&n(l)==="[object RegExp]"}r.__isRegExp=s;function a(l){var u="";return l.global&&(u+="g"),l.ignoreCase&&(u+="i"),l.multiline&&(u+="m"),u}return r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)})(y2);var Sk=y2.exports,w2={exports:{}},kk={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ui=kk,x2={};for(var xf in Ui)Ui.hasOwnProperty(xf)&&(x2[Ui[xf]]=xf);var te=w2.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Xt in te)if(te.hasOwnProperty(Xt)){if(!("channels"in te[Xt]))throw new Error("missing channels property: "+Xt);if(!("labels"in te[Xt]))throw new Error("missing channel labels property: "+Xt);if(te[Xt].labels.length!==te[Xt].channels)throw new Error("channel and label counts mismatch: "+Xt);var Nk=te[Xt].channels,Mk=te[Xt].labels;delete te[Xt].channels,delete te[Xt].labels,Object.defineProperty(te[Xt],"channels",{value:Nk}),Object.defineProperty(te[Xt],"labels",{value:Mk})}te.rgb.hsl=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,l,u;return o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360),u=(i+o)/2,o===i?l=0:u<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,u*100]};te.rgb.hsv=function(t){var e,r,n,i,o,s=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(s,a,l),c=u-Math.min(s,a,l),h=function(p){return(u-p)/6/c+1/2};return c===0?i=o=0:(o=c/u,e=h(s),r=h(a),n=h(l),s===u?i=n-r:a===u?i=1/3+e-n:l===u&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,u*100]};te.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2],i=te.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};te.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i,o,s,a;return a=Math.min(1-e,1-r,1-n),i=(1-e-a)/(1-a)||0,o=(1-r-a)/(1-a)||0,s=(1-n-a)/(1-a)||0,[i*100,o*100,s*100,a*100]};function Pk(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}te.rgb.keyword=function(t){var e=x2[t];if(e)return e;var r=1/0,n;for(var i in Ui)if(Ui.hasOwnProperty(i)){var o=Ui[i],s=Pk(t,o);s.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};te.rgb.lab=function(t){var e=te.rgb.xyz(t),r=e[0],n=e[1],i=e[2],o,s,a;return r/=95.047,n/=100,i/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,o=116*n-16,s=500*(r-n),a=200*(n-i),[o,s,a]};te.hsl.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s,a,l;if(r===0)return l=n*255,[l,l,l];n<.5?o=n*(1+r):o=n+r-n*r,i=2*n-o,a=[0,0,0];for(var u=0;u<3;u++)s=e+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?l=i+(o-i)*6*s:2*s<1?l=o:3*s<2?l=i+(o-i)*(2/3-s)*6:l=i,a[u]=l*255;return a};te.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01),s,a;return n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o,a=(n+r)/2,s=n===0?2*i/(o+i):2*r/(n+r),[e,s*100,a*100]};te.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),l=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,l,s];case 1:return[a,n,s];case 2:return[s,n,l];case 3:return[s,a,n];case 4:return[l,s,n];case 5:return[n,s,a]}};te.hsv.hsl=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s,a;return a=(2-r)*n,o=(2-r)*i,s=r*i,s/=o<=1?o:2-o,s=s||0,a/=2,[e,s*100,a*100]};te.hwb.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o,s,a,l;i>1&&(r/=i,n/=i),o=Math.floor(6*e),s=1-n,a=6*e-o,o&1&&(a=1-a),l=r+a*(s-r);var u,c,h;switch(o){default:case 6:case 0:u=s,c=l,h=r;break;case 1:u=l,c=s,h=r;break;case 2:u=r,c=s,h=l;break;case 3:u=r,c=l,h=s;break;case 4:u=l,c=r,h=s;break;case 5:u=s,c=r,h=l;break}return[u*255,c*255,h*255]};te.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o,s,a;return o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i),[o*255,s*255,a*255]};te.xyz.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};te.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;return e/=95.047,r/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*r-16,o=500*(e-r),s=200*(r-n),[i,o,s]};te.lab.xyz=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;var a=Math.pow(o,3),l=Math.pow(i,3),u=Math.pow(s,3);return o=a>.008856?a:(o-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,s=u>.008856?u:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};te.lab.lch=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;return i=Math.atan2(n,r),o=i*360/2/Math.PI,o<0&&(o+=360),s=Math.sqrt(r*r+n*n),[e,s,o]};te.lch.lab=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;return s=n/360*2*Math.PI,i=r*Math.cos(s),o=r*Math.sin(s),[e,i,o]};te.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:te.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return i===2&&(o+=60),o};te.hsv.ansi16=function(t){return te.rgb.ansi16(te.hsv.rgb(t),t[2])};te.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];if(e===r&&r===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};te.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};te.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var r,n=Math.floor(t/36)/5*255,i=Math.floor((r=t%36)/6)/5*255,o=r%6/5*255;return[n,i,o]};te.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),r=e.toString(16).toUpperCase();return"000000".substring(r.length)+r};te.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];e[0].length===3&&(r=r.split("").map(function(a){return a+a}).join(""));var n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};te.rgb.hcg=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,l;return s<1?a=o/(1-s):a=0,s<=0?l=0:i===e?l=(r-n)/s%6:i===r?l=2+(n-e)/s:l=4+(e-r)/s+4,l/=6,l%=1,[l*360,s*100,a*100]};te.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return r<.5?n=2*e*r:n=2*e*(1-r),n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};te.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};te.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];var i=[0,0,0],o=e%1*6,s=o%1,a=1-s,l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-r)*n,[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]};te.hcg.hsv=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};te.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100,n=r*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};te.hcg.hwb=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};te.hwb.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1-r,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};te.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};te.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};te.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};te.gray.hsl=te.gray.hsv=function(t){return[0,0,t[0]]};te.gray.hwb=function(t){return[0,100,t[0]]};te.gray.cmyk=function(t){return[0,0,0,t[0]]};te.gray.lab=function(t){return[t[0],0,0]};te.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,r=(e<<16)+(e<<8)+e,n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};te.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var b2=w2.exports,xu=b2;function Ck(){for(var t={},e=Object.keys(xu),r=e.length,n=0;n1&&(r=Array.prototype.slice.call(arguments)),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Dk(t){var e=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var n=t(r);if(typeof n=="object")for(var i=n.length,o=0;or?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=t[0]*.3+t[1]*.59+t[2]*.11;return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=e<0?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){var r=this,n=t,i=e===void 0?.5:e,o=2*i-1,s=r.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return this.rgb(a*r.red()+l*n.red(),a*r.green()+l*n.green(),a*r.blue()+l*n.blue()).alpha(r.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new gn;return t.values=Yk(this.values),t}};gn.prototype.getValues=function(t){for(var e={},r=0;r{const n=L.useRef(null);return L.useEffect(()=>{if(t&&n.current){const i=parseInt(t.slice(2,10),16),o=c6(e,i);n.current.innerHTML="",n.current.appendChild(o)}},[t,e]),M.jsx("div",{...r,ref:n})},{useIsActivating:h6}=Xd;function d6({provider:t,packageAbi:e}){var ie;const{state:r}=Uu(),{listedApps:n}=os(),{account:i,isActive:o}=Zu.useWeb3React(),s=h6(),[a,l]=L.useState(""),[u,c]=L.useState(),[h,p]=L.useState(!1),[g,v]=L.useState(""),[b,S]=L.useState(((ie=window.our)==null?void 0:ie.node)||""),[x,w]=L.useState(""),[E,T]=L.useState(""),[j,D]=L.useState(!1);L.useEffect(()=>{const ae=r==null?void 0:r.app;ae&&(v(ae.package),S(ae.publisher),D(!0))},[r]);const $=L.useCallback(async()=>{await v2.activate().catch(()=>{});try{Km(wu)}catch(ae){console.error(ae)}},[]),H=L.useCallback(async()=>{if(!x){T("");return}try{const C=await(await fetch(x)).text();JSON.parse(C);const f=ct(gr(C));T(f)}catch{window.alert("Error calculating metadata hash. Please ensure the URL is valid and the metadata is in JSON format.")}},[x]),J=L.useCallback(async ae=>{var f;ae.preventDefault(),ae.stopPropagation();let C=E;try{if(!C){const k=await fetch(x);await k.json();const _=await k.text();C=ct(gr(_))}l("Please confirm the transaction in your wallet");const m=wk(b);await Km(wu);const A=await(j?e.updateMetadata(G.from(z_(["string","bytes"],[g,m])),x,C):e.registerApp(g,m,x,C));await new Promise(k=>setTimeout(k,2e3)),l("Publishing package..."),await A.wait(),c({packageName:g,publisherId:b}),v(""),S(((f=window.our)==null?void 0:f.node)||b),w(""),T(""),D(!1)}catch(m){console.error(m),window.alert("Error publishing package. Please ensure the package name and publisher ID are valid, and the metadata is in JSON format.")}finally{l("")}},[g,j,b,x,E,e,c,v,S,w,T,D]),Y=L.useCallback(async()=>{j||g&&b&&n.find(ae=>ae.package===g&&ae.publisher===b)&&D(!0)},[n,g,b,j,D]);return M.jsxs("div",{className:"max-w-[900px] w-full",children:[M.jsx(nc,{hideSearch:!0,onBack:h?()=>p(!1):void 0}),M.jsxs("div",{className:"flex justify-between items-center my-2",children:[M.jsx("h4",{children:"Publish Package"}),!!i&&M.jsxs("div",{className:"card flex items-center",children:[M.jsx("span",{children:"Publishing as:"}),M.jsx(f6,{address:i,className:"mx-2"}),M.jsxs("span",{className:"font-mono",children:[i==null?void 0:i.slice(0,4),"...",i==null?void 0:i.slice(-4)]})]})]}),a?M.jsx("div",{className:"flex flex-col items-center",children:M.jsx(Rh,{msg:a})}):u?M.jsxs("div",{className:"flex flex-col items-center",children:[M.jsx("h4",{className:"mb-2",children:"Package Published!"}),M.jsxs("div",{className:"mb-2",children:[M.jsx("strong",{children:"Package Name:"})," ",u.packageName]}),M.jsxs("div",{className:"mb-2",children:[M.jsx("strong",{children:"Publisher ID:"})," ",u.publisherId]}),M.jsx("button",{className:"flex ml-2 mt-2",onClick:()=>c(void 0),children:"Publish Another Package"})]}):h?M.jsx(xk,{packageName:g,publisherId:b,app:r==null?void 0:r.app,goBack:()=>p(!1)}):!i||!o?M.jsxs(M.Fragment,{children:[M.jsx("h4",{style:{},children:"Please connect your wallet to publish a package"}),M.jsx("button",{className:"connect-wallet row",onClick:$,children:"Connect Wallet"})]}):s?M.jsx(Rh,{msg:"Approve connection in your wallet"}):M.jsxs("form",{className:"flex flex-col flex-1 overflow-y-auto",onSubmit:J,children:[M.jsxs("div",{className:"flex cursor-pointer p-2 -mb-2",onClick:()=>D(!j),children:[M.jsx(bk,{checked:j,readOnly:!0}),M.jsx("label",{htmlFor:"update",className:"cursor-pointer ml-4",children:"Update existing package"})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"package-name",children:"Package Name"}),M.jsx("input",{id:"package-name",type:"text",required:!0,placeholder:"my-package",value:g,onChange:ae=>v(ae.target.value),onBlur:Y})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"publisher-id",children:"Publisher ID"}),M.jsx("input",{id:"publisher-id",type:"text",required:!0,value:b,onChange:ae=>S(ae.target.value),onBlur:Y})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"metadata-url",children:"Metadata URL"}),M.jsx("input",{id:"metadata-url",type:"text",required:!0,value:x,onChange:ae=>w(ae.target.value),onBlur:H,placeholder:"https://github/my-org/my-repo/metadata.json"}),M.jsxs("div",{className:"mt-2",children:["Metadata is a JSON file that describes your package.",M.jsx("br",{})," You can"," ",M.jsx("a",{onClick:()=>p(!0),className:"underline cursor-pointer",children:"fill out a template here"}),"."]})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"metadata-hash",children:"Metadata Hash"}),M.jsx("input",{readOnly:!0,id:"metadata-hash",type:"text",value:E,onChange:ae=>T(ae.target.value),placeholder:"Calculated automatically from metadata URL"})]}),M.jsx("button",{type:"submit",children:"Publish"})]})]})}var p6={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const m6=[[v2,Xd]],{useProvider:g6}=Xd,v6="https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",Us="/main:app_store:sys";window.our&&(window.our.process=Us==null?void 0:Us.replace("/",""));const y6=`${p6.VITE_NODE_URL||"http://localhost:8080"}${Us}`;function w6(){const t=g6(),[e,r]=L.useState(!0),[n,i]=L.useState(Ih.connect(Gm[Il.SEPOLIA],new _i(v6)));if(L.useEffect(()=>{t==null||t.getNetwork().then(s=>{s.chainId===Il.SEPOLIA&&i(Ih.connect(Gm[Il.SEPOLIA],t.getSigner()))})},[t]),L.useEffect(()=>{},[]),!e)return M.jsxs("div",{className:"flex flex-col c",children:[M.jsx("h2",{style:{color:"red"},children:"Node not connected"}),M.jsxs("h4",{children:["You need to start a node at ",y6," before you can use this UI in development."]})]});const o={provider:t,packageAbi:n};return M.jsx("div",{className:"flex flex-col c h-screen w-screen",children:M.jsx(Zu.Web3ReactProvider,{connectors:m6,children:M.jsx(Jb,{basename:Us,children:M.jsxs(Kb,{children:[M.jsx(_s,{path:"/",element:M.jsx(ak,{...o})}),M.jsx(_s,{path:jh,element:M.jsx(lk,{...o})}),M.jsx(_s,{path:"/app-details/:id",element:M.jsx(uk,{...o})}),M.jsx(_s,{path:"/publish",element:M.jsx(d6,{...o})})]})})})})}Ef.createRoot(document.getElementById("root")).render(M.jsx(Vr.StrictMode,{children:M.jsx(w6,{})})); +*/(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var o="",s=0;sn(`/app-details/${Ee(t)}`),children:[M.jsx("img",{src:((i=t.metadata)==null?void 0:i.image)||"https://png.pngtree.com/png-vector/20190215/ourmid/pngtree-vector-question-mark-icon-png-image_515448.jpg",alt:"app icon",className:xi("mr-2",{"h-32 rounded-md":e==="large","h-12 rounded":e!=="large"})}),M.jsxs("div",{className:"flex flex-col w-full",children:[M.jsx("div",{className:xi("whitespace-nowrap overflow-hidden text-ellipsis",{"text-3xl":e==="large"}),children:((o=t.metadata)==null?void 0:o.name)||Ee(t)}),((s=t.metadata)==null?void 0:s.description)&&e!=="large"&&M.jsx("div",{className:"whitespace-nowrap overflow-hidden text-ellipsis",children:(l=(a=t.metadata)==null?void 0:a.description)==null?void 0:l.slice(0,100)})]})]})}function y4(t){return xn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"},child:[]}]})(t)}function w4(t){return xn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"},child:[]}]})(t)}function x4(t){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"},child:[]}]})(t)}function b4(t){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"},child:[]}]})(t)}function E4(t){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 109.3V352c0 17.7-14.3 32-32 32s-32-14.3-32-32V109.3l-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352H192c0 35.3 28.7 64 64 64s64-28.7 64-64H448c35.3 0 64 28.7 64 64v32c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V416c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"},child:[]}]})(t)}function Yd(t){return xn({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"},child:[]}]})(t)}const A4=({show:t,hide:e,hideClose:r=!1,title:n,...i})=>{const o=s=>{s.stopPropagation()};return t?M.jsx("div",{className:xi("bg-black/25 fixed top-0 bottom-0 left-0 right-0 flex flex-col c z-30 min-h-[10em] min-w-[30em]",{show:t}),onClick:e,children:M.jsxs("div",{...i,className:`flex flex-col relative bg-black/90 rounded-lg py-6 px-12 ${i.className||""}`,onClick:o,children:[!!n&&M.jsx("h4",{className:"mt-0 mb-2",children:n}),!r&&M.jsx("button",{className:"icon absolute top-1 right-1",onClick:e,children:M.jsx(Yd,{})}),M.jsx("div",{className:"flex flex-col items-center w-full",onClick:o,children:i.children})]})}):null};function Rh({msg:t}){return M.jsxs("div",{id:"loading",className:"flex flex-col text-center",children:[M.jsx("h4",{children:t}),M.jsxs("div",{id:"loader",children:[" ",M.jsx("div",{})," ",M.jsx("div",{})," ",M.jsx("div",{})," ",M.jsx("div",{})," "]})]})}function u2({app:t,...e}){var Y,ie,ae,C,f,m,A;const{updateApp:r,downloadApp:n,installApp:i,getCaps:o,getMyApp:s}=os(),[a,l]=L.useState(!1),[u,c]=L.useState(((ae=(ie=(Y=t.metadata)==null?void 0:Y.properties)==null?void 0:ie.mirrors)==null?void 0:ae[0])||"Other"),[h,p]=L.useState(""),[g,v]=L.useState([]),[b,S]=L.useState(""),{clean:x,installed:w,downloaded:E,updatable:T}=L.useMemo(()=>{var d,P,X,y;const _=(Object.entries(((P=(d=t==null?void 0:t.metadata)==null?void 0:d.properties)==null?void 0:P.code_hashes)||{}).find(([B])=>{var F,U;return B===((U=(F=t.metadata)==null?void 0:F.properties)==null?void 0:U.current_version)})||[])[1],I=t.installed,R=!!t.state,N=!!((X=t.state)!=null&&X.our_version&&_)&&((y=t.state)==null?void 0:y.our_version)!==_&&t.publisher!==window.our.node;return{clean:!I&&!R&&!N,installed:I,downloaded:R,updatable:N}},[t]);L.useEffect(()=>{var k,_,I;c(((I=(_=(k=t.metadata)==null?void 0:k.properties)==null?void 0:_.mirrors)==null?void 0:I[0])||"Other")},[(f=(C=t.metadata)==null?void 0:C.properties)==null?void 0:f.mirrors]);const j=L.useCallback(async()=>{w&&!T?window.alert("App is installed"):(E&&o(t).then(k=>{v(k.request_capabilities)}),l(!0))},[t,w,E,T,l,o]),D=L.useCallback(async k=>{k.preventDefault(),k.stopPropagation();const _=u==="Other"?h:u;if(!_){window.alert("Please select a mirror");return}try{S(`Downloading ${no(t)}...`),await n(t,_);const I=setInterval(()=>{s(t).then(()=>{S(""),l(!1),clearInterval(I)}).catch(console.log)},2e3)}catch(I){console.error(I),window.alert(`Failed to download app from ${_}, please try a different mirror.`),S("")}},[u,h,t,n,s]),$=L.useCallback(async()=>{try{S(`Installing ${no(t)}...`),await i(t);const k=setInterval(()=>{s(t).then(_=>{_.installed&&(S(""),l(!1),clearInterval(k))}).catch(console.log)},2e3)}catch(k){console.error(k),window.alert("Failed to install, please try again."),S("")}},[t,i,s]),H=L.useCallback(async()=>{try{S(`Updating ${no(t)}...`),await r(t);const k=setInterval(()=>{s(t).then(_=>{_.installed&&(S(""),l(!1),clearInterval(k))}).catch(console.log)},2e3)}catch(k){console.error(k),window.alert("Failed to update, please try again."),S("")}},[t,r,s]),J=no(t);return M.jsxs(M.Fragment,{children:[M.jsx("button",{...e,type:"button",className:xi("text-sm min-w-[100px] px-2 py-1 self-start",e.className),onClick:j,children:w&&T?"Update":w?"Installed":E?"Install":"Download"}),M.jsx(A4,{show:a,hide:()=>l(!1),children:b?M.jsx(Rh,{msg:b}):x?M.jsxs("form",{className:"flex flex-col items-center gap-2",onSubmit:D,children:[M.jsxs("h4",{children:["Download '",J,"'"]}),M.jsx("h5",{style:{margin:0},children:"Select Mirror"}),M.jsx("select",{value:u,onChange:k=>c(k.target.value),children:(((A=(m=t.metadata)==null?void 0:m.properties)==null?void 0:A.mirrors)||[]).concat(["Other"]).map(k=>M.jsx("option",{value:k,children:k},k))}),u==="Other"&&M.jsx("input",{type:"text",value:h,onChange:k=>p(k.target.value),placeholder:"Mirror, i.e. 'template.os'",className:"p-1 max-w-[240px] w-full",required:!0,autoFocus:!0}),M.jsx("button",{type:"submit",children:"Download"})]}):E?M.jsxs(M.Fragment,{children:[M.jsx("h4",{children:"Approve App Permissions"}),M.jsxs("h5",{className:"m-0",children:[no(t)," needs the following permissions:"]}),M.jsx("ul",{className:"flex flex-col items-start",children:g.map(k=>M.jsx("li",{children:k},k))}),M.jsx("button",{type:"button",onClick:$,children:"Approve & Install"})]}):M.jsxs(M.Fragment,{children:[M.jsx("h4",{children:"Approve App Permissions"}),M.jsxs("h5",{className:"m-0",children:[no(t)," needs the following permissions:"]}),M.jsx("br",{}),M.jsx("ul",{className:"flex flex-col items-start",children:g.map(k=>M.jsx("li",{children:k},k))}),M.jsx("button",{type:"button",onClick:H,children:"Approve & Update"})]})})]})}const c2=t=>!!t&&t[0]==="o",Dm=ia.unstable_batchedUpdates||(t=>t()),io=(t,e,r=1e-4)=>Math.abs(t-e)t===!0||!!(t&&t[e]),pn=(t,e)=>typeof t=="function"?t(e):t,f2="_szhsinMenu",_4=t=>t[f2],S4=(t,e)=>Object.defineProperty(e,f2,{value:t}),Xd=(t,e)=>(e&&Object.keys(e).forEach(r=>{const n=t[r],i=e[r];typeof i=="function"&&n?t[r]=(...o)=>{i(...o),n(...o)}:t[r]=i}),t),k4=t=>{if(typeof t!="string")return{top:0,right:0,bottom:0,left:0};const e=t.trim().split(/\s+/,4).map(parseFloat),r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?r:e[1];return{top:r,right:n,bottom:isNaN(e[2])?r:e[2],left:isNaN(e[3])?n:e[3]}},mf=t=>{for(;t;){if(t=t.parentNode,!t||t===document.body||!t.parentNode)return;const{overflow:e,overflowX:r,overflowY:n}=getComputedStyle(t);if(/auto|scroll|overlay|hidden/.test(e+n+r))return t}};function N4(t,e){return{"aria-disabled":t||void 0,tabIndex:e?0:-1}}function Fm(t,e){for(let r=0;rL.useMemo(()=>{const i=e?`${t}__${e}`:t;let o=i;r&&Object.keys(r).forEach(a=>{const l=r[a];l&&(o+=` ${i}--${l===!0?a:`${a}-${l}`}`)});let s=typeof n=="function"?n(r):n;return typeof s=="string"&&(s=s.trim(),s&&(o+=` ${s}`)),o},[t,e,r,n]),M4="szh-menu-container",gf="szh-menu",P4="szh-menu-button",C4="arrow",I4=L.createContext(),R4=L.createContext({}),Um=L.createContext({}),O4=L.createContext({}),h2=L.createContext({}),Cn=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),It=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),va=Object.freeze({CLICK:"click",CANCEL:"cancel",BLUR:"blur",SCROLL:"scroll"}),Fs=Object.freeze({FIRST:"first",LAST:"last"}),T4=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),vf="absolute",L4="menuitem",zm={"aria-hidden":!0,role:L4},j4=S4("MenuButton",L.forwardRef(function({className:e,isOpen:r,disabled:n,children:i,...o},s){const a=L.useMemo(()=>({open:r}),[r]);return M.jsx("button",{"aria-haspopup":!0,"aria-expanded":r,"aria-disabled":n||void 0,type:"button",disabled:n,...o,ref:s,className:mu({block:P4,modifiers:a,className:e}),children:i})})),B4=({className:t,containerRef:e,containerProps:r,children:n,isOpen:i,theming:o,transition:s,onClose:a})=>{const l=ga(s,"item"),u=({key:h})=>{switch(h){case Cn.ESC:pn(a,{key:h,reason:va.CANCEL});break}},c=h=>{i&&!h.currentTarget.contains(h.relatedTarget)&&pn(a,{reason:va.BLUR})};return M.jsx("div",{...Xd({onKeyDown:u,onBlur:c},r),className:mu({block:M4,modifiers:L.useMemo(()=>({theme:o,itemTransition:l}),[o,l]),className:t}),style:{position:"absolute",...r==null?void 0:r.style},ref:e,children:n})},D4=()=>{let t,e=0;return{toggle:r=>{r?e++:e--,e=Math.max(e,0)},on:(r,n,i)=>{e?t||(t=setTimeout(()=>{t=0,n()},r)):i==null||i()},off:()=>{t&&(clearTimeout(t),t=0)}}},F4=(t,e)=>{const[r,n]=L.useState(),o=L.useRef({items:[],hoverIndex:-1,sorted:!1}).current,s=L.useCallback((l,u)=>{const{items:c}=o;if(!l)o.items=[];else if(u)c.push(l);else{const h=c.indexOf(l);h>-1&&(c.splice(h,1),l.contains(document.activeElement)&&(e.current.focus(),n()))}o.hoverIndex=-1,o.sorted=!1},[o,e]),a=L.useCallback((l,u,c)=>{const{items:h,hoverIndex:p}=o,g=()=>{if(o.sorted)return;const S=t.current.querySelectorAll(".szh-menu__item");h.sort((x,w)=>Fm(S,x)-Fm(S,w)),o.sorted=!0};let v=-1,b;switch(l){case It.RESET:break;case It.SET:b=u;break;case It.UNSET:b=S=>S===u?void 0:S;break;case It.FIRST:g(),v=0,b=h[v];break;case It.LAST:g(),v=h.length-1,b=h[v];break;case It.SET_INDEX:g(),v=c,b=h[v];break;case It.INCREASE:g(),v=p,v<0&&(v=h.indexOf(u)),v++,v>=h.length&&(v=0),b=h[v];break;case It.DECREASE:g(),v=p,v<0&&(v=h.indexOf(u)),v--,v<0&&(v=h.length-1),b=h[v];break}b||(v=-1),n(b),o.hoverIndex=v},[t,o]);return{hoverItem:r,dispatch:a,updateItems:s}},U4=(t,e,r,n)=>{const i=e.current.getBoundingClientRect(),o=t.current.getBoundingClientRect(),s=r===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:r.getBoundingClientRect(),a=k4(n),l=v=>v+o.left-s.left-a.left,u=v=>v+o.left+i.width-s.right+a.right,c=v=>v+o.top-s.top-a.top,h=v=>v+o.top+i.height-s.bottom+a.bottom;return{menuRect:i,containerRect:o,getLeftOverflow:l,getRightOverflow:u,getTopOverflow:c,getBottomOverflow:h,confineHorizontally:v=>{let b=l(v);if(b<0)v-=b;else{const S=u(v);S>0&&(v-=S,b=l(v),b<0&&(v-=b))}return v},confineVertically:v=>{let b=c(v);if(b<0)v-=b;else{const S=h(v);S>0&&(v-=S,b=c(v),b<0&&(v-=b))}return v}}},z4=({arrowRef:t,menuY:e,anchorRect:r,containerRect:n,menuRect:i})=>{let o=r.top-n.top-e+r.height/2;const s=t.current.offsetHeight*1.25;return o=Math.max(s,o),o=Math.min(o,i.height-s),o},$4=({anchorRect:t,containerRect:e,menuRect:r,placeLeftorRightY:n,placeLeftX:i,placeRightX:o,getLeftOverflow:s,getRightOverflow:a,confineHorizontally:l,confineVertically:u,arrowRef:c,arrow:h,direction:p,position:g})=>{let v=p,b=n;g!=="initial"&&(b=u(b),g==="anchor"&&(b=Math.min(b,t.bottom-e.top),b=Math.max(b,t.top-e.top-r.height)));let S,x,w;return v==="left"?(S=i,g!=="initial"&&(x=s(S),x<0&&(w=a(o),(w<=0||-x>w)&&(S=o,v="right")))):(S=o,g!=="initial"&&(w=a(S),w>0&&(x=s(i),(x>=0||-x{let o=r.left-n.left-e+r.width/2;const s=t.current.offsetWidth*1.25;return o=Math.max(s,o),o=Math.min(o,i.width-s),o},q4=({anchorRect:t,containerRect:e,menuRect:r,placeToporBottomX:n,placeTopY:i,placeBottomY:o,getTopOverflow:s,getBottomOverflow:a,confineHorizontally:l,confineVertically:u,arrowRef:c,arrow:h,direction:p,position:g})=>{let v=p==="top"?"top":"bottom",b=n;g!=="initial"&&(b=l(b),g==="anchor"&&(b=Math.min(b,t.right-e.left),b=Math.max(b,t.left-e.left-r.width)));let S,x,w;return v==="top"?(S=i,g!=="initial"&&(x=s(S),x<0&&(w=a(o),(w<=0||-x>w)&&(S=o,v="bottom")))):(S=o,g!=="initial"&&(w=a(S),w>0&&(x=s(i),(x>=0||-x{const{menuRect:u,containerRect:c}=l,h=r==="left"||r==="right";let p=h?n:i,g=h?i:n;if(t){const j=a.current;h?p+=j.offsetWidth:g+=j.offsetHeight}const v=s.left-c.left-u.width-p,b=s.right-c.left+p,S=s.top-c.top-u.height-g,x=s.bottom-c.top+g;let w,E;e==="end"?(w=s.right-c.left-u.width,E=s.bottom-c.top-u.height):e==="center"?(w=s.left-c.left-(u.width-s.width)/2,E=s.top-c.top-(u.height-s.height)/2):(w=s.left-c.left,E=s.top-c.top),w+=p,E+=g;const T={...l,anchorRect:s,placeLeftX:v,placeRightX:b,placeLeftorRightY:E,placeTopY:S,placeBottomY:x,placeToporBottomX:w,arrowRef:a,arrow:t,direction:r,position:o};switch(r){case"left":case"right":return $4(T);case"top":case"bottom":default:return q4(T)}},yf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?L.useLayoutEffect:L.useEffect;function $m(t,e){typeof t=="function"?t(e):t.current=e}const d2=(t,e)=>L.useMemo(()=>t?e?r=>{$m(t,r),$m(e,r)}:t:e,[t,e]),Hm=-9999,G4=({ariaLabel:t,menuClassName:e,menuStyle:r,arrow:n,arrowProps:i={},anchorPoint:o,anchorRef:s,containerRef:a,containerProps:l,focusProps:u,externalRef:c,parentScrollingRef:h,align:p="start",direction:g="bottom",position:v="auto",overflow:b="visible",setDownOverflow:S,repositionFlag:x,captureFocus:w=!0,state:E,endTransition:T,isDisabled:j,menuItemFocus:D,gap:$=0,shift:H=0,children:J,onClose:Y,...ie})=>{const[ae,C]=L.useState({x:Hm,y:Hm}),[f,m]=L.useState({}),[A,k]=L.useState(),[_,I]=L.useState(g),[R]=L.useState(D4),[N,d]=L.useReducer(ne=>ne+1,1),{transition:P,boundingBoxRef:X,boundingBoxPadding:y,rootMenuRef:B,rootAnchorRef:F,scrollNodesRef:U,reposition:V,viewScroll:oe,submenuCloseDelay:Q}=L.useContext(h2),{submenuCtx:W,reposSubmenu:Ye=x}=L.useContext(Um),K=L.useRef(null),le=L.useRef(),Jr=L.useRef(),Te=L.useRef(!1),Me=L.useRef({width:0,height:0}),Yr=L.useRef(()=>{}),{hoverItem:Pe,dispatch:fe,updateItems:xr}=F4(K,le),he=c2(E),Le=ga(P,"open"),Xr=ga(P,"close"),ge=U.current,$e=ne=>{switch(ne.key){case Cn.HOME:fe(It.FIRST);break;case Cn.END:fe(It.LAST);break;case Cn.UP:fe(It.DECREASE,Pe);break;case Cn.DOWN:fe(It.INCREASE,Pe);break;case Cn.SPACE:ne.target&&ne.target.className.indexOf(gf)!==-1&&ne.preventDefault();return;default:return}ne.preventDefault(),ne.stopPropagation()},bn=()=>{E==="closing"&&k(),pn(T)},He=ne=>{ne.stopPropagation(),R.on(Q,()=>{fe(It.RESET),le.current.focus()})},qe=ne=>{ne.target===ne.currentTarget&&R.off()},qt=L.useCallback(ne=>{var st;const ve=s?(st=s.current)==null?void 0:st.getBoundingClientRect():o?{left:o.x,right:o.x,top:o.y,bottom:o.y,width:0,height:0}:null;if(!ve)return;ge.menu||(ge.menu=(X?X.current:mf(B.current))||window);const de=U4(a,K,ge.menu,y);let{arrowX:nt,arrowY:_e,x:Se,y:Pt,computedDirection:Ie}=V4({arrow:n,align:p,direction:g,gap:$,shift:H,position:v,anchorRect:ve,arrowRef:Jr,positionHelpers:de});const{menuRect:Fe}=de;let Qt=Fe.height;if(!ne&&b!=="visible"){const{getTopOverflow:Ke,getBottomOverflow:Qe}=de;let Jt,Re;const Ue=Me.current.height,br=Qe(Pt);if(br>0||io(br,0)&&io(Qt,Ue))Jt=Qt-br,Re=br;else{const Ne=Ke(Pt);(Ne<0||io(Ne,0)&&io(Qt,Ue))&&(Jt=Qt+Ne,Re=0-Ne,Jt>=0&&(Pt-=Ne))}Jt>=0?(Qt=Jt,k({height:Jt,overflowAmt:Re})):k()}n&&m({x:nt,y:_e}),C({x:Se,y:Pt}),I(Ie),Me.current={width:Fe.width,height:Qt}},[n,p,y,g,$,H,v,b,o,s,a,X,B,ge]);yf(()=>{he&&(qt(),Te.current&&d()),Te.current=he,Yr.current=qt},[he,qt,Ye]),yf(()=>{A&&!S&&(K.current.scrollTop=0)},[A,S]),yf(()=>xr,[xr]),L.useEffect(()=>{let{menu:ne}=ge;if(!he||!ne)return;if(ne=ne.addEventListener?ne:window,!ge.anchors){ge.anchors=[];let nt=mf(F&&F.current);for(;nt&&nt!==ne;)ge.anchors.push(nt),nt=mf(nt)}let st=oe;if(ge.anchors.length&&st==="initial"&&(st="auto"),st==="initial")return;const ve=()=>{st==="auto"?Dm(()=>qt(!0)):pn(Y,{reason:va.SCROLL})},de=ge.anchors.concat(oe!=="initial"?ne:[]);return de.forEach(nt=>nt.addEventListener("scroll",ve)),()=>de.forEach(nt=>nt.removeEventListener("scroll",ve))},[F,ge,he,Y,oe,qt]);const je=!!A&&A.overflowAmt>0;L.useEffect(()=>{if(je||!he||!h)return;const ne=()=>Dm(qt),st=h.current;return st.addEventListener("scroll",ne),()=>st.removeEventListener("scroll",ne)},[he,je,h,qt]),L.useEffect(()=>{if(typeof ResizeObserver!="function"||V==="initial")return;const ne=new ResizeObserver(([ve])=>{const{borderBoxSize:de,target:nt}=ve;let _e,Se;if(de){const{inlineSize:Pt,blockSize:Ie}=de[0]||de;_e=Pt,Se=Ie}else{const Pt=nt.getBoundingClientRect();_e=Pt.width,Se=Pt.height}_e===0||Se===0||io(_e,Me.current.width,1)&&io(Se,Me.current.height,1)||ia.flushSync(()=>{Yr.current(),d()})}),st=K.current;return ne.observe(st,{box:"border-box"}),()=>ne.unobserve(st)},[V]),L.useEffect(()=>{if(!he){fe(It.RESET),Xr||k();return}const{position:ne,alwaysUpdate:st}=D||{},ve=()=>{ne===Fs.FIRST?fe(It.FIRST):ne===Fs.LAST?fe(It.LAST):ne>=-1&&fe(It.SET_INDEX,void 0,ne)};if(st)ve();else if(w){const de=setTimeout(()=>{const nt=K.current;nt&&!nt.contains(document.activeElement)&&(le.current.focus(),ve())},Le?170:100);return()=>clearTimeout(de)}},[he,Le,Xr,w,D,fe]);const Ve=L.useMemo(()=>({isParentOpen:he,submenuCtx:R,dispatch:fe,updateItems:xr}),[he,R,fe,xr]);let Or,Ce;A&&(S?Ce=A.overflowAmt:Or=A.height);const Ge=L.useMemo(()=>({reposSubmenu:N,submenuCtx:R,overflow:b,overflowAmt:Ce,parentMenuRef:K,parentDir:_}),[N,R,b,Ce,_]),En=Or>=0?{maxHeight:Or,overflow:b}:void 0,Be=L.useMemo(()=>({state:E,dir:_}),[E,_]),We=L.useMemo(()=>({dir:_}),[_]),An=mu({block:gf,element:C4,modifiers:We,className:i.className}),De=M.jsxs("ul",{role:"menu","aria-label":t,...N4(j),...Xd({onPointerEnter:W==null?void 0:W.off,onPointerMove:He,onPointerLeave:qe,onKeyDown:$e,onAnimationEnd:bn},ie),ref:d2(c,K),className:mu({block:gf,modifiers:Be,className:e}),style:{...r,...En,margin:0,display:E==="closed"?"none":void 0,position:vf,left:ae.x,top:ae.y},children:[M.jsx("li",{tabIndex:-1,style:{position:vf,left:0,top:0,display:"block",outline:"none"},ref:le,...zm,...u}),n&&M.jsx("li",{...zm,...i,className:An,style:{display:"block",position:vf,left:f.x,top:f.y,...i.style},ref:Jr}),M.jsx(Um.Provider,{value:Ge,children:M.jsx(R4.Provider,{value:Ve,children:M.jsx(I4.Provider,{value:Pe,children:pn(J,Be)})})})]});return l?M.jsx(B4,{...l,isOpen:he,children:De}):De},W4=L.forwardRef(function({"aria-label":e,className:r,containerProps:n,initialMounted:i,unmountOnClose:o,transition:s,transitionTimeout:a,boundingBoxRef:l,boundingBoxPadding:u,reposition:c="auto",submenuOpenDelay:h=300,submenuCloseDelay:p=150,viewScroll:g="initial",portal:v,theming:b,onItemClick:S,...x},w){const E=L.useRef(null),T=L.useRef({}),{anchorRef:j,state:D,onClose:$}=x,H=L.useMemo(()=>({initialMounted:i,unmountOnClose:o,transition:s,transitionTimeout:a,boundingBoxRef:l,boundingBoxPadding:u,rootMenuRef:E,rootAnchorRef:j,scrollNodesRef:T,reposition:c,viewScroll:g,submenuOpenDelay:h,submenuCloseDelay:p}),[i,o,s,a,j,l,u,c,g,h,p]),J=L.useMemo(()=>({handleClick(ie,ae){ie.stopPropagation||pn(S,ie);let C=ie.keepOpen;C===void 0&&(C=ae&&ie.key===Cn.SPACE),C||pn($,{value:ie.value,key:ie.key,reason:va.CLICK})},handleClose(ie){pn($,{key:ie,reason:va.CLICK})}}),[S,$]);if(!D)return null;const Y=M.jsx(h2.Provider,{value:H,children:M.jsx(O4.Provider,{value:J,children:M.jsx(G4,{...x,ariaLabel:e||"Menu",externalRef:w,containerRef:E,containerProps:{className:r,containerRef:E,containerProps:n,theming:b,transition:s,onClose:$}})})});return v===!0&&typeof document<"u"?ia.createPortal(Y,document.body):v?v.target?ia.createPortal(Y,v.target):v.stablePosition?null:Y:Y}),Oh=0,Th=1,gu=2,vu=3,yu=4,K4=5,p2=6,Q4=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],m2=t=>({_s:t,status:Q4[t],isEnter:tyu}),Lh=t=>t?p2:K4,J4=(t,e)=>{switch(t){case Th:case Oh:return gu;case yu:case vu:return Lh(e)}},Y4=t=>typeof t=="object"?[t.enter,t.exit]:[t,t],X4=(t,e)=>setTimeout(()=>{isNaN(document.body.offsetTop)||t(e+1)},0),qm=(t,e,r,n,i)=>{clearTimeout(n.current);const o=m2(t);e(o),r.current=o,i&&i({current:o})},Z4=({enter:t=!0,exit:e=!0,preEnter:r,preExit:n,timeout:i,initialEntered:o,mountOnEnter:s,unmountOnExit:a,onStateChange:l}={})=>{const[u,c]=L.useState(()=>m2(o?gu:Lh(s))),h=L.useRef(u),p=L.useRef(),[g,v]=Y4(i),b=L.useCallback(()=>{const x=J4(h.current._s,a);x&&qm(x,c,h,p,l)},[l,a]),S=L.useCallback(x=>{const w=T=>{switch(qm(T,c,h,p,l),T){case Th:g>=0&&(p.current=setTimeout(b,g));break;case yu:v>=0&&(p.current=setTimeout(b,v));break;case Oh:case vu:p.current=X4(w,T);break}},E=h.current.isEnter;typeof x!="boolean"&&(x=!E),x?!E&&w(t?r?Oh:Th:gu):E&&w(e?n?vu:yu:Lh(a))},[b,l,t,e,r,n,g,v,a]);return L.useEffect(()=>()=>clearTimeout(p.current),[]),[u,S,b]},ek=({initialOpen:t,initialMounted:e,unmountOnClose:r,transition:n,transitionTimeout:i=500}={})=>{const[{status:o},s,a]=Z4({initialEntered:t,mountOnEnter:!e,unmountOnExit:r,timeout:i,enter:ga(n,"open"),exit:ga(n,"close")});return[{state:T4[o],endTransition:a},s]},tk=t=>{const[e,r]=ek(t),[n,i]=L.useState(),o=(s,a)=>{i({position:s,alwaysUpdate:a}),r(!0)};return[{menuItemFocus:n,...e},r,o]},rk=(t,e)=>{const[r]=L.useState({});return{onMouseDown:()=>{r.v=t&&t!=="closed"},onClick:n=>r.v?r.v=!1:e(!0,n)}},nk=(t,e)=>{const r=L.useRef(e);L.useEffect(()=>{r.current!==e&&pn(t,{open:e}),r.current=e},[t,e])},ik=L.forwardRef(function({"aria-label":e,captureFocus:r,initialOpen:n,menuButton:i,instanceRef:o,onMenuChange:s,...a},l){const[u,c,h]=tk(a),{state:p}=u,g=c2(p),v=L.useRef(null),b=rk(p,(j,D)=>h(D.detail?void 0:Fs.FIRST)),S=L.useCallback(j=>{c(!1),j.key&&v.current.focus()},[c]),x=j=>{switch(j.key){case Cn.UP:h(Fs.LAST);break;case Cn.DOWN:h(Fs.FIRST);break;default:return}j.preventDefault()},w=pn(i,{open:g});if(!w||!w.type)throw new Error("Menu requires a menuButton prop.");const E={ref:d2(w.ref,v),...Xd({onKeyDown:x,...b},w.props)};_4(w.type)==="MenuButton"&&(E.isOpen=g);const T=L.cloneElement(w,E);return nk(s,g),L.useImperativeHandle(o,()=>({openMenu:h,closeMenu:()=>c(!1)})),M.jsxs(L.Fragment,{children:[T,M.jsx(W4,{...a,...u,"aria-label":e||(typeof w.props.children=="string"?w.props.children:"Menu"),anchorRef:v,ref:l,onClose:S})]})});function Vm({...t}){return M.jsx(ik,{...t,unmountOnClose:!0,className:xi("relative",t.className),menuButton:M.jsx(j4,{className:"small",children:M.jsx(i4,{className:"-mb-1"})}),children:t.children})}function ok({app:t,className:e}){var a,l,u,c,h;const{uninstallApp:r,setMirroring:n,setAutoUpdate:i}=os(),o=Sa();return!t.state?t.metadata?M.jsx(Vm,{className:e,children:M.jsxs("div",{className:"flex flex-col bg-black/50 p-2 rounded-lg",children:[((a=t.metadata)==null?void 0:a.description)&&M.jsx("button",{className:"my-1 whitespace-nowrap clear",onClick:()=>o(`/app-details/${Ee(t)}`),children:"View Details"}),((l=t.metadata)==null?void 0:l.external_url)&&M.jsx("a",{target:"_blank",href:(u=t.metadata)==null?void 0:u.external_url,className:"mb-1 whitespace-nowrap button clear",children:"View Site"})]})}):M.jsx(M.Fragment,{}):M.jsx(Vm,{className:e,children:M.jsxs("div",{className:"flex flex-col bg-black/50 p-2 rounded-lg",children:[M.jsx("button",{className:"my-1 whitespace-nowrap clear",onClick:()=>o(`/app-details/${Ee(t)}`),children:"View Details"}),t.installed&&M.jsxs(M.Fragment,{children:[M.jsx("button",{className:"mb-1 whitespace-nowrap clear",onClick:()=>r(t),children:"Uninstall"}),M.jsxs("button",{className:"mb-1 whitespace-nowrap clear",onClick:()=>{var p;return n(t,!((p=t.state)!=null&&p.mirroring))},children:[(c=t.state)!=null&&c.mirroring?"Stop":"Start"," Mirroring"]}),M.jsxs("button",{className:"mb-1 whitespace-nowrap clear",onClick:()=>{var p;return i(t,!((p=t.state)!=null&&p.auto_update))},children:[(h=t.state)!=null&&h.auto_update?"Disable":"Enable"," Auto Update"]})]})]})})}function Ns({app:t,...e}){var r;return L.createElement("div",{...e,key:Ee(t),className:"flex justify-between w-full rounded hover:bg-white/10 card"},M.jsx(l2,{app:t,size:"small"}),M.jsxs("div",{className:"flex mr-1 items-start",children:[!((r=t.state)!=null&&r.caps_approved)&&M.jsx(u2,{app:t,className:"mr-2"}),M.jsx(ok,{app:t})]}))}const jh="/my-apps";function nc({value:t="",onChange:e=()=>null,onBack:r,hideSearch:n=!1}){const i=Sa(),o=Uu(),s=Vr.useRef(null),a=o.key!=="default",l=o.pathname===jh;return M.jsxs("div",{className:"flex justify-between",children:[o.pathname!=="/"?M.jsx("button",{className:"flex flex-col c mr-1 icon",onClick:()=>{r?r():i(a?-1:"/")},children:M.jsx(y4,{})}):M.jsx("button",{className:"flex flex-col c mr-1 alt",onClick:()=>i("/publish"),children:M.jsx(E4,{})}),!n&&M.jsxs("div",{className:"flex mx-2 flex-1 rounded-md",children:[M.jsx("button",{className:"icon",type:"button",onClick:()=>{var u;return(u=s.current)==null?void 0:u.focus()},children:M.jsx(b4,{})}),M.jsx("input",{type:"text",ref:s,onChange:u=>e(u.target.value),value:t,placeholder:"Search for apps...",className:"w-full ml-2"}),t.length>0&&M.jsx("button",{className:"icon ml-2",onClick:()=>e(""),children:M.jsx(Yd,{})})]}),M.jsx("div",{className:"flex",children:M.jsxs("button",{className:xi("flex ml-1 alt"),onClick:()=>i(l?-1:jh),children:[M.jsx(x4,{className:"mr-1"}),"My Apps"]})})]})}function sk(t){const{listedApps:e,getListedApps:r}=os(),[n,i]=L.useState("Recently published"),[o,s]=L.useState(""),[a,l]=L.useState(e),[u,c]=L.useState(1),h=L.useMemo(()=>Array.from({length:Math.ceil(a.length/10)},(v,b)=>b+1),[a]);L.useEffect(()=>{const v=(u-1)*10,b=v+10;l(e.slice(v,b))},[e]),L.useEffect(()=>{r().then(v=>{l(Object.values(v))}).catch(v=>console.error(v))},[]);const p=L.useCallback(async v=>{},[]),g=L.useCallback(v=>{s(v);const b=e.filter(S=>{var x,w,E,T;return S.package.toLowerCase().includes(v.toLowerCase())||((w=(x=S.metadata)==null?void 0:x.description)==null?void 0:w.toLowerCase().includes(v.toLowerCase()))||((T=(E=S.metadata)==null?void 0:E.description)==null?void 0:T.toLowerCase().includes(v.toLowerCase()))},[e]);l(b)},[e]);return M.jsxs("div",{className:"max-w-[900px] w-full",children:[M.jsx(nc,{value:o,onChange:g}),M.jsxs("div",{className:"flex justify-between items-center my-2 mx-0",children:[M.jsx("h4",{children:"New"}),M.jsxs("select",{value:n,onChange:v=>{i(v.target.value),p(v.target.value)},children:[M.jsx("option",{children:"Recently published"}),M.jsx("option",{children:"Most popular"}),M.jsx("option",{children:"Best rating"}),M.jsx("option",{children:"Recently updated"})]})]}),M.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto gap-2",children:[a.map(v=>{var b;return M.jsx(Ns,{app:v},Ee(v)+(((b=v.state)==null?void 0:b.our_version)||""))}),h.length>1&&M.jsxs("div",{className:"flex self-center",children:[u!==h[0]&&M.jsx(r4,{onClick:()=>c(u-1)}),h.map(v=>M.jsx("div",{className:xi("my-1 mx-2",{"font-bold":v===u}),onClick:()=>c(v),children:v},`page-${v}`)),u!==h[h.length-1]&&M.jsx(n4,{onClick:()=>c(u+1)})]})]})]})}function ak(t){const{myApps:e,getMyApps:r}=os(),n=Sa(),[i,o]=L.useState(""),[s,a]=L.useState(e);L.useEffect(()=>{r().then(a).catch(u=>console.error(u))},[]);const l=L.useCallback(u=>{o(u);const c=Object.keys(e).reduce((h,p)=>(h[p]=e[p].filter(g=>{var v,b,S,x;return g.package.toLowerCase().includes(u.toLowerCase())||((b=(v=g.metadata)==null?void 0:v.description)==null?void 0:b.toLowerCase().includes(u.toLowerCase()))||((x=(S=g.metadata)==null?void 0:S.description)==null?void 0:x.toLowerCase().includes(u.toLowerCase()))}),h),{downloaded:[],installed:[],local:[],system:[]});a(c)},[e]);return L.useEffect(()=>{i?l(i):a(e)},[e]),M.jsxs("div",{className:"flex flex-col w-full max-w-[900px]",children:[M.jsx(nc,{value:i,onChange:l}),M.jsxs("div",{className:"flex justify-between items-center mt-2",children:[M.jsx("h4",{className:"mb-2",children:"My Packages"}),M.jsxs("button",{onClick:()=>n("/publish"),children:[M.jsx(o4,{className:"mr-2"}),"Publish Package"]})]}),M.jsxs("div",{className:"flex flex-col card gap-2 mt-2",children:[M.jsx("h4",{children:"Downloaded"}),(s.downloaded||[]).map(u=>M.jsx(Ns,{app:u},Ee(u))),M.jsx("h4",{children:"Installed"}),(s.installed||[]).map(u=>M.jsx(Ns,{app:u},Ee(u))),M.jsx("h4",{children:"Local"}),(s.local||[]).map(u=>M.jsx(Ns,{app:u},Ee(u))),M.jsx("h4",{children:"System"}),(s.system||[]).map(u=>M.jsx(Ns,{app:u},Ee(u)))]})]})}function lk(t){var p,g,v,b,S,x,w,E;const{myApps:e,listedApps:r,getListedApp:n}=os(),i=Sa(),o=Ob(),[s,a]=L.useState(void 0);L.useEffect(()=>{const T=e.local.find(j=>Ee(j)===o.id);if(T)return a(T);if(o.id){const j=r.find(D=>Ee(D)===o.id);j?a(j):n(o.id).then(D=>a(D)).catch(console.error)}},[o.id]);const l=L.useCallback(()=>{i("/publish",{state:{app:s}})},[s,i]),u=L.useMemo(()=>{var T,j;return((j=(T=s==null?void 0:s.metadata)==null?void 0:T.properties)==null?void 0:j.current_version)||"Unknown"},[s]),c=Object.entries(((g=(p=s==null?void 0:s.metadata)==null?void 0:p.properties)==null?void 0:g.code_hashes)||{}),h=((v=s==null?void 0:s.state)==null?void 0:v.our_version)||(c[(c.length||1)-1]||["",""])[1];return M.jsxs("div",{className:"flex flex-col w-full max-w-[900px]",children:[M.jsx(nc,{value:"",onChange:()=>null,hideSearch:!0}),M.jsx("div",{className:"card mt1",children:s?M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex justify-between",children:[M.jsx(l2,{app:s,size:"large"}),M.jsx(u2,{app:s,className:"mr-1"})]}),M.jsxs("div",{className:"flex flex-col mt-2",children:[M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Description"}),M.jsx("div",{className:"mb-1 w-3/4",children:(((b=s.metadata)==null?void 0:b.description)||"No description given").slice(0,2e3)})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Publisher"}),M.jsx("div",{className:"mb-1 w-3/4",children:s.publisher})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Version"}),M.jsx("div",{className:"mb-1 w-3/4",children:u})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Mirrors"}),M.jsx("div",{className:"w-3/4 flex flex-col",children:(((x=(S=s.metadata)==null?void 0:S.properties)==null?void 0:x.mirrors)||[]).map((T,j)=>M.jsx("div",{className:"mb-1",children:T},j+T))})]}),M.jsxs("div",{className:"flex mt-1 items-start",children:[M.jsx("div",{className:"w-1/4",children:"Hash"}),M.jsx("div",{className:"w-3/4 break-all",children:h})]})]}),M.jsx("div",{className:"app-screenshots flex mt-2 overflow-x-auto max-w-full",children:(((E=(w=s.metadata)==null?void 0:w.properties)==null?void 0:E.screenshots)||[]).map((T,j)=>M.jsx("img",{src:T,className:"mr-2 max-h-20 max-w-full rounded border border-black"},j+T))}),s.installed&&M.jsx("button",{type:"button",onClick:l,children:"Publish"})]}):M.jsxs(M.Fragment,{children:[M.jsx("h4",{children:"App details not found for "}),M.jsx("h4",{children:o.id})]})})]})}var Il=(t=>(t[t.SEPOLIA=11155111]="SEPOLIA",t[t.OPTIMISM=10]="OPTIMISM",t[t.OPTIMISM_GOERLI=420]="OPTIMISM_GOERLI",t[t.LOCAL=1337]="LOCAL",t))(Il||{});const wu="0xaa36a7",Gm="0xa",Wm={11155111:"0x18c39eB547A0060C6034f8bEaFB947D1C16eADF1"},uk="4902",Km={[wu]:{chainId:wu,chainName:"Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://rpc.sepolia.org"],blockExplorerUrls:["https://sepolia.etherscan.io"]},[Gm]:{chainId:Gm,chainName:"Optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://mainnet.optimism.io"],blockExplorerUrls:["https://optimistic.etherscan.io"]}},ck=t=>{switch(t){case"1":case"0x1":return"Ethereum";case"10":case"a":case"0xa":return"Optimism";case"42161":return"Arbitrum";case"11155111":case"aa36a7":case"0xaa36a7":return"Sepolia";default:return"Unknown"}},Qm=async t=>{var r,n,i;let e=await((r=window.ethereum)==null?void 0:r.request({method:"net_version"}).catch(()=>"1"));if(e="0x"+(typeof e=="string"?e.replace(/^0x/,""):e.toString(16)),!Km[t]){console.error(`Invalid chain ID: ${t}`);return}if(t!==e)try{await((n=window.ethereum)==null?void 0:n.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}))}catch(o){if(String(o).includes(uk))await((i=window.ethereum)==null?void 0:i.request({method:"wallet_addEthereumChain",params:[Km[t]]}));else throw window.alert(`You must enable the ${ck(t)} network in your wallet.`),new Error(`User cancelled connection to ${t}`)}};var ya={},ic={};Object.defineProperty(ic,"__esModule",{value:!0});ic.Connector=void 0;class fk{constructor(e,r){this.actions=e,this.onError=r}resetState(){this.actions.resetState()}}ic.Connector=fk;var wf,Jm;function hk(){if(Jm)return wf;Jm=1;function t({mustBeMetaMask:e=!1,silent:r=!1,timeout:n=3e3}={}){o();let i=!1;return new Promise(s=>{window.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},n));function a(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",a);const{ethereum:l}=window;l&&(!e||l.isMetaMask)?s(l):(!r&&console.error("@metamask/detect-provider:",e&&l?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),s(null))}});function o(){if(typeof e!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof r!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof n!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}return wf=t,wf}var dk=ze&&ze.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),pk=ze&&ze.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mk=ze&&ze.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&dk(e,t,r);return pk(e,t),e},oo=ze&&ze.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):i(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(ya,"__esModule",{value:!0});var g2=ya.MetaMask=ya.NoMetaMaskError=void 0;const gk=ic;class wa extends Error{constructor(){super("MetaMask not installed"),this.name=wa.name,Object.setPrototypeOf(this,wa.prototype)}}ya.NoMetaMaskError=wa;function ll(t){return Number.parseInt(t,16)}class vk extends gk.Connector{constructor({actions:e,options:r,onError:n}){super(e,n),this.options=r}isomorphicInitialize(){return oo(this,void 0,void 0,function*(){if(!this.eagerConnection)return this.eagerConnection=Promise.resolve().then(()=>mk(hk())).then(e=>oo(this,void 0,void 0,function*(){var r,n;const i=yield e.default(this.options);i&&(this.provider=i,!((r=this.provider.providers)===null||r===void 0)&&r.length&&(this.provider=(n=this.provider.providers.find(o=>o.isMetaMask))!==null&&n!==void 0?n:this.provider.providers[0]),this.provider.on("connect",({chainId:o})=>{this.actions.update({chainId:ll(o)})}),this.provider.on("disconnect",o=>{var s;if(o.code===1013){console.debug('MetaMask logged connection error 1013: "Try again later"');return}this.actions.resetState(),(s=this.onError)===null||s===void 0||s.call(this,o)}),this.provider.on("chainChanged",o=>{this.actions.update({chainId:ll(o)})}),this.provider.on("accountsChanged",o=>{o.length===0?this.actions.resetState():this.actions.update({accounts:o})}))}))})}connectEagerly(){return oo(this,void 0,void 0,function*(){const e=this.actions.startActivation();try{if(yield this.isomorphicInitialize(),!this.provider)return e();const r=yield this.provider.request({method:"eth_accounts"});if(!r.length)throw new Error("No accounts returned");const n=yield this.provider.request({method:"eth_chainId"});this.actions.update({chainId:ll(n),accounts:r})}catch(r){console.debug("Could not connect eagerly",r),this.actions.resetState()}})}activate(e){var r,n;return oo(this,void 0,void 0,function*(){let i;return!((n=(r=this.provider)===null||r===void 0?void 0:r.isConnected)===null||n===void 0)&&n.call(r)||(i=this.actions.startActivation()),this.isomorphicInitialize().then(()=>oo(this,void 0,void 0,function*(){if(!this.provider)throw new wa;const o=yield this.provider.request({method:"eth_requestAccounts"}),s=yield this.provider.request({method:"eth_chainId"}),a=ll(s),l=typeof e=="number"?e:e==null?void 0:e.chainId;if(!l||a===l)return this.actions.update({chainId:a,accounts:o});const u=`0x${l.toString(16)}`;return this.provider.request({method:"wallet_switchEthereumChain",params:[{chainId:u}]}).catch(c=>{var h,p;if((((p=(h=c.data)===null||h===void 0?void 0:h.originalError)===null||p===void 0?void 0:p.code)||c.code)===4902&&typeof e!="number"){if(!this.provider)throw new Error("No provider");return this.provider.request({method:"wallet_addEthereumChain",params:[Object.assign(Object.assign({},e),{chainId:u})]})}throw c}).then(()=>this.activate(l))})).catch(o=>{throw i==null||i(),o})})}watchAsset({address:e,symbol:r,decimals:n,image:i}){return oo(this,void 0,void 0,function*(){if(!this.provider)throw new Error("No provider");return this.provider.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,symbol:r,decimals:n,image:i}}}).then(o=>{if(!o)throw new Error("Rejected");return!0})})}}g2=ya.MetaMask=vk;const[v2,Zd]=Zu.initializeConnector(t=>new g2({actions:t}));function yk(t){const e=t.split("."),r=new Uint8Array(t.length+e.length);let n=0;for(const i of e){const o=i.length;r[n]=o,n++;for(let s=0;si.toString(16).padStart(2,"0")).join("")}`}const Ym=/^\d+\.\d+\.\d+$/,wk=({app:t,packageName:e,publisherId:r,goBack:n})=>{var h,p,g,v,b,S,x,w;const[i,o]=L.useState({name:((h=t==null?void 0:t.metadata)==null?void 0:h.name)||"",description:((p=t==null?void 0:t.metadata)==null?void 0:p.description)||"",image:((g=t==null?void 0:t.metadata)==null?void 0:g.image)||"",external_url:((v=t==null?void 0:t.metadata)==null?void 0:v.external_url)||"",animation_url:((b=t==null?void 0:t.metadata)==null?void 0:b.animation_url)||"",package_name:e,current_version:"",publisher:r,mirrors:[r]}),[s,a]=L.useState(Object.entries(((x=(S=t==null?void 0:t.metadata)==null?void 0:S.properties)==null?void 0:x.code_hashes)||{}).concat([["",((w=t==null?void 0:t.state)==null?void 0:w.our_version)||""]])),l=(E,T)=>{o({...i,[E]:T})};L.useEffect(()=>{l("package_name",e)},[e]),L.useEffect(()=>{l("publisher",r)},[r]);const u=L.useCallback(()=>{const E=s.reduce((H,[J,Y])=>(H[J]=Y,H),{});if(Ym.test(i.current_version))if(E[i.current_version]){if(!Object.keys(E).reduce((H,J)=>H&&Ym.test(J),!0)){window.alert("Code hashes must be a JSON object with valid version keys");return}}else{window.alert(`Code hashes must include current version (${i.current_version})`);return}else{window.alert("Current version must be in the format x.y.z");return}const T=JSON.stringify({name:i.name,description:i.description,image:i.image,external_url:i.external_url,animation_url:i.animation_url,properties:{package_name:i.package_name,current_version:i.current_version,publisher:i.publisher,mirrors:i.mirrors,code_hashes:E}}),j=new Blob([T],{type:"application/json"}),D=URL.createObjectURL(j),$=document.createElement("a");$.href=D,$.download=i.package_name+"_"+i.publisher+"_metadata.json",$.click(),URL.revokeObjectURL(D)},[i,s]),c=()=>{o({name:"",description:"",image:"",external_url:"",animation_url:"",package_name:"",current_version:"",publisher:"",mirrors:[]}),a([])};return M.jsxs("form",{className:"flex flex-col card mt-2 gap-2",children:[M.jsx("h4",{children:"Fill out metadata"}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Name"}),M.jsx("input",{type:"text",placeholder:"Name",value:i.name,onChange:E=>l("name",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Description"}),M.jsx("input",{type:"text",placeholder:"Description",value:i.description,onChange:E=>l("description",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Image URL"}),M.jsx("input",{type:"text",placeholder:"Image URL",value:i.image,onChange:E=>l("image",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"External URL"}),M.jsx("input",{type:"text",placeholder:"External URL",value:i.external_url,onChange:E=>l("external_url",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Animation URL"}),M.jsx("input",{type:"text",placeholder:"Animation URL",value:i.animation_url,onChange:E=>l("animation_url",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Package Name"}),M.jsx("input",{type:"text",placeholder:"Package Name",value:i.package_name,onChange:E=>l("package_name",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Current Version"}),M.jsx("input",{type:"text",placeholder:"Current Version",value:i.current_version,onChange:E=>l("current_version",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Publisher"}),M.jsx("input",{type:"text",placeholder:"Publisher",value:i.publisher,onChange:E=>l("publisher",E.target.value)})]}),M.jsxs("div",{className:"flex flex-col w-3/4",children:[M.jsx("label",{className:"metadata-label",children:"Mirrors (separated by commas)"}),M.jsx("input",{type:"text",placeholder:"Mirrors (separated by commas)",value:i.mirrors.join(","),onChange:E=>l("mirrors",E.target.value.split(",").map(T=>T.trim()))})]}),M.jsxs("div",{className:"flex flex-col w-3/4 gap-2",children:[M.jsxs("div",{className:"flex gap-2 mt-0 justify-between w-full",children:[M.jsx("h5",{className:"m-0",children:"Code Hashes"}),M.jsx("button",{type:"button",onClick:()=>a([...s,["",""]]),className:"clear",children:"Add code hash"})]}),s.map(([E,T],j,D)=>M.jsxs("div",{className:"flex gap-2 mt-0 w-full",children:[M.jsx("input",{type:"text",placeholder:"Version",value:E,onChange:$=>a(H=>{const J=[...H];return J[j][0]=$.target.value,J}),className:"flex-1"}),M.jsx("input",{type:"text",placeholder:"Hash",value:T,onChange:$=>a(H=>{const J=[...H];return J[j][1]=$.target.value,J}),className:"flex-5"}),D.length>1&&M.jsx("button",{type:"button",onClick:()=>a($=>$.filter((H,J)=>J!==j)),className:"icon",children:M.jsx(Yd,{})})]},j+"_code_hash"))]}),M.jsxs("div",{className:"flex gap-2 my-4",children:[M.jsx("button",{type:"button",onClick:u,className:"alt",children:"Download JSON"}),M.jsx("button",{type:"button",onClick:c,className:"clear",children:"Clear Form"}),M.jsx("button",{type:"button",onClick:n,children:"Done"})]})]})};function xk({readOnly:t=!1,checked:e,setChecked:r}){return M.jsxs("div",{className:"relative",children:[M.jsx("input",{type:"checkbox",id:"checked",name:"checked",checked:e,onChange:n=>r&&r(n.target.checked),autoFocus:!0,readOnly:t}),e&&M.jsx(w4,{className:"absolute left-1 top-1 cursor-pointer",onClick:()=>r&&r(!1)})]})}var Wn=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};Wn.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Wn.prototype.init_by_array=function(t,e){var r,n,i;for(this.init_seed(19650218),r=1,n=0,i=this.N>e?this.N:e;i;i--){var o=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+t[n]+n,this.mt[r]>>>=0,r++,n++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1),n>=e&&(n=0)}for(i=this.N-1;i;i--){var o=this.mt[r-1]^this.mt[r-1]>>>30;this.mt[r]=(this.mt[r]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-r,this.mt[r]>>>=0,r++,r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1)}this.mt[0]=2147483648};Wn.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_seed(5489),r=0;r>>1^e[t&1];for(;r>>1^e[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};Wn.prototype.random_int31=function(){return this.random_int()>>>1};Wn.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Wn.prototype.random=function(){return this.random_int()*(1/4294967296)};Wn.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Wn.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var bk=Wn;function Ek(t,e){var r=document.createElement("div");return r.style.borderRadius="50px",r.style.overflow="hidden",r.style.padding="0px",r.style.margin="0px",r.style.width=""+t+"px",r.style.height=""+t+"px",r.style.display="inline-block",r.style.background=e,{container:r}}var Ak=Ek,y2={exports:{}};(function(t){var e=function(){function r(l,u,c,h){typeof u=="object"&&(c=u.depth,h=u.prototype,u.filter,u=u.circular);var p=[],g=[],v=typeof Buffer<"u";typeof u>"u"&&(u=!0),typeof c>"u"&&(c=1/0);function b(S,x){if(S===null)return null;if(x==0)return S;var w,E;if(typeof S!="object")return S;if(r.__isArray(S))w=[];else if(r.__isRegExp(S))w=new RegExp(S.source,a(S)),S.lastIndex&&(w.lastIndex=S.lastIndex);else if(r.__isDate(S))w=new Date(S.getTime());else{if(v&&Buffer.isBuffer(S))return Buffer.allocUnsafe?w=Buffer.allocUnsafe(S.length):w=new Buffer(S.length),S.copy(w),w;typeof h>"u"?(E=Object.getPrototypeOf(S),w=Object.create(E)):(w=Object.create(h),E=h)}if(u){var T=p.indexOf(S);if(T!=-1)return g[T];p.push(S),g.push(w)}for(var j in S){var D;E&&(D=Object.getOwnPropertyDescriptor(E,j)),!(D&&D.set==null)&&(w[j]=b(S[j],x-1))}return w}return b(l,c)}r.clonePrototype=function(u){if(u===null)return null;var c=function(){};return c.prototype=u,new c};function n(l){return Object.prototype.toString.call(l)}r.__objToStr=n;function i(l){return typeof l=="object"&&n(l)==="[object Date]"}r.__isDate=i;function o(l){return typeof l=="object"&&n(l)==="[object Array]"}r.__isArray=o;function s(l){return typeof l=="object"&&n(l)==="[object RegExp]"}r.__isRegExp=s;function a(l){var u="";return l.global&&(u+="g"),l.ignoreCase&&(u+="i"),l.multiline&&(u+="m"),u}return r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)})(y2);var _k=y2.exports,w2={exports:{}},Sk={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ui=Sk,x2={};for(var xf in Ui)Ui.hasOwnProperty(xf)&&(x2[Ui[xf]]=xf);var te=w2.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Xt in te)if(te.hasOwnProperty(Xt)){if(!("channels"in te[Xt]))throw new Error("missing channels property: "+Xt);if(!("labels"in te[Xt]))throw new Error("missing channel labels property: "+Xt);if(te[Xt].labels.length!==te[Xt].channels)throw new Error("channel and label counts mismatch: "+Xt);var kk=te[Xt].channels,Nk=te[Xt].labels;delete te[Xt].channels,delete te[Xt].labels,Object.defineProperty(te[Xt],"channels",{value:kk}),Object.defineProperty(te[Xt],"labels",{value:Nk})}te.rgb.hsl=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,l,u;return o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360),u=(i+o)/2,o===i?l=0:u<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,u*100]};te.rgb.hsv=function(t){var e,r,n,i,o,s=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(s,a,l),c=u-Math.min(s,a,l),h=function(p){return(u-p)/6/c+1/2};return c===0?i=o=0:(o=c/u,e=h(s),r=h(a),n=h(l),s===u?i=n-r:a===u?i=1/3+e-n:l===u&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,u*100]};te.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2],i=te.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};te.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i,o,s,a;return a=Math.min(1-e,1-r,1-n),i=(1-e-a)/(1-a)||0,o=(1-r-a)/(1-a)||0,s=(1-n-a)/(1-a)||0,[i*100,o*100,s*100,a*100]};function Mk(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}te.rgb.keyword=function(t){var e=x2[t];if(e)return e;var r=1/0,n;for(var i in Ui)if(Ui.hasOwnProperty(i)){var o=Ui[i],s=Mk(t,o);s.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};te.rgb.lab=function(t){var e=te.rgb.xyz(t),r=e[0],n=e[1],i=e[2],o,s,a;return r/=95.047,n/=100,i/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,o=116*n-16,s=500*(r-n),a=200*(n-i),[o,s,a]};te.hsl.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s,a,l;if(r===0)return l=n*255,[l,l,l];n<.5?o=n*(1+r):o=n+r-n*r,i=2*n-o,a=[0,0,0];for(var u=0;u<3;u++)s=e+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?l=i+(o-i)*6*s:2*s<1?l=o:3*s<2?l=i+(o-i)*(2/3-s)*6:l=i,a[u]=l*255;return a};te.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01),s,a;return n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o,a=(n+r)/2,s=n===0?2*i/(o+i):2*r/(n+r),[e,s*100,a*100]};te.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),l=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,l,s];case 1:return[a,n,s];case 2:return[s,n,l];case 3:return[s,a,n];case 4:return[l,s,n];case 5:return[n,s,a]}};te.hsv.hsl=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s,a;return a=(2-r)*n,o=(2-r)*i,s=r*i,s/=o<=1?o:2-o,s=s||0,a/=2,[e,s*100,a*100]};te.hwb.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o,s,a,l;i>1&&(r/=i,n/=i),o=Math.floor(6*e),s=1-n,a=6*e-o,o&1&&(a=1-a),l=r+a*(s-r);var u,c,h;switch(o){default:case 6:case 0:u=s,c=l,h=r;break;case 1:u=l,c=s,h=r;break;case 2:u=r,c=s,h=l;break;case 3:u=r,c=l,h=s;break;case 4:u=l,c=r,h=s;break;case 5:u=s,c=r,h=l;break}return[u*255,c*255,h*255]};te.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o,s,a;return o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i),[o*255,s*255,a*255]};te.xyz.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};te.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;return e/=95.047,r/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*r-16,o=500*(e-r),s=200*(r-n),[i,o,s]};te.lab.xyz=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;var a=Math.pow(o,3),l=Math.pow(i,3),u=Math.pow(s,3);return o=a>.008856?a:(o-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,s=u>.008856?u:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};te.lab.lch=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;return i=Math.atan2(n,r),o=i*360/2/Math.PI,o<0&&(o+=360),s=Math.sqrt(r*r+n*n),[e,s,o]};te.lch.lab=function(t){var e=t[0],r=t[1],n=t[2],i,o,s;return s=n/360*2*Math.PI,i=r*Math.cos(s),o=r*Math.sin(s),[e,i,o]};te.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:te.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return i===2&&(o+=60),o};te.hsv.ansi16=function(t){return te.rgb.ansi16(te.hsv.rgb(t),t[2])};te.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];if(e===r&&r===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};te.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};te.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var r,n=Math.floor(t/36)/5*255,i=Math.floor((r=t%36)/6)/5*255,o=r%6/5*255;return[n,i,o]};te.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),r=e.toString(16).toUpperCase();return"000000".substring(r.length)+r};te.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];e[0].length===3&&(r=r.split("").map(function(a){return a+a}).join(""));var n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};te.rgb.hcg=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,l;return s<1?a=o/(1-s):a=0,s<=0?l=0:i===e?l=(r-n)/s%6:i===r?l=2+(n-e)/s:l=4+(e-r)/s+4,l/=6,l%=1,[l*360,s*100,a*100]};te.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return r<.5?n=2*e*r:n=2*e*(1-r),n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};te.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};te.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];var i=[0,0,0],o=e%1*6,s=o%1,a=1-s,l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-r)*n,[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]};te.hcg.hsv=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};te.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100,n=r*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};te.hcg.hwb=function(t){var e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};te.hwb.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1-r,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};te.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};te.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};te.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};te.gray.hsl=te.gray.hsv=function(t){return[0,0,t[0]]};te.gray.hwb=function(t){return[0,100,t[0]]};te.gray.cmyk=function(t){return[0,0,0,t[0]]};te.gray.lab=function(t){return[t[0],0,0]};te.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,r=(e<<16)+(e<<8)+e,n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};te.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var b2=w2.exports,xu=b2;function Pk(){for(var t={},e=Object.keys(xu),r=e.length,n=0;n1&&(r=Array.prototype.slice.call(arguments)),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Bk(t){var e=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var n=t(r);if(typeof n=="object")for(var i=n.length,o=0;or?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=t[0]*.3+t[1]*.59+t[2]*.11;return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=e<0?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){var r=this,n=t,i=e===void 0?.5:e,o=2*i-1,s=r.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return this.rgb(a*r.red()+l*n.red(),a*r.green()+l*n.green(),a*r.blue()+l*n.blue()).alpha(r.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new mn;return t.values=Jk(this.values),t}};mn.prototype.getValues=function(t){for(var e={},r=0;r{const n=L.useRef(null);return L.useEffect(()=>{if(t&&n.current){const i=parseInt(t.slice(2,10),16),o=u6(e,i);n.current.innerHTML="",n.current.appendChild(o)}},[t,e]),M.jsx("div",{...r,ref:n})},{useIsActivating:f6}=Zd;function h6({provider:t,packageAbi:e}){var ie;const{state:r}=Uu(),{listedApps:n}=os(),{account:i,isActive:o}=Zu.useWeb3React(),s=f6(),[a,l]=L.useState(""),[u,c]=L.useState(),[h,p]=L.useState(!1),[g,v]=L.useState(""),[b,S]=L.useState(((ie=window.our)==null?void 0:ie.node)||""),[x,w]=L.useState(""),[E,T]=L.useState(""),[j,D]=L.useState(!1);L.useEffect(()=>{const ae=r==null?void 0:r.app;ae&&(v(ae.package),S(ae.publisher),D(!0))},[r]);const $=L.useCallback(async()=>{await v2.activate().catch(()=>{});try{Qm(wu)}catch(ae){console.error(ae)}},[]),H=L.useCallback(async()=>{if(!x){T("");return}try{const C=await(await fetch(x)).text();JSON.parse(C);const f=ct(gr(C));T(f)}catch{window.alert("Error calculating metadata hash. Please ensure the URL is valid and the metadata is in JSON format.")}},[x]),J=L.useCallback(async ae=>{var f;ae.preventDefault(),ae.stopPropagation();let C=E;try{if(!C){const k=await fetch(x);await k.json();const _=await k.text();C=ct(gr(_))}l("Please confirm the transaction in your wallet");const m=yk(b);await Qm(wu);const A=await(j?e.updateMetadata(G.from(z_(["string","bytes"],[g,m])),x,C):e.registerApp(g,m,x,C));await new Promise(k=>setTimeout(k,2e3)),l("Publishing package..."),await A.wait(),c({packageName:g,publisherId:b}),v(""),S(((f=window.our)==null?void 0:f.node)||b),w(""),T(""),D(!1)}catch(m){console.error(m),window.alert("Error publishing package. Please ensure the package name and publisher ID are valid, and the metadata is in JSON format.")}finally{l("")}},[g,j,b,x,E,e,c,v,S,w,T,D]),Y=L.useCallback(async()=>{j||g&&b&&n.find(ae=>ae.package===g&&ae.publisher===b)&&D(!0)},[n,g,b,j,D]);return M.jsxs("div",{className:"max-w-[900px] w-full",children:[M.jsx(nc,{hideSearch:!0,onBack:h?()=>p(!1):void 0}),M.jsxs("div",{className:"flex justify-between items-center my-2",children:[M.jsx("h4",{children:"Publish Package"}),!!i&&M.jsxs("div",{className:"card flex items-center",children:[M.jsx("span",{children:"Publishing as:"}),M.jsx(c6,{address:i,className:"mx-2"}),M.jsxs("span",{className:"font-mono",children:[i==null?void 0:i.slice(0,4),"...",i==null?void 0:i.slice(-4)]})]})]}),a?M.jsx("div",{className:"flex flex-col items-center",children:M.jsx(Rh,{msg:a})}):u?M.jsxs("div",{className:"flex flex-col items-center",children:[M.jsx("h4",{className:"mb-2",children:"Package Published!"}),M.jsxs("div",{className:"mb-2",children:[M.jsx("strong",{children:"Package Name:"})," ",u.packageName]}),M.jsxs("div",{className:"mb-2",children:[M.jsx("strong",{children:"Publisher ID:"})," ",u.publisherId]}),M.jsx("button",{className:"flex ml-2 mt-2",onClick:()=>c(void 0),children:"Publish Another Package"})]}):h?M.jsx(wk,{packageName:g,publisherId:b,app:r==null?void 0:r.app,goBack:()=>p(!1)}):!i||!o?M.jsxs(M.Fragment,{children:[M.jsx("h4",{style:{},children:"Please connect your wallet to publish a package"}),M.jsx("button",{className:"connect-wallet row",onClick:$,children:"Connect Wallet"})]}):s?M.jsx(Rh,{msg:"Approve connection in your wallet"}):M.jsxs("form",{className:"flex flex-col flex-1 overflow-y-auto",onSubmit:J,children:[M.jsxs("div",{className:"flex cursor-pointer p-2 -mb-2",onClick:()=>D(!j),children:[M.jsx(xk,{checked:j,readOnly:!0}),M.jsx("label",{htmlFor:"update",className:"cursor-pointer ml-4",children:"Update existing package"})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"package-name",children:"Package Name"}),M.jsx("input",{id:"package-name",type:"text",required:!0,placeholder:"my-package",value:g,onChange:ae=>v(ae.target.value),onBlur:Y})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"publisher-id",children:"Publisher ID"}),M.jsx("input",{id:"publisher-id",type:"text",required:!0,value:b,onChange:ae=>S(ae.target.value),onBlur:Y})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"metadata-url",children:"Metadata URL"}),M.jsx("input",{id:"metadata-url",type:"text",required:!0,value:x,onChange:ae=>w(ae.target.value),onBlur:H,placeholder:"https://github/my-org/my-repo/metadata.json"}),M.jsxs("div",{className:"mt-2",children:["Metadata is a JSON file that describes your package.",M.jsx("br",{})," You can"," ",M.jsx("a",{onClick:()=>p(!0),className:"underline cursor-pointer",children:"fill out a template here"}),"."]})]}),M.jsxs("div",{className:"flex flex-col mb-2",children:[M.jsx("label",{htmlFor:"metadata-hash",children:"Metadata Hash"}),M.jsx("input",{readOnly:!0,id:"metadata-hash",type:"text",value:E,onChange:ae=>T(ae.target.value),placeholder:"Calculated automatically from metadata URL"})]}),M.jsx("button",{type:"submit",children:"Publish"})]})]})}var d6={VITE_SEPOLIA_RPC_URL:"https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",VITE_OPTIMISM_RPC_URL:"https://mainnet.optimism.io/",BASE_URL:"/main:app_store:sys",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const p6=[[v2,Zd]],{useProvider:m6}=Zd,g6="https://eth-sepolia.g.alchemy.com/v2/IyK9MyYxeSXOxLbdpI44d_Ayw58WH2M7",Us="/main:app_store:sys";window.our&&(window.our.process=Us==null?void 0:Us.replace("/",""));const v6=`${d6.VITE_NODE_URL||"http://localhost:8080"}${Us}`;function y6(){const t=m6(),[e,r]=L.useState(!0),[n,i]=L.useState(Ih.connect(Wm[Il.SEPOLIA],new _i(g6)));if(L.useEffect(()=>{t==null||t.getNetwork().then(s=>{s.chainId===Il.SEPOLIA&&i(Ih.connect(Wm[Il.SEPOLIA],t.getSigner()))})},[t]),L.useEffect(()=>{},[]),!e)return M.jsxs("div",{className:"flex flex-col c",children:[M.jsx("h2",{style:{color:"red"},children:"Node not connected"}),M.jsxs("h4",{children:["You need to start a node at ",v6," before you can use this UI in development."]})]});const o={provider:t,packageAbi:n};return M.jsx("div",{className:"flex flex-col c h-screen w-screen",children:M.jsx(Zu.Web3ReactProvider,{connectors:p6,children:M.jsx(Jb,{basename:Us,children:M.jsxs(Kb,{children:[M.jsx(_s,{path:"/",element:M.jsx(sk,{...o})}),M.jsx(_s,{path:jh,element:M.jsx(ak,{...o})}),M.jsx(_s,{path:"/app-details/:id",element:M.jsx(lk,{...o})}),M.jsx(_s,{path:"/publish",element:M.jsx(h6,{...o})})]})})})})}Ef.createRoot(document.getElementById("root")).render(M.jsx(Vr.StrictMode,{children:M.jsx(y6,{})})); diff --git a/kinode/packages/app_store/pkg/ui/index.html b/kinode/packages/app_store/pkg/ui/index.html index 6624036c..1267ac3d 100644 --- a/kinode/packages/app_store/pkg/ui/index.html +++ b/kinode/packages/app_store/pkg/ui/index.html @@ -15,8 +15,8 @@ - - + + diff --git a/kinode/packages/app_store/ui/src/components/Modal.tsx b/kinode/packages/app_store/ui/src/components/Modal.tsx index 6393ecb3..0fcdfbcb 100644 --- a/kinode/packages/app_store/ui/src/components/Modal.tsx +++ b/kinode/packages/app_store/ui/src/components/Modal.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames' import React, { MouseEvent } from 'react' -import { FaPlus } from 'react-icons/fa' +import { FaX } from 'react-icons/fa6' export interface ModalProps extends React.HTMLAttributes { show: boolean @@ -27,23 +27,23 @@ const Modal: React.FC = ({ return (
{Boolean(title) &&

{title}

} {!hideClose && ( )}