diff --git a/README.md b/README.md index d55d86ca..55b3cba6 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ Options (named): -w [--write] Run built-in write test and display. ``` -Did you check if all supported [CPU Extensions](#cpu-extensions) are built in (`./bn --hardware`)? +Did you check if all supported [CPU Extensions](#cpu-extensions) are built in (`./bs --hardware`)? ### Startup Process @@ -375,4 +375,4 @@ $ sudo sysctl vm.dirty_writeback_centisecs=12000 If set this way the settings are only temporary and reset after reboot. Although there are options to set them permanently we suggest to play around with session based parameters until you found the setting that works best for your system. Note that these parameters apply to the OS and therefore to all running applications. -Further information on how to adjust dirty page writeback on other operating systems can be found [here](/docs/theory-of-operation.md#linux-dirty-page-writeback-tuning-notes). \ No newline at end of file +Further information on how to adjust dirty page writeback on other operating systems can be found [here](/docs/theory-of-operation.md#linux-dirty-page-writeback-tuning-notes). diff --git a/console/embedded/native_css.cpp b/console/embedded/native_css.cpp index 12ed13a2..544c986c 100644 --- a/console/embedded/native_css.cpp +++ b/console/embedded/native_css.cpp @@ -23,17 +23,16 @@ namespace server { // Simple test css for embedded page, links in font. DEFINE_EMBEDDED_PAGE(native_pages, char, css, - R"DELIM(@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-400:oklch(70.4% .191 22.216);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bold)DELIM" - R"DELIM(er}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.88)DELIM" - R"DELIM(1);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-full{height:100%}.max-h-\[60vh\]{max-height:60vh}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing)*2)}.w-4{width:calc(var(--spacing)*4)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing)*0)}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-10{gap:calc(var(--spacing)*10)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-rever)DELIM" - R"DELIM(se:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500)50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500)50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500)50%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500)20%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500)20%,transparent)}}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-transparent{background-color:#0000}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.pt-24{padding-top:calc(var(--spacing)*24)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.text-center{text-align:center}.text-left{text-)DELIM" - R"DELIM(align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-red-400{color:var(--color-red-400)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:max-w-\[18rem\]:is(:where(.group):hover *){max-width:18rem}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing)*2)}.focus-within\:px-3:)DELIM" - R"DELIM(focus-within{padding-inline:calc(var(--spacing)*3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing)*2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing)*3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing)*72)}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{sy)DELIM" - R"DELIM(ntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false} +R"DELIM(@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-400:oklch(70.4% .191 22.216);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bold)DELIM" +R"DELIM(er}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.88)DELIM" +R"DELIM(1);--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-full{height:100%}.max-h-\[60vh\]{max-height:60vh}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing)*2)}.w-4{width:calc(var(--spacing)*4)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing)*0)}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-10{gap:calc(var(--spacing)*10)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-rever)DELIM" +R"DELIM(se:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500)50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500)50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500)50%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500)20%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500)20%,transparent)}}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-transparent{background-color:#0000}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.pt-24{padding-top:calc(var(--spacing)*24)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.text-center{text-align:center}.text-left{text-)DELIM" +R"DELIM(align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-red-400{color:var(--color-red-400)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:max-w-\[18rem\]:is(:where(.group):hover *){max-width:18rem}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing)*2)}.focus-within\:px-3:)DELIM" +R"DELIM(focus-within{padding-inline:calc(var(--spacing)*3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing)*2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing)*3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing)*72)}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{sy)DELIM" +R"DELIM(ntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false} )DELIM" - ) } // namespace server diff --git a/console/embedded/native_ecma.cpp b/console/embedded/native_ecma.cpp index cf6bfb80..225dfc0f 100644 --- a/console/embedded/native_ecma.cpp +++ b/console/embedded/native_ecma.cpp @@ -23,140 +23,158 @@ namespace server { // Simple test ecma script for embedded page. DEFINE_EMBEDDED_PAGE(native_pages, char, ecma, - R"DELIM(function SS(e,a){for(var i=0;il[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qf={exports:{}},Ul={};var yv;function wS(){if(yv)return Ul;yv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var d=null;if(u!==void 0&&(d=""+u),s.key!==void 0&&(d=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:d,ref:s!==void 0?s:null,props:u}}return Ul.Fragment=a,Ul.jsx=i,Ul.jsxs=i,Ul}var vv;function _S(){return vv||(vv=1,qf.exports=wS()),qf.exports}var b=_S(),Qf={exports:{}},Oe={};var gv;function ES(){if(gv)return Oe;gv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function _(T){return T===null||typeof T!="object"?null:(T=x&&T[x]||T["@@iterator"],typeof T=="function"?T:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,k={};function j(T,Q,te){this.props=T,this.context=Q,this.refs=k,this.updater=te||E}j.prototype.isReactComponent={},j.prototype.setState=function(T,Q){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,Q,"setState")},j.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function L(){}L.prototype=j.prototype;function U(T,Q,te){this.props=T,this.context=Q,this.refs=k,this.updater=te||E}var J=U.prototype=new L;J.constructor=U,R(J,j.prototype),J.isPureReactComponent=!0;var I=Array.isArray;function ce(){}var O={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function me(T,Q,te){var ie=te.ref;return{$$typeof:e,type:T,key:Q,ref:ie!==void 0?ie:null,props:te}}function re(T,Q){return me(T.type,Q,T.props)}function ne(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function se(T){var Q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(te){return Q[te]})}var ze=/\/+/g;function oe(T,Q){return typeof T=="object"&&T!==null&&T.key!=null?se(""+T.key):Q.toString(36)}function $(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ce,ce):(T.status="pending",T.then(function(Q){T.status==="pending"&&(T.status="fulfilled",T.value=Q)},function(Q){T.status==="pending"&&(T.status="rejected",T.reason=Q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function S(T,Q,te,ie,pe){var Ee=typeof T;(Ee==="undefined"||Ee==="boolean")&&(T=null);var ue=!1;if(T===null)ue=!0;else switch(Ee){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(T.$$typeof){case e:case a:ue=!0;break;case g:return ue=T._init,S(ue(T._payload),Q,te,ie,pe)}}if(ue)return pe=pe(T),ue=ie===""?"."+oe(T,0):ie,I(pe)?(te="",ue!=null&&(te=ue.replace(ze,"$&/")+"/"),S(pe,Q,te,"",function(Ve){return Ve})):pe!=null&&(ne(pe)&&(pe=re(pe,te+(pe.key==null||T&&T.key===pe.key?"":(""+pe.key).replace(ze,"$&/")+"/")+ue)),Q.push(pe)),1;ue=0;var Ce=ie===""?".":ie+":";if(I(T))for(var Ae=0;Ae>>1,ae=S[V];if(0>>1;Vs(te,N))DELIM" - R"DELIM()ies(pe,te)?(S[V]=pe,S[ie]=N,V=ie):(S[V]=te,S[Q]=N,V=Q);else if(ies(pe,N))S[V]=pe,S[ie]=N,V=ie;else break e}}return M}function s(S,M){var N=S.sortIndex-M.sortIndex;return N!==0?N:S.id-M.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var p=[],m=[],g=1,v=null,x=3,_=!1,E=!1,R=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function J(S){for(var M=i(m);M!==null;){if(M.callback===null)l(m);else if(M.startTime<=S)l(m),M.sortIndex=M.expirationTime,a(p,M);else break;M=i(m)}}function I(S){if(R=!1,J(S),!E)if(i(p)!==null)E=!0,ce||(ce=!0,se());else{var M=i(m);M!==null&&$(I,M.startTime-S)}}var ce=!1,O=-1,K=5,me=-1;function re(){return k?!0:!(e.unstable_now()-meS&&re());){var V=v.callback;if(typeof V=="function"){v.callback=null,x=v.priorityLevel;var ae=V(v.expirationTime<=S);if(S=e.unstable_now(),typeof ae=="function"){v.callback=ae,J(S),M=!0;break t}v===i(p)&&l(p),J(S)}else l(p);v=i(p)}if(v!==null)M=!0;else{var T=i(m);T!==null&&$(I,T.startTime-S),M=!1}}break e}finally{v=null,x=N,_=!1}M=void 0}}finally{M?se():ce=!1}}}var se;if(typeof U=="function")se=function(){U(ne)};else if(typeof MessageChannel<"u"){var ze=new MessageChannel,oe=ze.port2;ze.port1.onmessage=ne,se=function(){oe.postMessage(null)}}else se=function(){j(ne,0)};function $(S,M){O=j(function(){S(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(S){S.callback=null},e.unstable_forceFrameRate=function(S){0>S||125V?(S.sortIndex=N,a(m,S),i(p)===null&&S===i(m)&&(R?(L(O),O=-1):R=!0,$(I,N-V))):(S.sortIndex=ae,a(p,S),E||_||(E=!0,ce||(ce=!0,se()))),S},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(S){var M=x;return function(){var N=x;x=M;try{return S.apply(this,arguments)}finally{x=N}}}})(Gf)),Gf}var Sv;function zS(){return Sv||(Sv=1,Yf.exports=RS()),Yf.exports}var Kf={exports:{}},Vt={};var wv;function AS(){if(wv)return Vt;wv=1;var e=co();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Kf.exports=AS(),Kf.exports}var Ev;function CS(){if(Ev)return $l;Ev=1;var e=zS(),a=co(),i=y0();function l(t){var n="https://react.dev/errors/"+t;if(1ae||(t.current=V[ae],V[ae]=null,ae--)}function te(t,n){ae++,V[ae]=t.current,t.current=n}var ie=T(null),pe=T(null),Ee=T(null),ue=T(null);function Ce(t,n){switch(te(Ee,n),te(pe,t),te(ie,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Uy(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Uy(n),t=$y(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q(ie),te(ie,t)}function Ae(){Q(ie),Q(pe),Q(Ee)}function Ve(t){t.memoizedState!==null&&te(ue,t);var n=ie.current,r=$y(n,t.type);n!==r&&(te(pe,t),te(ie,r))}function it(t){pe.current===t&&(Q(ie),Q(pe)),ue.current===t&&(Q(ue),kl._currentValue=N)}var Ye,Lt;function Je(t){if(Ye===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ye=n&&n[1]||"",Lt=-1l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function co(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qf={exports:{}},$l={};var yv;function TS(){if(yv)return $l;yv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var f=null;if(u!==void 0&&(f=""+u),s.key!==void 0&&(f=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:f,ref:s!==void 0?s:null,props:u}}return $l.Fragment=a,$l.jsx=i,$l.jsxs=i,$l}var vv;function RS(){return vv||(vv=1,Qf.exports=TS()),Qf.exports}var b=RS(),Pf={exports:{}},Ce={};var gv;function zS(){if(gv)return Ce;gv=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function _(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,j={};function k(R,Q,te){this.props=R,this.context=Q,this.refs=j,this.updater=te||E}k.prototype.isReactComponent={},k.prototype.setState=function(R,Q){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,Q,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function L(){}L.prototype=k.prototype;function U(R,Q,te){this.props=R,this.context=Q,this.refs=j,this.updater=te||E}var V=U.prototype=new L;V.constructor=U,T(V,k.prototype),V.isPureReactComponent=!0;var X=Array.isArray;function ue(){}var C={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function he(R,Q,te){var re=te.ref;return{$$typeof:e,type:R,key:Q,ref:re!==void 0?re:null,props:te}}function le(R,Q){return he(R.type,Q,R.props)}function ne(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function oe(R){var Q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(te){return Q[te]})}var we=/\/+/g;function se(R,Q){return typeof R=="object"&&R!==null&&R.key!=null?oe(""+R.key):Q.toString(36)}function $(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(ue,ue):(R.status="pending",R.then(function(Q){R.status==="pending"&&(R.status="fulfilled",R.value=Q)},function(Q){R.status==="pending"&&(R.status="rejected",R.reason=Q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function S(R,Q,te,re,pe){var Te=typeof R;(Te==="undefined"||Te==="boolean")&&(R=null);var ce=!1;if(R===null)ce=!0;else switch(Te){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(R.$$typeof){case e:case a:ce=!0;break;case g:return ce=R._init,S(ce(R._payload),Q,te,re,pe)}}if(ce)return pe=pe(R),ce=re===""?"."+se(R,0):re,X(pe)?(te="",ce!=null&&(te=ce.replace(we,"$&/")+"/"),S(pe,Q,te,"",function(Ve){return Ve})):pe!=null&&(ne(pe)&&(pe=le(pe,te+(pe.key==null||R&&R.key===pe.key?"":(""+pe.key).replace(we,"$&/")+"/")+ce)),Q.push(pe)),1;ce=0;var Oe=re===""?".":re+":";if(X(R))for(var Ae=0;Ae>>1,ae=S[J];if(0>>1;Js(te,N))DELIM" +R"DELIM()res(pe,te)?(S[J]=pe,S[re]=N,J=re):(S[J]=te,S[Q]=N,J=Q);else if(res(pe,N))S[J]=pe,S[re]=N,J=re;else break e}}return M}function s(S,M){var N=S.sortIndex-M.sortIndex;return N!==0?N:S.id-M.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();e.unstable_now=function(){return f.now()-h}}var p=[],m=[],g=1,v=null,x=3,_=!1,E=!1,T=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function V(S){for(var M=i(m);M!==null;){if(M.callback===null)l(m);else if(M.startTime<=S)l(m),M.sortIndex=M.expirationTime,a(p,M);else break;M=i(m)}}function X(S){if(T=!1,V(S),!E)if(i(p)!==null)E=!0,ue||(ue=!0,oe());else{var M=i(m);M!==null&&$(X,M.startTime-S)}}var ue=!1,C=-1,K=5,he=-1;function le(){return j?!0:!(e.unstable_now()-heS&&le());){var J=v.callback;if(typeof J=="function"){v.callback=null,x=v.priorityLevel;var ae=J(v.expirationTime<=S);if(S=e.unstable_now(),typeof ae=="function"){v.callback=ae,V(S),M=!0;break t}v===i(p)&&l(p),V(S)}else l(p);v=i(p)}if(v!==null)M=!0;else{var R=i(m);R!==null&&$(X,R.startTime-S),M=!1}}break e}finally{v=null,x=N,_=!1}M=void 0}}finally{M?oe():ue=!1}}}var oe;if(typeof U=="function")oe=function(){U(ne)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,se=we.port2;we.port1.onmessage=ne,oe=function(){se.postMessage(null)}}else oe=function(){k(ne,0)};function $(S,M){C=k(function(){S(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(S){S.callback=null},e.unstable_forceFrameRate=function(S){0>S||125J?(S.sortIndex=N,a(m,S),i(p)===null&&S===i(m)&&(T?(L(C),C=-1):T=!0,$(X,N-J))):(S.sortIndex=ae,a(p,S),E||_||(E=!0,ue||(ue=!0,oe()))),S},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(S){var M=x;return function(){var N=x;x=M;try{return S.apply(this,arguments)}finally{x=N}}}})(Kf)),Kf}var Sv;function CS(){return Sv||(Sv=1,Gf.exports=OS()),Gf.exports}var Ff={exports:{}},Vt={};var wv;function MS(){if(wv)return Vt;wv=1;var e=fo();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Ff.exports=MS(),Ff.exports}var Ev;function NS(){if(Ev)return Zl;Ev=1;var e=CS(),a=fo(),i=y0();function l(t){var n="https://react.dev/errors/"+t;if(1ae||(t.current=J[ae],J[ae]=null,ae--)}function te(t,n){ae++,J[ae]=t.current,t.current=n}var re=R(null),pe=R(null),Te=R(null),ce=R(null);function Oe(t,n){switch(te(Te,n),te(pe,t),te(re,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Uy(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Uy(n),t=$y(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q(re),te(re,t)}function Ae(){Q(re),Q(pe),Q(Te)}function Ve(t){t.memoizedState!==null&&te(ce,t);var n=re.current,r=$y(n,t.type);n!==r&&(te(pe,t),te(re,r))}function it(t){pe.current===t&&(Q(re),Q(pe)),ce.current===t&&(Q(ce),Ll._currentValue=N)}var Ye,Lt;function Je(t){if(Ye===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ye=n&&n[1]||"",Lt=-1)":-1c||C[o]!==q[c]){var F=` -`+C[o].replace(" at new "," at ");return t.displayName&&F.includes("")&&(F=F.replace("",t.displayName)),F}while(1<=o&&0<=c);break}}}finally{st=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Je(r):""}function dt(t,n){switch(t.tag){case 26:case 27:case 5:return Je(t.type);case 16:return Je("Lazy");case 13:return t.child!==n&&n!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return De(t.type,!1);case 11:return De(t.type.render,!1);case 1:return De(t.type,!0);case 31:return Je("Activity");default:return""}}function Fn(t){try{var n="",r=null;do n+=dt(t,r),r=t,t=t.return;while(t);return n}catch(o){return` +`);for(c=o=0;oc||O[o]!==q[c]){var F=` +`+O[o].replace(" at new "," at ");return t.displayName&&F.includes("")&&(F=F.replace("",t.displayName)),F}while(1<=o&&0<=c);break}}}finally{st=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Je(r):""}function dt(t,n){switch(t.tag){case 26:case 27:case 5:return Je(t.type);case 16:return Je("Lazy");case 13:return t.child!==n&&n!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return De(t.type,!1);case 11:return De(t.type.render,!1);case 1:return De(t.type,!0);case 31:return Je("Activity");default:return""}}function Xn(t){try{var n="",r=null;do n+=dt(t,r),r=t,t=t.return;while(t);return n}catch(o){return` Error generating stack: `+o.message+` -`+o.stack}}var Oa=Object.prototype.hasOwnProperty,yr=e.unstable_scheduleCallback,Ki=e.unstable_cancelCallback,Ou=e.unstable_shouldYield,Mu=e.unstable_requestPaint,St=e.unstable_now,vr=e.unstable_getCurrentPriorityLevel,Fi=e.unstable_ImmediatePriority,ei=e.unstable_UserBlockingPriority,en=e.unstable_NormalPriority,Hn=e.unstable_LowPriority,Vi=e.unstable_IdlePriority,Nu=e.log,Xi=e.unstable_setDisableYieldValue,gr=null,ht=null;function Un(t){if(typeof Nu=="function"&&Xi(t),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(gr,t)}catch{}}var Ft=Math.clz32?Math.clz32:wo,So=Math.log,ju=Math.LN2;function wo(t){return t>>>=0,t===0?32:31-(So(t)/ju|0)|0}var la=256,br=262144,Ma=4194304;function oa(t){var n=t&42;if(n!==0)return n;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function xr(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var c=0,f=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var w=o&134217727;return w!==0?(o=w&~f,o!==0?c=oa(o):(y&=w,y!==0?c=oa(y):r||(r=w&~t,r!==0&&(c=oa(r))))):(w=o&~f,w!==0?c=oa(w):y!==0?c=oa(y):r||(r=o&~t,r!==0&&(c=oa(r)))),c===0?0:n!==0&&n!==c&&(n&f)===0&&(f=c)DELIM" -R"DELIM(&-c,r=n&-n,f>=r||f===32&&(r&4194048)!==0)?n:c}function Sr(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function _o(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wr(){var t=Ma;return Ma<<=1,(Ma&62914560)===0&&(Ma=4194304),t}function Na(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function ja(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Du(t,n,r,o,c,f){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var w=t.entanglements,C=t.expirationTimes,q=t.hiddenUpdates;for(r=y&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var p1=/[\n"\\]/g;function _n(t){return t.replace(p1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ku(t,n,r,o,c,f,y,w){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+qe(n)):t.value!==""+qe(n)&&(t.value=""+qe(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?Lu(t,y,qe(n)):r!=null?Lu(t,y,qe(r)):o!=null&&t.removeAttribute("value"),c==null&&f!=null&&(t.defaultChecked=!!f),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.name=""+qe(w):t.removeAttribute("name")}function jh(t,n,r,o,c,f,y,w){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),n!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Ji(t);return}r=r!=null?""+qe(r):"",n=n!=null?""+qe(n):r,w||n===t.value||(t.value=n),t.defaultValue=n}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=w?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Ji(t)}function Lu(t,n,r){n==="number"&&Ro(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function ti(t,n,r,o){if(t=t.options,n){n={};for(var c=0;c"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zu=!1;if(ca)try{var Wi={};Object.defineProperty(Wi,"passive",{get:function(){Zu=!0}}),window.addEventListener("test",Wi,Wi),window.removeEventListener("test",Wi,Wi)}catch{Zu=!1}var Da=null,qu=null,Ao=null;function $h(){if(Ao)return Ao;var t,n=qu,r=n.length,o,c="value"in Da?Da.value:Da.textContent,f=c.length;for(t=0;t=nl),Gh=" ",Kh=!1;function Fh(t,n){switch(t){case"keyup":return Q1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ii=!1;function Y1(t,n){switch(t){case"compositionend":return Vh(n);case"keypress":return n.which!==32?null:(Kh=!0,Gh);case"textInput":return t=n.data,t===Gh&&Kh?null:t;default:return null}}function G1(t,n){if(ii)return t==="compositionend"||!Ku&&Fh(t,n)?(t=$h(),Ao=qu=Da=null,ii=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=am(r)}}function im(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?im(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function lm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Ro(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=Ro(t.document)}return n}function Xu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var ex=ca&&"documentMode"in document&&11>=document.documentMode,li=null,Ju=null,ll=null,Iu=!1;function om(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Iu||li==null||li!==Ro(o)||(o=li,"selectionStart"in o&&Xu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ll&&il(ll,o)||(ll=o,o=Ss(Ju,"onSelect"),0>=y,c-=y,Vn=1<<32-Ft(n)+c|r<Ne?(He=ge,ge=null):He=ge.sibling;var Fe=P(B,ge,Z[Ne],X);if(Fe===null){ge===null&&(ge=He);break}t&&ge&&Fe.alternate===null&&n(B,ge),D=f(Fe,D,Ne),Ke===null?we=Fe:Ke.sibling=Fe,Ke=Fe,ge=He}if(Ne===Z.length)return r(B,ge),Qe&&da(B,Ne),we;if(ge===null){for(;NeNe?(He=ge,ge=null):He=ge.sibling;var nr=P(B,ge,Fe.value,X);if(nr===null){ge===null&&(ge=He);break}t&&ge&&nr.alternate=)DELIM" -R"DELIM(==null&&n(B,ge),D=f(nr,D,Ne),Ke===null?we=nr:Ke.sibling=nr,Ke=nr,ge=He}if(Fe.done)return r(B,ge),Qe&&da(B,Ne),we;if(ge===null){for(;!Fe.done;Ne++,Fe=Z.next())Fe=W(B,Fe.value,X),Fe!==null&&(D=f(Fe,D,Ne),Ke===null?we=Fe:Ke.sibling=Fe,Ke=Fe);return Qe&&da(B,Ne),we}for(ge=o(ge);!Fe.done;Ne++,Fe=Z.next())Fe=G(ge,B,Ne,Fe.value,X),Fe!==null&&(t&&Fe.alternate!==null&&ge.delete(Fe.key===null?Ne:Fe.key),D=f(Fe,D,Ne),Ke===null?we=Fe:Ke.sibling=Fe,Ke=Fe);return t&&ge.forEach(function(xS){return n(B,xS)}),Qe&&da(B,Ne),we}function nt(B,D,Z,X){if(typeof Z=="object"&&Z!==null&&Z.type===R&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:e:{for(var we=Z.key;D!==null;){if(D.key===we){if(we=Z.type,we===R){if(D.tag===7){r(B,D.sibling),X=c(D,Z.props.children),X.return=B,B=X;break e}}else if(D.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===K&&kr(we)===D.type){r(B,D.sibling),X=c(D,Z.props),dl(X,Z),X.return=B,B=X;break e}r(B,D);break}else n(B,D);D=D.sibling}Z.type===R?(X=Or(Z.props.children,B.mode,X,Z.key),X.return=B,B=X):(X=Ho(Z.type,Z.key,Z.props,null,B.mode,X),dl(X,Z),X.return=B,B=X)}return y(B);case E:e:{for(we=Z.key;D!==null;){if(D.key===we)if(D.tag===4&&D.stateNode.containerInfo===Z.containerInfo&&D.stateNode.implementation===Z.implementation){r(B,D.sibling),X=c(D,Z.children||[]),X.return=B,B=X;break e}else{r(B,D);break}else n(B,D);D=D.sibling}X=ic(Z,B.mode,X),X.return=B,B=X}return y(B);case K:return Z=kr(Z),nt(B,D,Z,X)}if($(Z))return ve(B,D,Z,X);if(se(Z)){if(we=se(Z),typeof we!="function")throw Error(l(150));return Z=we.call(Z),Re(B,D,Z,X)}if(typeof Z.then=="function")return nt(B,D,Yo(Z),X);if(Z.$$typeof===U)return nt(B,D,Zo(B,Z),X);Go(B,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,D!==null&&D.tag===6?(r(B,D.sibling),X=c(D,Z),X.return=B,B=X):(r(B,D),X=rc(Z,B.mode,X),X.return=B,B=X),y(B)):r(B,D)}return function(B,D,Z,X){try{fl=0;var we=nt(B,D,Z,X);return vi=null,we}catch(ge){if(ge===yi||ge===Qo)throw ge;var Ke=hn(29,ge,null,B.mode);return Ke.lanes=X,Ke.return=B,Ke}}}var Br=Om(!0),Mm=Om(!1),Ua=!1;function vc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gc(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function $a(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Za(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Xe&2)!==0){var c=o.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),o.pending=n,n=Bo(t),mm(t,null,r),n}return Lo(t,o,n,r),Bo(t)}function hl(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,A(t,r)}}function bc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var c=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};f===null?c=f=y:f=f.next=y,r=r.next}while(r!==null);f===null?c=f=n:f=f.next=n}else c=f=n;r={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var xc=!1;function ml(){if(xc){var t=pi;if(t!==null)throw t}}function pl(t,n,r,o){xc=!1;var c=t.updateQueue;Ua=!1;var f=c.firstBaseUpdate,y=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var C=w,q=C.next;C.next=null,y===null?f=q:y.next=q,y=C;var F=t.alternate;F!==null&&(F=F.updateQueue,w=F.lastBaseUpdate,w!==y&&(w===null?F.firstBaseUpdate=q:w.next=q,F.lastBaseUpdate=C))}if(f!==null){var W=c.baseState;y=0,F=q=C=null,w=f;do{var P=w.lane&-536870913,G=P!==w.lane;if(G?(Be&P)===P:(o&P)===P){P!==0&&P===mi&&(xc=!0),F!==null&&(F=F.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ve=t,Re=w;P=n;var nt=r;switch(Re.tag){case 1:if(ve=Re.payload,typeof ve=="function"){W=ve.call(nt,W,P);break e}W=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Re.payload,P=typeof ve=="function"?ve.call(nt,W,P):ve,P==null)break e;W=v({},W,P);break e;case 2:Ua=!0}}P=w.callback,P!==null&&(t.flags|=64,G&&(t.flags|=8192),G=c.callbacks,G===null?c.callbacks=[P]:G.push(P))}else G={lane:P,tag:w.tag,payload:w.payload,callback:w.callback,next:null},F===null?(q=F=G,C=W):F=F.next=G,y|=P;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;G=w,w=G.next,G.next=null,c.lastBaseUpdate=G,c.shared.pending=null}}while(!0);F===null&&(C=W),c.baseState=C,c.firstBaseUpdate=q,c.lastBaseUpdate=F,f===null&&(c.shared.lanes=0),Ga|=y,t.lanes=y,t.memoizedState=W}}function Nm(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function jm(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;tf?f:8;var y=S.T,w={};S.T=w,Uc(t,!1,n,r);try{var C=c(),q=S.S;if(q!==null&&q(w,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var F=ux(C,o);gl(t,n,F,gn(t))}else gl(t,n,o,gn(t))}catch(W){gl(t,n,{then:function(){},status:"rejected",reason:W},gn())}finally{M.p=f,y!==null&&w.types!==null&&(y.types=w.types),S.T=y}}function px(){}function Bc(t,n,r,o){if(t.tag!==5)throw Error(l(476));var c=fp(t).queue;cp(t,c,n,N,r===null?px:function(){return dp(t),r(o)})}function fp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:N},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function dp(t){var n=fp(t);n.next===null&&(n=t.alternate.memoizedState),gl(t,n.next.queue,{},gn())}function Hc(){return qt(kl)}function hp(){return Et().memoizedState}function mp(){return Et().memoizedState}function yx(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=gn();t=$a(r);var o=Za(n,t,r);o!==null&&(sn(o,n,r),hl(o,n,r)),n={cache:hc()},t.payload=n;return}n=n.return}}function vx(t,n,r){var o=gn();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ns(t)?yp(n,r):(r=nc(t,n,r,o),r!==null&&(sn(r,t,o),vp(r,n,o)))}function pp(t,n,r){var o=gn();gl(t,n,r,o)}function gl(t,n,r,o){var c={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ns(t))yp(n,c);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,w=f(y,r);if(c.hasEagerState=!0,c.eagerState=w,dn(w,y))return Lo(t,n,c,0),at===null&&ko(),!1}catch{}if(r=nc(t,n,c,o),r!==null)return sn(r,t,o),vp(r,n,o),!0}return!1}function Uc(t,n,r,o){if(o={lane:2,revertLane:gf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ns(t)){if(n)throw Error(l(479))}else n=nc(t,r,o,2),n!==null&&sn(n,t,2)}function ns(t){var n=t.alternate;return t===Me||n!==null&&n===Me}function yp(t,n){bi=Vo=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function vp(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,A(t,r)}}var bl={readContext:qt,use:Io,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};bl.useEffectEvent=gt;var gp={readContext:qt,use:Io,useCallback:function(t,n){return Jt().memoizedState=[t,n===void 0?null:n],t},useContext:qt,useEffect:tp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,es(4194308,4,ip.bind(null,n,t),r)},useLayoutEffect:function(t,n){return es(4194308,4,t,n)},useInsertionEffect:function(t,n){es(4,2,t,n)},useMemo:function(t,n){var r=Jt();n=n===void 0?null:n;var o=t();if(Hr){Un(!0);try{t()}finally{Un(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=Jt();if(r!==void 0){var c=r(n);if(Hr){Un(!0);try{r(n)}finally{Un(!1)}}}else c=n;return o.memoizedState=o.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},o.queue=t,t=t.dispatch=vx.bind(null,Me,t),[o.memoizedState,t]},useRef:function(t){var n=Jt();return t={current:t},n.memoizedState=t},useState:function(t){t=Nc(t);var n=t.queue,r=pp.bind(null,Me,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:kc,useDeferredValue:function(t,n){var r=Jt();return Lc(r,t,n)},useTransition:function(){var t=Nc(!1);return t=cp.bind(null,Me,t.queue,!0,!1),Jt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Me,c=Jt();if(Qe){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),at===null)throw Error(l(349));(Be&127)!==0||Um(o,n,r)}c.memoizedState=r;var f={value:r,getSnapshot:n};return c.queue=f,tp(Zm.bind(null,o,f,t),[t]),o.flags|=2048,Si(9)DELIM" -R"DELIM(,{destroy:void 0},$m.bind(null,o,f,r,n),null),r},useId:function(){var t=Jt(),n=at.identifierPrefix;if(Qe){var r=Xn,o=Vn;r=(o&~(1<<32-Ft(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Xo++,0<\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?f.multiple=!0:o.size&&(f.size=o.size);break;default:f=typeof o.is=="string"?y.createElement(c,{is:o.is}):y.createElement(c)}}f[de]=n,f[ye]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch(Pt(f,c,o),c){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ga(n)}}return ot(n),Wc(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ga(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=Ee.current,di(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,c=Zt,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}t[de]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||By(t.nodeValue,r)),t||Ba(n,!0)}else t=ws(t).createTextNode(o),t[de]=n,n.stateNode=t}return ot(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=di(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[de]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ot(n),t=!1}else r=uc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(pn(n),n):(pn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return ot(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=di(n),o!==null&&o.dehydrated!==null){if(t===null){if(!c)throw Error(l(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[de]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ot(n),c=!1}else c=uc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(pn(n),n):(pn(n),null)}return pn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),os(n,n.updateQueue),ot(n),null);case 4:return Ae(),t===null&&wf(n.stateNode.containerInfo),ot(n),null;case 10:return ma(n.type),ot(n),null;case 19:if(Q(_t),o=n.memoizedState,o===null)return ot(n),null;if(c=(n.flags&128)!==0,f=o.rendering,f===null)if(c)Sl(o,!1);else{if(bt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(f=Fo(t),f!==null){for(n.flags|=128,Sl(o,!1),t=f.updateQueue,n.updateQueue=t,os(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)pm(r,t),r=r.sibling;return te(_t,_t.current&1|2),Qe&&da(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&St()>ds&&(n.flags|=128,c=!0,Sl(o,!1),n.lanes=4194304)}else{if(!c)if(t=Fo(f),t!==null){if(n.flags|=128,c=!0,t=t.updateQueue,n.updateQueue=t,os(n,t),Sl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!f.alternate&&!Qe)return ot(n),null}else 2*St()-o.renderingStartTime>ds&&r!==536870912&&(n.flags|=128,c=!0,Sl(o,!1),n.lanes=4194304);o.isBackwards?(f.sibling=n.child,n.child=f):(t=o.last,t!==null?t.sibling=f:n.child=f,o.last=f)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=St(),t.sibling=null,r=_t.current,te(_t,c?r&1|2:r&1),Qe&&da(n,o.treeForkCount),t):(ot(n),null);case 22:case 23:return pn(n),wc(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(ot(n),n.subtreeFlags&6&&(n.flags|=8192)):ot(n),r=n.updateQueue,r!==null&&os(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&Q(Dr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ma(zt),ot(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function wx(t,n){switch(oc(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;)DELIM" -R"DELIM(case 3:return ma(zt),Ae(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return it(n),null;case 31:if(n.memoizedState!==null){if(pn(n),n.alternate===null)throw Error(l(340));Mr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Mr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Q(_t),null;case 4:return Ae(),null;case 10:return ma(n.type),null;case 22:case 23:return pn(n),wc(),t!==null&&Q(Dr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ma(zt),null;case 25:return null;default:return null}}function qp(t,n){switch(oc(n),n.tag){case 3:ma(zt),Ae();break;case 26:case 27:case 5:it(n);break;case 4:Ae();break;case 31:n.memoizedState!==null&&pn(n);break;case 13:pn(n);break;case 19:Q(_t);break;case 10:ma(n.type);break;case 22:case 23:pn(n),wc(),t!==null&&Q(Dr);break;case 24:ma(zt)}}function wl(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var c=o.next;r=c;do{if((r.tag&t)===t){o=void 0;var f=r.create,y=r.inst;o=f(),y.destroy=o}r=r.next}while(r!==c)}}catch(w){We(n,n.return,w)}}function Pa(t,n,r){try{var o=n.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var f=c.next;o=f;do{if((o.tag&t)===t){var y=o.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,c=n;var C=r,q=w;try{q()}catch(F){We(c,C,F)}}}o=o.next}while(o!==f)}}catch(F){We(n,n.return,F)}}function Qp(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{jm(n,r)}catch(o){We(t,t.return,o)}}}function Pp(t,n,r){r.props=Ur(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){We(t,n,o)}}function _l(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(c){We(t,n,c)}}function Jn(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(c){We(t,n,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){We(t,n,c)}else r.current=null}function Yp(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(c){We(t,t.return,c)}}function ef(t,n,r){try{var o=t.stateNode;Px(o,t.type,r,n),o[ye]=n}catch(c){We(t,t.return,c)}}function Gp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ja(t.type)||t.tag===4}function tf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gp(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.tag===27&&Ja(t.type)||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 nf(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ua));else if(o!==4&&(o===27&&Ja(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(nf(t,n,r),t=t.sibling;t!==null;)nf(t,n,r),t=t.sibling}function ss(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&Ja(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(ss(t,n,r),t=t.sibling;t!==null;)ss(t,n,r),t=t.sibling}function Kp(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Pt(n,o,r),n[de]=t,n[ye]=r}catch(f){We(t,t.return,f)}}var ba=!1,Ot=!1,af=!1,Fp=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function _x(t,n){if(t=t.containerInfo,Tf=Cs,t=lm(t),Xu(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var c=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var y=0,w=-1,C=-1,q=0,F=0,W=t,P=null;t:for(;;){for(var G;W!==r||c!==0&&W.nodeType!==3||(w=y+c),W!==f||o!==0&&W.nodeType!==3||(C=y+o),W.nodeType===3&&(y+=W.nodeValue.length),(G=W.firstChild)!==null;)P=W,W=G;for(;;){if(W===t)break t;if(P===r&&++q===c&&(w=y),P===f&&++F===o&&(C=y),(G=W.nextSibling)!==null)break;W=P,P=W.parentNode}W=G}r=w===-1||C===-1?null:{start:w,end:C}}else r=null}r=r||{start:0,end:0}}else r=null;for(Rf={focusedElem:t,selectionRange:r},Cs=!1,Ht=n;Ht!==null;)if(n=Ht,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Ht=t;else for(;Ht!==null;){switch(n=Ht,f=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Pt(f,o,r),f[de]=t,ut(f),o=f;break e;case"link":var y=ev("link","href",c).get(o+(r.href||""));if(y){for(var w=0;wnt&&(y=nt,nt=Re,Re=y);var B=rm(w,Re),D=rm(w,nt);if(B&&D&&(G.rangeCount!==1||G.anchorNode!==B.node||G.anchorOffset!==B.offset||G.focusNode!==D.node||G.focusOffset!==D.offset)){var Z=W.createRange();Z.setStart(B.node,B.offset),G.removeAllRanges(),Re>nt?(G.addRange(Z),G.extend(D.node,D.offset)):(Z.setEnd(D.node,D.offset),G.addRange(Z))}}}}for(W=[],G=w;G=G.parentNode;)G.nodeType===1&&W.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;wr?32:r,S.T=null,r=ff,ff=null;var f=Fa,y=Ea;if(Dt=0,Ri=Fa=null,Ea=0,(Xe&6)!==0)throw Error(l(331));var w=Xe;if(Xe|=4,iy(f.current),ny(f,f.current,y,r),Xe=w,Cl(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(gr,f)}catch{}return!0}finally{M.p=c,S.T=o,_y(t,n)}}function Ty(t,n,r){n=Tn(r,n),n=Qc(t.stateNode,n,2),t=Za(t,n,2),t!==null&&(ja(t,2),In(t))}function We(t,n,r){if(t.tag===3)Ty(t,t,r);else for(;n!==null;){if(n.tag===3){Ty(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&()DELIM" -R"DELIM(Ka===null||!Ka.has(o))){t=Tn(r,t),r=Rp(2),o=Za(n,r,2),o!==null&&(zp(r,o,n,t),ja(o,2),In(o));break}}n=n.return}}function pf(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new Rx;var c=new Set;o.set(n,c)}else c=o.get(n),c===void 0&&(c=new Set,o.set(n,c));c.has(r)||(of=!0,c.add(r),t=Mx.bind(null,t,n,r),n.then(t,t))}function Mx(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,at===t&&(Be&r)===r&&(bt===4||bt===3&&(Be&62914560)===Be&&300>St()-fs?(Xe&2)===0&&zi(t,0):sf|=r,Ti===Be&&(Ti=0)),In(t)}function Ry(t,n){n===0&&(n=wr()),t=Cr(t,n),t!==null&&(ja(t,n),In(t))}function Nx(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),Ry(t,r)}function jx(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,c=t.memoizedState;c!==null&&(r=c.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),Ry(t,r)}function Dx(t,n){return yr(t,n)}var gs=null,Ci=null,yf=!1,bs=!1,vf=!1,Xa=0;function In(t){t!==Ci&&t.next===null&&(Ci===null?gs=Ci=t:Ci=Ci.next=t),bs=!0,yf||(yf=!0,Lx())}function Cl(t,n){if(!vf&&bs){vf=!0;do for(var r=!1,o=gs;o!==null;){if(t!==0){var c=o.pendingLanes;if(c===0)var f=0;else{var y=o.suspendedLanes,w=o.pingedLanes;f=(1<<31-Ft(42|t)+1)-1,f&=c&~(y&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,Oy(o,f))}else f=Be,f=xr(o,o===at?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||Sr(o,f)||(r=!0,Oy(o,f));o=o.next}while(r);vf=!1}}function kx(){zy()}function zy(){bs=yf=!1;var t=0;Xa!==0&&Gx()&&(t=Xa);for(var n=St(),r=null,o=gs;o!==null;){var c=o.next,f=Ay(o,n);f===0?(o.next=null,r===null?gs=c:r.next=c,c===null&&(Ci=r)):(r=o,(t!==0||(f&3)!==0)&&(bs=!0)),o=c}Dt!==0&&Dt!==5||Cl(t),Xa!==0&&(Xa=0)}function Ay(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,c=t.expirationTimes,f=t.pendingLanes&-62914561;0w)break;var F=C.transferSize,W=C.initiatorType;F&&Hy(W)&&(C=C.responseEnd,y+=F*(C"u"?null:document;function Xy(t,n,r){var o=Oi;if(o&&typeof n=="string"&&n){var c=_n(n);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Vy.has(c)||(Vy.add(c),t={rel:t,crossOrigin:r,href:n},o.querySelector(c)===null&&(n=o.createElement("link"),Pt(n,"link",t),ut(n),o.head.appendChild(n)))}}function tS(t){Ta.D(t),Xy("dns-prefetch",t,null)}function nS(t,n){Ta.C(t,n),Xy("preconnect",t,n)}function aS(t,n,r){Ta.L(t,n,r);var o=Oi;if(o&&t&&n){var c='link[rel="preload"][as="'+_n(n)+'"]';n==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+_n(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+_n(r.imageSizes)+'"]')):c+='[href="'+_n(t)+'"]';var f=c;switch(n){case"style":f=Mi(t);break;case"script":f=Ni(t)}Mn.has(f)||(t=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Mn.set(f,t),o.querySelector(c)!==null||n==="style"&&o.querySelector(jl(f))||n==="script"&&o.querySelector(Dl(f))||(n=o.createElement("link"),Pt(n,"link",t),ut(n),o.head.appendChild(n)))}}function rS(t,n){Ta.m(t,n);var r=Oi;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+_n(o)+'"][href="'+_n(t)+'"]',f=c;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker)DELIM" -R"DELIM(":case"worker":case"script":f=Ni(t)}if(!Mn.has(f)&&(t=v({rel:"modulepreload",href:t},n),Mn.set(f,t),r.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Dl(f)))return}o=r.createElement("link"),Pt(o,"link",t),ut(o),r.head.appendChild(o)}}}function iS(t,n,r){Ta.S(t,n,r);var o=Oi;if(o&&t){var c=tn(o).hoistableStyles,f=Mi(t);n=n||"default";var y=c.get(f);if(!y){var w={loading:0,preload:null};if(y=o.querySelector(jl(f)))w.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Mn.get(f))&&jf(t,r);var C=y=o.createElement("link");ut(C),Pt(C,"link",t),C._p=new Promise(function(q,F){C.onload=q,C.onerror=F}),C.addEventListener("load",function(){w.loading|=1}),C.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Es(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:w},c.set(f,y)}}}function lS(t,n){Ta.X(t,n);var r=Oi;if(r&&t){var o=tn(r).hoistableScripts,c=Ni(t),f=o.get(c);f||(f=r.querySelector(Dl(c)),f||(t=v({src:t,async:!0},n),(n=Mn.get(c))&&Df(t,n),f=r.createElement("script"),ut(f),Pt(f,"link",t),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(c,f))}}function oS(t,n){Ta.M(t,n);var r=Oi;if(r&&t){var o=tn(r).hoistableScripts,c=Ni(t),f=o.get(c);f||(f=r.querySelector(Dl(c)),f||(t=v({src:t,async:!0,type:"module"},n),(n=Mn.get(c))&&Df(t,n),f=r.createElement("script"),ut(f),Pt(f,"link",t),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(c,f))}}function Jy(t,n,r,o){var c=(c=Ee.current)?_s(c):null;if(!c)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Mi(r.href),r=tn(c).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Mi(r.href);var f=tn(c).hoistableStyles,y=f.get(t);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,y),(f=c.querySelector(jl(t)))&&!f._p&&(y.instance=f,y.state.loading=5),Mn.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Mn.set(t,r),f||sS(c,t,r,y.state))),n&&o===null)throw Error(l(528,""));return y}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ni(r),r=tn(c).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Mi(t){return'href="'+_n(t)+'"'}function jl(t){return'link[rel="stylesheet"]['+t+"]"}function Iy(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function sS(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Pt(n,"link",r),ut(n),t.head.appendChild(n))}function Ni(t){return'[src="'+_n(t)+'"]'}function Dl(t){return"script[async]"+t}function Wy(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+_n(r.href)+'"]');if(o)return n.instance=o,ut(o),o;var c=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),ut(o),Pt(o,"style",c),Es(o,r.precedence,t),n.instance=o;case"stylesheet":c=Mi(r.href);var f=t.querySelector(jl(c));if(f)return n.state.loading|=4,n.instance=f,ut(f),f;o=Iy(r),(c=Mn.get(c))&&jf(o,c),f=(t.ownerDocument||t).createElement("link"),ut(f);var y=f;return y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Pt(f,"link",o),n.state.loading|=4,Es(f,r.precedence,t),n.instance=f;case"script":return f=Ni(r.src),(c=t.querySelector(Dl(f)))?(n.instance=c,ut(c),c):(o=r,(c=Mn.get(f))&&(o=v({},r),Df(o,c)),t=t.ownerDocument||t,c=t.createElement("script"),ut(c),Pt(c,"link",o),t.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Es(o,r.precedence,t));return n.instance}function Es(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,f=c,y=0;y title"):null)}function uS(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function nv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function cS(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Mi(o.href),f=n.querySelector(jl(c));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Rs.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=f,ut(f);return}f=n.ownerDocument||n,o=Iy(o),(c=Mn.get(c))&&jf(o,c),f=f.createElement("link"),ut(f);var y=f;y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Pt(f,"link",o),r.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Rs.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var kf=0;function fS(t,n){return t.stylesheets&&t.count===0&&As(t,t.stylesheets),0kf?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(c)}}:null}function Rs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)As(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var zs=null;function As(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,zs=new Map,n.forEach(dS,t),zs=null,Rs.call(t))}function dS(t,n){if(!(n.state.loading&4)){var r=zs.get(t);if(r)var o=r.get(null);else{r=new Map,zs.set(t,r);for(var c=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Pf.exports=CS(),Pf.exports}var MS=OS();const NS=uo(MS);var fo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},jS={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},DS=class{#e=jS;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,a){return this.#e.setTimeout(e,a)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,a){return this.#e.setInterval(e,a)}clearInterval(e){this.#e.clearInterval(e)}},Qr=new DS;function kS(e){setTimeout(e,0)}var Kr=typeof window>"u"||"Deno"in globalThis;function un(){}function LS(e,a){)DELIM" -R"DELIM(return typeof e=="function"?e(a):e}function Rd(e){return typeof e=="number"&&e>=0&&e!==1/0}function v0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function cr(e,a){return typeof e=="function"?e(a):e}function Dn(e,a){return typeof e=="function"?e(a):e}function Rv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:d,stale:h}=e;if(d){if(l){if(a.queryHash!==Fd(d,a.options))return!1}else if(!to(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||s&&s!==a.state.fetchStatus||u&&!u(a))}function zv(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(eo(a.options.mutationKey)!==eo(u))return!1}else if(!to(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function Fd(e,a){return(a?.queryKeyHashFn||eo)(e)}function eo(e){return JSON.stringify(e,(a,i)=>Ad(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function to(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>to(e[i],a[i])):!1}var BS=Object.prototype.hasOwnProperty;function g0(e,a){if(e===a)return e;const i=Av(e)&&Av(a);if(!i&&!(Ad(e)&&Ad(a)))return a;const s=(i?e:Object.keys(e)).length,u=i?a:Object.keys(a),d=u.length,h=i?new Array(d):{};let p=0;for(let m=0;m{Qr.setTimeout(a,e)})}function Cd(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?g0(e,a):a}function US(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function $S(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var Vd=Symbol();function b0(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Vd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ZS(e,a){return typeof e=="function"?e(...a):!!e}var qS=class extends fo{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Kr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Xd=new qS;function Od(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var QS=kS;function PS(){let e=[],a=0,i=h=>{h()},l=h=>{h()},s=QS;const u=h=>{a?e.push(h):s(()=>{i(h)})},d=()=>{const h=e;e=[],h.length&&s(()=>{l(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{l=h},setScheduler:h=>{s=h}}}var Gt=PS(),YS=class extends fo{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Kr&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},ou=new YS;function GS(e){return Math.min(1e3*2**e,3e4)}function x0(e){return(e??"online")==="online"?ou.isOnline():!0}var Md=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function S0(e){let a=!1,i=0,l;const s=Od(),u=()=>s.status!=="pending",d=R=>{if(!u()){const k=new Md(R);x(k),e.onCancel?.(k)}},h=()=>{a=!0},p=())DELIM" -R"DELIM(=>{a=!1},m=()=>Xd.isFocused()&&(e.networkMode==="always"||ou.isOnline())&&e.canRun(),g=()=>x0(e.networkMode)&&e.canRun(),v=R=>{u()||(l?.(),s.resolve(R))},x=R=>{u()||(l?.(),s.reject(R))},_=()=>new Promise(R=>{l=k=>{(u()||m())&&R(k)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),E=()=>{if(u())return;let R;const k=i===0?e.initialPromise:void 0;try{R=k??e.fn()}catch(j){R=Promise.reject(j)}Promise.resolve(R).then(v).catch(j=>{if(u())return;const L=e.retry??(Kr?0:3),U=e.retryDelay??GS,J=typeof U=="function"?U(i,j):U,I=L===!0||typeof L=="number"&&im()?void 0:_()).then(()=>{a?x(j):E()})})};return{promise:s,status:()=>s.status,cancel:d,continue:()=>(l?.(),s),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?E():_().then(E),s)}}var w0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rd(this.gcTime)&&(this.#e=Qr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Qr.clearTimeout(this.#e),this.#e=void 0)}},KS=class extends w0{#e;#t;#n;#r;#a;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Mv(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Mv(this.options);a.data!==void 0&&(this.setState(Ov(a.data,a.dataUpdatedAt)),this.#e=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=Cd(this.state.data,e,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#a?.promise;return this.#a?.cancel(e),a?a.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Dn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>cr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!v0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#a&&(this.#l?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,l=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},s=()=>{const h=b0(this.options,a),m=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return l(g),g})();return this.#l=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:s};return l(h),h})();this.options.behavior?.onFetch(d,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=S0({initialPromise:a?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof Md&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.opti)DELIM" -R"DELIM(ons.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Md){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,..._0(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...Ov(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Gt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function _0(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:x0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ov(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Mv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var FS=class extends fo{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#l=Od(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#o;#l;#i;#p;#d;#h;#u;#c;#s;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Nv(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!zd(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&jv(this.#t,i,this.options,a)&&this.#f(),this.updateResult(),l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||cr(this.options.staleTime,this.#t)!==cr(a.staleTime,this.#t))&&this.#y();const s=this.#v();l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||s!==this.#s)&&this.#g(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return XS(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(un)),a}#y(){this.#x();const e=cr(this.options.staleTime,this.#t);if(Kr||this.#r.isStale||!Rd(e))return;const i=v0(this.#r.dataUpdatedAt,e)+1;this.#u=Qr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInte)DELIM" -R"DELIM(rval(this.#t):this.options.refetchInterval)??!1}#g(e){this.#S(),this.#s=e,!(Kr||Dn(this.options.enabled,this.#t)===!1||!Rd(this.#s)||this.#s===0)&&(this.#c=Qr.setInterval(()=>{(this.options.refetchIntervalInBackground||Xd.isFocused())&&this.#f()},this.#s))}#b(){this.#y(),this.#g(this.#v())}#x(){this.#u&&(Qr.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(Qr.clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#r,u=this.#a,d=this.#o,p=e!==i?e.state:this.#n,{state:m}=e;let g={...m},v=!1,x;if(a._optimisticResults){const K=this.hasListeners(),me=!K&&Nv(e,a),re=K&&jv(e,i,a,l);(me||re)&&(g={...g,..._0(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:_,errorUpdatedAt:E,status:R}=g;x=g.data;let k=!1;if(a.placeholderData!==void 0&&x===void 0&&R==="pending"){let K;s?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(K=s.data,k=!0):K=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,K!==void 0&&(R="success",x=Cd(s?.data,K,a),v=!0)}if(a.select&&x!==void 0&&!k)if(s&&x===u?.data&&a.select===this.#p)x=this.#d;else try{this.#p=a.select,x=a.select(x),x=Cd(s?.data,x,a),this.#d=x,this.#i=null}catch(K){this.#i=K}this.#i&&(_=this.#i,x=this.#d,E=Date.now(),R="error");const j=g.fetchStatus==="fetching",L=R==="pending",U=R==="error",J=L&&j,I=x!==void 0,O={status:R,fetchStatus:g.fetchStatus,isPending:L,isSuccess:R==="success",isError:U,isInitialLoading:J,isLoading:J,data:x,dataUpdatedAt:g.dataUpdatedAt,error:_,errorUpdatedAt:E,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:j,isRefetching:j&&!L,isLoadingError:U&&!I,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:U&&I,isStale:Jd(e,a),refetch:this.refetch,promise:this.#l,isEnabled:Dn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const K=ne=>{O.status==="error"?ne.reject(O.error):O.data!==void 0&&ne.resolve(O.data)},me=()=>{const ne=this.#l=O.promise=Od();K(ne)},re=this.#l;switch(re.status){case"pending":e.queryHash===i.queryHash&&K(re);break;case"fulfilled":(O.status==="error"||O.data!==re.value)&&me();break;case"rejected":(O.status!=="error"||O.error!==re.reason)&&me();break}}return O}updateResult(){const e=this.#r,a=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),zd(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#m.size)return!0;const u=new Set(s??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const h=d;return this.#r[h]!==e[h]&&u.has(h)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Gt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function VS(e,a){return Dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function Nv(e,a){return VS(e,a)||e.state.data!==void 0&&Nd(e,a,a.refetchOnMount)}function Nd(e,a,i){if(Dn(a.enabled,e)!==!1&&cr(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&Jd(e,a)}return!1}function jv(e,a,i,l){return(e!==a||Dn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Jd(e,i)}function Jd(e,a){return Dn(a.enabled,e)!==!1&&e.isStaleByTime(cr(a.staleTime,e))}function XS(e,a){return!zd(e.getCurrentResult(),a)}function Dv(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const v=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(a.signal.aborted?g=!0:a.signal.addEventListener("abort",()=>{g=!0}),a.signal)})},x=b0(a.options,a.fetchOptions),_=async(E,R,k)=>{if(g)return Promise.reject();if(R==null&&E.pages.length)return Promise.resolve(E);const L=(()=>{const ce={client:a.client,queryKey:a.queryKey,pageParam:R,direction:k?"backward":"forward",meta:a.options.meta};return v(ce),ce})(),U=await x(L),{maxPages:J}=a.options,I=k?$S:US;return{pages:I(E.pages,U,J),pageParams:I(E.pageParams,R,J)}};if(s&&u.length){const E=s==="backward",R=E?JS:kv,k={pages:u,pageParams:d},j=R(l,k);h=await _(k,j,E)}else{const E=e??u.length;do{const R=p===0?d[0]??l.initialPageParam:kv(l,h);if(p>0&&R==null)break;h=await _(h,R),p++}while(pa.options)DELIM" -R"DELIM(.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function kv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function JS(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var IS=class extends w0{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||WS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=S0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#a({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#r.canStart();try{if(l)a();else{this.#a({type:"pending",variables:e,isPaused:s}),await this.#n.config.onMutate?.(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:s})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#a({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,i),await this.options.onError?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,u,e,this.state.context,i),u}finally{this.#a({type:"error",error:u})}}finally{this.#n.runNext(this)}}#a(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Gt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function WS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ew=class extends fo{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new IS({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=Ls(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=Ls(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Ls(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=Ls(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Gt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>zv(a,i))}findAll(e={}){return this.getAll().filter(a=>zv(e,a))}notify(e){Gt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Gt.batch(()=>Promise.all(e.map(a=>a.continue().catch(un))))}};function Ls(e){return e.options.scope?.id}var tw=class extends fo{constructor(e=)DELIM" -R"DELIM({}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??Fd(l,a);let u=this.get(s);return u||(u=new KS({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Gt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>Rv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>Rv(e,i)):a}notify(e){Gt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nw=class{#e;#t;#n;#r;#a;#o;#l;#i;constructor(e={}){this.#e=e.queryCache||new tw,this.#t=e.mutationCache||new ew,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#l=Xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=ou.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#l?.(),this.#l=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#e.build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(cr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,d=LS(a,u);if(d!==void 0)return this.#e.build(this,l).setData(d,{...i,manual:!0})}setQueriesData(e,a,i){return Gt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Gt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Gt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Gt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(un).catch(un)}invalidateQueries(e,a={}){return Gt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Gt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(un)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(l).then(un)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(cr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=Dv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=Dv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ou.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#r.set(eo(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(l=>{to(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(eo(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{to(e,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Fd(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Vd&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.m)DELIM" -R"DELIM(utationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},E0=z.createContext(void 0),bu=e=>{const a=z.useContext(E0);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},aw=({client:e,children:a})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(E0.Provider,{value:e,children:a})),T0=z.createContext(!1),rw=()=>z.useContext(T0);T0.Provider;function iw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var lw=z.createContext(iw()),ow=()=>z.useContext(lw),sw=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},uw=e=>{z.useEffect(()=>{e.clearReset()},[e])},cw=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||ZS(i,[e.error,l])),fw=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},dw=(e,a)=>e.isLoading&&e.isFetching&&!a,hw=(e,a)=>e?.suspense&&a.isPending,Lv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function mw(e,a,i){const l=rw(),s=ow(),u=bu(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=l?"isRestoring":"optimistic",fw(d),sw(d,s),uw(s);const h=!u.getQueryCache().get(d.queryHash),[p]=z.useState(()=>new a(u,d)),m=p.getOptimisticResult(d),g=!l&&e.subscribed!==!1;if(z.useSyncExternalStore(z.useCallback(v=>{const x=g?p.subscribe(Gt.batchCalls(v)):un;return p.updateResult(),x},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),z.useEffect(()=>{p.setOptions(d)},[d,p]),hw(d,m))throw Lv(d,p,s);if(cw({result:m,errorResetBoundary:s,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Kr&&dw(m,l)&&(h?Lv(d,p,s):u.getQueryCache().get(d.queryHash)?.promise)?.catch(un).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function Sn(e,a){return mw(e,FS)}const pw="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Bv=(e=21)=>{let a="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)a+=pw[i[e]&63];return a};var Xs={exports:{}},yw=Xs.exports,Hv;function vw(){return Hv||(Hv=1,(function(e,a){(function(i,l){e.exports=l()})(yw,(function(){var i=1e3,l=6e4,s=36e5,u="millisecond",d="second",h="minute",p="hour",m="day",g="week",v="month",x="quarter",_="year",E="date",R="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,L={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(oe){var $=["th","st","nd","rd"],S=oe%100;return"["+oe+($[(S-20)%10]||$[S]||$[0])+"]"}},U=function(oe,$,S){var M=String(oe);return!M||M.length>=$?oe:""+Array($+1-M.length).join(S)+oe},J={s:U,z:function(oe){var $=-oe.utcOffset(),S=Math.abs($),M=Math.floor(S/60),N=S%60;return($<=0?"+":"-")+U(M,2,"0")+":"+U(N,2,"0")},m:function oe($,S){if($.date()1)return oe(ae[0])}else{var T=$.name;ce[T]=$,N=T}return!M&&N&&(I=N),N||!M&&I},re=function(oe,$){if(K(oe))return oe.clone();var S=typeof $=="object"?$:{};return S.date=oe,S.args=arguments,new se(S)},ne=J;ne.l=me,ne.i=K,ne.w=function(oe,$){return re(oe,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var se=(function(){function oe(S){this.$L=me(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[O]=!0}var $=oe.prototype;return $.parse=function(S){this.$d=(function(M){var N=M.date,V=M.utc;if(N===null)return new Date(NaN);if(ne.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var ae=N.match(k);if(ae){var T=ae[2]-1||0,Q=(ae[7]||"0").substring(0,3);return V?new Date(Date.UTC(ae[1],T,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,Q)):new Date(ae[1],T,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,Q)}}return new Date(N)})(S),this.init()},$.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S)DELIM" -R"DELIM(.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},$.$utils=function(){return ne},$.isValid=function(){return this.$d.toString()!==R},$.isSame=function(S,M){var N=re(S);return this.startOf(M)<=N&&N<=this.endOf(M)},$.isAfter=function(S,M){return re(S)-1&&S%1==0&&S0?M[L(0,N-1)]:void 0}function ce(S){return me(S)&&g.call(S,"callee")&&(!x.call(S,"callee")||v.call(S)==a)}var O=Array.isArray;function K(S){return S!=null&&ne(S.length)&&!re(S)}function me(S){return ze(S)&&K(S)}function re(S){var M=se(S)?v.call(S):"";return M==i||M==l}function ne(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=e}function se(S){var M=typeof S;return!!S&&(M=="object"||M=="function")}function ze(S){return!!S&&typeof S=="object"}function oe(S){return K(S)?k(S):j(S)}function $(S){return S?h(S,oe(S)):[]}return Ff=I,Ff}var xw=bw();const Sw=uo(xw);function Aa(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const d=i.slice(0,l);if(["bc","tb","bcrt","ltc","sb"].includes(d)){const h=i.slice(l+1);if(!h)return;const p=h.charAt(0);return p==="p"?"p2tr":p==="q"?h.length===39||h.length===40||e.length===42?"p2wpkh":h.length===59||h.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const s=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(a)&&a.length>=26&&a.length<=35;switch(i[0]){case"1":case"m":case"n":return s?"p2pkh":void 0;case"3":case"2":return s?"p2sh":void 0;default:return}}const Kl=new Set;let Vf=0;function $v(e){for(const a of Kl)a(e)}const z0=R0().subtract(2,"hour").unix(),sr=Array.from({length:20}).map((e,a)=>{const i=`mock-tx-${a.toString().padStart(4,"0")}`,l=[{index:0,address:`bcrt1qmock${String(a)}`,valueSats:1e6+a*1234,scriptType:"p2wpkh",spent:!1,script:{hex:`0014mockoutput${String(a)}`,mnemonic:"OP_0 mock-output-pubkey"}}];return{txid:i,hash:i,status:"confirmed",confirmations:10-Math.floor(a/2),blockHeight:8e5-a,blockHash:`mock-block-${String(Math.floor(a/2))}`,receivedTime:z0+a*60,feeSats:250+a,feeRate:12+a*.1,size:225+a,weight:900+a*4,version:2,locktime:0,totalInput:1005e3,totalOutput:l.reduce((s,u)=>s+u.valueSats,0),inputs:[{index:0,prevTxId:`mock-prev-${String(a)}`,prevOutputIndex:0,address:`bcrt1qprev${String(a)}`,valueSats:1005e3,scriptType:"p2wpkh",script:{hex:`160014mockinputscriptsig${String(a)}`,mnemonic:"OP_PUSHBYTES_22 mock-input-scriptsig"},witness:["3045022100cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafe","02deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbe"],sequence:4294967293}],outputs:l}}),za=[];for(let e=0;e<6;e+=1){const a=8e5+e,i=`mock-block-${String(a)}`,l=sr.slice(e*3,e*3+3);za.push({hash:i,height:a,timestamp:z0+e*600,txCount:l.length,size:12e5,weight:4e6,difficulty:5e10,previousBlockHash:e===0?null:za[e-1]?.hash,merkleRoot:`mock-merkle-${String(e)}`,nonce:1e3+e,bits:486604799,version:2,nextBlockHash:null,transactions:l}),e>0&&(za[e-1].nextBlockHash=i)}const ww={bcrt1qmock0:{address:"bcrt1qmock0",addressType:Aa("bcrt1qmock0"),balance:2345678,totalReceived:5e6,totalSent:2654322,txCount:5,utxoCount:3,transactions:sr.slice(0,5).map(e=>({txid:e.txid,timestamp:e.receivedTime,valueChange:e.outputs[0]?.valueSats??0,blockHeight:e.blockHeight}))}};function Bs(e){if(e==="latest"){const i=za.at(-1);if(!i)throw new Error("No blocks available");return i}const a=za.find(i=>i.hash===e||i.height.toString()===e);if(!a)throw new Error("Block not found");return a}function Id(e){return ww[e]??{address:e,addressType:Aa(e),balance:0,totalReceived:0,totalSent:0,txCount:0,utxoCount:0,transactions:[]}}function _w(e){const{transactions:a,...i}=Id(e);return i}function Ew(e,a){const i=Id(e),l=10,s=a?i.transactions.findIndex(u=>u.txid===a)+1:0;return s<=0&&a?[]:i.transactions.slice(s,s+l)}function Xf(){return{metadata:{id:"mock",label:"Mock data (offline)",type:"mock",connectionState:"connected",supportsWebsocket:!0,endpoint:"offline",description:"Generates synthetic blockchain data for development."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},getLatestBlocks(e=10){const a=[...za].reverse().slice(0,e).map(i=>({hash:i.hash,height:i.height,timestamp:i.timestamp,txCount:i.txCount,size:i.size,weight:i.weight,difficulty:i.difficulty,previousBlockHash:i.previousBlockHash}));return Promise.resolve(a)},getBlockHeader(e){const{transactions:a,...i}=Bs(e);return Promise.resolve(i)},getBlockStats(e){const a=Bs(e)DELIM" -R"DELIM();return Promise.resolve({weight:a.weight,feesSats:a.feesSats,subsidySats:a.subsidySats,sigops:a.sigops})},getBlock(e){return Promise.resolve(Bs(e))},getBlocksBefore(e,a=10){const i=za.filter(l=>l.height<=e).reverse().slice(0,a).map(l=>({hash:l.hash,height:l.height,timestamp:l.timestamp,txCount:l.txCount,size:l.size,weight:l.weight,difficulty:l.difficulty,previousBlockHash:l.previousBlockHash}));return Promise.resolve(i)},getBlockTransactions(e,a=0){const i=Bs(e);return Promise.resolve(i.transactions.slice(a,a+25))},getTransactionHeader(e){const a=sr.find(i=>i.txid===e||i.hash===e);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getTransaction(e){const a=sr.find(i=>i.txid===e||i.hash===e);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getTransactionInputScriptHex(e,a){const i=sr.find(s=>s.txid===e||s.hash===e);if(!i)return Promise.reject(new Error("Transaction not found"));const l=i.inputs[a]?.script?.hex;return typeof l!="string"?Promise.reject(new Error("Input script hex not found")):Promise.resolve(l)},getTransactionOutputScriptHex(e,a){const i=sr.find(s=>s.txid===e||s.hash===e);if(!i)return Promise.reject(new Error("Transaction not found"));const l=i.outputs[a]?.script?.hex;return typeof l!="string"?Promise.reject(new Error("Output script hex not found")):Promise.resolve(l)},getAddressSummary(e){return Promise.resolve(_w(e))},getAddress(e){return Promise.resolve(Id(e))},getAddressTransactions(e,a){return Promise.resolve(Ew(e,a))},subscribeToEvents(e){return Kl.add(e),Kl.size===1&&Tw(),()=>{Kl.delete(e),Kl.size===0&&Rw()}}}}let Jl=null;function Tw(){Jl||(Jl=setInterval(()=>{const e=Aw();za.push(e),$v({type:"block.new",payload:zw(e)});const a=Sw(sr);a&&$v({type:"tx.new",payload:a})},15e3))}function Rw(){Jl&&(clearInterval(Jl),Jl=null)}function zw(e){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:e.txCount,size:e.size,weight:e.weight,difficulty:e.difficulty,previousBlockHash:e.previousBlockHash}}function Aw(){Vf+=1;const e=za.at(-1);if(!e)throw new Error("No blocks available");const a=e.height+1,i=`mock-block-${String(a)}-${Bv(6)}`,l=R0().unix(),s=sr.slice(0,2).map(d=>({...d,blockHash:i,blockHeight:a})),u={hash:i,height:a,timestamp:l,txCount:s.length,size:12e5+Vf*1e3,weight:4e6,difficulty:5e10,previousBlockHash:e.hash,merkleRoot:`mock-merkle-${Bv(10)}`,nonce:1e3+Vf,bits:486604799,version:2,nextBlockHash:null,transactions:s};return e.nextBlockHash=i,u}function ee(e,a,i){function l(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),a(h,p);const m=d.prototype,g=Object.keys(m);for(let v=0;vi?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class qi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class A0 extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const C0={};function Fr(e){return C0}function O0(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function jd(e,a){return typeof a=="bigint"?a.toString():a}function Wd(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function eh(e){return e==null}function th(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function Cw(e,a){const i=(e.toString().split(".")[1]||"").length,l=a.toString();let s=(l.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(l)){const p=l.match(/\d?e-(\d?)/);p?.[1]&&(s=Number.parseInt(p[1]))}const u=i>s?i:s,d=Number.parseInt(e.toFixed(u).replace(".","")),h=Number.parseInt(a.toFixed(u).replace(".",""));return d%h/10**u}const Zv=Symbol("evaluating");function rt(e,a,i){let l;Object.defineProperty(e,a,{get(){if(l!==Zv)return l===void 0&&(l=Zv,l=i()),l},set(s){Object.defineProperty(e,a,{value:s})},configurable:!0})}function Xr(e,a,i){Object.defineProperty(e,a,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Jr(...e){const a={};for(const i of e){const l=Object.getOwnPropertyDescriptors(i);Object.assign(a,l)}return Object.defineProperties({},a)}function qv(e){return JSON.stringify(e)}function Ow(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const M0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function su(e){return typeof e=="object"&&e!==null&&!Arra)DELIM" -R"DELIM(y.isArray(e)}const Mw=Wd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function no(e){if(su(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(su(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function N0(e){return no(e)?{...e}:Array.isArray(e)?[...e]:e}const Nw=new Set(["string","number","symbol"]);function xu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hr(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function _e(e){const a=e;if(!a)return{};if(typeof a=="string")return{error:()=>a};if(a?.message!==void 0){if(a?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function jw(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const Dw={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function kw(e,a){const i=e._zod.def,l=Jr(e._zod.def,{get shape(){const s={};for(const u in a){if(!(u in i.shape))throw new Error(`Unrecognized key: "${u}"`);a[u]&&(s[u]=i.shape[u])}return Xr(this,"shape",s),s},checks:[]});return hr(e,l)}function Lw(e,a){const i=e._zod.def,l=Jr(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const u in a){if(!(u in i.shape))throw new Error(`Unrecognized key: "${u}"`);a[u]&&delete s[u]}return Xr(this,"shape",s),s},checks:[]});return hr(e,l)}function Bw(e,a){if(!no(a))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const s=Jr(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return Xr(this,"shape",u),u},checks:[]});return hr(e,s)}function Hw(e,a){if(!no(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i={...e._zod.def,get shape(){const l={...e._zod.def.shape,...a};return Xr(this,"shape",l),l},checks:e._zod.def.checks};return hr(e,i)}function Uw(e,a){const i=Jr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return Xr(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:[]});return hr(e,i)}function $w(e,a,i){const l=Jr(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const d in i){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(u[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(const d in s)u[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return Xr(this,"shape",u),u},checks:[]});return hr(a,l)}function Zw(e,a,i){const l=Jr(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const d in i){if(!(d in u))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(u[d]=new e({type:"nonoptional",innerType:s[d]}))}else for(const d in s)u[d]=new e({type:"nonoptional",innerType:s[d]});return Xr(this,"shape",u),u},checks:[]});return hr(a,l)}function $i(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function Hs(e){return typeof e=="string"?e:e?.message}function Vr(e,a,i){const l={...e,path:e.path??[]};if(!e.message){const s=Hs(e.inst?._zod.def?.error?.(e))??Hs(a?.error?.(e))??Hs(i.customError?.(e))??Hs(i.localeError?.(e))??"Invalid input";l.message=s}return delete l.inst,delete l.continue,a?.reportInput||delete l.input,l}function nh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ao(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const D0=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,jd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},k0=ee("$ZodError",D0),L0=ee("$ZodError",D0,{Parent:Error});function qw(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function Qw(e,a=i=>i.message){const i={_errors:[]},l=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>l({issues:d}));else if(u.code==="invalid_key")l({issues:u.issues});else if(u.code==="invalid_element")l({issues:u.issues});else if(u.path.length===0)i._errors.push(a(u));else{let d=i,h=0;for(;h(a,i,l,s)=>{const u=l?Object.assign(l,{async:!1}):{async:!1},d=a._zod.run({value:i,issues:[]},u);if(d instanceof Promise)throw new qi;if(d.issues.length){const h=new(s?.Err??e)(d.issues.map(p=>Vr(p,u,Fr())));throw M0(h,s?.callee),h}return d.value},rh=e=>async(a,i,l,s)=>{const u=l?Object.assign(l,{async:!0}):{async:!0};let d=a._zod.run({value:i,issues:[]},u);if(d instanceof Promise&&(d=await d),d.issues.length){const h=new(s?.Err??e)(d.issues.map(p=>Vr(p,u,Fr())));throw M0(h,s?.callee),h}return d.value},Su=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new qi;return u.issues.length?{success:!1,error:new(e??k0)(u.issues.map(d=>Vr(d,s,Fr())))}:{success:!0,data:u.value}},Pw=Su(L0),wu=e=>async(a,i,l)=>{const s=l?Object.assign(l,{async:!0}):{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(d=>Vr(d,s,Fr())))}:{success:!0,data:u.value}},Yw=wu(L0),Gw=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return ah(e)(a,i,s)},Kw=e=>(a,i,l)=>ah(e)(a,i,l),Fw=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return rh(e)(a,i,s)},Vw=e=>async(a,i,l)=>rh(e)(a,i,l),Xw=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return Su(e)(a,i,s)},Jw=e=>(a,i,l)=>Su(e)(a,i,l),Iw=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return wu(e)(a,i,s)},Ww=e=>async(a,i,l)=>wu(e)(a,i,l),e2=/^[cC][^\s-]{8,}$/,t2=/^[0-9a-z]+$/,n2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,a2=/^[0-9a-vA-V]{20}$/,r2=/^[A-Za-z0-9]{27}$/,i2=/^[a-zA-Z0-9_-]{21}$/,l2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,o2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qv=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,s2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,u2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function c2(){return new RegExp(u2,"u")}const f2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,d2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,h2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,m2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,p2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,B0=/^[A-Za-z0-9_-]*$/,y2=/^\+(?:[0-9]){6,14}[0-9]$/,H0="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",v2=new RegExp(`^${H0}$`);function U0(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function g2(e){return new RegExp(`^${U0(e)}$`)}function b2(e){const a=U0({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${H0}T(?:${l})$`)}const x2=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},S2=/^-?\d+$/,w2=/^-?\d+(?:\.\d+)?/,_2=/^(?:true|false)$/i,E2=/^[^A-Z]*$/,T2=/^[^a-z]*$/,cn=ee("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),$0={number:"number",bigint:"bigint",object:"date"},Z0=ee("$ZodCheckLessThan",(e,a)=>{cn.init(e,a);const i=$0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{cn.init(e,a);const i=$0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.m)DELIM" -R"DELIM(inimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),R2=ee("$ZodCheckMultipleOf",(e,a)=>{cn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._zod.check=i=>{if(typeof i.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%a.value===BigInt(0):Cw(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:e,continue:!a.abort})}}),z2=ee("$ZodCheckNumberFormat",(e,a)=>{cn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=Dw[a.format];e._zod.onattach.push(d=>{const h=d._zod.bag;h.format=a.format,h.minimum=s,h.maximum=u,i&&(h.pattern=S2)}),e._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,continue:!a.abort}):d.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,continue:!a.abort});return}}hu&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:u,inst:e})}}),A2=ee("$ZodCheckMaxLength",(e,a)=>{var i;cn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!eh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const d=nh(s);l.issues.push({origin:d,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),C2=ee("$ZodCheckMinLength",(e,a)=>{var i;cn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!eh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const d=nh(s);l.issues.push({origin:d,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),O2=ee("$ZodCheckLengthEquals",(e,a)=>{var i;cn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!eh(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const d=nh(s),h=u>a.length;l.issues.push({origin:d,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),_u=ee("$ZodCheckStringFormat",(e,a)=>{var i,l;cn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),M2=ee("$ZodCheckRegex",(e,a)=>{_u.init(e,a),e._zod.check=i=>{a.pattern.lastIndex=0,!a.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:a.pattern.toString(),inst:e,continue:!a.abort})}}),N2=ee("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=E2),_u.init(e,a)}),j2=ee("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=T2),_u.init(e,a)}),D2=ee("$ZodCheckIncludes",(e,a)=>{cn.init(e,a);const i=xu(a.includes),l=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),k2=ee("$ZodCheckStartsWith",(e,a)=>{cn.init(e,a);const i=new RegExp(`^${xu(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),L2=ee("$ZodCheckEndsWith",(e,a)=>{cn.init(e,a);const i=new RegExp(`.*${xu(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l)DELIM" -R"DELIM(._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),B2=ee("$ZodCheckOverwrite",(e,a)=>{cn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class H2{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const l=a.split(` -`).filter(d=>d),s=Math.min(...l.map(d=>d.length-d.trimStart().length)),u=l.map(d=>d.slice(s)).map(d=>" ".repeat(this.indent*2)+d);for(const d of u)this.content.push(d)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new a(...i,s.join(` -`))}}const U2={major:4,minor:2,patch:1},Rt=ee("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=U2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(d,h,p)=>{let m=$i(d),g;for(const v of h){if(v._zod.def.when){if(!v._zod.def.when(d))continue}else if(m)continue;const x=d.issues.length,_=v._zod.check(d);if(_ instanceof Promise&&p?.async===!1)throw new qi;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,d.issues.length!==x&&(m||(m=$i(d,x)))});else{if(d.issues.length===x)continue;m||(m=$i(d,x))}}return g?g.then(()=>d):d},u=(d,h,p)=>{if($i(d))return d.aborted=!0,d;const m=s(h,l,p);if(m instanceof Promise){if(p.async===!1)throw new qi;return m.then(g=>e._zod.parse(g,p))}return e._zod.parse(m,p)};e._zod.run=(d,h)=>{if(h.skipChecks)return e._zod.parse(d,h);if(h.direction==="backward"){const m=e._zod.parse({value:d.value,issues:[]},{...h,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,d,h)):u(m,d,h)}const p=e._zod.parse(d,h);if(p instanceof Promise){if(h.async===!1)throw new qi;return p.then(m=>s(m,l,h))}return s(p,l,h)}}e["~standard"]={validate:s=>{try{const u=Pw(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Yw(e,s).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}}),ih=ee("$ZodString",(e,a)=>{Rt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??x2(e._zod.bag),e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),ft=ee("$ZodStringFormat",(e,a)=>{_u.init(e,a),ih.init(e,a)}),$2=ee("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=o2),ft.init(e,a)}),Z2=ee("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Qv(l))}else a.pattern??(a.pattern=Qv());ft.init(e,a)}),q2=ee("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=s2),ft.init(e,a)}),Q2=ee("$ZodURL",(e,a)=>{ft.init(e,a),e._zod.check=i=>{try{const l=i.value.trim(),s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),P2=ee("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=c2()),ft.init(e,a)}),Y2=ee("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=i2),ft.init(e,a)}),G2=ee("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=e2),ft.init(e,a)}),K2=ee("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=t2),ft.init(e,a)}),F2=ee("$ZodULID",(e,a)=>{a.pattern??(a.pattern=n2),ft.init(e,a)}),V2=ee("$ZodXID",(e,a)=>{a.pattern??(a.pattern=a2),ft.init(e,a)}),X2=ee("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=r2),ft.init(e,a)}),J2=ee("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=b2(a)),ft.init(e,a)}),I2=ee("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=v2),ft.init(e,a)}),W2=ee("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=g2(a)),ft.init(e,a)}),e_=ee("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=l2),ft.init(e,a)}),t_=ee("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=f2),ft.init(e,a),e._zod.bag.format="ipv4"}),n_=ee("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=d2),ft.init(e,a),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!a.abort})}}}),a_=ee("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=h2),ft.init(e,a)}),r_=ee("$ZodCIDRv6",(e,a)=>{a.pattern)DELIM" -R"DELIM(??(a.pattern=m2),ft.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const d=Number(u);if(`${d}`!==u)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!a.abort})}}});function Q0(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const i_=ee("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=p2),ft.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Q0(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function l_(e){if(!B0.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return Q0(i)}const o_=ee("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=B0),ft.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{l_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),s_=ee("$ZodE164",(e,a)=>{a.pattern??(a.pattern=y2),ft.init(e,a)});function u_(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const c_=ee("$ZodJWT",(e,a)=>{ft.init(e,a),e._zod.check=i=>{u_(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),P0=ee("$ZodNumber",(e,a)=>{Rt.init(e,a),e._zod.pattern=e._zod.bag.pattern??w2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),f_=ee("$ZodNumberFormat",(e,a)=>{z2.init(e,a),P0.init(e,a)}),d_=ee("$ZodBoolean",(e,a)=>{Rt.init(e,a),e._zod.pattern=_2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),h_=ee("$ZodUnknown",(e,a)=>{Rt.init(e,a),e._zod.parse=i=>i}),m_=ee("$ZodNever",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Pv(e,a,i){e.issues.length&&a.issues.push(...j0(i,e.issues)),a.value[i]=e.value}const p_=ee("$ZodArray",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let d=0;dPv(m,i,d))):Pv(p,i,d)}return u.length?Promise.all(u).then(()=>i):i}});function uu(e,a,i,l){e.issues.length&&a.issues.push(...j0(i,e.issues)),e.value===void 0?i in l&&(a.value[i]=void 0):a.value[i]=e.value}function Y0(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=jw(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function G0(e,a,i,l,s,u){const d=[],h=s.keySet,p=s.catchall._zod,m=p.def.type;for(const g in a){if(h.has(g))continue;if(m==="never"){d.push(g);continue}const v=p.run({value:a[g],issues:[]},l);v instanceof Promise?e.push(v.then(x=>uu(x,i,g,a))):uu(v,i,g,a)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const y_=ee("$ZodObject",(e,a)=>{if(Rt.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const h=a.shape;Object.defineProperty(a,"shape",{get:()=>{const p={...h};return Object.defineProperty(a,"shape",{value:p}),p}})}const l=Wd(()=>Y0(a));rt(e._zod,"propValues",()=>{const h=a.shape,p={};for(const m in h){const g=h[m]._zod;if(g.values){p[m]??(p[m]=new Set);for(const v of g.values)p[m].add(v)}}return p});const s=su,u=a.catchall;let d;e._zod.parse=(h,p)=>{d??(d=l.value);const m=h.value;if(!s(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h;h.value={};const g=[],v=d.shape;for(const x of d.keys){const E=v[x]._zod.run({value:m[x],issues:[]},p);E instanceof Promise?g.push(E.then(R=>uu(R,h,x,m))):uu(E,h,x,m)}return u?G0(g,m,h,p,l.value,e):g.length?Promise.all(g).then(()=>h):h}}),v_=ee("$ZodObjectJIT",(e,a)=>{y_.init(e,a);const i=e._zod.parse,l=Wd(()=>Y0(a)),s=x=>{const _=new H2(["shape","payload","ctx"]),E=l.value,R=U=>{const J=qv(U);return`shape[${J}]._zod.run({ value: input[${J}], issues: [] }, ctx)`};_.write("const input = payload.value;");const k=Object.create(null);let j=0;for(const U of E.keys)k[U]=`key_${j++}`;_.write("const newResult = {};");for(const U of E.keys){const J=k[U],I=qv(U);_.write(`const)DELIM" -R"DELIM( ${J} = ${R(U)};`),_.write(` - if (${J}.issues.length) { - payload.issues = payload.issues.concat(${J}.issues.map(iss => ({ +`+o.stack}}var Ma=Object.prototype.hasOwnProperty,vr=e.unstable_scheduleCallback,Fi=e.unstable_cancelCallback,Mu=e.unstable_shouldYield,Nu=e.unstable_requestPaint,St=e.unstable_now,gr=e.unstable_getCurrentPriorityLevel,Vi=e.unstable_ImmediatePriority,ei=e.unstable_UserBlockingPriority,en=e.unstable_NormalPriority,Un=e.unstable_LowPriority,Xi=e.unstable_IdlePriority,ju=e.log,Ji=e.unstable_setDisableYieldValue,br=null,ht=null;function $n(t){if(typeof ju=="function"&&Ji(t),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(br,t)}catch{}}var Ft=Math.clz32?Math.clz32:wo,So=Math.log,Du=Math.LN2;function wo(t){return t>>>=0,t===0?32:31-(So(t)/Du|0)|0}var la=256,xr=262144,Na=4194304;function oa(t){var n=t&42;if(n!==0)return n;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Sr(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var c=0,d=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var w=o&134217727;return w!==0?(o=w&~d,o!==0?c=oa(o):(y&=w,y!==0?c=oa(y):r||(r=w&~t,r!==0&&(c=oa(r))))):(w=o&~d,w!==0?c=oa(w):y!==0?c=oa(y):r||(r=o&~t,r!==0&&(c=oa(r)))),c===0?0:n!==0&&n!==c&&(n&d)===0&&(d=c)DELIM" +R"DELIM(&-c,r=n&-n,d>=r||d===32&&(r&4194048)!==0)?n:c}function wr(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function _o(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _r(){var t=Na;return Na<<=1,(Na&62914560)===0&&(Na=4194304),t}function ja(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function Da(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ku(t,n,r,o,c,d){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var w=t.entanglements,O=t.expirationTimes,q=t.hiddenUpdates;for(r=y&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var g1=/[\n"\\]/g;function _n(t){return t.replace(g1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Lu(t,n,r,o,c,d,y,w){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+qe(n)):t.value!==""+qe(n)&&(t.value=""+qe(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?Bu(t,y,qe(n)):r!=null?Bu(t,y,qe(r)):o!=null&&t.removeAttribute("value"),c==null&&d!=null&&(t.defaultChecked=!!d),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.name=""+qe(w):t.removeAttribute("name")}function jh(t,n,r,o,c,d,y,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.type=d),n!=null||r!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){Ii(t);return}r=r!=null?""+qe(r):"",n=n!=null?""+qe(n):r,w||n===t.value||(t.value=n),t.defaultValue=n}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=w?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Ii(t)}function Bu(t,n,r){n==="number"&&Ro(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function ti(t,n,r,o){if(t=t.options,n){n={};for(var c=0;c"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qu=!1;if(ca)try{var el={};Object.defineProperty(el,"passive",{get:function(){qu=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{qu=!1}var ka=null,Qu=null,Ao=null;function $h(){if(Ao)return Ao;var t,n=Qu,r=n.length,o,c="value"in ka?ka.value:ka.textContent,d=c.length;for(t=0;t=al),Gh=" ",Kh=!1;function Fh(t,n){switch(t){case"keyup":return G1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ii=!1;function F1(t,n){switch(t){case"compositionend":return Vh(n);case"keypress":return n.which!==32?null:(Kh=!0,Gh);case"textInput":return t=n.data,t===Gh&&Kh?null:t;default:return null}}function V1(t,n){if(ii)return t==="compositionend"||!Fu&&Fh(t,n)?(t=$h(),Ao=Qu=ka=null,ii=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=am(r)}}function im(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?im(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function lm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Ro(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=Ro(t.document)}return n}function Ju(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var ax=ca&&"documentMode"in document&&11>=document.documentMode,li=null,Iu=null,ol=null,Wu=!1;function om(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Wu||li==null||li!==Ro(o)||(o=li,"selectionStart"in o&&Ju(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ol&&ll(ol,o)||(ol=o,o=Ss(Iu,"onSelect"),0>=y,c-=y,Jn=1<<32-Ft(n)+c|r<je?(He=ge,ge=null):He=ge.sibling;var Fe=P(B,ge,Z[je],I);if(Fe===null){ge===null&&(ge=He);break}t&&ge&&Fe.alternate===null&&n(B,ge),D=d(Fe,D,je),Ke===null?_e=Fe:Ke.sibling=Fe,Ke=Fe,ge=He}if(je===Z.length)return r(B,ge),Qe&&da(B,je),_e;if(ge===null){for(;jeje?(He=ge,ge=null):He=ge.sibling;var ar=P(B,ge,Fe.value,I);if(ar===null){ge===null&&(ge=He);break}t&&ge&&ar.alternate=)DELIM" +R"DELIM(==null&&n(B,ge),D=d(ar,D,je),Ke===null?_e=ar:Ke.sibling=ar,Ke=ar,ge=He}if(Fe.done)return r(B,ge),Qe&&da(B,je),_e;if(ge===null){for(;!Fe.done;je++,Fe=Z.next())Fe=W(B,Fe.value,I),Fe!==null&&(D=d(Fe,D,je),Ke===null?_e=Fe:Ke.sibling=Fe,Ke=Fe);return Qe&&da(B,je),_e}for(ge=o(ge);!Fe.done;je++,Fe=Z.next())Fe=G(ge,B,je,Fe.value,I),Fe!==null&&(t&&Fe.alternate!==null&&ge.delete(Fe.key===null?je:Fe.key),D=d(Fe,D,je),Ke===null?_e=Fe:Ke.sibling=Fe,Ke=Fe);return t&&ge.forEach(function(_S){return n(B,_S)}),Qe&&da(B,je),_e}function at(B,D,Z,I){if(typeof Z=="object"&&Z!==null&&Z.type===T&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:e:{for(var _e=Z.key;D!==null;){if(D.key===_e){if(_e=Z.type,_e===T){if(D.tag===7){r(B,D.sibling),I=c(D,Z.props.children),I.return=B,B=I;break e}}else if(D.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===K&&Lr(_e)===D.type){r(B,D.sibling),I=c(D,Z.props),hl(I,Z),I.return=B,B=I;break e}r(B,D);break}else n(B,D);D=D.sibling}Z.type===T?(I=Mr(Z.props.children,B.mode,I,Z.key),I.return=B,B=I):(I=Ho(Z.type,Z.key,Z.props,null,B.mode,I),hl(I,Z),I.return=B,B=I)}return y(B);case E:e:{for(_e=Z.key;D!==null;){if(D.key===_e)if(D.tag===4&&D.stateNode.containerInfo===Z.containerInfo&&D.stateNode.implementation===Z.implementation){r(B,D.sibling),I=c(D,Z.children||[]),I.return=B,B=I;break e}else{r(B,D);break}else n(B,D);D=D.sibling}I=lc(Z,B.mode,I),I.return=B,B=I}return y(B);case K:return Z=Lr(Z),at(B,D,Z,I)}if($(Z))return ve(B,D,Z,I);if(oe(Z)){if(_e=oe(Z),typeof _e!="function")throw Error(l(150));return Z=_e.call(Z),ze(B,D,Z,I)}if(typeof Z.then=="function")return at(B,D,Yo(Z),I);if(Z.$$typeof===U)return at(B,D,Zo(B,Z),I);Go(B,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,D!==null&&D.tag===6?(r(B,D.sibling),I=c(D,Z),I.return=B,B=I):(r(B,D),I=ic(Z,B.mode,I),I.return=B,B=I),y(B)):r(B,D)}return function(B,D,Z,I){try{dl=0;var _e=at(B,D,Z,I);return vi=null,_e}catch(ge){if(ge===yi||ge===Qo)throw ge;var Ke=hn(29,ge,null,B.mode);return Ke.lanes=I,Ke.return=B,Ke}}}var Hr=Cm(!0),Mm=Cm(!1),$a=!1;function gc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bc(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Za(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function qa(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Xe&2)!==0){var c=o.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),o.pending=n,n=Bo(t),mm(t,null,r),n}return Lo(t,o,n,r),Bo(t)}function ml(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,A(t,r)}}function xc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var c=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,r=r.next}while(r!==null);d===null?c=d=n:d=d.next=n}else c=d=n;r={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var Sc=!1;function pl(){if(Sc){var t=pi;if(t!==null)throw t}}function yl(t,n,r,o){Sc=!1;var c=t.updateQueue;$a=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var O=w,q=O.next;O.next=null,y===null?d=q:y.next=q,y=O;var F=t.alternate;F!==null&&(F=F.updateQueue,w=F.lastBaseUpdate,w!==y&&(w===null?F.firstBaseUpdate=q:w.next=q,F.lastBaseUpdate=O))}if(d!==null){var W=c.baseState;y=0,F=q=O=null,w=d;do{var P=w.lane&-536870913,G=P!==w.lane;if(G?(Be&P)===P:(o&P)===P){P!==0&&P===mi&&(Sc=!0),F!==null&&(F=F.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ve=t,ze=w;P=n;var at=r;switch(ze.tag){case 1:if(ve=ze.payload,typeof ve=="function"){W=ve.call(at,W,P);break e}W=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ze.payload,P=typeof ve=="function"?ve.call(at,W,P):ve,P==null)break e;W=v({},W,P);break e;case 2:$a=!0}}P=w.callback,P!==null&&(t.flags|=64,G&&(t.flags|=8192),G=c.callbacks,G===null?c.callbacks=[P]:G.push(P))}else G={lane:P,tag:w.tag,payload:w.payload,callback:w.callback,next:null},F===null?(q=F=G,O=W):F=F.next=G,y|=P;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;G=w,w=G.next,G.next=null,c.lastBaseUpdate=G,c.shared.pending=null}}while(!0);F===null&&(O=W),c.baseState=O,c.firstBaseUpdate=q,c.lastBaseUpdate=F,d===null&&(c.shared.lanes=0),Ka|=y,t.lanes=y,t.memoizedState=W}}function Nm(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function jm(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;td?d:8;var y=S.T,w={};S.T=w,$c(t,!1,n,r);try{var O=c(),q=S.S;if(q!==null&&q(w,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var F=dx(O,o);bl(t,n,F,gn(t))}else bl(t,n,o,gn(t))}catch(W){bl(t,n,{then:function(){},status:"rejected",reason:W},gn())}finally{M.p=d,y!==null&&w.types!==null&&(y.types=w.types),S.T=y}}function gx(){}function Hc(t,n,r,o){if(t.tag!==5)throw Error(l(476));var c=fp(t).queue;cp(t,c,n,N,r===null?gx:function(){return dp(t),r(o)})}function fp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:N},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function dp(t){var n=fp(t);n.next===null&&(n=t.alternate.memoizedState),bl(t,n.next.queue,{},gn())}function Uc(){return qt(Ll)}function hp(){return Et().memoizedState}function mp(){return Et().memoizedState}function bx(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=gn();t=Za(r);var o=qa(n,t,r);o!==null&&(sn(o,n,r),ml(o,n,r)),n={cache:mc()},t.payload=n;return}n=n.return}}function xx(t,n,r){var o=gn();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ns(t)?yp(n,r):(r=ac(t,n,r,o),r!==null&&(sn(r,t,o),vp(r,n,o)))}function pp(t,n,r){var o=gn();bl(t,n,r,o)}function bl(t,n,r,o){var c={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ns(t))yp(n,c);else{var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var y=n.lastRenderedState,w=d(y,r);if(c.hasEagerState=!0,c.eagerState=w,dn(w,y))return Lo(t,n,c,0),rt===null&&ko(),!1}catch{}if(r=ac(t,n,c,o),r!==null)return sn(r,t,o),vp(r,n,o),!0}return!1}function $c(t,n,r,o){if(o={lane:2,revertLane:bf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ns(t)){if(n)throw Error(l(479))}else n=ac(t,r,o,2),n!==null&&sn(n,t,2)}function ns(t){var n=t.alternate;return t===Me||n!==null&&n===Me}function yp(t,n){bi=Vo=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function vp(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,A(t,r)}}var xl={readContext:qt,use:Io,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};xl.useEffectEvent=gt;var gp={readContext:qt,use:Io,useCallback:function(t,n){return Jt().memoizedState=[t,n===void 0?null:n],t},useContext:qt,useEffect:tp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,es(4194308,4,ip.bind(null,n,t),r)},useLayoutEffect:function(t,n){return es(4194308,4,t,n)},useInsertionEffect:function(t,n){es(4,2,t,n)},useMemo:function(t,n){var r=Jt();n=n===void 0?null:n;var o=t();if(Ur){$n(!0);try{t()}finally{$n(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=Jt();if(r!==void 0){var c=r(n);if(Ur){$n(!0);try{r(n)}finally{$n(!1)}}}else c=n;return o.memoizedState=o.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},o.queue=t,t=t.dispatch=xx.bind(null,Me,t),[o.memoizedState,t]},useRef:function(t){var n=Jt();return t={current:t},n.memoizedState=t},useState:function(t){t=jc(t);var n=t.queue,r=pp.bind(null,Me,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:Lc,useDeferredValue:function(t,n){var r=Jt();return Bc(r,t,n)},useTransition:function(){var t=jc(!1);return t=cp.bind(null,Me,t.queue,!0,!1),Jt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Me,c=Jt();if(Qe){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),rt===null)throw Error(l(349));(Be&127)!==0||Um(o,n,r)}c.memoizedState=r;var d={value:r,getSnapshot:n};return c.queue=d,tp(Zm.bind(null,o,d,t),[t]),o.flags|=2048,Si(9)DELIM" +R"DELIM(,{destroy:void 0},$m.bind(null,o,d,r,n),null),r},useId:function(){var t=Jt(),n=rt.identifierPrefix;if(Qe){var r=In,o=Jn;r=(o&~(1<<32-Ft(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Xo++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?y.createElement(c,{is:o.is}):y.createElement(c)}}d[de]=n,d[ye]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=d;e:switch(Pt(d,c,o),c){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ga(n)}}return ot(n),ef(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ga(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=Te.current,di(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,c=Zt,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}t[de]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||By(t.nodeValue,r)),t||Ha(n,!0)}else t=ws(t).createTextNode(o),t[de]=n,n.stateNode=t}return ot(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=di(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[de]=n}else Nr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ot(n),t=!1}else r=cc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(pn(n),n):(pn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return ot(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=di(n),o!==null&&o.dehydrated!==null){if(t===null){if(!c)throw Error(l(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[de]=n}else Nr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ot(n),c=!1}else c=cc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(pn(n),n):(pn(n),null)}return pn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==c&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),os(n,n.updateQueue),ot(n),null);case 4:return Ae(),t===null&&_f(n.stateNode.containerInfo),ot(n),null;case 10:return ma(n.type),ot(n),null;case 19:if(Q(_t),o=n.memoizedState,o===null)return ot(n),null;if(c=(n.flags&128)!==0,d=o.rendering,d===null)if(c)wl(o,!1);else{if(bt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(d=Fo(t),d!==null){for(n.flags|=128,wl(o,!1),t=d.updateQueue,n.updateQueue=t,os(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)pm(r,t),r=r.sibling;return te(_t,_t.current&1|2),Qe&&da(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&St()>ds&&(n.flags|=128,c=!0,wl(o,!1),n.lanes=4194304)}else{if(!c)if(t=Fo(d),t!==null){if(n.flags|=128,c=!0,t=t.updateQueue,n.updateQueue=t,os(n,t),wl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Qe)return ot(n),null}else 2*St()-o.renderingStartTime>ds&&r!==536870912&&(n.flags|=128,c=!0,wl(o,!1),n.lanes=4194304);o.isBackwards?(d.sibling=n.child,n.child=d):(t=o.last,t!==null?t.sibling=d:n.child=d,o.last=d)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=St(),t.sibling=null,r=_t.current,te(_t,c?r&1|2:r&1),Qe&&da(n,o.treeForkCount),t):(ot(n),null);case 22:case 23:return pn(n),_c(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(ot(n),n.subtreeFlags&6&&(n.flags|=8192)):ot(n),r=n.updateQueue,r!==null&&os(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&Q(kr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ma(At),ot(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function Tx(t,n){switch(sc(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;)DELIM" +R"DELIM(case 3:return ma(At),Ae(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return it(n),null;case 31:if(n.memoizedState!==null){if(pn(n),n.alternate===null)throw Error(l(340));Nr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Nr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Q(_t),null;case 4:return Ae(),null;case 10:return ma(n.type),null;case 22:case 23:return pn(n),_c(),t!==null&&Q(kr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ma(At),null;case 25:return null;default:return null}}function qp(t,n){switch(sc(n),n.tag){case 3:ma(At),Ae();break;case 26:case 27:case 5:it(n);break;case 4:Ae();break;case 31:n.memoizedState!==null&&pn(n);break;case 13:pn(n);break;case 19:Q(_t);break;case 10:ma(n.type);break;case 22:case 23:pn(n),_c(),t!==null&&Q(kr);break;case 24:ma(At)}}function _l(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var c=o.next;r=c;do{if((r.tag&t)===t){o=void 0;var d=r.create,y=r.inst;o=d(),y.destroy=o}r=r.next}while(r!==c)}}catch(w){We(n,n.return,w)}}function Ya(t,n,r){try{var o=n.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var d=c.next;o=d;do{if((o.tag&t)===t){var y=o.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,c=n;var O=r,q=w;try{q()}catch(F){We(c,O,F)}}}o=o.next}while(o!==d)}}catch(F){We(n,n.return,F)}}function Qp(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{jm(n,r)}catch(o){We(t,t.return,o)}}}function Pp(t,n,r){r.props=$r(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){We(t,n,o)}}function El(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(c){We(t,n,c)}}function Wn(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(c){We(t,n,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){We(t,n,c)}else r.current=null}function Yp(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(c){We(t,t.return,c)}}function tf(t,n,r){try{var o=t.stateNode;Kx(o,t.type,r,n),o[ye]=n}catch(c){We(t,t.return,c)}}function Gp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ia(t.type)||t.tag===4}function nf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gp(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.tag===27&&Ia(t.type)||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 af(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ua));else if(o!==4&&(o===27&&Ia(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(af(t,n,r),t=t.sibling;t!==null;)af(t,n,r),t=t.sibling}function ss(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&Ia(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(ss(t,n,r),t=t.sibling;t!==null;)ss(t,n,r),t=t.sibling}function Kp(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Pt(n,o,r),n[de]=t,n[ye]=r}catch(d){We(t,t.return,d)}}var ba=!1,Mt=!1,rf=!1,Fp=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function Rx(t,n){if(t=t.containerInfo,Rf=Os,t=lm(t),Ju(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var c=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var y=0,w=-1,O=-1,q=0,F=0,W=t,P=null;t:for(;;){for(var G;W!==r||c!==0&&W.nodeType!==3||(w=y+c),W!==d||o!==0&&W.nodeType!==3||(O=y+o),W.nodeType===3&&(y+=W.nodeValue.length),(G=W.firstChild)!==null;)P=W,W=G;for(;;){if(W===t)break t;if(P===r&&++q===c&&(w=y),P===d&&++F===o&&(O=y),(G=W.nextSibling)!==null)break;W=P,P=W.parentNode}W=G}r=w===-1||O===-1?null:{start:w,end:O}}else r=null}r=r||{start:0,end:0}}else r=null;for(zf={focusedElem:t,selectionRange:r},Os=!1,Ht=n;Ht!==null;)if(n=Ht,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Ht=t;else for(;Ht!==null;){switch(n=Ht,d=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Pt(d,o,r),d[de]=t,ut(d),o=d;break e;case"link":var y=ev("link","href",c).get(o+(r.href||""));if(y){for(var w=0;wat&&(y=at,at=ze,ze=y);var B=rm(w,ze),D=rm(w,at);if(B&&D&&(G.rangeCount!==1||G.anchorNode!==B.node||G.anchorOffset!==B.offset||G.focusNode!==D.node||G.focusOffset!==D.offset)){var Z=W.createRange();Z.setStart(B.node,B.offset),G.removeAllRanges(),ze>at?(G.addRange(Z),G.extend(D.node,D.offset)):(Z.setEnd(D.node,D.offset),G.addRange(Z))}}}}for(W=[],G=w;G=G.parentNode;)G.nodeType===1&&W.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;wr?32:r,S.T=null,r=df,df=null;var d=Va,y=Ea;if(Dt=0,Ri=Va=null,Ea=0,(Xe&6)!==0)throw Error(l(331));var w=Xe;if(Xe|=4,iy(d.current),ny(d,d.current,y,r),Xe=w,Cl(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(br,d)}catch{}return!0}finally{M.p=c,S.T=o,_y(t,n)}}function Ty(t,n,r){n=Tn(r,n),n=Pc(t.stateNode,n,2),t=qa(t,n,2),t!==null&&(Da(t,2),ea(t))}function We(t,n,r){if(t.tag===3)Ty(t,t,r);else for(;n!==null;){if(n.tag===3){Ty(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&()DELIM" +R"DELIM(Fa===null||!Fa.has(o))){t=Tn(r,t),r=Rp(2),o=qa(n,r,2),o!==null&&(zp(r,o,n,t),Da(o,2),ea(o));break}}n=n.return}}function yf(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new Ox;var c=new Set;o.set(n,c)}else c=o.get(n),c===void 0&&(c=new Set,o.set(n,c));c.has(r)||(sf=!0,c.add(r),t=Dx.bind(null,t,n,r),n.then(t,t))}function Dx(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,rt===t&&(Be&r)===r&&(bt===4||bt===3&&(Be&62914560)===Be&&300>St()-fs?(Xe&2)===0&&zi(t,0):uf|=r,Ti===Be&&(Ti=0)),ea(t)}function Ry(t,n){n===0&&(n=_r()),t=Cr(t,n),t!==null&&(Da(t,n),ea(t))}function kx(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),Ry(t,r)}function Lx(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,c=t.memoizedState;c!==null&&(r=c.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),Ry(t,r)}function Bx(t,n){return vr(t,n)}var gs=null,Oi=null,vf=!1,bs=!1,gf=!1,Ja=0;function ea(t){t!==Oi&&t.next===null&&(Oi===null?gs=Oi=t:Oi=Oi.next=t),bs=!0,vf||(vf=!0,Ux())}function Cl(t,n){if(!gf&&bs){gf=!0;do for(var r=!1,o=gs;o!==null;){if(t!==0){var c=o.pendingLanes;if(c===0)var d=0;else{var y=o.suspendedLanes,w=o.pingedLanes;d=(1<<31-Ft(42|t)+1)-1,d&=c&~(y&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(r=!0,Cy(o,d))}else d=Be,d=Sr(o,o===rt?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||wr(o,d)||(r=!0,Cy(o,d));o=o.next}while(r);gf=!1}}function Hx(){zy()}function zy(){bs=vf=!1;var t=0;Ja!==0&&Vx()&&(t=Ja);for(var n=St(),r=null,o=gs;o!==null;){var c=o.next,d=Ay(o,n);d===0?(o.next=null,r===null?gs=c:r.next=c,c===null&&(Oi=r)):(r=o,(t!==0||(d&3)!==0)&&(bs=!0)),o=c}Dt!==0&&Dt!==5||Cl(t),Ja!==0&&(Ja=0)}function Ay(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,c=t.expirationTimes,d=t.pendingLanes&-62914561;0w)break;var F=O.transferSize,W=O.initiatorType;F&&Hy(W)&&(O=O.responseEnd,y+=F*(O"u"?null:document;function Xy(t,n,r){var o=Ci;if(o&&typeof n=="string"&&n){var c=_n(n);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Vy.has(c)||(Vy.add(c),t={rel:t,crossOrigin:r,href:n},o.querySelector(c)===null&&(n=o.createElement("link"),Pt(n,"link",t),ut(n),o.head.appendChild(n)))}}function rS(t){Ta.D(t),Xy("dns-prefetch",t,null)}function iS(t,n){Ta.C(t,n),Xy("preconnect",t,n)}function lS(t,n,r){Ta.L(t,n,r);var o=Ci;if(o&&t&&n){var c='link[rel="preload"][as="'+_n(n)+'"]';n==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+_n(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+_n(r.imageSizes)+'"]')):c+='[href="'+_n(t)+'"]';var d=c;switch(n){case"style":d=Mi(t);break;case"script":d=Ni(t)}Mn.has(d)||(t=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Mn.set(d,t),o.querySelector(c)!==null||n==="style"&&o.querySelector(Dl(d))||n==="script"&&o.querySelector(kl(d))||(n=o.createElement("link"),Pt(n,"link",t),ut(n),o.head.appendChild(n)))}}function oS(t,n){Ta.m(t,n);var r=Ci;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+_n(o)+'"][href="'+_n(t)+'"]',d=c;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker)DELIM" +R"DELIM(":case"worker":case"script":d=Ni(t)}if(!Mn.has(d)&&(t=v({rel:"modulepreload",href:t},n),Mn.set(d,t),r.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(kl(d)))return}o=r.createElement("link"),Pt(o,"link",t),ut(o),r.head.appendChild(o)}}}function sS(t,n,r){Ta.S(t,n,r);var o=Ci;if(o&&t){var c=tn(o).hoistableStyles,d=Mi(t);n=n||"default";var y=c.get(d);if(!y){var w={loading:0,preload:null};if(y=o.querySelector(Dl(d)))w.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Mn.get(d))&&Df(t,r);var O=y=o.createElement("link");ut(O),Pt(O,"link",t),O._p=new Promise(function(q,F){O.onload=q,O.onerror=F}),O.addEventListener("load",function(){w.loading|=1}),O.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Es(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:w},c.set(d,y)}}}function uS(t,n){Ta.X(t,n);var r=Ci;if(r&&t){var o=tn(r).hoistableScripts,c=Ni(t),d=o.get(c);d||(d=r.querySelector(kl(c)),d||(t=v({src:t,async:!0},n),(n=Mn.get(c))&&kf(t,n),d=r.createElement("script"),ut(d),Pt(d,"link",t),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function cS(t,n){Ta.M(t,n);var r=Ci;if(r&&t){var o=tn(r).hoistableScripts,c=Ni(t),d=o.get(c);d||(d=r.querySelector(kl(c)),d||(t=v({src:t,async:!0,type:"module"},n),(n=Mn.get(c))&&kf(t,n),d=r.createElement("script"),ut(d),Pt(d,"link",t),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function Jy(t,n,r,o){var c=(c=Te.current)?_s(c):null;if(!c)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Mi(r.href),r=tn(c).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Mi(r.href);var d=tn(c).hoistableStyles,y=d.get(t);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(t,y),(d=c.querySelector(Dl(t)))&&!d._p&&(y.instance=d,y.state.loading=5),Mn.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Mn.set(t,r),d||fS(c,t,r,y.state))),n&&o===null)throw Error(l(528,""));return y}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ni(r),r=tn(c).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Mi(t){return'href="'+_n(t)+'"'}function Dl(t){return'link[rel="stylesheet"]['+t+"]"}function Iy(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function fS(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Pt(n,"link",r),ut(n),t.head.appendChild(n))}function Ni(t){return'[src="'+_n(t)+'"]'}function kl(t){return"script[async]"+t}function Wy(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+_n(r.href)+'"]');if(o)return n.instance=o,ut(o),o;var c=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),ut(o),Pt(o,"style",c),Es(o,r.precedence,t),n.instance=o;case"stylesheet":c=Mi(r.href);var d=t.querySelector(Dl(c));if(d)return n.state.loading|=4,n.instance=d,ut(d),d;o=Iy(r),(c=Mn.get(c))&&Df(o,c),d=(t.ownerDocument||t).createElement("link"),ut(d);var y=d;return y._p=new Promise(function(w,O){y.onload=w,y.onerror=O}),Pt(d,"link",o),n.state.loading|=4,Es(d,r.precedence,t),n.instance=d;case"script":return d=Ni(r.src),(c=t.querySelector(kl(d)))?(n.instance=c,ut(c),c):(o=r,(c=Mn.get(d))&&(o=v({},r),kf(o,c)),t=t.ownerDocument||t,c=t.createElement("script"),ut(c),Pt(c,"link",o),t.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Es(o,r.precedence,t));return n.instance}function Es(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,d=c,y=0;y title"):null)}function dS(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function nv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function hS(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Mi(o.href),d=n.querySelector(Dl(c));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Rs.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=d,ut(d);return}d=n.ownerDocument||n,o=Iy(o),(c=Mn.get(c))&&Df(o,c),d=d.createElement("link"),ut(d);var y=d;y._p=new Promise(function(w,O){y.onload=w,y.onerror=O}),Pt(d,"link",o),r.instance=d}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Rs.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var Lf=0;function mS(t,n){return t.stylesheets&&t.count===0&&As(t,t.stylesheets),0Lf?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(c)}}:null}function Rs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)As(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var zs=null;function As(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,zs=new Map,n.forEach(pS,t),zs=null,Rs.call(t))}function pS(t,n){if(!(n.state.loading&4)){var r=zs.get(t);if(r)var o=r.get(null);else{r=new Map,zs.set(t,r);for(var c=t.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Yf.exports=NS(),Yf.exports}var DS=jS();const kS=co(DS);var ho=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},LS={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},BS=class{#e=LS;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,a){return this.#e.setTimeout(e,a)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,a){return this.#e.setInterval(e,a)}clearInterval(e){this.#e.clearInterval(e)}},Pr=new BS;function HS(e){setTimeout(e,0)}var Fr=typeof window>"u"||"Deno"in globalThis;function un(){}function US(e,a){)DELIM" +R"DELIM(return typeof e=="function"?e(a):e}function zd(e){return typeof e=="number"&&e>=0&&e!==1/0}function v0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function fr(e,a){return typeof e=="function"?e(a):e}function Dn(e,a){return typeof e=="function"?e(a):e}function Rv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:f,stale:h}=e;if(f){if(l){if(a.queryHash!==Vd(f,a.options))return!1}else if(!no(a.queryKey,f))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||s&&s!==a.state.fetchStatus||u&&!u(a))}function zv(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(to(a.options.mutationKey)!==to(u))return!1}else if(!no(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function Vd(e,a){return(a?.queryKeyHashFn||to)(e)}function to(e){return JSON.stringify(e,(a,i)=>Od(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function no(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>no(e[i],a[i])):!1}var $S=Object.prototype.hasOwnProperty;function g0(e,a,i=0){if(e===a)return e;if(i>500)return a;const l=Av(e)&&Av(a);if(!l&&!(Od(e)&&Od(a)))return a;const u=(l?e:Object.keys(e)).length,f=l?a:Object.keys(a),h=f.length,p=l?new Array(h):{};let m=0;for(let g=0;g{Pr.setTimeout(a,e)})}function Cd(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?g0(e,a):a}function qS(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function QS(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var Xd=Symbol();function b0(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Xd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function x0(e,a){return typeof e=="function"?e(...a):!!e}function PS(e,a,i){let l=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),l||(l=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var YS=class extends ho{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Fr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Jd=new YS;function Md(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var GS=HS;function KS(){let e=[],a=0,i=h=>{h()},l=h=>{h()},s=GS;const u=h=>{a?e.push(h):s(()=>{i(h)})},f=()=>{const h=e;e=[],h.length&&s(()=>{l(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||f()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{l=h},setScheduler:h=>{s=h}}}var Gt=KS(),FS=class extends ho{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Fr&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},ou=new FS;function VS(e){return Math.min(1e3*2**e,3e4)}function S0(e){return(e??"online")==="online"?ou.isOnline():!0}var Nd=class extends Error{constructor(e){super("Cancell)DELIM" +R"DELIM(edError"),this.revert=e?.revert,this.silent=e?.silent}};function w0(e){let a=!1,i=0,l;const s=Md(),u=()=>s.status!=="pending",f=T=>{if(!u()){const j=new Nd(T);x(j),e.onCancel?.(j)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>Jd.isFocused()&&(e.networkMode==="always"||ou.isOnline())&&e.canRun(),g=()=>S0(e.networkMode)&&e.canRun(),v=T=>{u()||(l?.(),s.resolve(T))},x=T=>{u()||(l?.(),s.reject(T))},_=()=>new Promise(T=>{l=j=>{(u()||m())&&T(j)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),E=()=>{if(u())return;let T;const j=i===0?e.initialPromise:void 0;try{T=j??e.fn()}catch(k){T=Promise.reject(k)}Promise.resolve(T).then(v).catch(k=>{if(u())return;const L=e.retry??(Fr?0:3),U=e.retryDelay??VS,V=typeof U=="function"?U(i,k):U,X=L===!0||typeof L=="number"&&im()?void 0:_()).then(()=>{a?x(k):E()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(l?.(),s),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?E():_().then(E),s)}}var _0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zd(this.gcTime)&&(this.#e=Pr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Pr.clearTimeout(this.#e),this.#e=void 0)}},XS=class extends _0{#e;#t;#n;#r;#a;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Mv(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Mv(this.options);a.data!==void 0&&(this.setState(Cv(a.data,a.dataUpdatedAt)),this.#e=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=Cd(this.state.data,e,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#a?.promise;return this.#a?.cancel(e),a?a.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Dn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>fr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!v0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#a&&(this.#l?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,l=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},s=()=>{const h=b0(this.options,a),m=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return l(g),g})();return this.#l=!1,this.options.persister?this.options.persister(h,m,this):h(m)},f=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:s};return l(h),h})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#i({type:"fetch",meta:f.fetchOptions?.meta}),this.#a=w0({initialPromise:a?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof Nd&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this)DELIM" +R"DELIM(.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Nd){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...E0(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...Cv(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Gt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function E0(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Cv(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Mv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var JS=class extends ho{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#l=Md(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#o;#l;#i;#p;#d;#h;#u;#c;#s;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Nv(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!Ad(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&jv(this.#t,i,this.options,a)&&this.#f(),this.updateResult(),l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||fr(this.options.staleTime,this.#t)!==fr(a.staleTime,this.#t))&&this.#y();const s=this.#v();l&&(this.#t!==i||Dn(this.options.enabled,this.#t)!==Dn(a.enabled,this.#t)||s!==this.#s)&&this.#g(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return WS(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(un)),a}#y(){this.#x();const e=fr(this.options.staleTime,this.#t);if(Fr||this.)DELIM" +R"DELIM(#r.isStale||!zd(e))return;const i=v0(this.#r.dataUpdatedAt,e)+1;this.#u=Pr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(e){this.#S(),this.#s=e,!(Fr||Dn(this.options.enabled,this.#t)===!1||!zd(this.#s)||this.#s===0)&&(this.#c=Pr.setInterval(()=>{(this.options.refetchIntervalInBackground||Jd.isFocused())&&this.#f()},this.#s))}#b(){this.#y(),this.#g(this.#v())}#x(){this.#u&&(Pr.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(Pr.clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#r,u=this.#a,f=this.#o,p=e!==i?e.state:this.#n,{state:m}=e;let g={...m},v=!1,x;if(a._optimisticResults){const K=this.hasListeners(),he=!K&&Nv(e,a),le=K&&jv(e,i,a,l);(he||le)&&(g={...g,...E0(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:_,errorUpdatedAt:E,status:T}=g;x=g.data;let j=!1;if(a.placeholderData!==void 0&&x===void 0&&T==="pending"){let K;s?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(K=s.data,j=!0):K=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,K!==void 0&&(T="success",x=Cd(s?.data,K,a),v=!0)}if(a.select&&x!==void 0&&!j)if(s&&x===u?.data&&a.select===this.#p)x=this.#d;else try{this.#p=a.select,x=a.select(x),x=Cd(s?.data,x,a),this.#d=x,this.#i=null}catch(K){this.#i=K}this.#i&&(_=this.#i,x=this.#d,E=Date.now(),T="error");const k=g.fetchStatus==="fetching",L=T==="pending",U=T==="error",V=L&&k,X=x!==void 0,C={status:T,fetchStatus:g.fetchStatus,isPending:L,isSuccess:T==="success",isError:U,isInitialLoading:V,isLoading:V,data:x,dataUpdatedAt:g.dataUpdatedAt,error:_,errorUpdatedAt:E,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:k,isRefetching:k&&!L,isLoadingError:U&&!X,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:U&&X,isStale:Id(e,a),refetch:this.refetch,promise:this.#l,isEnabled:Dn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const K=C.data!==void 0,he=C.status==="error"&&!K,le=we=>{he?we.reject(C.error):K&&we.resolve(C.data)},ne=()=>{const we=this.#l=C.promise=Md();le(we)},oe=this.#l;switch(oe.status){case"pending":e.queryHash===i.queryHash&&le(oe);break;case"fulfilled":(he||C.data!==oe.value)&&ne();break;case"rejected":(!he||C.error!==oe.reason)&&ne();break}}return C}updateResult(){const e=this.#r,a=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),Ad(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#m.size)return!0;const u=new Set(s??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(f=>{const h=f;return this.#r[h]!==e[h]&&u.has(h)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Gt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function IS(e,a){return Dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function Nv(e,a){return IS(e,a)||e.state.data!==void 0&&jd(e,a,a.refetchOnMount)}function jd(e,a,i){if(Dn(a.enabled,e)!==!1&&fr(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&Id(e,a)}return!1}function jv(e,a,i,l){return(e!==a||Dn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Id(e,i)}function Id(e,a){return Dn(a.enabled,e)!==!1&&e.isStaleByTime(fr(a.staleTime,e))}function WS(e,a){return!Ad(e.getCurrentResult(),a)}function Dv(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const v=E=>{PS(E,()=>a.signal,()=>g=!0)},x=b0(a.options,a.fetchOptions),_=async(E,T,j)=>{if(g)return Promise.reject();if(T==null&&E.pages.length)return Promise.resolve(E);const L=(()=>{const ue={client:a.client,queryKey:a.queryKey,pageParam:T,direction:j?"backward":"forward",meta:a.options.meta};return v(ue),ue})(),U=await x(L),{maxPages:V}=a.options,X=j?QS:qS;return{pages:X(E.pages,U,V),pageParams:X(E.pageParams,T,V)}};if(s&&u.length){const E=s==="backward",T=E?ew:kv,j={pages:u,pageParams:f},k=T(l,j);h=await _(j,k,E)}else{const E=e??u.length;do{const T=p===0?f[0]??l.initialPageParam:kv(l,h);if(p>0&&T==n)DELIM" +R"DELIM(ull)break;h=await _(h,T),p++}while(pa.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function kv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function ew(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var tw=class extends _0{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||nw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=w0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,f)=>{this.#a({type:"failed",failureCount:u,error:f})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#r.canStart();try{if(l)a();else{this.#a({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const f=await this.options.onMutate?.(e,i);f!==this.state.context&&this.#a({type:"pending",context:f,variables:e,isPaused:s})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#a({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(f){Promise.reject(f)}throw this.#a({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#a(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Gt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function nw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aw=class extends ho{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new tw({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=Ls(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=Ls(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Ls(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=Ls(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Gt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>zv(a,i))}findAll(e={}){return this.getAll().filter(a=>zv(e,a))}notify(e){Gt.batch(()=>{this.listeners.forEach(a=>{a(e)})DELIM" +R"DELIM()})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Gt.batch(()=>Promise.all(e.map(a=>a.continue().catch(un))))}};function Ls(e){return e.options.scope?.id}var rw=class extends ho{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??Vd(l,a);let u=this.get(s);return u||(u=new XS({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Gt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>Rv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>Rv(e,i)):a}notify(e){Gt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},iw=class{#e;#t;#n;#r;#a;#o;#l;#i;constructor(e={}){this.#e=e.queryCache||new rw,this.#t=e.mutationCache||new aw,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#l=Jd.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=ou.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#l?.(),this.#l=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#e.build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(fr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,f=US(a,u);if(f!==void 0)return this.#e.build(this,l).setData(f,{...i,manual:!0})}setQueriesData(e,a,i){return Gt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Gt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Gt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Gt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(un).catch(un)}invalidateQueries(e,a={}){return Gt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Gt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(un)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(l).then(un)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(fr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=Dv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=Dv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ou.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#r.set(to(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(l=>{no(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(to(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{no(e,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Vd(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnErro)DELIM" +R"DELIM(r=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Xd&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},T0=z.createContext(void 0),bu=e=>{const a=z.useContext(T0);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},lw=({client:e,children:a})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(T0.Provider,{value:e,children:a})),R0=z.createContext(!1),ow=()=>z.useContext(R0);R0.Provider;function sw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uw=z.createContext(sw()),cw=()=>z.useContext(uw),fw=(e,a,i)=>{const l=i?.state.error&&typeof e.throwOnError=="function"?x0(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},dw=e=>{z.useEffect(()=>{e.clearReset()},[e])},hw=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||x0(i,[e.error,l])),mw=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},pw=(e,a)=>e.isLoading&&e.isFetching&&!a,yw=(e,a)=>e?.suspense&&a.isPending,Lv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function vw(e,a,i){const l=ow(),s=cw(),u=bu(),f=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const h=u.getQueryCache().get(f.queryHash);f._optimisticResults=l?"isRestoring":"optimistic",mw(f),fw(f,s,h),dw(s);const p=!u.getQueryCache().get(f.queryHash),[m]=z.useState(()=>new a(u,f)),g=m.getOptimisticResult(f),v=!l&&e.subscribed!==!1;if(z.useSyncExternalStore(z.useCallback(x=>{const _=v?m.subscribe(Gt.batchCalls(x)):un;return m.updateResult(),_},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),z.useEffect(()=>{m.setOptions(f)},[f,m]),yw(f,g))throw Lv(f,m,s);if(hw({result:g,errorResetBoundary:s,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(f,g),f.experimental_prefetchInRender&&!Fr&&pw(g,l)&&(p?Lv(f,m,s):h?.promise)?.catch(un).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?g:m.trackResult(g)}function xn(e,a){return vw(e,JS)}const gw="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Bv=(e=21)=>{let a="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)a+=gw[i[e]&63];return a};var Xs={exports:{}},bw=Xs.exports,Hv;function xw(){return Hv||(Hv=1,(function(e,a){(function(i,l){e.exports=l()})(bw,(function(){var i=1e3,l=6e4,s=36e5,u="millisecond",f="second",h="minute",p="hour",m="day",g="week",v="month",x="quarter",_="year",E="date",T="Invalid Date",j=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,L={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(se){var $=["th","st","nd","rd"],S=se%100;return"["+se+($[(S-20)%10]||$[S]||$[0])+"]"}},U=function(se,$,S){var M=String(se);return!M||M.length>=$?se:""+Array($+1-M.length).join(S)+se},V={s:U,z:function(se){var $=-se.utcOffset(),S=Math.abs($),M=Math.floor(S/60),N=S%60;return($<=0?"+":"-")+U(M,2,"0")+":"+U(N,2,"0")},m:function se($,S){if($.date()1)return se(ae[0])}else{var R=$.name;ue[R]=$,N=R}return!M&&N&&(X=N),N||!M&&X},le=function(se,$){if(K(se))return se.clone();var S=typeof $=="object"?$:{};return S.date=se,S.args=arguments,new oe(S)},ne=V;ne.l=he,ne.i=K,ne.w=function(se,$){return le(se,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var oe=(function(){function se(S){this.$L=he(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[C]=!0}var $=se.prototype;return $.parse=function(S){this.$d=(function(M){var N=M.date,J=M.utc;if(N===null)return new Date(NaN);if(ne.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var ae=N.match(j);if(a)DELIM" +R"DELIM(e){var R=ae[2]-1||0,Q=(ae[7]||"0").substring(0,3);return J?new Date(Date.UTC(ae[1],R,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,Q)):new Date(ae[1],R,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,Q)}}return new Date(N)})(S),this.init()},$.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},$.$utils=function(){return ne},$.isValid=function(){return this.$d.toString()!==T},$.isSame=function(S,M){var N=le(S);return this.startOf(M)<=N&&N<=this.endOf(M)},$.isAfter=function(S,M){return le(S)-1&&S%1==0&&S0?M[L(0,N-1)]:void 0}function ue(S){return he(S)&&g.call(S,"callee")&&(!x.call(S,"callee")||v.call(S)==a)}var C=Array.isArray;function K(S){return S!=null&&ne(S.length)&&!le(S)}function he(S){return we(S)&&K(S)}function le(S){var M=oe(S)?v.call(S):"";return M==i||M==l}function ne(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=e}function oe(S){var M=typeof S;return!!S&&(M=="object"||M=="function")}function we(S){return!!S&&typeof S=="object"}function se(S){return K(S)?j(S):k(S)}function $(S){return S?h(S,se(S)):[]}return Vf=X,Vf}var _w=ww();const Ew=co(_w);function Aa(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const f=i.slice(0,l);if(["bc","tb","bcrt","ltc","sb"].includes(f)){const h=i.slice(l+1);if(!h)return;const p=h.charAt(0);return p==="p"?"p2tr":p==="q"?h.length===39||h.length===40||e.length===42?"p2wpkh":h.length===59||h.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const s=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(a)&&a.length>=26&&a.length<=35;switch(i[0]){case"1":case"m":case"n":return s?"p2pkh":void 0;case"3":case"2":return s?"p2sh":void 0;default:return}}const Fl=new Set;let Xf=0;function $v(e){for(const a of Fl)a(e)}const A0=z0().subtract(2,"hour").unix(),ur=Array.from({length:20}).map((e,a)=>{const i=`mock-tx-${a.toString().padStart(4,"0")}`,l=[{index:0,address:`bcrt1qmock${String(a)}`,valueSats:1e6+a*1234,scriptType:"p2wpkh",spent:!1,script:{hex:`0014mockoutput${String(a)}`,mnemonic:"OP_0 mock-output-pubkey"}}];return{txid:i,hash:i,status:"confirmed",confirmations:10-Math.floor(a/2),blockHeight:8e5-a,blockHash:`mock-block-${String(Math.floor(a/2))}`,receivedTime:A0+a*60,feeSats:250+a,feeRate:12+a*.1,size:225+a,weight:900+a*4,version:2,locktime:0,totalInput:1005e3,totalOutput:l.reduce((s,u)=>s+u.valueSats,0),inputs:[{index:0,prevTxId:`mock-prev-${String(a)}`,prevOutputIndex:0,address:`bcrt1qprev${String(a)}`,valueSats:1005e3,scriptType:"p2wpkh",script:{hex:`160014mockinputscriptsig${String(a)}`,mnemonic:"OP_PUSHBYTES_22 mock-input-scriptsig"},witness:["3045022100cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafe","02deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbe"],sequence:4294967293}],outputs:l}}),za=[];for(let e=0;e<6;e+=1){const a=8e5+e,i=`mock-block-${String(a)}`,l=ur.slice(e*3,e*3+3);za.push({hash:i,height:a,timestamp:A0+e*600,txCount:l.length,size:12e5,weight:4e6,difficulty:5e10,previousBlockHash:e===0?null:za[e-1]?.hash,merkleRoot:`mock-merkle-${String(e)}`,nonce:1e3+e,bits:486604799,version:2,nextBlockHash:null,transactions:l}),e>0&&(za[e-1].nextBlockHash=i)}const Tw={bcrt1qmock0:{address:"bcrt1qmock0",addressType:Aa("bcrt1qmock0"),balance:2345678,totalReceived:5e6,totalSent:2654322,txCount:5,utxoCount:3,transactions:ur.slice(0,5).map(e=>({txid:e.txid,timestamp:e.receivedTime,valueChange:e.outputs[0]?.valueSats??0,blockHeight:e.blockHeight}))}};function Bs(e){if(e==="latest"){const i=za.at(-1);if(!i)throw new Error("No blocks available");return i}const a=za.find(i=>i.hash===e||i.height.toString()===e);if(!a)throw new Error("Block not found");return a}function Wd(e){return Tw[e]??{address:e,addressType:Aa(e),balance:0,totalReceived:0,totalSent:0,txCount:0,utxoCount:0,transactions:[]}}function Rw(e){const{transactions:a,...i}=Wd(e);return i}function zw(e,a){const i=Wd(e),l=10,s=a?i.transactions.findIndex(u=>u.txid===a)+1:0;return s<=0&&a?[]:i.transactions.slice(s,s+l)}function Jf(){return{metadata:{id:"mock",label:"Mock data (offline)",type:"mock",connectionState:"connected",supportsWebsocket:!0,endpoint:"offline",description:"Generates synthetic blockchain data for development."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},getLatestBlocks(e=10){const a=[...za].reverse().slice(0,e))DELIM" +R"DELIM(.map(i=>({hash:i.hash,height:i.height,timestamp:i.timestamp,txCount:i.txCount,size:i.size,weight:i.weight,difficulty:i.difficulty,previousBlockHash:i.previousBlockHash}));return Promise.resolve(a)},getBlockHeader(e){const{transactions:a,...i}=Bs(e);return Promise.resolve(i)},getBlockStats(e){const a=Bs(e);return Promise.resolve({weight:a.weight,feesSats:a.feesSats,subsidySats:a.subsidySats,sigops:a.sigops})},getBlock(e){return Promise.resolve(Bs(e))},getBlocksBefore(e,a=10){const i=za.filter(l=>l.height<=e).reverse().slice(0,a).map(l=>({hash:l.hash,height:l.height,timestamp:l.timestamp,txCount:l.txCount,size:l.size,weight:l.weight,difficulty:l.difficulty,previousBlockHash:l.previousBlockHash}));return Promise.resolve(i)},getBlockTransactions(e,a=0){const i=Bs(e);return Promise.resolve(i.transactions.slice(a,a+25))},getTransactionHeader(e){const a=ur.find(i=>i.txid===e||i.hash===e);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getTransaction(e){const a=ur.find(i=>i.txid===e||i.hash===e);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getTransactionInputScriptHex(e,a){const i=ur.find(s=>s.txid===e||s.hash===e);if(!i)return Promise.reject(new Error("Transaction not found"));const l=i.inputs[a]?.script?.hex;return typeof l!="string"?Promise.reject(new Error("Input script hex not found")):Promise.resolve(l)},getTransactionOutputScriptHex(e,a){const i=ur.find(s=>s.txid===e||s.hash===e);if(!i)return Promise.reject(new Error("Transaction not found"));const l=i.outputs[a]?.script?.hex;return typeof l!="string"?Promise.reject(new Error("Output script hex not found")):Promise.resolve(l)},getAddressSummary(e){return Promise.resolve(Rw(e))},getAddress(e){return Promise.resolve(Wd(e))},getAddressTransactions(e,a){return Promise.resolve(zw(e,a))},subscribeToEvents(e){return Fl.add(e),Fl.size===1&&Aw(),()=>{Fl.delete(e),Fl.size===0&&Ow()}}}}let Il=null;function Aw(){Il||(Il=setInterval(()=>{const e=Mw();za.push(e),$v({type:"block.new",payload:Cw(e)});const a=Ew(ur);a&&$v({type:"tx.new",payload:a})},15e3))}function Ow(){Il&&(clearInterval(Il),Il=null)}function Cw(e){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:e.txCount,size:e.size,weight:e.weight,difficulty:e.difficulty,previousBlockHash:e.previousBlockHash}}function Mw(){Xf+=1;const e=za.at(-1);if(!e)throw new Error("No blocks available");const a=e.height+1,i=`mock-block-${String(a)}-${Bv(6)}`,l=z0().unix(),s=ur.slice(0,2).map(f=>({...f,blockHash:i,blockHeight:a})),u={hash:i,height:a,timestamp:l,txCount:s.length,size:12e5+Xf*1e3,weight:4e6,difficulty:5e10,previousBlockHash:e.hash,merkleRoot:`mock-merkle-${Bv(10)}`,nonce:1e3+Xf,bits:486604799,version:2,nextBlockHash:null,transactions:s};return e.nextBlockHash=i,u}function ee(e,a,i){function l(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:f,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),a(h,p);const m=f.prototype,g=Object.keys(m);for(let v=0;vi?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class qi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O0 extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const C0={};function Vr(e){return C0}function M0(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function Dd(e,a){return typeof a=="bigint"?a.toString():a}function eh(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function th(e){return e==null}function nh(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function Nw(e,a){const i=(e.toString().split(".")[1]||"").length,l=a.toString();let s=(l.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(l)){const p=l.match(/\d?e-(\d?)/);p?.[1]&&(s=Number.parseInt(p[1]))}const u=i>s?i:s,f=Number.parseInt(e.toFixed(u).replace(".","")),h=Number.parseInt(a.toFixed(u).replace(".",""));return f%h/10**u}const Zv=Symbol("evaluating");function et(e,a,i){let l;Object.defineProperty(e,a,{get(){if(l!==Zv)return l===void 0&&(l=Zv,l=i()),l},set(s){Object.defineProperty(e,a,{value:s})},configurable:!0})}function Jr(e,a,i){Object.defineProperty(e,a,{value:i,writable:!0,enumerable:!0,configurable:!0})}function mr(...e){const a={};for(const i of e){const l=Object.getOwnPropertyDescriptors(i);Object.assign(a,l)}return Object.def)DELIM" +R"DELIM(ineProperties({},a)}function qv(e){return JSON.stringify(e)}function jw(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const N0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function su(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Dw=eh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ao(e){if(su(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(su(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function j0(e){return ao(e)?{...e}:Array.isArray(e)?[...e]:e}const kw=new Set(["string","number","symbol"]);function xu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pr(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function Ee(e){const a=e;if(!a)return{};if(typeof a=="string")return{error:()=>a};if(a?.message!==void 0){if(a?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function Lw(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const Bw={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Hw(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=mr(e._zod.def,{get shape(){const f={};for(const h in a){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&(f[h]=i.shape[h])}return Jr(this,"shape",f),f},checks:[]});return pr(e,u)}function Uw(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=mr(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const h in a){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&delete f[h]}return Jr(this,"shape",f),f},checks:[]});return pr(e,u)}function $w(e,a){if(!ao(a))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const u=e._zod.def.shape;for(const f in a)if(Object.getOwnPropertyDescriptor(u,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=mr(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return Jr(this,"shape",u),u}});return pr(e,s)}function Zw(e,a){if(!ao(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=mr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return Jr(this,"shape",l),l}});return pr(e,i)}function qw(e,a){const i=mr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return Jr(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:[]});return pr(e,i)}function Qw(e,a,i){const s=a._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const f=mr(a._zod.def,{get shape(){const h=a._zod.def.shape,p={...h};if(i)for(const m in i){if(!(m in h))throw new Error(`Unrecognized key: "${m}"`);i[m]&&(p[m]=e?new e({type:"optional",innerType:h[m]}):h[m])}else for(const m in h)p[m]=e?new e({type:"optional",innerType:h[m]}):h[m];return Jr(this,"shape",p),p},checks:[]});return pr(a,f)}function Pw(e,a,i){const l=mr(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const f in i){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);i[f]&&(u[f]=new e({type:"nonoptional",innerType:s[f]}))}else for(const f in s)u[f]=new e({type:"nonoptional",innerType:s[f]});return Jr(this,"shape",u),u}});return pr(a,l)}function $i(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function Hs(e){return typeof e=="string"?e:e?.message}function Xr(e,a,i){const l={...e,path:e.path??[]};if(!e.message){const s=Hs(e.inst?._zod.def?.error?.(e))??Hs(a?.error?.(e))??Hs(i.customError?.(e))??Hs(i.localeError?.(e))??"Invalid input";l.message=s}return delete l.inst,delete l.continue,a?.reportInput||delete l.input,l}function ah(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ro(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const k0=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,Dd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},L0=ee(")DELIM" +R"DELIM($ZodError",k0),B0=ee("$ZodError",k0,{Parent:Error});function Yw(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function Gw(e,a=i=>i.message){const i={_errors:[]},l=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>l({issues:f}));else if(u.code==="invalid_key")l({issues:u.issues});else if(u.code==="invalid_element")l({issues:u.issues});else if(u.path.length===0)i._errors.push(a(u));else{let f=i,h=0;for(;h(a,i,l,s)=>{const u=l?Object.assign(l,{async:!1}):{async:!1},f=a._zod.run({value:i,issues:[]},u);if(f instanceof Promise)throw new qi;if(f.issues.length){const h=new(s?.Err??e)(f.issues.map(p=>Xr(p,u,Vr())));throw N0(h,s?.callee),h}return f.value},ih=e=>async(a,i,l,s)=>{const u=l?Object.assign(l,{async:!0}):{async:!0};let f=a._zod.run({value:i,issues:[]},u);if(f instanceof Promise&&(f=await f),f.issues.length){const h=new(s?.Err??e)(f.issues.map(p=>Xr(p,u,Vr())));throw N0(h,s?.callee),h}return f.value},Su=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new qi;return u.issues.length?{success:!1,error:new(e??L0)(u.issues.map(f=>Xr(f,s,Vr())))}:{success:!0,data:u.value}},Kw=Su(B0),wu=e=>async(a,i,l)=>{const s=l?Object.assign(l,{async:!0}):{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(f=>Xr(f,s,Vr())))}:{success:!0,data:u.value}},Fw=wu(B0),Vw=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return rh(e)(a,i,s)},Xw=e=>(a,i,l)=>rh(e)(a,i,l),Jw=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return ih(e)(a,i,s)},Iw=e=>async(a,i,l)=>ih(e)(a,i,l),Ww=e=>(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return Su(e)(a,i,s)},e2=e=>(a,i,l)=>Su(e)(a,i,l),t2=e=>async(a,i,l)=>{const s=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return wu(e)(a,i,s)},n2=e=>async(a,i,l)=>wu(e)(a,i,l),a2=/^[cC][^\s-]{8,}$/,r2=/^[0-9a-z]+$/,i2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l2=/^[0-9a-vA-V]{20}$/,o2=/^[A-Za-z0-9]{27}$/,s2=/^[a-zA-Z0-9_-]{21}$/,u2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,c2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qv=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,f2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,d2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function h2(){return new RegExp(d2,"u")}const m2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,p2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,y2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,v2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,g2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,H0=/^[A-Za-z0-9_-]*$/,b2=/^\+[1-9]\d{6,14}$/,U0="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",x2=new RegExp(`^${U0}$`);function $0(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function S2(e){return new RegExp(`^${$0(e)}$`)}function w2(e){const a=$0({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${U0}T(?:${l})$`)}const _2=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},E2=/^-?\d+$/,T2=/^-?\d+(?:\.\d+)?$/,R2=/^(?:true|false)$/i,z2=/^[^A-Z]*$/,A2=/^[^a-z]*$/,cn=ee("$ZodCheck",(e,a)=>)DELIM" +R"DELIM({var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),Z0={number:"number",bigint:"bigint",object:"date"},q0=ee("$ZodCheckLessThan",(e,a)=>{cn.init(e,a);const i=Z0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{cn.init(e,a);const i=Z0[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),O2=ee("$ZodCheckMultipleOf",(e,a)=>{cn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._zod.check=i=>{if(typeof i.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%a.value===BigInt(0):Nw(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:e,continue:!a.abort})}}),C2=ee("$ZodCheckNumberFormat",(e,a)=>{cn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=Bw[a.format];e._zod.onattach.push(f=>{const h=f._zod.bag;h.format=a.format,h.minimum=s,h.maximum=u,i&&(h.pattern=E2)}),e._zod.check=f=>{const h=f.value;if(i){if(!Number.isInteger(h)){f.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?f.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):f.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}hu&&f.issues.push({origin:"number",input:h,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!a.abort})}}),M2=ee("$ZodCheckMaxLength",(e,a)=>{var i;cn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!th(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const f=ah(s);l.issues.push({origin:f,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),N2=ee("$ZodCheckMinLength",(e,a)=>{var i;cn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!th(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const f=ah(s);l.issues.push({origin:f,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),j2=ee("$ZodCheckLengthEquals",(e,a)=>{var i;cn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!th(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const f=ah(s),h=u>a.length;l.issues.push({origin:f,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),_u=ee("$ZodCheckStringFormat",(e,a)=>{var i,l;cn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),D2=ee("$ZodCheckRegex",(e,a)=>{_u.init(e,a),e._zod.check=i=>{a.pattern.lastIndex=0,!a.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:a.pattern.toString(),inst:e,continue:!a.abort})}}),k2=ee("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=z2),_u.init(e,a)}),L2=ee("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=A2),_u.init(e,a)}),B2=ee("$ZodCheckIncludes",(e,a)=>{cn.init(e,a);const i=xu(a.includes),l=new RegExp(typeof a.position=="number"?`^.{${a.po)DELIM" +R"DELIM(sition}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),H2=ee("$ZodCheckStartsWith",(e,a)=>{cn.init(e,a);const i=new RegExp(`^${xu(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),U2=ee("$ZodCheckEndsWith",(e,a)=>{cn.init(e,a);const i=new RegExp(`.*${xu(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),$2=ee("$ZodCheckOverwrite",(e,a)=>{cn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class Z2{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const l=a.split(` +`).filter(f=>f),s=Math.min(...l.map(f=>f.length-f.trimStart().length)),u=l.map(f=>f.slice(s)).map(f=>" ".repeat(this.indent*2)+f);for(const f of u)this.content.push(f)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new a(...i,s.join(` +`))}}const q2={major:4,minor:3,patch:6},Rt=ee("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=q2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(f,h,p)=>{let m=$i(f),g;for(const v of h){if(v._zod.def.when){if(!v._zod.def.when(f))continue}else if(m)continue;const x=f.issues.length,_=v._zod.check(f);if(_ instanceof Promise&&p?.async===!1)throw new qi;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,f.issues.length!==x&&(m||(m=$i(f,x)))});else{if(f.issues.length===x)continue;m||(m=$i(f,x))}}return g?g.then(()=>f):f},u=(f,h,p)=>{if($i(f))return f.aborted=!0,f;const m=s(h,l,p);if(m instanceof Promise){if(p.async===!1)throw new qi;return m.then(g=>e._zod.parse(g,p))}return e._zod.parse(m,p)};e._zod.run=(f,h)=>{if(h.skipChecks)return e._zod.parse(f,h);if(h.direction==="backward"){const m=e._zod.parse({value:f.value,issues:[]},{...h,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,f,h)):u(m,f,h)}const p=e._zod.parse(f,h);if(p instanceof Promise){if(h.async===!1)throw new qi;return p.then(m=>s(m,l,h))}return s(p,l,h)}}et(e,"~standard",()=>({validate:s=>{try{const u=Kw(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Fw(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),lh=ee("$ZodString",(e,a)=>{Rt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_2(e._zod.bag),e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),ft=ee("$ZodStringFormat",(e,a)=>{_u.init(e,a),lh.init(e,a)}),Q2=ee("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=c2),ft.init(e,a)}),P2=ee("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Qv(l))}else a.pattern??(a.pattern=Qv());ft.init(e,a)}),Y2=ee("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=f2),ft.init(e,a)}),G2=ee("$ZodURL",(e,a)=>{ft.init(e,a),e._zod.check=i=>{try{const l=i.value.trim(),s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),K2=ee("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=h2()),ft.init(e,a)}),F2=ee("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=s2),ft.init(e,a)}),V2=ee("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=a2),ft.init(e,a)}),X2=ee("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=r2),ft.init(e,a)}),J2=ee("$ZodULID",(e,a)=>{a.pattern??(a.pattern=i2),ft.init)DELIM" +R"DELIM((e,a)}),I2=ee("$ZodXID",(e,a)=>{a.pattern??(a.pattern=l2),ft.init(e,a)}),W2=ee("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=o2),ft.init(e,a)}),e_=ee("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=w2(a)),ft.init(e,a)}),t_=ee("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=x2),ft.init(e,a)}),n_=ee("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=S2(a)),ft.init(e,a)}),a_=ee("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=u2),ft.init(e,a)}),r_=ee("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=m2),ft.init(e,a),e._zod.bag.format="ipv4"}),i_=ee("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=p2),ft.init(e,a),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!a.abort})}}}),l_=ee("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=y2),ft.init(e,a)}),o_=ee("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=v2),ft.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const f=Number(u);if(`${f}`!==u)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!a.abort})}}});function P0(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const s_=ee("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=g2),ft.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{P0(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function u_(e){if(!H0.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return P0(i)}const c_=ee("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=H0),ft.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{u_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),f_=ee("$ZodE164",(e,a)=>{a.pattern??(a.pattern=b2),ft.init(e,a)});function d_(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const h_=ee("$ZodJWT",(e,a)=>{ft.init(e,a),e._zod.check=i=>{d_(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),Y0=ee("$ZodNumber",(e,a)=>{Rt.init(e,a),e._zod.pattern=e._zod.bag.pattern??T2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),m_=ee("$ZodNumberFormat",(e,a)=>{C2.init(e,a),Y0.init(e,a)}),p_=ee("$ZodBoolean",(e,a)=>{Rt.init(e,a),e._zod.pattern=R2,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),y_=ee("$ZodUnknown",(e,a)=>{Rt.init(e,a),e._zod.parse=i=>i}),v_=ee("$ZodNever",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Pv(e,a,i){e.issues.length&&a.issues.push(...D0(i,e.issues)),a.value[i]=e.value}const g_=ee("$ZodArray",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let f=0;fPv(m,i,f))):Pv(p,i,f)}return u.length?Promise.all(u).then(()=>i):i}});function uu(e,a,i,l,s){if(e.issues.length){if(s&&!(i in l))return;a.issues.push(...D0(i,e.issues))}e.value===void 0?i in l&&(a.value[i]=void 0):a.value[i]=e.value}function G0(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=Lw(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function K0(e,a,i,l,s,u){const f=[],h=s.keySet,p=s.catchall._zod,m=p.def.type,g=p.optout==="optional";for(const v in a){if(h.has(v))continue;if(m==="never"){f.push(v);continue}const x=p.run({value:a[v],issues:[]},l);x instanceof Promise?e.push(x.then(_=>uu(_,i,v,a,g))):uu(x,i,v,a,g)}return f.length&&i.issues.push({code:"unrecognized_keys",keys:f,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const b_=ee("$ZodObject",(e,a)=>{if(Rt.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const h=a.shape;Object.defineProperty(a,"shape",{get:()=>{const p={...h};return Object.defineProperty(a,"shape",{value:p}),p}})}const l=eh(()=>G0(a));et(e._zod,"propValues",()=>{const h=a.shape,p={};for(const m in h){const g=h[m]._zod;if()DELIM" +R"DELIM(g.values){p[m]??(p[m]=new Set);for(const v of g.values)p[m].add(v)}}return p});const s=su,u=a.catchall;let f;e._zod.parse=(h,p)=>{f??(f=l.value);const m=h.value;if(!s(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h;h.value={};const g=[],v=f.shape;for(const x of f.keys){const _=v[x],E=_._zod.optout==="optional",T=_._zod.run({value:m[x],issues:[]},p);T instanceof Promise?g.push(T.then(j=>uu(j,h,x,m,E))):uu(T,h,x,m,E)}return u?K0(g,m,h,p,l.value,e):g.length?Promise.all(g).then(()=>h):h}}),x_=ee("$ZodObjectJIT",(e,a)=>{b_.init(e,a);const i=e._zod.parse,l=eh(()=>G0(a)),s=x=>{const _=new Z2(["shape","payload","ctx"]),E=l.value,T=U=>{const V=qv(U);return`shape[${V}]._zod.run({ value: input[${V}], issues: [] }, ctx)`};_.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const U of E.keys)j[U]=`key_${k++}`;_.write("const newResult = {};");for(const U of E.keys){const V=j[U],X=qv(U),C=x[U]?._zod?.optout==="optional";_.write(`const ${V} = ${T(U)};`),C?_.write(` + if (${V}.issues.length) { + if (${X} in input) { + payload.issues = payload.issues.concat(${V}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${X}, ...iss.path] : [${X}] + }))); + } + } + + if (${V}.value === undefined) { + if (${X} in input) { + newResult[${X}] = undefined; + } + } else { + newResult[${X}] = ${V}.value; + } + + `):_.write(` + if (${V}.issues.length) { + payload.issues = payload.issues.concat(${V}.issues.map(iss => ({ ...iss, - path: iss.path ? [${I}, ...iss.path] : [${I}] + path: iss.path ? [${X}, ...iss.path] : [${X}] }))); } - - if (${J}.value === undefined) { - if (${I} in input) { - newResult[${I}] = undefined; + if (${V}.value === undefined) { + if (${X} in input) { + newResult[${X}] = undefined; } } else { - newResult[${I}] = ${J}.value; + newResult[${X}] = ${V}.value; } - `)}_.write("payload.value = newResult;"),_.write("return payload;");const L=_.compile();return(U,J)=>L(x,U,J)};let u;const d=su,h=!C0.jitless,m=h&&Mw.value,g=a.catchall;let v;e._zod.parse=(x,_)=>{v??(v=l.value);const E=x.value;return d(E)?h&&m&&_?.async===!1&&_.jitless!==!0?(u||(u=s(a.shape)),x=u(x,_),g?G0([],E,x,_,v,e):x):i(x,_):(x.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),x)}});function Yv(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!$i(u));return s.length===1?(a.value=s[0].value,s[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:e.map(u=>u.issues.map(d=>Vr(d,l,Fr())))}),a)}const g_=ee("$ZodUnion",(e,a)=>{Rt.init(e,a),rt(e._zod,"optin",()=>a.options.some(s=>s._zod.optin==="optional")?"optional":void 0),rt(e._zod,"optout",()=>a.options.some(s=>s._zod.optout==="optional")?"optional":void 0),rt(e._zod,"values",()=>{if(a.options.every(s=>s._zod.values))return new Set(a.options.flatMap(s=>Array.from(s._zod.values)))}),rt(e._zod,"pattern",()=>{if(a.options.every(s=>s._zod.pattern)){const s=a.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>th(u.source)).join("|")})$`)}});const i=a.options.length===1,l=a.options[0]._zod.run;e._zod.parse=(s,u)=>{if(i)return l(s,u);let d=!1;const h=[];for(const p of a.options){const m=p._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)h.push(m),d=!0;else{if(m.issues.length===0)return m;h.push(m)}}return d?Promise.all(h).then(p=>Yv(p,s,e,u)):Yv(h,s,e,u)}}),b_=ee("$ZodIntersection",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),d=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||d instanceof Promise?Promise.all([u,d]).then(([p,m])=>Gv(i,p,m)):Gv(i,u,d)}});function Dd(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(no(e)&&no(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const d=Dd(e[u],a[u]);if(!d.valid)return{valid:!1,mergeErrorPath:[u,...d.mergeErrorPath]};s[u]=d.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;l{Rt.init(e,a);const i=O0(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>Nw.has(typeof s)).map(s=>typeof s=="string"?xu(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const d=s.value;return l.has(d)||s.issues.push({code:"invalid_value",values:i,input:d,inst:e}),s}}),S_=ee("$ZodTransform",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new A0(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(d=>(i.value=d,i));if(s instanceof Promise)throw new qi;return i.value=s,i}});function Kv(e,a){return e.issues.length&&a===void 0?{issues:[],value:void 0}:e}const w_=ee("$ZodOptional",(e,a)=>{Rt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",rt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),rt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${th(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Kv(u,i.value)):Kv(s,i.value)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),__=ee("$ZodNullable",(e,a)=>{Rt.init(e,a),rt(e._zod,"optin",()=>a.innerType._zod.optin),rt(e._zod,"optout",()=>a.innerType._zod.optout),rt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${th(i.source)}|null)$`):void 0}),rt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),E_=ee("$ZodDefault",(e,a)=>{Rt.init(e,a),e._zod.optin="optional",rt(e._zod,"values",()=>a.innerType._zod.values),e._zod.par)DELIM" - R"DELIM(se=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Fv(u,a)):Fv(s,a)}});function Fv(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const T_=ee("$ZodPrefault",(e,a)=>{Rt.init(e,a),e._zod.optin="optional",rt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),R_=ee("$ZodNonOptional",(e,a)=>{Rt.init(e,a),rt(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Vv(u,e)):Vv(s,e)}});function Vv(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const z_=ee("$ZodCatch",(e,a)=>{Rt.init(e,a),rt(e._zod,"optin",()=>a.innerType._zod.optin),rt(e._zod,"optout",()=>a.innerType._zod.optout),rt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(d=>Vr(d,l,Fr()))},input:i.value}),i.issues=[]),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>Vr(u,l,Fr()))},input:i.value}),i.issues=[]),i)}}),A_=ee("$ZodPipe",(e,a)=>{Rt.init(e,a),rt(e._zod,"values",()=>a.in._zod.values),rt(e._zod,"optin",()=>a.in._zod.optin),rt(e._zod,"optout",()=>a.out._zod.optout),rt(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(d=>Us(d,a.in,l)):Us(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>Us(u,a.out,l)):Us(s,a.out,l)}});function Us(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues},i)}const C_=ee("$ZodReadonly",(e,a)=>{Rt.init(e,a),rt(e._zod,"propValues",()=>a.innerType._zod.propValues),rt(e._zod,"values",()=>a.innerType._zod.values),rt(e._zod,"optin",()=>a.innerType?._zod?.optin),rt(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(Xv):Xv(s)}});function Xv(e){return e.value=Object.freeze(e.value),e}const O_=ee("$ZodCustom",(e,a)=>{cn.init(e,a),Rt.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>Jv(u,i,l,e));Jv(s,i,l,e)}});function Jv(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(ao(s))}}var Iv;class M_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const l=i[0];if(this._map.set(a,l),l&&typeof l=="object"&&"id"in l){if(this._idmap.has(l.id))throw new Error(`ID ${l.id} already exists in the registry`);this._idmap.set(l.id,a)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const i=this._map.get(a);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(a),this}get(a){const i=a._zod.parent;if(i){const l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function N_(){return new M_}(Iv=globalThis).__zod_globalRegistry??(Iv.__zod_globalRegistry=N_());const Fl=globalThis.__zod_globalRegistry;function j_(e,a){return new e({type:"string",..._e(a)})}function D_(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._e(a)})}function Wv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._e(a)})}function k_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._e(a)})}function L_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._e(a)})}function B_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._e(a)})}function H_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._e(a)})}function U_(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._e(a)})}function $_(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._e(a)})}function Z_(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._e(a)})}function q_(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._e(a)})}function Q_(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._e(a)})}function P_(e,a){)DELIM" - R"DELIM(return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._e(a)})}function Y_(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._e(a)})}function G_(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._e(a)})}function K_(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._e(a)})}function F_(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._e(a)})}function V_(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._e(a)})}function X_(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._e(a)})}function J_(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._e(a)})}function I_(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._e(a)})}function W_(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._e(a)})}function eE(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._e(a)})}function tE(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._e(a)})}function nE(e,a){return new e({type:"string",format:"date",check:"string_format",..._e(a)})}function aE(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,..._e(a)})}function rE(e,a){return new e({type:"string",format:"duration",check:"string_format",..._e(a)})}function iE(e,a){return new e({type:"number",checks:[],..._e(a)})}function lE(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._e(a)})}function oE(e,a){return new e({type:"boolean",..._e(a)})}function sE(e){return new e({type:"unknown"})}function uE(e,a){return new e({type:"never",..._e(a)})}function eg(e,a){return new Z0({check:"less_than",..._e(a),value:e,inclusive:!1})}function Jf(e,a){return new Z0({check:"less_than",..._e(a),value:e,inclusive:!0})}function tg(e,a){return new q0({check:"greater_than",..._e(a),value:e,inclusive:!1})}function If(e,a){return new q0({check:"greater_than",..._e(a),value:e,inclusive:!0})}function ng(e,a){return new R2({check:"multiple_of",..._e(a),value:e})}function K0(e,a){return new A2({check:"max_length",..._e(a),maximum:e})}function cu(e,a){return new C2({check:"min_length",..._e(a),minimum:e})}function F0(e,a){return new O2({check:"length_equals",..._e(a),length:e})}function cE(e,a){return new M2({check:"string_format",format:"regex",..._e(a),pattern:e})}function fE(e){return new N2({check:"string_format",format:"lowercase",..._e(e)})}function dE(e){return new j2({check:"string_format",format:"uppercase",..._e(e)})}function hE(e,a){return new D2({check:"string_format",format:"includes",..._e(a),includes:e})}function mE(e,a){return new k2({check:"string_format",format:"starts_with",..._e(a),prefix:e})}function pE(e,a){return new L2({check:"string_format",format:"ends_with",..._e(a),suffix:e})}function Gi(e){return new B2({check:"overwrite",tx:e})}function yE(e){return Gi(a=>a.normalize(e))}function vE(){return Gi(e=>e.trim())}function gE(){return Gi(e=>e.toLowerCase())}function bE(){return Gi(e=>e.toUpperCase())}function xE(){return Gi(e=>Ow(e))}function SE(e,a,i){return new e({type:"array",element:a,..._e(i)})}function wE(e,a,i){return new e({type:"custom",check:"custom",fn:a,..._e(i)})}function _E(e){const a=EE(i=>(i.addIssue=l=>{if(typeof l=="string")i.issues.push(ao(l,i.value,a._zod.def));else{const s=l;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=a),s.continue??(s.continue=!a._zod.def.abort),i.issues.push(ao(s))}},e(i.value,i)));return a}function EE(e,a){const i=new cn({check:"custom",..._e(a)});return i._zod.check=e,i}function V0(e){let a=e?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Fl,target:a,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Kt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const d={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,d);const h=e._zod.toJSONSchema?.();if(h)d.schema=h;else{const g={...i,schemaPath:[...i.schemaPath,e],path:i.path},v=e._zod.parent;if(v)d.ref=v,Kt(v,a,g),a.seen.get(v).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,d.schema,g);else{const x=d.schema,_=a.processors[s.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);_(e,a,x,g)}}const p=a.metadataRegistry.get(e);return p&&Object.assign(d.schema,p),a.io==="input"&&It(e)&&(delete d.schema.examples,delete d.schema.default),a.io==="input"&&d.schema._prefault&&((l=d.)DELIM" - R"DELIM(schema).default??(l.default=d.schema._prefault)),delete d.schema._prefault,a.seen.get(e).schema}function X0(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=u=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(u[0])?.id,v=e.external.uri??(_=>_);if(g)return{ref:v(g)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${v("__shared")}#/${d}/${x}`}}if(u[1]===i)return{ref:"#"};const p=`#/${d}/`,m=u[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:p+m}},s=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:h,defId:p}=l(u);d.def={...d.schema},p&&(d.defId=p);const m=d.schema;for(const g in m)delete m[g];m.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ + `)}_.write("payload.value = newResult;"),_.write("return payload;");const L=_.compile();return(U,V)=>L(x,U,V)};let u;const f=su,h=!C0.jitless,m=h&&Dw.value,g=a.catchall;let v;e._zod.parse=(x,_)=>{v??(v=l.value);const E=x.value;return f(E)?h&&m&&_?.async===!1&&_.jitless!==!0?(u||(u=s(a.shape)),x=u(x,_),g?K0([],E,x,_,v,e):x):i(x,_):(x.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),x)}});function Yv(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!$i(u));return s.length===1?(a.value=s[0].value,s[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:e.map(u=>u.issues.map(f=>Xr(f,l,Vr())))}),a)}const S_=ee("$ZodUnion",(e,a)=>{Rt.init(e,a),et(e._zod,"optin",()=>a.options.some(s=>s._zod.optin==="optional")?"optional":void 0),et(e._zod,"optout",()=>a.options.some(s=>s._zod.optout==="optional")?"optional":void 0),et(e._zod,"values",()=>{if(a.options.every(s=>s._zod.values))return new Set(a.options.flatMap(s=>Array.from(s._zod.values)))}),et(e._zod,"pattern",()=>{if(a.options.every(s=>s._zod.pattern)){const s=a.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>nh(u.source)).join("|")})$`)}});const i=a.options.length===1,l=a.options[0]._zod.run;e._zod.parse=(s,u)=>{if(i)return l(s,u);let f=!1;const h=[];for(const p of a.options){const m=p._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)h.push(m),f=!0;else{if(m.issues.length===0)return m;h.push(m)}}return f?Promise.all(h).then(p=>Yv(p,s,e,u)):Yv(h,s,e,u)}}),w_=ee("$ZodIntersection",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),f=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||f instanceof Promise?Promise.all([u,f]).then(([p,m])=>Gv(i,p,m)):Gv(i,u,f)}});function kd(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(ao(e)&&ao(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const f=kd(e[u],a[u]);if(!f.valid)return{valid:!1,mergeErrorPath:[u,...f.mergeErrorPath]};s[u]=f.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;lh.l&&h.r).map(([h])=>h);if(u.length&&s&&e.issues.push({...s,keys:u}),$i(e))return e;const f=kd(a.value,i.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return e.v)DELIM" +R"DELIM(alue=f.data,e}const __=ee("$ZodEnum",(e,a)=>{Rt.init(e,a);const i=M0(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>kw.has(typeof s)).map(s=>typeof s=="string"?xu(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const f=s.value;return l.has(f)||s.issues.push({code:"invalid_value",values:i,input:f,inst:e}),s}}),E_=ee("$ZodTransform",(e,a)=>{Rt.init(e,a),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new O0(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(f=>(i.value=f,i));if(s instanceof Promise)throw new qi;return i.value=s,i}});function Kv(e,a){return e.issues.length&&a===void 0?{issues:[],value:void 0}:e}const F0=ee("$ZodOptional",(e,a)=>{Rt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",et(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),et(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${nh(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Kv(u,i.value)):Kv(s,i.value)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),T_=ee("$ZodExactOptional",(e,a)=>{F0.init(e,a),et(e._zod,"values",()=>a.innerType._zod.values),et(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,l)=>a.innerType._zod.run(i,l)}),R_=ee("$ZodNullable",(e,a)=>{Rt.init(e,a),et(e._zod,"optin",()=>a.innerType._zod.optin),et(e._zod,"optout",()=>a.innerType._zod.optout),et(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${nh(i.source)}|null)$`):void 0}),et(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),z_=ee("$ZodDefault",(e,a)=>{Rt.init(e,a),e._zod.optin="optional",et(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Fv(u,a)):Fv(s,a)}});function Fv(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const A_=ee("$ZodPrefault",(e,a)=>{Rt.init(e,a),e._zod.optin="optional",et(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),O_=ee("$ZodNonOptional",(e,a)=>{Rt.init(e,a),et(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Vv(u,e)):Vv(s,e)}});function Vv(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const C_=ee("$ZodCatch",(e,a)=>{Rt.init(e,a),et(e._zod,"optin",()=>a.innerType._zod.optin),et(e._zod,"optout",()=>a.innerType._zod.optout),et(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(f=>Xr(f,l,Vr()))},input:i.value}),i.issues=[]),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>Xr(u,l,Vr()))},input:i.value}),i.issues=[]),i)}}),M_=ee("$ZodPipe",(e,a)=>{Rt.init(e,a),et(e._zod,"values",()=>a.in._zod.values),et(e._zod,"optin",()=>a.in._zod.optin),et(e._zod,"optout",()=>a.out._zod.optout),et(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(f=>Us(f,a.in,l)):Us(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>Us(u,a.out,l)):Us(s,a.out,l)}});function Us(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues},i)}const N_=ee("$ZodReadonly",(e,a)=>{Rt.init(e,a),et(e._zod,"propValues",()=>a.innerType._zod.propValues),et(e._zod,"values",()=>a.innerType._zod.values),et(e._zod,"optin",()=>a.innerType?._zod?.optin),et(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(Xv):Xv(s)}});function Xv(e){return e.value=Object.freeze(e.value),e}const j_=ee("$ZodCustom",(e,a)=>{cn.init(e,a),Rt.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>Jv(u,i,l,e));Jv(s,i,l,e)}});function Jv(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(ro(s))}}var Iv;class D_{constructor(){this._map=new We)DELIM" +R"DELIM(akMap,this._idmap=new Map}add(a,...i){const l=i[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const i=this._map.get(a);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(a),this}get(a){const i=a._zod.parent;if(i){const l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function k_(){return new D_}(Iv=globalThis).__zod_globalRegistry??(Iv.__zod_globalRegistry=k_());const Vl=globalThis.__zod_globalRegistry;function L_(e,a){return new e({type:"string",...Ee(a)})}function B_(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(a)})}function Wv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(a)})}function H_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(a)})}function U_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(a)})}function $_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(a)})}function Z_(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(a)})}function q_(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(a)})}function Q_(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(a)})}function P_(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(a)})}function Y_(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(a)})}function G_(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(a)})}function K_(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(a)})}function F_(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(a)})}function V_(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(a)})}function X_(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(a)})}function J_(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(a)})}function I_(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(a)})}function W_(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(a)})}function eE(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(a)})}function tE(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(a)})}function nE(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(a)})}function aE(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(a)})}function rE(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(a)})}function iE(e,a){return new e({type:"string",format:"date",check:"string_format",...Ee(a)})}function lE(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(a)})}function oE(e,a){return new e({type:"string",format:"duration",check:"string_format",...Ee(a)})}function sE(e,a){return new e({type:"number",checks:[],...Ee(a)})}function uE(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(a)})}function cE(e,a){return new e({type:"boolean",...Ee(a)})}function fE(e){return new e({type:"unknown"})}function dE(e,a){return new e({type:"never",...Ee(a)})}function eg(e,a){return new q0({check:"less_than",...Ee(a),value:e,inclusive:!1})}function If(e,a){return new q0({check:"less_than",...Ee(a),value:e,inclusive:!0})}function tg(e,a){return new Q0({check:"greater_than",...Ee(a),value:e,inclusive:!1})}function Wf(e,a){return new Q0({check:"greater_than",...Ee(a),value:e,inclusive:!0})}function ng(e,a){return new O2({check:"multiple_of",...Ee(a),value:e})}function V0(e,a){return new M2({check:"max_length",...Ee(a),maximum:e})}function cu(e,a){return new N2({check:"min_length",...Ee(a),minimum:e})}function X0(e,a){return new j2({check:"length_equals",...Ee(a),length:e})}function hE(e,a){return new D2({check:"string_format",format:"regex",...Ee(a),pattern:e})}function mE(e){return new k2({check:"string_format",format:"lowercase",...Ee(e)})}function pE(e){return new L2({check:"string_format",format:"uppercase",...Ee(e)})}function yE(e,a){return new B2({check:"string_format",format:"includes",...Ee(a),includes:e})}function vE(e,a){return new H2({check:"string_format",format:"starts_with",...Ee(a),prefix:e})}function gE(e,a){return new U2({check:"string_format",format:"ends_with",...Ee(a),suffix:e})}function Gi(e){return new $2({check:"overwrite",tx:e})}function bE(e){return Gi(a=>a.nor)DELIM" +R"DELIM(malize(e))}function xE(){return Gi(e=>e.trim())}function SE(){return Gi(e=>e.toLowerCase())}function wE(){return Gi(e=>e.toUpperCase())}function _E(){return Gi(e=>jw(e))}function EE(e,a,i){return new e({type:"array",element:a,...Ee(i)})}function TE(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Ee(i)})}function RE(e){const a=zE(i=>(i.addIssue=l=>{if(typeof l=="string")i.issues.push(ro(l,i.value,a._zod.def));else{const s=l;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=a),s.continue??(s.continue=!a._zod.def.abort),i.issues.push(ro(s))}},e(i.value,i)));return a}function zE(e,a){const i=new cn({check:"custom",...Ee(a)});return i._zod.check=e,i}function J0(e){let a=e?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vl,target:a,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Kt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const f={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,f);const h=e._zod.toJSONSchema?.();if(h)f.schema=h;else{const g={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,f.schema,g);else{const x=f.schema,_=a.processors[s.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);_(e,a,x,g)}const v=e._zod.parent;v&&(f.ref||(f.ref=v),Kt(v,a,g),a.seen.get(v).isParent=!0)}const p=a.metadataRegistry.get(e);return p&&Object.assign(f.schema,p),a.io==="input"&&It(e)&&(delete f.schema.examples,delete f.schema.default),a.io==="input"&&f.schema._prefault&&((l=f.schema).default??(l.default=f.schema._prefault)),delete f.schema._prefault,a.seen.get(e).schema}function I0(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const f of e.seen.entries()){const h=e.metadataRegistry.get(f[0])?.id;if(h){const p=l.get(h);if(p&&p!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(h,f[0])}}const s=f=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(f[0])?.id,x=e.external.uri??(E=>E);if(v)return{ref:x(v)};const _=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=_,{defId:_,ref:`${x("__shared")}#/${h}/${_}`}}if(f[1]===i)return{ref:"#"};const m=`#/${h}/`,g=f[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:p,defId:m}=s(f);h.def={...h.schema},m&&(h.defId=m);const g=h.schema;for(const v in g)delete g[v];g.$ref=p};if(e.cycles==="throw")for(const f of e.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(a===u[0]){s(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(a!==u[0]&&p){s(u);continue}}if(e.metadataRegistry.get(u[0])?.id){s(u);continue}if(d.cycle){s(u);continue}if(d.count>1&&e.reused==="ref"){s(u);continue}}}function J0(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=d=>{const h=e.seen.get(d),p=h.def??h.schema,m={...p};if(h.ref===null)return;const g=h.ref;if(h.ref=null,g){l(g);const v=e.seen.get(g).schema;v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):(Object.assign(p,v),Object.assign(p,m))}h.isParent||e.override({zodSchema:d,jsonSchema:p,path:h.path??[]})};for(const d of[...e.seen.entries()].reverse())l(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(a)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,i.def??i.schema);const u=e.external?.defs??{};for(const d of e.seen.entries()){const h=d[1];h.def&&h.defId&&(u[h.defId]=h.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:fu(a,"input"),output:fu(a,"output")}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function It(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return It(l.element,i);if(l.type==="set")return It(l.valueType,i);if(l.type==="lazy")return It(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return It(l.innerType,i);if(l.type==="intersection")return It(l.left,i)||It(l.right,i);if(l.type==="record"||l.type==="map")return It(l.keyType,i)||It(l.valueType,i);if(l.type==="pipe")return It(l.in,i)||It(l.out,i);if(l.type==="object"){for(const s in l.shape)if(It(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(It(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(It(s,i))return!0;return!!(l.rest&&It(l.rest,i))}return!1}const TE=(e,a={})=>i=>{const l=V0({...i,processors:a});return Kt(e,l),X0(l,e),J0(l,e)},fu=(e,a)=>i=>{const{libraryOptions:l,target:s}=i??{},u=V0({...l??{},target:s,io:a,processors:{}});return Kt(e,u),X0(u,e),J0(u,e)},RE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zE=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:d,format:h,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof d=="number"&&(s.maxLength=d),h&&(s.format=RE[h]??h,s.format===""&&delete s.format),m&&(s.contentEncoding=m),p&&p.size>0){const g=[...p];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(v=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},AE=(e,a,i,l)=>{const s=i,{minimum:u,maximum:d,format:h,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof h=="string"&&h.includes("int")?s.type="integer":s.type="number",typeof g=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.minimum=g,s.exclusiveMinimum=!0):s.exclusiveMinimum=g),typeof u=="number"&&(s.minimum=u,typeof g=="number"&&a.target!=="draft-04"&&(g>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof m=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.maximum=m,s.exclusiveMaximum=!0):s.exclusiveMaximum=m),typeof d=="number"&&(s.maximum=d,typeof m=="nu)DELIM" -R"DELIM(mber"&&a.target!=="draft-04"&&(m<=d?delete s.maximum:delete s.exclusiveMaximum)),typeof p=="number"&&(s.multipleOf=p)},CE=(e,a,i,l)=>{i.type="boolean"},OE=(e,a,i,l)=>{i.not={}},ME=(e,a,i,l)=>{},NE=(e,a,i,l)=>{const s=e._zod.def,u=O0(s.entries);u.every(d=>typeof d=="number")&&(i.type="number"),u.every(d=>typeof d=="string")&&(i.type="string"),i.enum=u},jE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},DE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kE=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(s.minItems=d),typeof h=="number"&&(s.maxItems=h),s.type="array",s.items=Kt(u.element,a,{...l,path:[...l.path,"items"]})},LE=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const d=u.shape;for(const m in d)s.properties[m]=Kt(d[m],a,{...l,path:[...l.path,"properties",m]});const h=new Set(Object.keys(d)),p=new Set([...h].filter(m=>{const g=u.shape[m]._zod;return a.io==="input"?g.optin===void 0:g.optout===void 0}));p.size>0&&(s.required=Array.from(p)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Kt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},BE=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,d=s.options.map((h,p)=>Kt(h,a,{...l,path:[...l.path,u?"oneOf":"anyOf",p]}));u?i.oneOf=d:i.anyOf=d},HE=(e,a,i,l)=>{const s=e._zod.def,u=Kt(s.left,a,{...l,path:[...l.path,"allOf",0]}),d=Kt(s.right,a,{...l,path:[...l.path,"allOf",1]}),h=m=>"allOf"in m&&Object.keys(m).length===1,p=[...h(u)?u.allOf:[u],...h(d)?d.allOf:[d]];i.allOf=p},UE=(e,a,i,l)=>{const s=e._zod.def,u=Kt(s.innerType,a,l),d=a.seen.get(e);a.target==="openapi-3.0"?(d.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},$E=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},ZE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},qE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},QE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let d;try{d=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=d},PE=(e,a,i,l)=>{const s=e._zod.def,u=a.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Kt(u,a,l);const d=a.seen.get(e);d.ref=u},YE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},GE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},KE=ee("ZodISODateTime",(e,a)=>{J2.init(e,a),pt.init(e,a)});function FE(e){return tE(KE,e)}const VE=ee("ZodISODate",(e,a)=>{I2.init(e,a),pt.init(e,a)});function XE(e){return nE(VE,e)}const JE=ee("ZodISOTime",(e,a)=>{W2.init(e,a),pt.init(e,a)});function IE(e){return aE(JE,e)}const WE=ee("ZodISODuration",(e,a)=>{e_.init(e,a),pt.init(e,a)});function e4(e){return rE(WE,e)}const t4=(e,a)=>{k0.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Qw(e,i)},flatten:{value:i=>qw(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,jd,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,jd,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ln=ee("ZodError",t4,{Parent:Error}),n4=ah(Ln),a4=rh(Ln),r4=Su(Ln),i4=wu(Ln),l4=Gw(Ln),o4=Kw(Ln),s4=Fw(Ln),u4=Vw(Ln),c4=Xw(Ln),f4=Jw(Ln),d4=Iw(Ln),h4=Ww(Ln),jt=ee("ZodType",(e,a)=>(Rt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:fu(e,"input"),output:fu(e,"output")}}),e.toJSONSchema=TE(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.check=(...i)=>e.clone(Jr(a,{checks:[...a.checks??[],...i.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]})),e.clone=(i,l)=>hr(e,i,l),e.brand=()=>e,e.register=((i,l)=>(i.add(e,l),e)),e.parse=(i,l)=>n4(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>r4(e,i,l),e.parseAsync=async(i,l)=>a4(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>i4(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>l4(e,i,l),e.decode=(i,l)=>o4(e,i,l),e.encodeAsync=async(i,l)=>s4(e,i,l),e.decodeAsync=async(i,l)=>u4(e,i,l),e.safeEncode=(i,l)=>c4(e,i,l),e.safeDecode=(i,l)=>f4(e,i,l),e.safeEncodeAsync=async(i,l)=>d4(e,i,l),e.safeDecodeAsync=async(i,l)=>h4(e,i,l),e.refine=(i,l)=>e.check(rT(i,l)),e.superRefine=i=>e.check(iT(i)),e.overwrite=i=>e.check(Gi(i)),e.optional=()=>lg(e),e.nullable=()=>og(e),e.nullish=()=>lg(og(e)),e.nonoptional=i=>J4(e,i),e.array=()=>Pi(e),e.or=i=>$4([e,i]),e.and=i=>q4(e,i),e.transform=i=>sg(e,Y4(i)),e.default=i=>F4(e,i),e.prefault=i=>X4(e,i),e.catch=i=>W4(e,i),e.pipe=i=>sg(e,i),e.readonly=()=>nT(e),e)DELIM" -R"DELIM(.describe=i=>{const l=e.clone();return Fl.add(l,{description:i}),l},Object.defineProperty(e,"description",{get(){return Fl.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Fl.get(e);const l=e.clone();return Fl.add(l,i[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),I0=ee("_ZodString",(e,a)=>{ih.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>zE(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...l)=>e.check(cE(...l)),e.includes=(...l)=>e.check(hE(...l)),e.startsWith=(...l)=>e.check(mE(...l)),e.endsWith=(...l)=>e.check(pE(...l)),e.min=(...l)=>e.check(cu(...l)),e.max=(...l)=>e.check(K0(...l)),e.length=(...l)=>e.check(F0(...l)),e.nonempty=(...l)=>e.check(cu(1,...l)),e.lowercase=l=>e.check(fE(l)),e.uppercase=l=>e.check(dE(l)),e.trim=()=>e.check(vE()),e.normalize=(...l)=>e.check(yE(...l)),e.toLowerCase=()=>e.check(gE()),e.toUpperCase=()=>e.check(bE()),e.slugify=()=>e.check(xE())}),m4=ee("ZodString",(e,a)=>{ih.init(e,a),I0.init(e,a),e.email=i=>e.check(D_(p4,i)),e.url=i=>e.check(U_(y4,i)),e.jwt=i=>e.check(eE(M4,i)),e.emoji=i=>e.check($_(v4,i)),e.guid=i=>e.check(Wv(ag,i)),e.uuid=i=>e.check(k_($s,i)),e.uuidv4=i=>e.check(L_($s,i)),e.uuidv6=i=>e.check(B_($s,i)),e.uuidv7=i=>e.check(H_($s,i)),e.nanoid=i=>e.check(Z_(g4,i)),e.guid=i=>e.check(Wv(ag,i)),e.cuid=i=>e.check(q_(b4,i)),e.cuid2=i=>e.check(Q_(x4,i)),e.ulid=i=>e.check(P_(S4,i)),e.base64=i=>e.check(J_(A4,i)),e.base64url=i=>e.check(I_(C4,i)),e.xid=i=>e.check(Y_(w4,i)),e.ksuid=i=>e.check(G_(_4,i)),e.ipv4=i=>e.check(K_(E4,i)),e.ipv6=i=>e.check(F_(T4,i)),e.cidrv4=i=>e.check(V_(R4,i)),e.cidrv6=i=>e.check(X_(z4,i)),e.e164=i=>e.check(W_(O4,i)),e.datetime=i=>e.check(FE(i)),e.date=i=>e.check(XE(i)),e.time=i=>e.check(IE(i)),e.duration=i=>e.check(e4(i))});function Nt(e){return j_(m4,e)}const pt=ee("ZodStringFormat",(e,a)=>{ft.init(e,a),I0.init(e,a)}),p4=ee("ZodEmail",(e,a)=>{q2.init(e,a),pt.init(e,a)}),ag=ee("ZodGUID",(e,a)=>{$2.init(e,a),pt.init(e,a)}),$s=ee("ZodUUID",(e,a)=>{Z2.init(e,a),pt.init(e,a)}),y4=ee("ZodURL",(e,a)=>{Q2.init(e,a),pt.init(e,a)}),v4=ee("ZodEmoji",(e,a)=>{P2.init(e,a),pt.init(e,a)}),g4=ee("ZodNanoID",(e,a)=>{Y2.init(e,a),pt.init(e,a)}),b4=ee("ZodCUID",(e,a)=>{G2.init(e,a),pt.init(e,a)}),x4=ee("ZodCUID2",(e,a)=>{K2.init(e,a),pt.init(e,a)}),S4=ee("ZodULID",(e,a)=>{F2.init(e,a),pt.init(e,a)}),w4=ee("ZodXID",(e,a)=>{V2.init(e,a),pt.init(e,a)}),_4=ee("ZodKSUID",(e,a)=>{X2.init(e,a),pt.init(e,a)}),E4=ee("ZodIPv4",(e,a)=>{t_.init(e,a),pt.init(e,a)}),T4=ee("ZodIPv6",(e,a)=>{n_.init(e,a),pt.init(e,a)}),R4=ee("ZodCIDRv4",(e,a)=>{a_.init(e,a),pt.init(e,a)}),z4=ee("ZodCIDRv6",(e,a)=>{r_.init(e,a),pt.init(e,a)}),A4=ee("ZodBase64",(e,a)=>{i_.init(e,a),pt.init(e,a)}),C4=ee("ZodBase64URL",(e,a)=>{o_.init(e,a),pt.init(e,a)}),O4=ee("ZodE164",(e,a)=>{s_.init(e,a),pt.init(e,a)}),M4=ee("ZodJWT",(e,a)=>{c_.init(e,a),pt.init(e,a)}),W0=ee("ZodNumber",(e,a)=>{P0.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>AE(e,l,s),e.gt=(l,s)=>e.check(tg(l,s)),e.gte=(l,s)=>e.check(If(l,s)),e.min=(l,s)=>e.check(If(l,s)),e.lt=(l,s)=>e.check(eg(l,s)),e.lte=(l,s)=>e.check(Jf(l,s)),e.max=(l,s)=>e.check(Jf(l,s)),e.int=l=>e.check(rg(l)),e.safe=l=>e.check(rg(l)),e.positive=l=>e.check(tg(0,l)),e.nonnegative=l=>e.check(If(0,l)),e.negative=l=>e.check(eg(0,l)),e.nonpositive=l=>e.check(Jf(0,l)),e.multipleOf=(l,s)=>e.check(ng(l,s)),e.step=(l,s)=>e.check(ng(l,s)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Ge(e){return iE(W0,e)}const N4=ee("ZodNumberFormat",(e,a)=>{f_.init(e,a),W0.init(e,a)});function rg(e){return lE(N4,e)}const j4=ee("ZodBoolean",(e,a)=>{d_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>CE(e,i,l)});function lh(e){return oE(j4,e)}const D4=ee("ZodUnknown",(e,a)=>{h_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>ME()});function ig(){return sE(D4)}const k4=ee("ZodNever",(e,a)=>{m_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>OE(e,i,l)});function L4(e){return uE(k4,e)}const B4=ee("ZodArray",(e,a)=>{p_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>kE(e,i,l,s),e.element=a.element,e.min=(i,l)=>e.check(cu(i,l)),e.nonempty=i=>e.check(cu(1,i)),e.max=(i,l)=>e.check(K0(i,l)),e.length=(i,l)=>e.check(F0(i,l)),e.unwrap=()=>e.element});function Pi(e,a){return SE(B4,e,a)}const H4=ee("ZodObject",(e,a)=>{v_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>LE(e,i,l,s),rt(e,"shape",()=>a.shape),e.keyof=()=>Q4(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ig()}),e.loose=()=>e.clone({...e)DELIM" -R"DELIM(._zod.def,catchall:ig()}),e.strict=()=>e.clone({...e._zod.def,catchall:L4()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>Bw(e,i),e.safeExtend=i=>Hw(e,i),e.merge=i=>Uw(e,i),e.pick=i=>kw(e,i),e.omit=i=>Lw(e,i),e.partial=(...i)=>$w(eb,e,i[0]),e.required=(...i)=>Zw(tb,e,i[0])});function ta(e,a){const i={type:"object",shape:e??{},..._e(a)};return new H4(i)}const U4=ee("ZodUnion",(e,a)=>{g_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>BE(e,i,l,s),e.options=a.options});function $4(e,a){return new U4({type:"union",options:e,..._e(a)})}const Z4=ee("ZodIntersection",(e,a)=>{b_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>HE(e,i,l,s)});function q4(e,a){return new Z4({type:"intersection",left:e,right:a})}const kd=ee("ZodEnum",(e,a)=>{x_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>NE(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const d of l)if(i.has(d))u[d]=a.entries[d];else throw new Error(`Key ${d} not found in enum`);return new kd({...a,checks:[],..._e(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const d of l)if(i.has(d))delete u[d];else throw new Error(`Key ${d} not found in enum`);return new kd({...a,checks:[],..._e(s),entries:u})}});function Q4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new kd({type:"enum",entries:i,..._e(a)})}const P4=ee("ZodTransform",(e,a)=>{S_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>DE(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new A0(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(ao(u,i.value,a));else{const d=u;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=i.value),d.inst??(d.inst=e),i.issues.push(ao(d))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i)):(i.value=s,i)}});function Y4(e){return new P4({type:"transform",transform:e})}const eb=ee("ZodOptional",(e,a)=>{w_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>GE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function lg(e){return new eb({type:"optional",innerType:e})}const G4=ee("ZodNullable",(e,a)=>{__.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>UE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function og(e){return new G4({type:"nullable",innerType:e})}const K4=ee("ZodDefault",(e,a)=>{E_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>ZE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function F4(e,a){return new K4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():N0(a)}})}const V4=ee("ZodPrefault",(e,a)=>{T_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>qE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function X4(e,a){return new V4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():N0(a)}})}const tb=ee("ZodNonOptional",(e,a)=>{R_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>$E(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function J4(e,a){return new tb({type:"nonoptional",innerType:e,..._e(a)})}const I4=ee("ZodCatch",(e,a)=>{z_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>QE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function W4(e,a){return new I4({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const eT=ee("ZodPipe",(e,a)=>{A_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>PE(e,i,l,s),e.in=a.in,e.out=a.out});function sg(e,a){return new eT({type:"pipe",in:e,out:a})}const tT=ee("ZodReadonly",(e,a)=>{C_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>YE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function nT(e){return new tT({type:"readonly",innerType:e})}const aT=ee("ZodCustom",(e,a)=>{O_.init(e,a),jt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>jE(e,i)});function rT(e,a={}){return wE(aT,e,a)}function iT(e){return _E(e)}class oh extends Error{constructor(a,i){super(a),this.status=i}}const Ld=ta({id:Nt(),height:Ge(),timestamp:Ge().optional(),mediantime:Ge().optional(),tx_count:Ge().optional(),size:Ge().optional(),weight:Ge().optional(),difficulty:Ge().optional(),bits:Ge().optional(),merkle_root:Nt().optional(),previousblockhash:Nt().nullable().optional(),nonce:Ge().optional(),version:Ge().optional()}).loose(),lT=ta({confirmed:lh(),block_height:Ge().optional(),block_hash:Nt().optional(),block_time:Ge().optional()}),oT=ta({txid:Nt().optional().nullable(),vout:Ge().optional().nullable(),sequence:Ge().optional(),scriptsig:Nt().optional().nullable(),scriptsig_asm:Nt().optional().nullable(),witness:Pi(Nt()).optional(),is_coinbase:lh().optional(),prevout:ta({scriptpubkey_type:Nt().optional(),scriptpubkey_address:Nt().optional(),scriptpubkey:Nt().optional(),scriptpubkey_asm:Nt().optional(),value:Ge().optional()}).partial().nullable().optional()}).loose(),sT=ta({scriptpubkey_type:Nt().optional(),scriptpubkey_address:Nt().optional(),scriptpubk)DELIM" -R"DELIM(ey:Nt().optional(),scriptpubkey_asm:Nt().optional(),value:Ge(),n:Ge().optional()}).loose(),Js=ta({txid:Nt(),hash:Nt().optional(),fee:Ge().optional(),version:Ge(),locktime:Ge(),vin:Pi(oT),vout:Pi(sT),size:Ge(),weight:Ge(),status:lT}).loose(),Is=Pi(Ld),du=Pi(Js),ug=ta({in_best_chain:lh(),next_best:Nt().optional(),height:Ge().optional()}),cg=ta({address:Nt(),chain_stats:ta({funded_txo_count:Ge().optional(),funded_txo_sum:Ge().optional(),spent_txo_count:Ge().optional(),spent_txo_sum:Ge().optional(),tx_count:Ge().optional()}),mempool_stats:ta({funded_txo_count:Ge().optional(),funded_txo_sum:Ge().optional(),spent_txo_count:Ge().optional(),spent_txo_sum:Ge().optional(),tx_count:Ge().optional()})});async function Yt(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);if(!s.ok)throw new oh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function fg(e,a){const i=await fetch(`${e}/blocks/tip/height`);if(!i.ok)throw new oh("Unable to fetch tip height",i.status);const l=await i.text(),s=Number(l.trim());if(!Number.isFinite(s))throw new TypeError("Invalid tip height response");return a.lastKnownHeight=s,s}async function Di(e,a,i){if(a.lastKnownHeight===null){await fg(e,a);return}typeof i=="number"&&a.lastKnownHeightu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const d=u.prevout;return d?.scriptpubkey_address===e&&typeof d.value=="number"?s+d.value:s},0);return i-l}async function Wf(e,a){if(a==="latest"||a==="tip"){const i=await Yt(e,"/blocks",Is);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${e}/block-height/${a}`);if(!i.ok)throw new oh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function dg(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function Zl(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function ed(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((p,m)=>{const g=p.is_coinbase||p.txid==null?void 0:typeof p.vout=="number"&&p.vout!==4294967295?p.vout:void 0;return{index:m,prevTxId:p.txid??void 0,prevOutputIndex:g,address:p.prevout?.scriptpubkey_address??void 0,valueSats:p.prevout?.value,scriptType:p.prevout?.scriptpubkey_type,isCoinbase:p.is_coinbase??!1,script:p.scriptsig||p.scriptsig_asm?{hex:p.scriptsig??void 0,mnemonic:p.scriptsig_asm??void 0}:void 0,witness:p.witness??void 0,sequence:p.sequence}}),s=e.vout.map((p,m)=>({index:m,address:p.scriptpubkey_address??void 0,valueSats:p.value,scriptType:p.scriptpubkey_type,spent:void 0,script:p.scriptpubkey||p.scriptpubkey_asm?{hex:p.scriptpubkey??void 0,mnemonic:p.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((p,m)=>p+m.valueSats,0),d=a.lastKnownHeight;let h=0;return e.status.block_height&&i==="confirmed"&&(h=d&&d>=e.status.block_height?d-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:h,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:u,inputs:l,outputs:s}}function cT(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=nb(e.address,a.slice(0,25));return{address:e.address,addressType:Aa(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function fT(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:Aa(e.address),balance:l,totalReceived:(a.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(a.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(a.tx_count??0)+(i.tx_count??0),utxoCount:(a.funded_txo_count??0)-(a.spent_txo_count??0)}}function nb(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:uT(e,i),blockHeight:i.status.block_height}))}async function hg(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return Yt(e,l,du)}async function dT(e,a,i){return i?Yt(e,`/address/${a}/txs/chain/${i}`,du):Yt(e,`/address/${a}/txs`,du)}function ab({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(h){const p=await Yt(e,`/tx/${h}`,Js);return await(p.status.block_height?Di(e,l,p.status.block_h)DELIM" -R"DELIM(eight):Di(e,l)),ed(p,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const h=await Yt(e,"/blocks",Is);if(h.length===0)return;const p=h[0];if(p.id!==l.lastBlockHash){l.lastBlockHash=p.id,l.lastKnownHeight=Math.max(p.height,l.lastKnownHeight??0);const m=Zl(p);for(const g of a)g({type:"block.new",payload:m})}}catch(h){console.warn("Block polling failed",h)}},15e3))}function d(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(h=10){const p=await Yt(e,"/blocks",Is);return p.length>0&&(l.lastBlockHash=p[0].id,l.lastKnownHeight=Math.max(p[0].height,l.lastKnownHeight??0)),p.slice(0,h).map(m=>Zl(m))},async getBlocksBefore(h,p=10){const m=Math.max(h,0),g=await Yt(e,`/blocks/${String(m)}`,Is);return g.length>0&&(l.lastKnownHeight=Math.max(g[0].height,l.lastKnownHeight??0)),g.slice(0,p).map(v=>Zl(v))},async getBlockHeader(h){const p=await Wf(e,h);await Di(e,l);const[m,g]=await Promise.all([Yt(e,`/block/${p}`,Ld),Yt(e,`/block/${p}/status`,ug).catch(()=>null)]),v=Zl(m);l.lastBlockHash=v.hash,l.lastKnownHeight=Math.max(v.height,l.lastKnownHeight??v.height);let x=g?.next_best??null;return x||(x=await dg(e,v.height,l)),{...v,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:x}},getBlockStats(h){return Promise.resolve({})},async getBlock(h){const p=await Wf(e,h);await Di(e,l);const m=await Yt(e,`/block/${p}`,Ld),[g,v]=await Promise.allSettled([hg(e,p),Yt(e,`/block/${p}/status`,ug)]);g.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",g.reason),v.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",v.reason);const x=Zl(m);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,l.lastKnownHeight??x.height);const _=g.status==="fulfilled"?g.value:[];let R=(v.status==="fulfilled"?v.value:null)?.next_best??null;return R||(R=await dg(e,x.height,l)),{...x,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:R,transactions:_.map(j=>ed(j,l))}},async getBlockTransactions(h,p=0){const m=await Wf(e,h),g=await hg(e,m,p),v=g.reduce((x,_)=>_.status.block_height?x===null?_.status.block_height:Math.max(x,_.status.block_height):x,null);return await(typeof v=="number"?Di(e,l,v):Di(e,l)),g.map(x=>ed(x,l))},async getTransactionHeader(h){return s(h)},async getTransaction(h){return s(h)},async getTransactionInputScriptHex(h,p){const m=await Yt(e,`/tx/${h}`,Js);if(p<0||p>=m.vin.length)throw new RangeError(`Input index ${String(p)} not found`);const v=m.vin[p].scriptsig;return typeof v=="string"?v:""},async getTransactionOutputScriptHex(h,p){const m=await Yt(e,`/tx/${h}`,Js);if(p<0||p>=m.vout.length)throw new RangeError(`Output index ${String(p)} not found`);const v=m.vout[p].scriptpubkey;if(typeof v!="string")throw new TypeError("Output script missing in provider response");return v},async getAddressSummary(h){const p=await Yt(e,`/address/${h}`,cg);return fT(p)},async getAddress(h){const p=await Yt(e,`/address/${h}`,cg),m=await Yt(e,`/address/${h}/txs`,du);return cT(p,m)},async getAddressTransactions(h,p){const m=await dT(e,h,p);return nb(h,m)},subscribeToEvents(h){return a.add(h),u(),()=>{a.delete(h),a.size===0&&d()}}}}function hT({baseUrl:e}){const a=ab({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function ro(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function rb(e,a){return Array.isArray(a)?a.length===0?!0:e?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function ib(e){if(typeof e!="function")throw new Error("function expected");return!0}function io(e,a){if(typeof a!="string")throw new Error(`${e}: string expected`);return!0}function ho(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function hu(e){if(!Array.isArray(e))throw new Error("array expected")}function lb(e,a){if(!rb(!0,a))throw new Error(`${e}: array of strings expected`)}function sh(e,a){if(!rb(!1,a))throw new Error(`${e}: array of numbers expected`)}function uh(...e){const a=u=>u,i=(u,d)=>h=>u(d(h)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function ob(e){const a=typeof e=="string"?e.split(""):e,i=a.length;lb("alphabet",a);const l=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(hu(s),s.map(u=>{if(!Number.isSafeInteger(u)||u<0||u>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${u}". Allowed: ${e}`);return a[u]})),decode:s=>(hu(s),s.map(u=>{io("alphabet.decode",u);const d=l.get(u);if(d===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e})DELIM" -R"DELIM(`);return d}))}}function sb(e=""){return io("join",e),{encode:a=>(lb("join.decode",a),a.join(e)),decode:a=>(io("join.decode",a),a.split(e))}}function mg(e,a,i){if(a<2)throw new Error(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new Error(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(hu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,h=>{if(ho(h),h<0||h>=a)throw new Error(`invalid integer: ${h}`);return h}),d=u.length;for(;;){let h=0,p=!0;for(let m=l;ma===0?e:ub(a,e%a),mu=(e,a)=>e+(a-ub(e,a)),Ws=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function Bd(e,a,i,l){if(hu(e),a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new Error(`convertRadix2: wrong to=${i}`);if(mu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${mu(a,i)}`);let s=0,u=0;const d=Ws[a],h=Ws[i]-1,p=[];for(const m of e){if(ho(m),m>=d)throw new Error(`convertRadix2: invalid data word=${m} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)p.push((s>>u-i&h)>>>0);const g=Ws[u];if(g===void 0)throw new Error("invalid carry");s&=g-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&p.push(s>>>0),p}function mT(e){ho(e);const a=2**8;return{encode:i=>{if(!ro(i))throw new Error("radix.encode input should be Uint8Array");return mg(Array.from(i),a,e)},decode:i=>(sh("radix.decode",i),Uint8Array.from(mg(i,e,a)))}}function pT(e,a=!1){if(ho(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(mu(8,e)>32||mu(e,8)>32)throw new Error("radix2: carry overflow");return{encode:i=>{if(!ro(i))throw new Error("radix2.encode input should be Uint8Array");return Bd(Array.from(i),8,e,!a)},decode:i=>(sh("radix2.decode",i),Uint8Array.from(Bd(i,e,8,a)))}}function pg(e){return ib(e),function(...a){try{return e.apply(null,a)}catch{}}}function yT(e,a){return ho(e),ib(a),{encode(i){if(!ro(i))throw new Error("checksum.encode: input should be Uint8Array");const l=a(i).slice(0,e),s=new Uint8Array(i.length+e);return s.set(i),s.set(l,i.length),s},decode(i){if(!ro(i))throw new Error("checksum.decode: input should be Uint8Array");const l=i.slice(0,-e),s=i.slice(-e),u=a(l).slice(0,e);for(let d=0;duh(mT(58),ob(e),sb("")),gT=vT("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),bT=e=>uh(yT(4,a=>e(e(a))),gT),Hd=uh(ob("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),sb("")),yg=[996825010,642813549,513874426,1027748829,705979059];function ql(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=yg[l]);return i}function vg(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=ql(s)^d>>5}s=ql(s);for(let u=0;u_)throw new TypeError(`Length ${R} exceeds limit ${_}`);const k=v.toLowerCase(),j=vg(k,x,a);return`${k}1${Hd.encode(x)}${j}`}function h(v,x=90){io("bech32.decode input",v);const _=v.length;if(_<8||x!==!1&&_>x)throw new TypeError(`invalid string length: ${_} (${v}). Expected (8..${x})`);const E=v.toLowerCase();if(v!==E&&v!==v.toUpperCase())throw new Error("String must be lowercase or uppercase");const R=E.lastIndexOf("1");if(R===0||R===-1)throw new Error('Letter "1" must be present between prefix and data only');const k=E.slice(0,R),j=E.slice(R+1);if(j.length<6)throw new Error("Data must be at least 6 characters long");const L=Hd.decode(j).slice(0,-6),U=vg(k,L,a);if(!j.endsWith(U))throw new Error(`Invalid checksum in ${v}: expected "${U}"`);return{prefix:k,words:L}}const p=pg(h);function m(v){const{prefix:x,words:_}=h(v,!1);return{prefix:x,words:_,bytes:l(_)}}function g(v,x){return d(v,s(x))}return{encode:d,decode:h,encodeFromBytes:g,decodeToBytes:m,decodeUnsafe:p,fromWords:l,fromWordsUnsafe:u,toWords:s}}const pu=cb("bech32"),Ud=cb("bech32m");function xT(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ch(e,a,i=""){const l=xT(e),s=e?.length;if(!l||a!==vo)DELIM" -R"DELIM(id 0){const d=i&&`"${i}" `,h="",p=l?`length=${s}`:`type=${typeof e}`;throw new Error(d+"expected Uint8Array"+h+", got "+p)}return e}function gg(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function ST(e,a){ch(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function $d(...e){for(let a=0;a>>a}const wT=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",_T=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function eu(e){if(ch(e),wT)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const TT=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function RT(e,a,i){return e&a^~e&i}function zT(e,a,i){return e&a^e&i^a&i}class AT{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffset=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=td(this.buffer)}update(a){gg(this),ch(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let d=0;ds-d&&(this.process(l,0),d=0);for(let v=d;vg.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v>>3,R=Wn(_,17)^Wn(_,19)^_>>>10;rr[v]=R+rr[v-7]+E+rr[v-16]|0}let{A:l,B:s,C:u,D:d,E:h,F:p,G:m,H:g}=this;for(let v=0;v<64;v++){const x=Wn(h,6)^Wn(h,11)^Wn(h,25),_=g+x+RT(h,p,m)+CT[v]+rr[v]|0,R=(Wn(l,2)^Wn(l,13)^Wn(l,22))+zT(l,s,u)|0;g=m,m=p,p=h,h=d+_|0,d=u,u=s,s=l,l=_+R|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,d=d+this.D|0,h=h+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(l,s,u,d,h,p,m,g)}roundClean(){$d(rr)}destroy(){this.set(0,0,0,0,0,0,0,0),$d(this.buffer)}}class MT extends OT{A=ar[0]|0;B=ar[1]|0;C=ar[2]|0;D=ar[3]|0;E=ar[4]|0;F=ar[5]|0;G=ar[6]|0;H=ar[7]|0;constructor(){super(32)}}const fb=ET(()=>new MT,TT(1)),db=bT(fb),NT=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function fh(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function dh(e){const a=e.toLowerCase();if(a.includes("dup hash160")&&a.includes("equalverify checksig"))return"p2pkh";if(a.startsWith("hash160")&&a.includes("equal"))return"p2sh";if(a.startsWith("zero [")){const l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function mo(){return"mainnet"}function po(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function bg(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(fh(a),1),db.encode(i)}function nd(e,a,i){const l=fh(i),s=pu.toWords(l);return s.unshift(a),(a===0?pu:Ud).encode(e,s)}function hb(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:bg(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:bg(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:nd(a.hrp,0,u[1]),type:"p2wpkh"};const d=i.match(/^zero \[([0-9a-f]{64})\]/);if(d)return{address:nd(a.hrp,0,d[1]),type:"p2wsh"};const h=i.match(/^1 \[([0-9a-f]{64})\]/);return h?{address:nd(a.hrp,1,h[1]),type:"p2tr"}:{type:dh(e)}}function kT(e,a){try{const s=db.decode(e),u=s[0],d=eu(s.slice(1));if(d.length===40&&u===a.p2pkh)return{scriptHex:`76a914${d}88ac`,type:"p2pkh"};if(d.length===40&&u===a.p2sh)return{scriptHex:`a914${d}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=p=>{try{return p.decode(s,90)}catch{return null}},d=u(pu);if(d&&d.prefix===a.hrp){const p=d.words[0],m=pu.fromWords(d.words.slice(1)),g=eu(m),v=m.length.toString(16).padStart(2,"0");if(p===0&&(m.length===20||m.length===32))return{scriptHex:`00${v}${g}`,type:m.length===20?"p2wpkh":"p2wsh"}}const h=u(Ud);if(h&&h.prefix===a.hrp){const p=h.words[0],m=Ud.fromWords(h.words.slice(1)),g=eu(m),v=m.length.toString(16).padStart(2,"0");if(p===1&&m.length===32)return{scriptHex:`51${v}${g}`,type:"p2tr"}}}return null}function fr(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=kT(e,a);if(!l)return null;const s=fb(fh(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:eu(u),type:l.type}}function Ql(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:jT(e.bits),previousBlockHash:e.previous}}function LT(e){const a=DT(e);return a&&a.length>0?a:void 0}function BT(e,a,i,l){const s=/^0{64}$/u.test(e.point.hash),u=a?hb(a.script,i):{address:void 0,type:void 0},d=a?a.value:void 0,h=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:d,scriptType:u.type??dh(h??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:LT(e.witness),sequence:e.sequence}}function HT(e,a,i){const l=hb(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??dh(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function UT(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function Zs(e,a,i,l,s){const u=e.outputs.map((g,v)=>HT(g,v,i)),d=u.reduce((g,v)=>g+v.valueSats,0),h=a.reduce((g,v)=>v?(g??0)+v.value:g,null),p=UT(l.tipHeight,l.blockHeight),m=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:m,confirmations:p,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:h,totalOutput:d,inputs:e.inputs.map((g,v)=>BT(g,a[v],i,v)),outputs:u}}const qs=25,xg=5e3,ad=new Map,rd=new Map,yu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function $T(e){if(!e||typeof e!="object"||Array.isArray(e))return yu;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:yu[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function ki(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.wire=="number"?l.wire:void 0;return s===void 0&&u===void 0?null:{count:s,wire:u}}function ZT(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function Qs(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?ZT(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typ)DELIM" -R"DELIM(eof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function Wt(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=rd.get(s);if(u)return u;const d=(async()=>{const h=await fetch(s,{headers:{Accept:"application/json"}});if(!h.ok){const m=await h.text().catch(()=>"");throw new Error(`Request failed ${String(h.status)}: ${m||h.statusText}`)}const p=await h.text();try{return JSON.parse(p)}catch{return p}})();rd.set(s,d);try{return await d}finally{rd.delete(s)}}async function Mt(e,a,i){try{return await Wt(e,a,i)}catch{return null}}async function mb(e,a){const i=await Wt(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}async function qr(e,a){const i=Date.now(),l=`${e}|0`,s=ad.get(l);if(s&&s.expiresAt>i)return s.promise;const u=mb(e,a).then(d=>(ad.set(l,{promise:u,value:d,expiresAt:Date.now()+xg}),d));return ad.set(l,{promise:u,value:s?.value??null,expiresAt:i+xg}),u}async function Ps(e,a,i){if(a==="latest"||a==="tip"){const l=await qr(e,i);return{path:`/v1/block/height/${String(l)}`,height:l}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function qT(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,d=i.get(u);if(d)return d;const h=Wt(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,h),h}}async function Sg(e,a,i,l){return Wt(e,`${a}/tx/${String(i)}?format=json`,l)}async function id(e,a,i){const l=await Mt(e,`/v1/address/${a}/confirmed?format=json`,i);return l||(await Mt(e,`/v1/address/${a}?format=json`,i)??[])}function QT({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set;let s=null,u=null;const d=po(mo());let h=null,p=null;function m(){return p||(p=Wt(e,"/v1/configuration?format=json").then(E=>{const R=$T(E);return h=R,R}).catch(E=>(console.warn("Libbitcoin configuration fetch failed",E),h=yu,yu)),p)}function g(E){return E.address}function v(E){return g(E)&&E.turbo}function x(){s||(s=setInterval(async()=>{try{const E=await mb(e);if(u===null){u=E;return}if(E>u){const[R,k]=await Promise.all([Wt(e,`/v1/block/height/${String(E)}/header?format=json`),Mt(e,`/v1/block/height/${String(E)}/header/context?format=json`)]),j=ki(k),U={...Ql(R,j?.count),size:j?.wire};for(const J of l)J({type:"block.new",payload:U});u=E}}catch(E){console.warn("Libbitcoin poller failed",E)}},a))}function _(){s&&(clearInterval(s),s=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return m()},async getLatestBlocks(E=10){const R=await qr(e);u=R;const k=Array.from({length:E},(U,J)=>R-J).filter(U=>U>=0),[j,L]=await Promise.all([Promise.all(k.map(U=>Wt(e,`/v1/block/height/${String(U)}/header?format=json`))),Promise.all(k.map(U=>Mt(e,`/v1/block/height/${String(U)}/header/context?format=json`)))]);return j.map((U,J)=>{const I=ki(L[J]);return{...Ql(U,I?.count),size:I?.wire}})},async getBlocksBefore(E,R=10){const k=Array.from({length:R},(U,J)=>E-J).filter(U=>U>=0),[j,L]=await Promise.all([Promise.all(k.map(U=>Wt(e,`/v1/block/height/${String(U)}/header?format=json`))),Promise.all(k.map(U=>Mt(e,`/v1/block/height/${String(U)}/header/context?format=json`)))]);return j.map((U,J)=>{const I=ki(L[J]);return{...Ql(U,I?.count),size:I?.wire}})},async getBlockHeader(E){const{path:R,height:k}=await Ps(e,E),j=k===void 0?qr(e):Promise.resolve(k),[L,U,J]=await Promise.all([Wt(e,`${R}/header?format=json`),j,Mt(e,`${R}/header/context?format=json`)]);u=Math.max(u??0,U);let I=null;L.heightM),ze=(await Promise.all(ne.map(S=>Sg(e,R,S).catch(()=>null)))).filter(S=>S!==null),oe=await Promise.all(ze.map(S=>Mt(e,`/v1/tx/${S.hash}/details?format=json`))),$=ze.map((S,M)=>{const N=oe[M],V=Zs(S,[],d,{blockHeight:L.height,blockHash:L.hash,tipHeight:U,timestamp:L.timestamp},typeof N?.fee=="number"?N.fee:void 0);return Qs(V,)DELIM" -R"DELIM(N)});return{...me,size:O?.wire??I?.maximal,weight:I?.weight,merkleRoot:L.merkle_root,nonce:L.nonce,bits:L.bits,version:L.version,nextBlockHash:ce,feesSats:I?.fees,subsidySats:I?.subsidy,sigops:I?.sigops,transactions:$}},async getBlockTransactions(E,R=0){const{path:k}=await Ps(e,E),[j,L,U]=await Promise.all([Wt(e,`${k}/header?format=json`),qr(e),Mt(e,`${k}/header/context?format=json`)]);u=Math.max(u??0,L);const J=ki(U)?.count;if(typeof J=="number"&&R>=J)return[];const I=typeof J=="number"?Math.min(R+qs,J):R+qs,ce=Array.from({length:Math.max(0,I-R)},(re,ne)=>R+ne),K=(await Promise.all(ce.map(re=>Sg(e,k,re).catch(()=>null)))).filter(re=>re!==null);if(K.length===0)return[];const me=await Promise.all(K.map(re=>Mt(e,`/v1/tx/${re.hash}/details?format=json`)));return K.map((re,ne)=>{const se=me[ne],ze=Zs(re,[],d,{blockHeight:j.height,blockHash:j.hash,tipHeight:L,timestamp:j.timestamp},typeof se?.fee=="number"?se.fee:void 0);return Qs(ze,se)})},async getTransaction(E){const R=await Wt(e,`/v1/tx/${E}?format=json`),k=qT(e),j=Promise.all(R.inputs.map(O=>/^0{64}$/u.test(O.point.hash)?Promise.resolve(null):k(O.point.hash,O.point.index))),[L,U,J,I]=await Promise.all([Mt(e,`/v1/tx/${E}/header?format=json`),qr(e).catch(()=>null),Mt(e,`/v1/tx/${E}/details?format=json`),j]);typeof U=="number"&&(u=Math.max(u??0,U));const ce=Zs(R,I,d,{blockHeight:L?.height,blockHash:L?.hash,tipHeight:typeof U=="number"?U:void 0,timestamp:L?.timestamp},typeof J?.fee=="number"?J.fee:void 0);return Qs(ce,J)},async getTransactionHeader(E){const R=await Wt(e,`/v1/tx/${E}?format=json`),[k,j,L]=await Promise.all([Mt(e,`/v1/tx/${E}/header?format=json`),qr(e).catch(()=>null),Mt(e,`/v1/tx/${E}/details?format=json`)]);typeof j=="number"&&(u=Math.max(u??0,j));const U=Zs(R,[],d,{blockHeight:k?.height,blockHash:k?.hash,tipHeight:typeof j=="number"?j:void 0,timestamp:k?.timestamp},typeof L?.fee=="number"?L.fee:void 0);return Qs(U,L)},async getTransactionInputScriptHex(E,R){return(await Wt(e,`/v1/input/${E}/${String(R)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(E,R){return(await Wt(e,`/v1/output/${E}/${String(R)}/script?format=text`)).trim()},async getAddress(E){const R=fr(E,d);if(!R)throw new Error("Unsupported address format for libbitcoin adapter");const k=h??await m();if(!g(k))throw new Error("Address endpoints are disabled by server configuration");const j=i&&v(k),[L,U]=await Promise.all([Mt(e,`/v1/address/${R.hash}/balance?format=json`,j),id(e,R.hash,j)]),J=typeof L=="number"?L:Number(L);let I=0;for(const K of U)I+=K.value;const ce=Number.isFinite(J)?J:I,O=U.map(K=>({txid:K.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:K.value}));return{address:E,addressType:R.type,balance:ce,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:U.length,transactions:O}},async getAddressSummary(E){const R=fr(E,d);if(!R)throw new Error("Unsupported address format for libbitcoin adapter");const k=h??await m();if(!g(k))throw new Error("Address endpoints are disabled by server configuration");const j=i&&v(k),[L,U]=await Promise.all([Mt(e,`/v1/address/${R.hash}/balance?format=json`,j),id(e,R.hash,j)]),J=typeof L=="number"?L:L===null?Number.NaN:Number(L),I=Number.isFinite(J)?J:0;return{address:E,addressType:R.type,balance:I,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:U.length}},async getAddressTransactions(E){const R=fr(E,d);if(!R)return[];const k=h??await m();if(!g(k))return[];const j=i&&v(k);return(await id(e,R.hash,j)).map(U=>({txid:U.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:U.value}))},subscribeToEvents(E){return l.add(E),x(),()=>{l.delete(E),l.size===0&&_()}}}}const pb=z.createContext(null),yb=z.createContext(null),vb=z.createContext(null);function PT({children:e,client:a}){return b.jsx(pb.Provider,{value:a,children:e})}function YT({children:e,provider:a,setProvider:i,availableProviders:l}){return b.jsx(yb.Provider,{value:{provider:a,setProvider:i,availableProviders:l},children:e})}function GT({children:e,turbo:a,setTurbo:i}){return b.jsx(vb.Provider,{value:{turbo:a,setTurbo:i},children:e})}function kt(){const e=z.useContext(pb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Eu(){return kt().metadata}function gb(){const e=z.useContext(yb);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function bb(){const e=z.useContext(vb);if(!e)throw new Error("TurboProvider missing in component tree");return e}function KT(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function FT(e,a){if(e==="blockstream")return ab({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return hT({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const i=KT();return QT({baseUrl:i,turbo:a?.turboEnabled})}return e==="external"?(console.warn("No external API URL provided, falling back to mock client"),Xf()):(e==="mock"||console.warn(`Unknown provider "${e}", falling back to mock`),)DELIM" -R"DELIM(Xf())}function VT(){return[...new Set(["libbitcoin","blockstream","mempool"])]}function XT({children:e}){const a="libbitcoin",i=VT(),l=(()=>{const v=globalThis.window;return v?v.localStorage.getItem("turboEnabled")==="true":!1})(),s=(()=>{const v=globalThis.window;if(!v)return a;const x=v.localStorage.getItem("blockchainProvider");return x&&i.includes(x)?x:a})(),[u,d]=z.useState(l),[h,p]=z.useState(s),[m]=z.useState(()=>new nw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),g=z.useMemo(()=>FT(h,{turboEnabled:u}),[h,u]);return z.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("turboEnabled",u?"true":"false")},[u]),z.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("blockchainProvider",h)},[h]),b.jsx(YT,{provider:h,setProvider:p,availableProviders:i,children:b.jsx(GT,{turbo:u,setTurbo:d,children:b.jsx(PT,{client:g,children:b.jsxs(aw,{client:m,children:[e,null]})})})})}var xb=e=>{throw TypeError(e)},JT=(e,a,i)=>a.has(e)||xb("Cannot "+i),ld=(e,a,i)=>(JT(e,a,"read from private field"),i?i.call(e):a.get(e)),IT=(e,a,i)=>a.has(e)?xb("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),wg="popstate";function WT(e={}){function a(l,s){let{pathname:u,search:d,hash:h}=l.location;return lo("",{pathname:u,search:d,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function i(l,s){return typeof s=="string"?s:aa(s)}return t3(a,i,null,e)}function je(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function xt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function e3(){return Math.random().toString(36).substring(2,10)}function _g(e,a){return{usr:e.state,key:e.key,idx:a}}function lo(e,a,i=null,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?mr(a):a,state:i,key:a&&a.key||l||e3()}}function aa({pathname:e="/",search:a="",hash:i=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function mr(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function t3(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,d=s.history,h="POP",p=null,m=g();m==null&&(m=0,d.replaceState({...d.state,idx:m},""));function g(){return(d.state||{idx:null}).idx}function v(){h="POP";let k=g(),j=k==null?null:k-m;m=k,p&&p({action:h,location:R.location,delta:j})}function x(k,j){h="PUSH";let L=lo(R.location,k,j);m=g()+1;let U=_g(L,m),J=R.createHref(L);try{d.pushState(U,"",J)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;s.location.assign(J)}u&&p&&p({action:h,location:R.location,delta:1})}function _(k,j){h="REPLACE";let L=lo(R.location,k,j);m=g();let U=_g(L,m),J=R.createHref(L);d.replaceState(U,"",J),u&&p&&p({action:h,location:R.location,delta:0})}function E(k){return Sb(k)}let R={get action(){return h},get location(){return e(s,d)},listen(k){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(wg,v),p=k,()=>{s.removeEventListener(wg,v),p=null}},createHref(k){return a(s,k)},createURL:E,encodeLocation(k){let j=E(k);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:x,replace:_,go(k){return d.go(k)}};return R}function Sb(e,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),je(i,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:aa(e);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}var Vl,Eg=class{constructor(e){if(IT(this,Vl,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(ld(this,Vl).has(e))return ld(this,Vl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){ld(this,Vl).set(e,a)}};Vl=new WeakMap;var n3=new Set(["lazy","caseSensitive","path","id","index","children"]);function a3(e){return n3.has(e)}var r3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function i3(e){return r3.has(e)}function l3(e){return e.index===!0}function oo(e,a,i=[],l={},s=!1){return e.map((u,d)=>{let h=[...i,String(d)],p=typeof u.id=="string"?u.id:h.join("-");if(je(u.index!==!0||!u.children,"Cannot specify children on an index route"),je(s||!l[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),l3(u)){let m={...u,id:p};return l[p]=Tg(m,a(m)),m}else{let m={...u,id:p,children:void 0};return l[p]=Tg(m,a(m)),u.children&&(m.children=oo(u.children,a,h,l,s)),m}})}function Tg(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function lr(e,a,i="/"){return Xl(e,a,i,!1)}function Xl(e,a,i,l){let s=typeof a=="string"?mr(a):a,u=kn(s.pathname||"/",i);if(u==null)return null;let d=wb(e);s3()DELIM" -R"DELIM(d);let h=null;for(let p=0;h==null&&p{let g={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:h,route:d};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&p)return;je(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let v=na([l,g.relativePath]),x=i.concat(g);d.children&&d.children.length>0&&(je(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),wb(d.children,a,x,v,p)),!(d.path==null&&!d.index)&&a.push({path:v,score:p3(v,d.index),routesMeta:x})};return e.forEach((d,h)=>{if(d.path===""||!d.path?.includes("?"))u(d,h);else for(let p of _b(d.path))u(d,h,!0,p)}),a}function _b(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let d=_b(l.join("/")),h=[];return h.push(...d.map(p=>p===""?u:[u,p].join("/"))),s&&h.push(...d),h.map(p=>e.startsWith("/")&&p===""?"/":p)}function s3(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:y3(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var u3=/^:[\w-]+$/,c3=3,f3=2,d3=1,h3=10,m3=-2,Rg=e=>e==="*";function p3(e,a){let i=e.split("/"),l=i.length;return i.some(Rg)&&(l+=m3),a&&(l+=f3),i.filter(s=>!Rg(s)).reduce((s,u)=>s+(u3.test(u)?c3:u===""?d3:h3),l)}function y3(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function v3(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",d=[];for(let h=0;h{if(g==="*"){let E=h[x]||"";d=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const _=h[x];return v&&!_?m[g]=void 0:m[g]=(_||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:d,pattern:e}}function g3(e,a=!1,i=!0){xt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,p)=>(l.push({paramName:h,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function b3(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return xt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function kn(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function x3({basename:e,pathname:a}){return a==="/"?e:na([e,a])}var Eb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tu=e=>Eb.test(e);function S3(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?mr(e):e,u;if(i)if(Tu(i))u=i;else{if(i.includes("//")){let d=i;i=i.replace(/\/\/+/g,"/"),xt(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${i}`)}i.startsWith("/")?u=zg(i.substring(1),"/"):u=zg(i,a)}else u=a;return{pathname:u,search:_3(l),hash:E3(s)}}function zg(e,a){let i=a.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function od(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Tb(e){return )DELIM" -R"DELIM(e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function hh(e){let a=Tb(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function mh(e,a,i,l=!1){let s;typeof e=="string"?s=mr(e):(s={...e},je(!s.pathname||!s.pathname.includes("?"),od("?","pathname","search",s)),je(!s.pathname||!s.pathname.includes("#"),od("#","pathname","hash",s)),je(!s.search||!s.search.includes("#"),od("#","search","hash",s)));let u=e===""||s.pathname==="",d=u?"/":s.pathname,h;if(d==null)h=i;else{let v=a.length-1;if(!l&&d.startsWith("..")){let x=d.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}h=v>=0?a[v]:"/"}let p=S3(s,h),m=d&&d!=="/"&&d.endsWith("/"),g=(u||d===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(m||g)&&(p.pathname+="/"),p}var na=e=>e.join("/").replace(/\/\/+/g,"/"),w3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,yo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function so(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function vo(e){return e.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Rb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function zb(e,a){let i=e;if(typeof i!="string"||!Eb.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(Rb)try{let u=new URL(window.location.href),d=i.startsWith("//")?new URL(u.protocol+i):new URL(i),h=kn(d.pathname,a);d.origin===u.origin&&h!=null?i=h+d.search+d.hash:s=!0}catch{xt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var ur=Symbol("Uninstrumented");function T3(e,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:a.id,index:a.index,path:a.path,instrument(u){let d=Object.keys(i);for(let h of d)u[h]&&i[h].push(u[h])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=Zi(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let d=s[u],h=i[`lazy.${u}`];if(typeof d=="function"&&h.length>0){let p=Zi(h,d,()=>{});p&&(l.lazy=Object.assign(l.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let d=u[ur]??u,h=Zi(i[s],d,(...p)=>Ag(p[0]));h&&(h[ur]=d,l[s]=h)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[ur]??s,d=Zi(i.middleware,u,(...h)=>Ag(h[0]));return d?(d[ur]=u,d):s})),l}function R3(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let d of u)s[d]&&i[d].push(s[d])}})),i.navigate.length>0){let l=e.navigate[ur]??e.navigate,s=Zi(i.navigate,l,(...u)=>{let[d,h]=u;return{to:typeof d=="number"||typeof d=="string"?d:d?aa(d):".",...Cg(e,h??{})}});s&&(s[ur]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[ur]??e.fetch,s=Zi(i.fetch,l,(...u)=>{let[d,,h,p]=u;return{href:h??".",fetcherKey:d,...Cg(e,p??{})}});s&&(s[ur]=l,e.fetch=s)}return e}function Zi(e,a,i){return e.length===0?null:async(...l)=>{let s=await Ab(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function Ab(e,a,i,l){let s=e[l],u;if(s){let d,h=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=Ab(e,a,i,l-1),u=await d,je(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(h,a)}catch(p){console.error("An instrumentation function threw an error:",p)}d||await h(),await d}else try{u={type:"success",value:await i()}}catch(d){u={type:"error",value:d}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Ag(e){let{request:a,context:i,params:l,unstable_pattern:s}=e;return{request:z3(a),params:{...l},unstable_pattern:s,context:A3(i)}}function Cg(e,a){return{currentUrl:aa(e.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function z3(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function A3(e){if(O3(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var C3=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function O3(e){if(e===null||typeof e!="object")return!1;const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===C3}var Cb=["POST","PUT","PATCH","DELETE"],M3=new Set(Cb),N3=["GET",...Cb],j3=new Set(N3),Ob=new Set([301,302,303,307,308]),D3=ne)DELIM" -R"DELIM(w Set([307,308]),sd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},k3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Pl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L3=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Mb="remix-router-transitions",Nb=Symbol("ResetLoaderData");function B3(e){const a=e.window?e.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";je(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRouteProperties||L3,u=s;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;u=H=>({...s(H),...T3(A.map(Y=>Y.route).filter(Boolean),H)})}let d={},h=oo(e.routes,u,void 0,d),p,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=e.dataStrategy||q3,v={...e.future},x=null,_=new Set,E=null,R=null,k=null,j=e.hydrationData!=null,L=lr(h,e.history.location,m),U=!1,J=null,I;if(L==null&&!e.patchRoutesOnNavigation){let A=jn(404,{pathname:e.history.location.pathname}),{matches:H,route:Y}=Ys(h);I=!0,L=H,J={[Y.id]:A}}else if(L&&!e.hydrationData&&wr(L,h,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))I=!1;else if(!L.some(A=>ph(A.route)))I=!0;else{let A=e.hydrationData?e.hydrationData.loaderData:null,H=e.hydrationData?e.hydrationData.errors:null;if(H){let Y=L.findIndex(le=>H[le.route.id]!==void 0);I=L.slice(0,Y+1).every(le=>!qd(le.route,A,H))}else I=L.every(Y=>!qd(Y.route,A,H))}else{I=!1,L=[];let A=wr(null,h,e.history.location.pathname);A.active&&A.matches&&(U=!0,L=A.matches)}let ce,O={historyAction:e.history.action,location:e.history.location,matches:L,initialized:I,navigation:sd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||J,fetchers:new Map,blockers:new Map},K="POP",me=null,re=!1,ne,se=!1,ze=new Map,oe=null,$=!1,S=!1,M=new Set,N=new Map,V=0,ae=-1,T=new Map,Q=new Set,te=new Map,ie=new Map,pe=new Set,Ee=new Map,ue,Ce=null;function Ae(){if(x=e.history.listen(({action:A,location:H,delta:Y})=>{if(ue){ue(),ue=void 0;return}xt(Ee.size===0||Y!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let le=br({currentLocation:O.location,nextLocation:H,historyAction:A});if(le&&Y!=null){let fe=new Promise(xe=>{ue=xe});e.history.go(Y*-1),la(le,{state:"blocked",location:H,proceed(){la(le,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),fe.then(()=>e.history.go(Y))},reset(){let xe=new Map(O.blockers);xe.set(le,Pl),Ye({blockers:xe})}}),me?.resolve(),me=null;return}return De(A,H)}),i){lR(a,ze);let A=()=>oR(a,ze);a.addEventListener("pagehide",A),oe=()=>a.removeEventListener("pagehide",A)}return O.initialized||De("POP",O.location,{initialHydration:!0}),ce}function Ve(){x&&x(),oe&&oe(),_.clear(),ne&&ne.abort(),O.fetchers.forEach((A,H)=>Xi(H)),O.blockers.forEach((A,H)=>wo(H))}function it(A){return _.add(A),()=>_.delete(A)}function Ye(A,H={}){A.matches&&(A.matches=A.matches.map(fe=>{let xe=d[fe.route.id],he=fe.route;return he.element!==xe.element||he.errorElement!==xe.errorElement||he.hydrateFallbackElement!==xe.hydrateFallbackElement?{...fe,route:xe}:fe})),O={...O,...A};let Y=[],le=[];O.fetchers.forEach((fe,xe)=>{fe.state==="idle"&&(pe.has(xe)?Y.push(xe):le.push(xe))}),pe.forEach(fe=>{!O.fetchers.has(fe)&&!N.has(fe)&&Y.push(fe)}),[..._].forEach(fe=>fe(O,{deletedFetchers:Y,newErrors:A.errors??null,viewTransitionOpts:H.viewTransitionOpts,flushSync:H.flushSync===!0})),Y.forEach(fe=>Xi(fe)),le.forEach(fe=>O.fetchers.delete(fe))}function Lt(A,H,{flushSync:Y}={}){let le=O.actionData!=null&&O.navigation.formMethod!=null&&Xt(O.navigation.formMethod)&&O.navigation.state==="loading"&&A.state?._isRedirect!==!0,fe;H.actionData?Object.keys(H.actionData).length>0?fe=H.actionData:fe=null:le?fe=O.actionData:fe=null;let xe=H.loaderData?Ug(O.loaderData,H.loaderData,H.matches||[],H.errors):O.loaderData,he=O.blockers;he.size>0&&(he=new Map(he),he.forEach((Te,Se)=>he.set(Se,Pl)));let de=$?!1:_o(A,H.matches||O.matches),ye=re===!0||O.navigation.formMethod!=null&&Xt(O.navigation.formMethod)&&A.state?._isRedirect!==!0;p&&(h=p,p=void 0),$||K==="POP"||(K==="PUSH"?e.history.push(A,A.state):K==="REPLACE"&&e.history.replace(A,A.state));let be;if(K==="POP"){let Te=ze.get(O.location.pathname);Te&&Te.has(A.pathname)?be={currentLocation:O.location,nextLocation:A})DELIM" -R"DELIM(:ze.has(A.pathname)&&(be={currentLocation:A,nextLocation:O.location})}else if(se){let Te=ze.get(O.location.pathname);Te?Te.add(A.pathname):(Te=new Set([A.pathname]),ze.set(O.location.pathname,Te)),be={currentLocation:O.location,nextLocation:A}}Ye({...H,actionData:fe,loaderData:xe,historyAction:K,location:A,initialized:!0,navigation:sd,revalidation:"idle",restoreScrollPosition:de,preventScrollReset:ye,blockers:he},{viewTransitionOpts:be,flushSync:Y===!0}),K="POP",re=!1,se=!1,$=!1,S=!1,me?.resolve(),me=null,Ce?.resolve(),Ce=null}async function Je(A,H){if(me?.resolve(),me=null,typeof A=="number"){me||(me=Qg());let Ue=me.promise;return e.history.go(A),Ue}let Y=Zd(O.location,O.matches,m,A,H?.fromRouteId,H?.relative),{path:le,submission:fe,error:xe}=Og(!1,Y,H),he=O.location,de=lo(O.location,le,H&&H.state);de={...de,...e.history.encodeLocation(de)};let ye=H&&H.replace!=null?H.replace:void 0,be="PUSH";ye===!0?be="REPLACE":ye===!1||fe!=null&&Xt(fe.formMethod)&&fe.formAction===O.location.pathname+O.location.search&&(be="REPLACE");let Te=H&&"preventScrollReset"in H?H.preventScrollReset===!0:void 0,Se=(H&&H.flushSync)===!0,Pe=br({currentLocation:he,nextLocation:de,historyAction:be});if(Pe){la(Pe,{state:"blocked",location:de,proceed(){la(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:de}),Je(A,H)},reset(){let Ue=new Map(O.blockers);Ue.set(Pe,Pl),Ye({blockers:Ue})}});return}await De(be,de,{submission:fe,pendingError:xe,preventScrollReset:Te,replace:H&&H.replace,enableViewTransition:H&&H.viewTransition,flushSync:Se,callSiteDefaultShouldRevalidate:H&&H.unstable_defaultShouldRevalidate})}function st(){Ce||(Ce=Qg()),ei(),Ye({revalidation:"loading"});let A=Ce.promise;return O.navigation.state==="submitting"?A:O.navigation.state==="idle"?(De(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),A):(De(K||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:se===!0}),A)}async function De(A,H,Y){ne&&ne.abort(),ne=null,K=A,$=(Y&&Y.startUninterruptedRevalidation)===!0,Sr(O.location,O.matches),re=(Y&&Y.preventScrollReset)===!0,se=(Y&&Y.enableViewTransition)===!0;let le=p||h,fe=Y&&Y.overrideNavigation,xe=Y?.initialHydration&&O.matches&&O.matches.length>0&&!U?O.matches:lr(le,H,m),he=(Y&&Y.flushSync)===!0;if(xe&&O.initialized&&!S&&X3(O.location,H)&&!(Y&&Y.submission&&Xt(Y.submission.formMethod))){Lt(H,{matches:xe},{flushSync:he});return}let de=wr(xe,le,H.pathname);if(de.active&&de.matches&&(xe=de.matches),!xe){let{error:yt,notFoundMatches:vt,route:$e}=Ma(H.pathname);Lt(H,{matches:vt,loaderData:{},errors:{[$e.id]:yt}},{flushSync:he});return}ne=new AbortController;let ye=Ui(e.history,H,ne.signal,Y&&Y.submission),be=e.getContext?await e.getContext():new Eg,Te;if(Y&&Y.pendingError)Te=[or(xe).route.id,{type:"error",error:Y.pendingError}];else if(Y&&Y.submission&&Xt(Y.submission.formMethod)){let yt=await dt(ye,H,Y.submission,xe,be,de.active,Y&&Y.initialHydration===!0,{replace:Y.replace,flushSync:he});if(yt.shortCircuited)return;if(yt.pendingActionResult){let[vt,$e]=yt.pendingActionResult;if(bn($e)&&so($e.error)&&$e.error.status===404){ne=null,Lt(H,{matches:yt.matches,loaderData:{},errors:{[vt]:$e.error}});return}}xe=yt.matches||xe,Te=yt.pendingActionResult,fe=ud(H,Y.submission),he=!1,de.active=!1,ye=Ui(e.history,ye.url,ye.signal)}let{shortCircuited:Se,matches:Pe,loaderData:Ue,errors:mt}=await Fn(ye,H,xe,be,de.active,fe,Y&&Y.submission,Y&&Y.fetcherSubmission,Y&&Y.replace,Y&&Y.initialHydration===!0,he,Te,Y&&Y.callSiteDefaultShouldRevalidate);Se||(ne=null,Lt(H,{matches:Pe||xe,...$g(Te),loaderData:Ue,errors:mt}))}async function dt(A,H,Y,le,fe,xe,he,de={}){ei();let ye=rR(H,Y);if(Ye({navigation:ye},{flushSync:de.flushSync===!0}),xe){let Se=await Na(le,H.pathname,A.signal);if(Se.type==="aborted")return{shortCircuited:!0};if(Se.type==="error"){if(Se.partialMatches.length===0){let{matches:Ue,route:mt}=Ys(h);return{matches:Ue,pendingActionResult:[mt.id,{type:"error",error:Se.error}]}}let Pe=or(Se.partialMatches).route.id;return{matches:Se.partialMatches,pendingActionResult:[Pe,{type:"error",error:Se.error}]}}else if(Se.matches)le=Se.matches;else{let{notFoundMatches:Pe,error:Ue,route:mt}=Ma(H.pathname);return{matches:Pe,pendingActionResult:[mt.id,{type:"error",error:Ue}]}}}let be,Te=tu(le,H);if(!Te.route.action&&!Te.route.lazy)be={type:"error",error:jn(405,{method:A.method,pathname:H.pathname,routeId:Te.route.id})};else{let Se=Qi(u,d,A,le,Te,he?[]:l,fe),Pe=await vr(A,Se,fe,null);if(be=Pe[Te.route.id],!be){for(let Ue of le)if(Pe[Ue.route.id]){be=Pe[Ue.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(Pr(be)){let Se;return de&&de.replace!=null?Se=de.replace:Se=Lg(be.response.headers.get("Location"),new URL(A.url),m)===O.location.pathname+O.location.search,await St(A,be,!0,{submission:Y,replace:Se}),{shortCircuited:!0}}if(bn(be)){let Se=or(le,Te.route.id);return(de&&de.replace)!==!0&&(K="PUSH"),{matches:le,pendingActionResult:[Se.route.id,be,Te.route.id]}}return{matches:le,pend)DELIM" -R"DELIM(ingActionResult:[Te.route.id,be]}}async function Fn(A,H,Y,le,fe,xe,he,de,ye,be,Te,Se,Pe){let Ue=xe||ud(H,he),mt=he||de||qg(Ue),yt=!$&&!be;if(fe){if(yt){let wt=Oa(Se);Ye({navigation:Ue,...wt!==void 0?{actionData:wt}:{}},{flushSync:Te})}let Ze=await Na(Y,H.pathname,A.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){if(Ze.partialMatches.length===0){let{matches:qn,route:$t}=Ys(h);return{matches:qn,loaderData:{},errors:{[$t.id]:Ze.error}}}let wt=or(Ze.partialMatches).route.id;return{matches:Ze.partialMatches,loaderData:{},errors:{[wt]:Ze.error}}}else if(Ze.matches)Y=Ze.matches;else{let{error:wt,notFoundMatches:qn,route:$t}=Ma(H.pathname);return{matches:qn,loaderData:{},errors:{[$t.id]:wt}}}}let vt=p||h,{dsMatches:$e,revalidatingFetchers:Bt}=Mg(A,le,u,d,e.history,O,Y,mt,H,be?[]:l,be===!0,S,M,pe,te,Q,vt,m,e.patchRoutesOnNavigation!=null,Se,Pe);if(ae=++V,!e.dataStrategy&&!$e.some(Ze=>Ze.shouldLoad)&&!$e.some(Ze=>Ze.route.middleware&&Ze.route.middleware.length>0)&&Bt.length===0){let Ze=Ft();return Lt(H,{matches:Y,loaderData:{},errors:Se&&bn(Se[1])?{[Se[0]]:Se[1].error}:null,...$g(Se),...Ze?{fetchers:new Map(O.fetchers)}:{}},{flushSync:Te}),{shortCircuited:!0}}if(yt){let Ze={};if(!fe){Ze.navigation=Ue;let wt=Oa(Se);wt!==void 0&&(Ze.actionData=wt)}Bt.length>0&&(Ze.fetchers=yr(Bt)),Ye(Ze,{flushSync:Te})}Bt.forEach(Ze=>{ht(Ze.key),Ze.controller&&N.set(Ze.key,Ze.controller)});let tn=()=>Bt.forEach(Ze=>ht(Ze.key));ne&&ne.signal.addEventListener("abort",tn);let{loaderResults:ut,fetcherResults:$n}=await Fi($e,Bt,A,le);if(A.signal.aborted)return{shortCircuited:!0};ne&&ne.signal.removeEventListener("abort",tn),Bt.forEach(Ze=>N.delete(Ze.key));let fn=Gs(ut);if(fn)return await St(A,fn.result,!0,{replace:ye}),{shortCircuited:!0};if(fn=Gs($n),fn)return Q.add(fn.key),await St(A,fn.result,!0,{replace:ye}),{shortCircuited:!0};let{loaderData:Zn,errors:wn}=Hg(O,Y,ut,Se,Bt,$n);be&&O.errors&&(wn={...O.errors,...wn});let sa=Ft(),_r=So(ae),Er=sa||_r||Bt.length>0;return{matches:Y,loaderData:Zn,errors:wn,...Er?{fetchers:new Map(O.fetchers)}:{}}}function Oa(A){if(A&&!bn(A[1]))return{[A[0]]:A[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function yr(A){return A.forEach(H=>{let Y=O.fetchers.get(H.key),le=Yl(void 0,Y?Y.data:void 0);O.fetchers.set(H.key,le)}),new Map(O.fetchers)}async function Ki(A,H,Y,le){ht(A);let fe=(le&&le.flushSync)===!0,xe=p||h,he=Zd(O.location,O.matches,m,Y,H,le?.relative),de=lr(xe,he,m),ye=wr(de,xe,he);if(ye.active&&ye.matches&&(de=ye.matches),!de){Hn(A,H,jn(404,{pathname:he}),{flushSync:fe});return}let{path:be,submission:Te,error:Se}=Og(!0,he,le);if(Se){Hn(A,H,Se,{flushSync:fe});return}let Pe=e.getContext?await e.getContext():new Eg,Ue=(le&&le.preventScrollReset)===!0;if(Te&&Xt(Te.formMethod)){await Ou(A,H,be,de,Pe,ye.active,fe,Ue,Te,le&&le.unstable_defaultShouldRevalidate);return}te.set(A,{routeId:H,path:be}),await Mu(A,H,be,de,Pe,ye.active,fe,Ue,Te)}async function Ou(A,H,Y,le,fe,xe,he,de,ye,be){ei(),te.delete(A);let Te=O.fetchers.get(A);en(A,iR(ye,Te),{flushSync:he});let Se=new AbortController,Pe=Ui(e.history,Y,Se.signal,ye);if(xe){let qe=await Na(le,new URL(Pe.url).pathname,Pe.signal,A);if(qe.type==="aborted")return;if(qe.type==="error"){Hn(A,H,qe.error,{flushSync:he});return}else if(qe.matches)le=qe.matches;else{Hn(A,H,jn(404,{pathname:Y}),{flushSync:he});return}}let Ue=tu(le,Y);if(!Ue.route.action&&!Ue.route.lazy){let qe=jn(405,{method:ye.formMethod,pathname:Y,routeId:H});Hn(A,H,qe,{flushSync:he});return}N.set(A,Se);let mt=V,yt=Qi(u,d,Pe,le,Ue,l,fe),vt=await vr(Pe,yt,fe,A),$e=vt[Ue.route.id];if(!$e){for(let qe of yt)if(vt[qe.route.id]){$e=vt[qe.route.id];break}}if(Pe.signal.aborted){N.get(A)===Se&&N.delete(A);return}if(pe.has(A)){if(Pr($e)||bn($e)){en(A,Ra(void 0));return}}else{if(Pr($e))if(N.delete(A),ae>mt){en(A,Ra(void 0));return}else return Q.add(A),en(A,Yl(ye)),St(Pe,$e,!1,{fetcherSubmission:ye,preventScrollReset:de});if(bn($e)){Hn(A,H,$e.error);return}}let Bt=O.navigation.location||O.location,tn=Ui(e.history,Bt,Se.signal),ut=p||h,$n=O.navigation.state!=="idle"?lr(ut,O.navigation.location,m):O.matches;je($n,"Didn't find any matches after fetcher action");let fn=++V;T.set(A,fn);let Zn=Yl(ye,$e.data);O.fetchers.set(A,Zn);let{dsMatches:wn,revalidatingFetchers:sa}=Mg(tn,fe,u,d,e.history,O,$n,ye,Bt,l,!1,S,M,pe,te,Q,ut,m,e.patchRoutesOnNavigation!=null,[Ue.route.id,$e],be);sa.filter(qe=>qe.key!==A).forEach(qe=>{let Tr=qe.key,To=O.fetchers.get(Tr),Ji=Yl(void 0,To?To.data:void 0);O.fetchers.set(Tr,Ji),ht(Tr),qe.controller&&N.set(Tr,qe.controller)}),Ye({fetchers:new Map(O.fetchers)});let _r=()=>sa.forEach(qe=>ht(qe.key));Se.signal.addEventListener("abort",_r);let{loaderResults:Er,fetcherResults:Ze}=await Fi(wn,sa,tn,fe);if(Se.signal.aborted)return;if(Se.signal.removeEventListener("abort",_r),T.delete(A),N.delete(A),sa.forEach(qe=>N.delete(qe.key)),O.fetchers.has(A)){let qe=Ra($e.data);O.fetchers.set(A,qe)}let wt=Gs(Er);if(wt)return St(tn,wt.result,!)DELIM" -R"DELIM(1,{preventScrollReset:de});if(wt=Gs(Ze),wt)return Q.add(wt.key),St(tn,wt.result,!1,{preventScrollReset:de});let{loaderData:qn,errors:$t}=Hg(O,$n,Er,void 0,sa,Ze);So(fn),O.navigation.state==="loading"&&fn>ae?(je(K,"Expected pending action"),ne&&ne.abort(),Lt(O.navigation.location,{matches:$n,loaderData:qn,errors:$t,fetchers:new Map(O.fetchers)})):(Ye({errors:$t,loaderData:Ug(O.loaderData,qn,$n,$t),fetchers:new Map(O.fetchers)}),S=!1)}async function Mu(A,H,Y,le,fe,xe,he,de,ye){let be=O.fetchers.get(A);en(A,Yl(ye,be?be.data:void 0),{flushSync:he});let Te=new AbortController,Se=Ui(e.history,Y,Te.signal);if(xe){let $e=await Na(le,new URL(Se.url).pathname,Se.signal,A);if($e.type==="aborted")return;if($e.type==="error"){Hn(A,H,$e.error,{flushSync:he});return}else if($e.matches)le=$e.matches;else{Hn(A,H,jn(404,{pathname:Y}),{flushSync:he});return}}let Pe=tu(le,Y);N.set(A,Te);let Ue=V,mt=Qi(u,d,Se,le,Pe,l,fe),vt=(await vr(Se,mt,fe,A))[Pe.route.id];if(N.get(A)===Te&&N.delete(A),!Se.signal.aborted){if(pe.has(A)){en(A,Ra(void 0));return}if(Pr(vt))if(ae>Ue){en(A,Ra(void 0));return}else{Q.add(A),await St(Se,vt,!1,{preventScrollReset:de});return}if(bn(vt)){Hn(A,H,vt.error);return}en(A,Ra(vt.data))}}async function St(A,H,Y,{submission:le,fetcherSubmission:fe,preventScrollReset:xe,replace:he}={}){Y||(me?.resolve(),me=null),H.response.headers.has("X-Remix-Revalidate")&&(S=!0);let de=H.response.headers.get("Location");je(de,"Expected a Location header on the redirect Response"),de=Lg(de,new URL(A.url),m);let ye=lo(O.location,de,{_isRedirect:!0});if(i){let mt=!1;if(H.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(Tu(de)){const yt=Sb(de,!0);mt=yt.origin!==a.location.origin||kn(yt.pathname,m)==null}if(mt){he?a.location.replace(de):a.location.assign(de);return}}ne=null;let be=he===!0||H.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Te,formAction:Se,formEncType:Pe}=O.navigation;!le&&!fe&&Te&&Se&&Pe&&(le=qg(O.navigation));let Ue=le||fe;if(D3.has(H.response.status)&&Ue&&Xt(Ue.formMethod))await De(be,ye,{submission:{...Ue,formAction:de},preventScrollReset:xe||re,enableViewTransition:Y?se:void 0});else{let mt=ud(ye,le);await De(be,ye,{overrideNavigation:mt,fetcherSubmission:fe,preventScrollReset:xe||re,enableViewTransition:Y?se:void 0})}}async function vr(A,H,Y,le){let fe,xe={};try{fe=await P3(g,A,H,le,Y,!1)}catch(he){return H.filter(de=>de.shouldLoad).forEach(de=>{xe[de.route.id]={type:"error",error:he}}),xe}if(A.signal.aborted)return xe;if(!Xt(A.method))for(let he of H){if(fe[he.route.id]?.type==="error")break;!fe.hasOwnProperty(he.route.id)&&!O.loaderData.hasOwnProperty(he.route.id)&&(!O.errors||!O.errors.hasOwnProperty(he.route.id))&&he.shouldCallHandler()&&(fe[he.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${he.route.id}`)})}for(let[he,de]of Object.entries(fe))if(eR(de)){let ye=de.result;xe[he]={type:"redirect",response:F3(ye,A,he,H,m)}}else xe[he]=await K3(de);return xe}async function Fi(A,H,Y,le){let fe=vr(Y,A,le,null),xe=Promise.all(H.map(async ye=>{if(ye.matches&&ye.match&&ye.request&&ye.controller){let Te=(await vr(ye.request,ye.matches,le,ye.key))[ye.match.route.id];return{[ye.key]:Te}}else return Promise.resolve({[ye.key]:{type:"error",error:jn(404,{pathname:ye.path})}})})),he=await fe,de=(await xe).reduce((ye,be)=>Object.assign(ye,be),{});return{loaderResults:he,fetcherResults:de}}function ei(){S=!0,te.forEach((A,H)=>{N.has(H)&&M.add(H),ht(H)})}function en(A,H,Y={}){O.fetchers.set(A,H),Ye({fetchers:new Map(O.fetchers)},{flushSync:(Y&&Y.flushSync)===!0})}function Hn(A,H,Y,le={}){let fe=or(O.matches,H);Xi(A),Ye({errors:{[fe.route.id]:Y},fetchers:new Map(O.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function Vi(A){return ie.set(A,(ie.get(A)||0)+1),pe.has(A)&&pe.delete(A),O.fetchers.get(A)||k3}function Nu(A,H){ht(A,H?.reason),en(A,Ra(null))}function Xi(A){let H=O.fetchers.get(A);N.has(A)&&!(H&&H.state==="loading"&&T.has(A))&&ht(A),te.delete(A),T.delete(A),Q.delete(A),pe.delete(A),M.delete(A),O.fetchers.delete(A)}function gr(A){let H=(ie.get(A)||0)-1;H<=0?(ie.delete(A),pe.add(A)):ie.set(A,H),Ye({fetchers:new Map(O.fetchers)})}function ht(A,H){let Y=N.get(A);Y&&(Y.abort(H),N.delete(A))}function Un(A){for(let H of A){let Y=Vi(H),le=Ra(Y.data);O.fetchers.set(H,le)}}function Ft(){let A=[],H=!1;for(let Y of Q){let le=O.fetchers.get(Y);je(le,`Expected fetcher: ${Y}`),le.state==="loading"&&(Q.delete(Y),A.push(Y),H=!0)}return Un(A),H}function So(A){let H=[];for(let[Y,le]of T)if(le0}function ju(A,H){let Y=O.blockers.get(A)||Pl;return Ee.get(A)!==H&&Ee.set(A,H),Y}function wo(A){O.blockers.delete(A),Ee.delete(A)}function la(A,H){let Y=O.blockers.get(A)||Pl;je(Y.state==="unblocked"&&H.state==="blocked"||Y.state==="blocked"&&H.state==="blocked"||Y.state==="blocked"&&H.state==="proceeding"||Y.state==="blocked"&&H.state===")DELIM" -R"DELIM(unblocked"||Y.state==="proceeding"&&H.state==="unblocked",`Invalid blocker state transition: ${Y.state} -> ${H.state}`);let le=new Map(O.blockers);le.set(A,H),Ye({blockers:le})}function br({currentLocation:A,nextLocation:H,historyAction:Y}){if(Ee.size===0)return;Ee.size>1&&xt(!1,"A router only supports one blocker at a time");let le=Array.from(Ee.entries()),[fe,xe]=le[le.length-1],he=O.blockers.get(fe);if(!(he&&he.state==="proceeding")&&xe({currentLocation:A,nextLocation:H,historyAction:Y}))return fe}function Ma(A){let H=jn(404,{pathname:A}),Y=p||h,{matches:le,route:fe}=Ys(Y);return{notFoundMatches:le,route:fe,error:H}}function oa(A,H,Y){if(E=A,k=H,R=Y||null,!j&&O.navigation===sd){j=!0;let le=_o(O.location,O.matches);le!=null&&Ye({restoreScrollPosition:le})}return()=>{E=null,k=null,R=null}}function xr(A,H){return R&&R(A,H.map(le=>o3(le,O.loaderData)))||A.key}function Sr(A,H){if(E&&k){let Y=xr(A,H);E[Y]=k()}}function _o(A,H){if(E){let Y=xr(A,H),le=E[Y];if(typeof le=="number")return le}return null}function wr(A,H,Y){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Xl(H,Y,m,!0)}}else return{active:!0,matches:Xl(H,Y,m,!0)||[]};return{active:!1,matches:null}}async function Na(A,H,Y,le){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let fe=A;for(;;){let xe=p==null,he=p||h,de=d;try{await e.patchRoutesOnNavigation({signal:Y,path:H,matches:fe,fetcherKey:le,patch:(Te,Se)=>{Y.aborted||Ng(Te,Se,he,de,u,!1)}})}catch(Te){return{type:"error",error:Te,partialMatches:fe}}finally{xe&&!Y.aborted&&(h=[...h])}if(Y.aborted)return{type:"aborted"};let ye=lr(he,H,m),be=null;if(ye){if(Object.keys(ye[0].params).length===0)return{type:"success",matches:ye};if(be=Xl(he,H,m,!0),!(be&&fe.lengthY.route.id===H[le].route.id)}function Du(A){d={},p=oo(A,u,void 0,d)}function Eo(A,H,Y=!1){let le=p==null;Ng(A,H,p||h,d,u,Y),le&&(h=[...h],Ye({}))}return ce={get basename(){return m},get future(){return v},get state(){return O},get routes(){return h},get window(){return a},initialize:Ae,subscribe:it,enableScrollRestoration:oa,navigate:Je,fetch:Ki,revalidate:st,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Vi,resetFetcher:Nu,deleteFetcher:gr,dispose:Ve,getBlocker:ju,deleteBlocker:wo,patchRoutes:Eo,_internalFetchControllers:N,_internalSetRoutes:Du,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){Ye(A)}},e.unstable_instrumentations&&(ce=R3(ce,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),ce}function H3(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Zd(e,a,i,l,s,u){let d,h;if(s){d=[];for(let m of a)if(d.push(m),m.route.id===s){h=m;break}}else d=a,h=a[a.length-1];let p=mh(l||".",hh(d),kn(e.pathname,i)||e.pathname,u==="path");if(l==null&&(p.search=e.search,p.hash=e.hash),(l==null||l===""||l===".")&&h){let m=vh(p.search);if(h.route.index&&!m)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&m){let g=new URLSearchParams(p.search),v=g.getAll("index");g.delete("index"),v.filter(_=>_).forEach(_=>g.append("index",_));let x=g.toString();p.search=x?`?${x}`:""}}return i!=="/"&&(p.pathname=x3({basename:i,pathname:p.pathname})),aa(p)}function Og(e,a,i){if(!i||!H3(i))return{path:a};if(i.formMethod&&!aR(i.formMethod))return{path:a,error:jn(405,{method:i.formMethod})};let l=()=>({path:a,error:jn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),d=Hb(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Xt(u))return l();let v=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[_,E])=>`${x}${_}=${E} -`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:d,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!Xt(u))return l();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:d,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}je(typeof FormData=="function","FormData is not available in this environment");let h,p;if(i.formData)h=Pd(i.formData),p=i.formData;else if(i.body instanceof FormData)h=Pd(i.body),p=i.body;else if(i.body instanceof URLSearchParams)h=i.body,p=Bg(h);else if(i.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(i.body),p=Bg(h)}catch{return l()}let m={formMethod:u,formAction:d,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Xt(m.formMethod))return{path:a,submission:m};let g=mr(a);return e&&g.search&&vh(g.search)&&h.append("index",""),g.search=`?${h}`,{path:aa(g),submission:m}}function)DELIM" -R"DELIM( Mg(e,a,i,l,s,u,d,h,p,m,g,v,x,_,E,R,k,j,L,U,J){let I=U?bn(U[1])?U[1].error:U[1].data:void 0,ce=s.createURL(u.location),O=s.createURL(p),K;if(g&&u.errors){let $=Object.keys(u.errors)[0];K=d.findIndex(S=>S.route.id===$)}else if(U&&bn(U[1])){let $=U[0];K=d.findIndex(S=>S.route.id===$)-1}let me=U?U[1].statusCode:void 0,re=me&&me>=400,ne={currentUrl:ce,currentParams:u.matches[0]?.params||{},nextUrl:O,nextParams:d[0].params,...h,actionResult:I,actionStatus:me},se=vo(d),ze=d.map(($,S)=>{let{route:M}=$,N=null;if(K!=null&&S>K?N=!1:M.lazy?N=!0:ph(M)?g?N=qd(M,u.loaderData,u.errors):U3(u.loaderData,u.matches[S],$)&&(N=!0):N=!1,N!==null)return Qd(i,l,e,se,$,m,a,N);let V=!1;typeof J=="boolean"?V=J:re?V=!1:(v||ce.pathname+ce.search===O.pathname+O.search||ce.search!==O.search||$3(u.matches[S],$))&&(V=!0);let ae={...ne,defaultShouldRevalidate:V},T=Il($,ae);return Qd(i,l,e,se,$,m,a,T,ae,J)}),oe=[];return E.forEach(($,S)=>{if(g||!d.some(ie=>ie.route.id===$.routeId)||_.has(S))return;let M=u.fetchers.get(S),N=M&&M.state!=="idle"&&M.data===void 0,V=lr(k,$.path,j);if(!V){if(L&&N)return;oe.push({key:S,routeId:$.routeId,path:$.path,matches:null,match:null,request:null,controller:null});return}if(R.has(S))return;let ae=tu(V,$.path),T=new AbortController,Q=Ui(s,$.path,T.signal),te=null;if(x.has(S))x.delete(S),te=Qi(i,l,Q,V,ae,m,a);else if(N)v&&(te=Qi(i,l,Q,V,ae,m,a));else{let ie;typeof J=="boolean"?ie=J:re?ie=!1:ie=v;let pe={...ne,defaultShouldRevalidate:ie};Il(ae,pe)&&(te=Qi(i,l,Q,V,ae,m,a,pe))}te&&oe.push({key:S,routeId:$.routeId,path:$.path,matches:te,match:ae,request:Q,controller:T})}),{dsMatches:ze,revalidatingFetchers:oe}}function ph(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function qd(e,a,i){if(e.lazy)return!0;if(!ph(e))return!1;let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;return!l&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!l&&!s}function U3(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function $3(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function Il(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function Ng(e,a,i,l,s,u){let d;if(e){let m=l[e];je(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),d=m.children}else d=i;let h=[],p=[];if(a.forEach(m=>{let g=d.find(v=>jb(m,v));g?p.push({existingRoute:g,newRoute:m}):h.push(m)}),h.length>0){let m=oo(h,s,[e||"_","patch",String(d?.length||"0")],l);d.push(...m)}if(u&&p.length>0)for(let m=0;ma.children?.some(s=>jb(i,s))):!1}var jg=new WeakMap,Db=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(je(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let d=jg.get(s);d||(d={},jg.set(s,d));let h=d[e];if(h)return h;let p=(async()=>{let m=a3(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)xt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),d[e]=Promise.resolve();else if(v)xt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return d[e]=p,p},Dg=new WeakMap;function Z3(e,a,i,l,s){let u=i[e.id];if(je(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=Dg.get(u);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{je(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),_={};for(let E in x){let R=x[E];if(R===void 0)continue;let k=i3(E),L=u[E]!==void 0&&E!=="hasErrorBoundary";k?xt(!k,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?xt(!L,`Route "${u.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):_[E]=R}Object.assign(u,_),Object.assign(u,{...l(u),lazy:void 0})})();return Dg.set(u,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let d=Object.keys(e.lazy),h=[],p;for(let g of d){if(s&&s.includes(g))continue;let v=Db({key:g,route:e,manifest:i,mapR)DELIM" -R"DELIM(outeProperties:l});v&&(h.push(v),g===a&&(p=v))}let m=h.length>0?Promise.all(h).then(()=>{}):void 0;return m?.catch(()=>{}),p?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:p}}async function kg(e){let a=e.matches.filter(s=>s.shouldLoad),i={};return(await Promise.all(a.map(s=>s.resolve()))).forEach((s,u)=>{i[a[u].route.id]=s}),i}async function q3(e){return e.matches.some(a=>a.route.middleware)?kb(e,()=>kg(e)):kg(e)}function kb(e,a){return Q3(e,a,l=>{if(nR(l))throw l;return l},I3,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:d}=e,h=Math.min(Math.max(d.findIndex(m=>m.route.id===s),0),Math.max(d.findIndex(m=>m.shouldCallHandler()),0)),p=or(d,d[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:l}})}}}async function Q3(e,a,i,l,s){let{matches:u,request:d,params:h,context:p,unstable_pattern:m}=e,g=u.flatMap(x=>x.route.middleware?x.route.middleware.map(_=>[x.route.id,_]):[]);return await Lb({request:d,params:h,context:p,unstable_pattern:m},g,a,i,l,s)}async function Lb(e,a,i,l,s,u,d=0){let{request:h}=e;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let p=a[d];if(!p)return await i();let[m,g]=p,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Lb(e,a,i,l,s,u,d+1)},v.value}catch(_){return v={value:await u(_,m,v)},v.value}};try{let _=await g(e,x),E=_!=null?l(_):void 0;return s(E)?E:v?E??v.value:(v={value:await x()},v.value)}catch(_){return await u(_,m,v)}}function Bb(e,a,i,l,s){let u=Db({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),d=Z3(l.route,Xt(i.method)?"action":"loader",a,e,s);return{middleware:u,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function Qd(e,a,i,l,s,u,d,h,p=null,m){let g=!1,v=Bb(e,a,i,s,u);return{...s,_lazyPromises:v,shouldLoad:h,shouldRevalidateArgs:p,shouldCallHandler(x){return g=!0,p?typeof m=="boolean"?Il(s,{...p,defaultShouldRevalidate:m}):typeof x=="boolean"?Il(s,{...p,defaultShouldRevalidate:x}):Il(s,p):h},resolve(x){let{lazy:_,loader:E,middleware:R}=s.route,k=g||h||x&&!Xt(i.method)&&(_||E),j=R&&R.length>0&&!E&&!_;return k&&(Xt(i.method)||!j)?Y3({request:i,unstable_pattern:l,match:s,lazyHandlerPromise:v?.handler,lazyRoutePromise:v?.route,handlerOverride:x,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Qi(e,a,i,l,s,u,d,h=null){return l.map(p=>p.route.id!==s.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:Bb(e,a,i,p,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Qd(e,a,i,vo(l),p,u,d,!0,h))}async function P3(e,a,i,l,s,u){i.some(m=>m._lazyPromises?.middleware)&&await Promise.all(i.map(m=>m._lazyPromises?.middleware));let d={request:a,unstable_pattern:vo(i),params:i[0].params,context:s,matches:i},p=await e({...d,fetcherKey:l,runClientMiddleware:m=>{let g=d;return kb(g,()=>m({...g,fetcherKey:l,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(m=>[m._lazyPromises?.handler,m._lazyPromises?.route]))}catch{}return p}async function Y3({request:e,unstable_pattern:a,match:i,lazyHandlerPromise:l,lazyRoutePromise:s,handlerOverride:u,scopedContext:d}){let h,p,m=Xt(e.method),g=m?"action":"loader",v=x=>{let _,E=new Promise((j,L)=>_=L);p=()=>_(),e.signal.addEventListener("abort",p);let R=j=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${i.route.id}]`)):x({request:e,unstable_pattern:a,params:i.params,context:d},...j!==void 0?[j]:[]),k=(async()=>{try{return{type:"data",result:await(u?u(L=>R(L)):R())}}catch(j){return{type:"error",result:j}}})();return Promise.race([k,E])};try{let x=m?i.route.action:i.route.loader;if(l||s)if(x){let _,[E]=await Promise.all([v(x).catch(R=>{_=R}),l,s]);if(_!==void 0)throw _;h=E}else{await l;let _=m?i.route.action:i.route.loader;if(_)[h]=await Promise.all([v(_),s]);else if(g==="action"){let E=new URL(e.url),R=E.pathname+E.search;throw jn(405,{method:e.method,pathname:R,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(x)h=await v(x);else{let _=new URL(e.url),E=_.pathname+_.search;throw jn(404,{pathname:E})}}catch(x){return{type:"error",result:x}}finally{p&&e.signal.removeEventListener("abort",p)}return h}async function G3(e){let a=e.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?e.body==null?null:e.json():e.text()}async function K3(e){let{result:a,type:i}=e;if(yh(a)){let l;try{l=await G3(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new yo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?Zg(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers)DELIM" -R"DELIM():void 0}:{type:"error",error:J3(a),statusCode:so(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:so(a)?a.status:void 0}:Zg(a)?{type:"data",data:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function F3(e,a,i,l,s){let u=e.headers.get("Location");if(je(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Tu(u)){let d=l.slice(0,l.findIndex(h=>h.route.id===i)+1);u=Zd(new URL(a.url),d,s,u),e.headers.set("Location",u)}return e}function Lg(e,a,i){if(Tu(e)){let l=e,s=l.startsWith("//")?new URL(a.protocol+l):new URL(l),u=kn(s.pathname,i)!=null;if(s.origin===a.origin&&u)return s.pathname+s.search+s.hash}return e}function Ui(e,a,i,l){let s=e.createURL(Hb(a)).toString(),u={signal:i};if(l&&Xt(l.formMethod)){let{formMethod:d,formEncType:h}=l;u.method=d.toUpperCase(),h==="application/json"?(u.headers=new Headers({"Content-Type":h}),u.body=JSON.stringify(l.json)):h==="text/plain"?u.body=l.text:h==="application/x-www-form-urlencoded"&&l.formData?u.body=Pd(l.formData):u.body=l.formData}return new Request(s,u)}function Pd(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function Bg(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function V3(e,a,i,l=!1,s=!1){let u={},d=null,h,p=!1,m={},g=i&&bn(i[1])?i[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in a))return;let x=v.route.id,_=a[x];if(je(!Pr(_),"Cannot handle redirect results in processLoaderData"),bn(_)){let E=_.error;if(g!==void 0&&(E=g,g=void 0),d=d||{},s)d[x]=E;else{let R=or(e,x);d[R.route.id]==null&&(d[R.route.id]=E)}l||(u[x]=Nb),p||(p=!0,h=so(_.error)?_.error.status:500),_.headers&&(m[x]=_.headers)}else u[x]=_.data,_.statusCode&&_.statusCode!==200&&!p&&(h=_.statusCode),_.headers&&(m[x]=_.headers)}),g!==void 0&&i&&(d={[i[0]]:g},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:d,statusCode:h||200,loaderHeaders:m}}function Hg(e,a,i,l,s,u){let{loaderData:d,errors:h}=V3(a,i,l);return s.filter(p=>!p.matches||p.matches.some(m=>m.shouldLoad)).forEach(p=>{let{key:m,match:g,controller:v}=p;if(v&&v.signal.aborted)return;let x=u[m];if(je(x,"Did not find corresponding fetcher result"),bn(x)){let _=or(e.matches,g?.route.id);h&&h[_.route.id]||(h={...h,[_.route.id]:x.error}),e.fetchers.delete(m)}else if(Pr(x))je(!1,"Unhandled fetcher revalidation redirect");else{let _=Ra(x.data);e.fetchers.set(m,_)}}),{loaderData:d,errors:h}}function Ug(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==Nb).reduce((u,[d,h])=>(u[d]=h,u),{});for(let u of i){let d=u.route.id;if(!a.hasOwnProperty(d)&&e.hasOwnProperty(d)&&u.route.loader&&(s[d]=e[d]),l&&l.hasOwnProperty(d))break}return s}function $g(e){return e?bn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function or(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function Ys(e){let a=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function jn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let d="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(d="Bad Request",l&&a&&i?h=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(h="Unable to encode submission body")):e===403?(d="Forbidden",h=`Route "${i}" does not match URL "${a}"`):e===404?(d="Not Found",h=`No route matches URL "${a}"`):e===405&&(d="Method Not Allowed",l&&a&&i?h=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(h=`Invalid request method "${l.toUpperCase()}"`)),new yo(e||500,d,new Error(h),!0)}function Gs(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(Pr(s))return{key:l,result:s}}}function Hb(e){let a=typeof e=="string"?mr(e):e;return aa({...a,hash:""})}function X3(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function J3(e){return new yo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function I3(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&W3(i))}function W3(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function eR(e){return yh(e.result)&&Ob.has(e.result.status)}function bn(e){return e.type==="error"}function Pr(e){return(e&&e.type)==="redirect"}function Zg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function yh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function tR(e){retur)DELIM" -R"DELIM(n Ob.has(e)}function nR(e){return yh(e)&&tR(e.status)&&e.headers.has("Location")}function aR(e){return j3.has(e.toUpperCase())}function Xt(e){return M3.has(e.toUpperCase())}function vh(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function tu(e,a){let i=typeof a=="string"?mr(a).search:a.search;if(e[e.length-1].route.index&&vh(i||""))return e[e.length-1];let l=Tb(e);return l[l.length-1]}function qg(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:d}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(d!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:d,text:void 0}}}function ud(e,a){return a?{state:"loading",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function rR(e,a){return{state:"submitting",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function Yl(e,a){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function iR(e,a){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a?a.data:void 0}}function Ra(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function lR(e,a){try{let i=e.sessionStorage.getItem(Mb);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function oR(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem(Mb,JSON.stringify(i))}catch(l){xt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function Qg(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var Ir=z.createContext(null);Ir.displayName="DataRouter";var go=z.createContext(null);go.displayName="DataRouterState";var Ub=z.createContext(!1);function sR(){return z.useContext(Ub)}var gh=z.createContext({isTransitioning:!1});gh.displayName="ViewTransition";var $b=z.createContext(new Map);$b.displayName="Fetchers";var uR=z.createContext(null);uR.displayName="Await";var Bn=z.createContext(null);Bn.displayName="Navigation";var Ru=z.createContext(null);Ru.displayName="Location";var Kn=z.createContext({outlet:null,matches:[],isDataRoute:!1});Kn.displayName="Route";var bh=z.createContext(null);bh.displayName="RouteError";var Zb="REACT_ROUTER_ERROR",cR="REDIRECT",fR="ROUTE_ERROR_RESPONSE";function dR(e){if(e.startsWith(`${Zb}:${cR}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function hR(e){if(e.startsWith(`${Zb}:${fR}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new yo(a.status,a.statusText,a.data)}catch{}}function mR(e,{relative:a}={}){je(bo(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=z.useContext(Bn),{hash:s,pathname:u,search:d}=xo(e,{relative:a}),h=u;return i!=="/"&&(h=u==="/"?i:na([i,u])),l.createHref({pathname:h,search:d,hash:s})}function bo(){return z.useContext(Ru)!=null}function ia(){return je(bo(),"useLocation() may be used only in the context of a component."),z.useContext(Ru).location}var qb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qb(e){z.useContext(Bn).static||z.useLayoutEffect(e)}function pr(){let{isDataRoute:e}=z.useContext(Kn);return e?AR():pR()}function pR(){je(bo(),"useNavigate() may be used only in the context of a component.");let e=z.useContext(Ir),{basename:a,navigator:i}=z.useContext(Bn),{matches:l}=z.useContext(Kn),{pathname:s}=ia(),u=JSON.stringify(hh(l)),d=z.useRef(!1);return Qb(()=>{d.current=!0}),z.useCallback((p,m={})=>{if(xt(d.current,qb),!d.current)return;if(typeof p=="number"){i.go(p);return}let g=mh(p,JSON.parse(u),s,m.relative==="path");e==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:na([a,g.pathname])),(m.replace?i.replace:i.push)(g,m.state,m)},[a,i,u,s,e])}var yR=z.createContext(null);function vR(e){let a=z.useContext(Kn).outlet;return z.useMemo(()=>a&&z.createElement(yR.Provider,{value:e},a),[a,e])}func)DELIM" -R"DELIM(tion xh(){let{matches:e}=z.useContext(Kn),a=e[e.length-1];return a?a.params:{}}function xo(e,{relative:a}={}){let{matches:i}=z.useContext(Kn),{pathname:l}=ia(),s=JSON.stringify(hh(i));return z.useMemo(()=>mh(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function gR(e,a,i,l,s){je(bo(),"useRoutes() may be used only in the context of a component.");let{navigator:u}=z.useContext(Bn),{matches:d}=z.useContext(Kn),h=d[d.length-1],p=h?h.params:{},m=h?h.pathname:"/",g=h?h.pathnameBase:"/",v=h&&h.route;{let L=v&&v.path||"";Gb(m,!v||L.endsWith("*")||L.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${m}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const h=f[1];if(a===f[0]){u(f);continue}if(e.external){const m=e.external.registry.get(f[0])?.id;if(a!==f[0]&&m){u(f);continue}}if(e.metadataRegistry.get(f[0])?.id){u(f);continue}if(h.cycle){u(f);continue}if(h.count>1&&e.reused==="ref"){u(f);continue}}}function W0(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=f=>{const h=e.seen.get(f);if(h.ref===null)return;const p=h.def??h.schema,m={...p},g=h.ref;if(h.ref=null,g){l(g);const x=e.seen.get(g),_=x.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(_)):Object.assign(p,_),Object.assign(p,m),f._zod.parent===g)for(const T in p)T==="$ref"||T==="allOf"||T in m||delete p[T];if(_.$ref&&x.def)for(const T in p)T==="$ref"||T==="allOf"||T in x.def&&JSON.stringify(p[T])===JSON.stringify(x.def[T])&&delete p[T]}const v=f._zod.parent;if(v&&v!==g){l(v);const x=e.seen.get(v);if(x?.schema.$ref&&(p.$ref=x.schema.$ref,x.def))for(const _ in p)_==="$ref"||_==="allOf"||_ in x.def&&JSON.stringify(p[_])===JSON.stringify(x.def[_])&&delete p[_]}e.override({zodSchema:f,jsonSchema:p,path:h.path??[]})};for(const f of[...e.seen.entries()].reverse())l(f[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const f=e.external.registry.get(a)?.id;if(!f)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(f)}Object.assign(s,i.def??i.schema);const u=e.external?.defs??{};for(const f of e.seen.entries()){const h=f[1];h.def&&h.defId&&(u[h.defId]=h.def)}e.exter)DELIM" +R"DELIM(nal||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const f=JSON.parse(JSON.stringify(s));return Object.defineProperty(f,"~standard",{value:{...a["~standard"],jsonSchema:{input:fu(a,"input",e.processors),output:fu(a,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function It(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return It(l.element,i);if(l.type==="set")return It(l.valueType,i);if(l.type==="lazy")return It(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return It(l.innerType,i);if(l.type==="intersection")return It(l.left,i)||It(l.right,i);if(l.type==="record"||l.type==="map")return It(l.keyType,i)||It(l.valueType,i);if(l.type==="pipe")return It(l.in,i)||It(l.out,i);if(l.type==="object"){for(const s in l.shape)if(It(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(It(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(It(s,i))return!0;return!!(l.rest&&It(l.rest,i))}return!1}const AE=(e,a={})=>i=>{const l=J0({...i,processors:a});return Kt(e,l),I0(l,e),W0(l,e)},fu=(e,a,i={})=>l=>{const{libraryOptions:s,target:u}=l??{},f=J0({...s??{},target:u,io:a,processors:i});return Kt(e,f),I0(f,e),W0(f,e)},OE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},CE=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:f,format:h,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof f=="number"&&(s.maxLength=f),h&&(s.format=OE[h]??h,s.format===""&&delete s.format,h==="time"&&delete s.format),m&&(s.contentEncoding=m),p&&p.size>0){const g=[...p];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(v=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},ME=(e,a,i,l)=>{const s=i,{minimum:u,maximum:f,format:h,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof h=="string"&&h.includes("int")?s.type="integer":s.type="number",typeof g=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.minimum=g,s.exclusiveMinimum=!0):s.exclusiveMinimum=g),typeof u=="number"&&(s.minimum=u,typeof g=="number"&&a.target!=="draft-04"&&(g>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof m=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(s.maximum=m,s.exclusiveMaximum=!0):s.exclusiveMaximum=m),typeof f=="number"&&(s.maximum=f,typeof m=="number"&&a.target!=="draft-04"&&(m<=f?delete s.maximum:delete s.exclusiveMaximum)),typeof p=="number"&&(s.multipleOf=p)},NE=(e,a,i,l)=>{i.type="boolean"},jE=(e,a,i,l)=>{i.not={}},DE=(e,a,i,l)=>{},kE=(e,a,i,l)=>{const s=e._zod.def,u=M0(s.entries);u.every(f=>typeof f=="number")&&(i.type="number"),u.every(f=>typeof f=="string")&&(i.type="string"),i.enum=u},LE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BE=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},HE=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:f,maximum:h}=e._zod.bag;typeof f=="number"&&(s.minItems=f),typeof h=="number"&&(s.maxItems=h),s.type="array",s.items=Kt(u.element,a,{...l,path:[...l.path,"items"]})},UE=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const f=u.shape;for(const m in f)s.properties[m]=Kt(f[m],a,{...l,path:[...l.path,"properties",m]});const h=new Set(Object.keys(f)),p=new Set([...h].filter(m=>{const g=u.shape[m]._zod;return a.io==="input"?g.optin===void 0:g.optout===void 0}));p.size>0&&(s.required=Array.from(p)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Kt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},$E=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,f=s.options.map((h,p)=>Kt(h,a,{...l,path:[...l.path,u?"oneOf":"anyOf",p]}));u?i.oneOf=f:i.anyOf=f},ZE=(e,a,i,l)=>{const s=e._zod.def,u=Kt(s.left,a,{...l,path:[...l.path,"allOf",0]}),f=Kt(s.right,a,{...l,path:[...l.path,"allOf",1]}),h=m=>"allOf"in m&&Object.keys(m).length===1,p=[...h(u)?u.allOf:[u],...h(f)?f.allOf:[f]];i.allOf=p},qE=(e,a,i,l)=>{const s=e._zod.def,u=Kt(s.innerType,a,l),f=a.seen.get(e);a.target==="openapi-3.0"?(f.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},QE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},PE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},YE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.def)DELIM" +R"DELIM(aultValue)))},GE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let f;try{f=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=f},KE=(e,a,i,l)=>{const s=e._zod.def,u=a.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Kt(u,a,l);const f=a.seen.get(e);f.ref=u},FE=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},eb=(e,a,i,l)=>{const s=e._zod.def;Kt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},VE=ee("ZodISODateTime",(e,a)=>{e_.init(e,a),pt.init(e,a)});function XE(e){return rE(VE,e)}const JE=ee("ZodISODate",(e,a)=>{t_.init(e,a),pt.init(e,a)});function IE(e){return iE(JE,e)}const WE=ee("ZodISOTime",(e,a)=>{n_.init(e,a),pt.init(e,a)});function e4(e){return lE(WE,e)}const t4=ee("ZodISODuration",(e,a)=>{a_.init(e,a),pt.init(e,a)});function n4(e){return oE(t4,e)}const a4=(e,a)=>{L0.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Gw(e,i)},flatten:{value:i=>Yw(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Dd,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Dd,2)}},isEmpty:{get(){return e.issues.length===0}}})},Bn=ee("ZodError",a4,{Parent:Error}),r4=rh(Bn),i4=ih(Bn),l4=Su(Bn),o4=wu(Bn),s4=Vw(Bn),u4=Xw(Bn),c4=Jw(Bn),f4=Iw(Bn),d4=Ww(Bn),h4=e2(Bn),m4=t2(Bn),p4=n2(Bn),zt=ee("ZodType",(e,a)=>(Rt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:fu(e,"input"),output:fu(e,"output")}}),e.toJSONSchema=AE(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.check=(...i)=>e.clone(mr(a,{checks:[...a.checks??[],...i.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0}),e.with=e.check,e.clone=(i,l)=>pr(e,i,l),e.brand=()=>e,e.register=((i,l)=>(i.add(e,l),e)),e.parse=(i,l)=>r4(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>l4(e,i,l),e.parseAsync=async(i,l)=>i4(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>o4(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>s4(e,i,l),e.decode=(i,l)=>u4(e,i,l),e.encodeAsync=async(i,l)=>c4(e,i,l),e.decodeAsync=async(i,l)=>f4(e,i,l),e.safeEncode=(i,l)=>d4(e,i,l),e.safeDecode=(i,l)=>h4(e,i,l),e.safeEncodeAsync=async(i,l)=>m4(e,i,l),e.safeDecodeAsync=async(i,l)=>p4(e,i,l),e.refine=(i,l)=>e.check(sT(i,l)),e.superRefine=i=>e.check(uT(i)),e.overwrite=i=>e.check(Gi(i)),e.optional=()=>lg(e),e.exactOptional=()=>V4(e),e.nullable=()=>og(e),e.nullish=()=>lg(og(e)),e.nonoptional=i=>tT(e,i),e.array=()=>Pi(e),e.or=i=>q4([e,i]),e.and=i=>P4(e,i),e.transform=i=>sg(e,K4(i)),e.default=i=>I4(e,i),e.prefault=i=>eT(e,i),e.catch=i=>aT(e,i),e.pipe=i=>sg(e,i),e.readonly=()=>lT(e),e.describe=i=>{const l=e.clone();return Vl.add(l,{description:i}),l},Object.defineProperty(e,"description",{get(){return Vl.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Vl.get(e);const l=e.clone();return Vl.add(l,i[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),tb=ee("_ZodString",(e,a)=>{lh.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>CE(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...l)=>e.check(hE(...l)),e.includes=(...l)=>e.check(yE(...l)),e.startsWith=(...l)=>e.check(vE(...l)),e.endsWith=(...l)=>e.check(gE(...l)),e.min=(...l)=>e.check(cu(...l)),e.max=(...l)=>e.check(V0(...l)),e.length=(...l)=>e.check(X0(...l)),e.nonempty=(...l)=>e.check(cu(1,...l)),e.lowercase=l=>e.check(mE(l)),e.uppercase=l=>e.check(pE(l)),e.trim=()=>e.check(xE()),e.normalize=(...l)=>e.check(bE(...l)),e.toLowerCase=()=>e.check(SE()),e.toUpperCase=()=>e.check(wE()),e.slugify=()=>e.check(_E())}),y4=ee("ZodString",(e,a)=>{lh.init(e,a),tb.init(e,a),e.email=i=>e.check(B_(v4,i)),e.url=i=>e.check(q_(g4,i)),e.jwt=i=>e.check(aE(j4,i)),e.emoji=i=>e.check(Q_(b4,i)),e.guid=i=>e.check(Wv(ag,i)),e.uuid=i=>e.check(H_($s,i)),e.uuidv4=i=>e.check(U_($s,i)),e.uuidv6=i=>e.check($_($s,i)),e.uuidv7=i=>e.check(Z_($s,i)),e.nanoid=i=>e.check(P_(x4,i)),e.guid=i=>e.check(Wv(ag,i)),e.cuid=i=>e.check(Y_(S4,i)),e.cuid2=i=>e.check(G_(w4,i)),e.ulid=i=>e.check(K_(_4,i)),e.base64=i=>e.check(eE(C4,i)),e.base64url=i=>e.check(tE(M4,i)),e.xid=i=>e.check(F_(E4,i)),e.ksuid=i=>e.check(V_(T4,i)),e.ipv4=i=>e.check(X_(R4,i)),e.ipv6=i=>e.check(J_(z4,i)),e.cidrv4=i=>e.check(I_(A4,i)),e.cidrv6=i=>e.check(W_(O4,i)),e.e164=i=>e.check(nE(N4,i)),e.datetime=i=>e.check(XE(i)),e.date=i=>e.check(IE(i)),e.time=i=>e.check(e4(i)),e.duration=i=>e.check(n4(i))});function jt(e){return L_(y4,e)}const pt=ee("ZodStringFormat",(e,a)=>{ft.init(e,a),tb.init(e,a)}),v4=ee("ZodEmail",(e,a)=>{Y2.init(e,a),pt.init(e,a)}),ag=ee("ZodGUID",(e,a)=>{Q2.init(e,a),pt.init(e,a)}),$s=ee("ZodUUID",(e,a)=>{P2.init(e,a),pt.init(e,a)}),g4=ee("ZodURL",(e,a)=>{G2.init(e,a),pt.init(e,a)}),b4=ee("ZodEmoji",(e,a)=>{K2.init(e,a),pt.init(e,a)}),x4=ee("Zo)DELIM" +R"DELIM(dNanoID",(e,a)=>{F2.init(e,a),pt.init(e,a)}),S4=ee("ZodCUID",(e,a)=>{V2.init(e,a),pt.init(e,a)}),w4=ee("ZodCUID2",(e,a)=>{X2.init(e,a),pt.init(e,a)}),_4=ee("ZodULID",(e,a)=>{J2.init(e,a),pt.init(e,a)}),E4=ee("ZodXID",(e,a)=>{I2.init(e,a),pt.init(e,a)}),T4=ee("ZodKSUID",(e,a)=>{W2.init(e,a),pt.init(e,a)}),R4=ee("ZodIPv4",(e,a)=>{r_.init(e,a),pt.init(e,a)}),z4=ee("ZodIPv6",(e,a)=>{i_.init(e,a),pt.init(e,a)}),A4=ee("ZodCIDRv4",(e,a)=>{l_.init(e,a),pt.init(e,a)}),O4=ee("ZodCIDRv6",(e,a)=>{o_.init(e,a),pt.init(e,a)}),C4=ee("ZodBase64",(e,a)=>{s_.init(e,a),pt.init(e,a)}),M4=ee("ZodBase64URL",(e,a)=>{c_.init(e,a),pt.init(e,a)}),N4=ee("ZodE164",(e,a)=>{f_.init(e,a),pt.init(e,a)}),j4=ee("ZodJWT",(e,a)=>{h_.init(e,a),pt.init(e,a)}),nb=ee("ZodNumber",(e,a)=>{Y0.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>ME(e,l,s),e.gt=(l,s)=>e.check(tg(l,s)),e.gte=(l,s)=>e.check(Wf(l,s)),e.min=(l,s)=>e.check(Wf(l,s)),e.lt=(l,s)=>e.check(eg(l,s)),e.lte=(l,s)=>e.check(If(l,s)),e.max=(l,s)=>e.check(If(l,s)),e.int=l=>e.check(rg(l)),e.safe=l=>e.check(rg(l)),e.positive=l=>e.check(tg(0,l)),e.nonnegative=l=>e.check(Wf(0,l)),e.negative=l=>e.check(eg(0,l)),e.nonpositive=l=>e.check(If(0,l)),e.multipleOf=(l,s)=>e.check(ng(l,s)),e.step=(l,s)=>e.check(ng(l,s)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Ge(e){return sE(nb,e)}const D4=ee("ZodNumberFormat",(e,a)=>{m_.init(e,a),nb.init(e,a)});function rg(e){return uE(D4,e)}const k4=ee("ZodBoolean",(e,a)=>{p_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>NE(e,i,l)});function oh(e){return cE(k4,e)}const L4=ee("ZodUnknown",(e,a)=>{y_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>DE()});function ig(){return fE(L4)}const B4=ee("ZodNever",(e,a)=>{v_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>jE(e,i,l)});function H4(e){return dE(B4,e)}const U4=ee("ZodArray",(e,a)=>{g_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>HE(e,i,l,s),e.element=a.element,e.min=(i,l)=>e.check(cu(i,l)),e.nonempty=i=>e.check(cu(1,i)),e.max=(i,l)=>e.check(V0(i,l)),e.length=(i,l)=>e.check(X0(i,l)),e.unwrap=()=>e.element});function Pi(e,a){return EE(U4,e,a)}const $4=ee("ZodObject",(e,a)=>{x_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>UE(e,i,l,s),et(e,"shape",()=>a.shape),e.keyof=()=>Y4(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ig()}),e.loose=()=>e.clone({...e._zod.def,catchall:ig()}),e.strict=()=>e.clone({...e._zod.def,catchall:H4()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>$w(e,i),e.safeExtend=i=>Zw(e,i),e.merge=i=>qw(e,i),e.pick=i=>Hw(e,i),e.omit=i=>Uw(e,i),e.partial=(...i)=>Qw(ab,e,i[0]),e.required=(...i)=>Pw(rb,e,i[0])});function na(e,a){const i={type:"object",shape:e??{},...Ee(a)};return new $4(i)}const Z4=ee("ZodUnion",(e,a)=>{S_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>$E(e,i,l,s),e.options=a.options});function q4(e,a){return new Z4({type:"union",options:e,...Ee(a)})}const Q4=ee("ZodIntersection",(e,a)=>{w_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>ZE(e,i,l,s)});function P4(e,a){return new Q4({type:"intersection",left:e,right:a})}const Ld=ee("ZodEnum",(e,a)=>{__.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>kE(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const f of l)if(i.has(f))u[f]=a.entries[f];else throw new Error(`Key ${f} not found in enum`);return new Ld({...a,checks:[],...Ee(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const f of l)if(i.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new Ld({...a,checks:[],...Ee(s),entries:u})}});function Y4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new Ld({type:"enum",entries:i,...Ee(a)})}const G4=ee("ZodTransform",(e,a)=>{E_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>BE(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new O0(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(ro(u,i.value,a));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=i.value),f.inst??(f.inst=e),i.issues.push(ro(f))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i)):(i.value=s,i)}});function K4(e){return new G4({type:"transform",transform:e})}const ab=ee("ZodOptional",(e,a)=>{F0.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>eb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function lg(e){return new ab({type:"optional",innerType:e})}const F4=ee("ZodExactOptional",(e,a)=>{T_.init(e,a))DELIM" +R"DELIM(,zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>eb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function V4(e){return new F4({type:"optional",innerType:e})}const X4=ee("ZodNullable",(e,a)=>{R_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>qE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function og(e){return new X4({type:"nullable",innerType:e})}const J4=ee("ZodDefault",(e,a)=>{z_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>PE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function I4(e,a){return new J4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():j0(a)}})}const W4=ee("ZodPrefault",(e,a)=>{A_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>YE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function eT(e,a){return new W4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():j0(a)}})}const rb=ee("ZodNonOptional",(e,a)=>{O_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>QE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function tT(e,a){return new rb({type:"nonoptional",innerType:e,...Ee(a)})}const nT=ee("ZodCatch",(e,a)=>{C_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>GE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function aT(e,a){return new nT({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const rT=ee("ZodPipe",(e,a)=>{M_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>KE(e,i,l,s),e.in=a.in,e.out=a.out});function sg(e,a){return new rT({type:"pipe",in:e,out:a})}const iT=ee("ZodReadonly",(e,a)=>{N_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>FE(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function lT(e){return new iT({type:"readonly",innerType:e})}const oT=ee("ZodCustom",(e,a)=>{j_.init(e,a),zt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>LE(e,i)});function sT(e,a={}){return TE(oT,e,a)}function uT(e){return RE(e)}class sh extends Error{constructor(a,i){super(a),this.status=i}}const Bd=na({id:jt(),height:Ge(),timestamp:Ge().optional(),mediantime:Ge().optional(),tx_count:Ge().optional(),size:Ge().optional(),weight:Ge().optional(),difficulty:Ge().optional(),bits:Ge().optional(),merkle_root:jt().optional(),previousblockhash:jt().nullable().optional(),nonce:Ge().optional(),version:Ge().optional()}).loose(),cT=na({confirmed:oh(),block_height:Ge().optional(),block_hash:jt().optional(),block_time:Ge().optional()}),fT=na({txid:jt().optional().nullable(),vout:Ge().optional().nullable(),sequence:Ge().optional(),scriptsig:jt().optional().nullable(),scriptsig_asm:jt().optional().nullable(),witness:Pi(jt()).optional(),is_coinbase:oh().optional(),prevout:na({scriptpubkey_type:jt().optional(),scriptpubkey_address:jt().optional(),scriptpubkey:jt().optional(),scriptpubkey_asm:jt().optional(),value:Ge().optional()}).partial().nullable().optional()}).loose(),dT=na({scriptpubkey_type:jt().optional(),scriptpubkey_address:jt().optional(),scriptpubkey:jt().optional(),scriptpubkey_asm:jt().optional(),value:Ge(),n:Ge().optional()}).loose(),Js=na({txid:jt(),hash:jt().optional(),fee:Ge().optional(),version:Ge(),locktime:Ge(),vin:Pi(fT),vout:Pi(dT),size:Ge(),weight:Ge(),status:cT}).loose(),Is=Pi(Bd),du=Pi(Js),ug=na({in_best_chain:oh(),next_best:jt().optional(),height:Ge().optional()}),cg=na({address:jt(),chain_stats:na({funded_txo_count:Ge().optional(),funded_txo_sum:Ge().optional(),spent_txo_count:Ge().optional(),spent_txo_sum:Ge().optional(),tx_count:Ge().optional()}),mempool_stats:na({funded_txo_count:Ge().optional(),funded_txo_sum:Ge().optional(),spent_txo_count:Ge().optional(),spent_txo_sum:Ge().optional(),tx_count:Ge().optional()})});async function Yt(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);if(!s.ok)throw new sh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function fg(e,a){const i=await fetch(`${e}/blocks/tip/height`);if(!i.ok)throw new sh("Unable to fetch tip height",i.status);const l=await i.text(),s=Number(l.trim());if(!Number.isFinite(s))throw new TypeError("Invalid tip height response");return a.lastKnownHeight=s,s}async function Di(e,a,i){if(a.lastKnownHeight===null){await fg(e,a);return}typeof i=="number"&&a.lastKnownHeightu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const f=u.prevout;return f?.scriptpubkey_address===e&&typeof f.value=="number"?s+f.value:s},0);return i-l}async function ed(e,a){if(a==="latest"||a==="tip"){const i=await Yt(e,"/blocks",Is);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${e}/block-height/${a}`);if(!i.ok)throw new sh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function dg(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);ret)DELIM" +R"DELIM(urn s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function ql(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function td(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((p,m)=>{const g=p.is_coinbase||p.txid==null?void 0:typeof p.vout=="number"&&p.vout!==4294967295?p.vout:void 0;return{index:m,prevTxId:p.txid??void 0,prevOutputIndex:g,address:p.prevout?.scriptpubkey_address??void 0,valueSats:p.prevout?.value,scriptType:p.prevout?.scriptpubkey_type,isCoinbase:p.is_coinbase??!1,script:p.scriptsig||p.scriptsig_asm?{hex:p.scriptsig??void 0,mnemonic:p.scriptsig_asm??void 0}:void 0,witness:p.witness??void 0,sequence:p.sequence}}),s=e.vout.map((p,m)=>({index:m,address:p.scriptpubkey_address??void 0,valueSats:p.value,scriptType:p.scriptpubkey_type,spent:void 0,script:p.scriptpubkey||p.scriptpubkey_asm?{hex:p.scriptpubkey??void 0,mnemonic:p.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((p,m)=>p+m.valueSats,0),f=a.lastKnownHeight;let h=0;return e.status.block_height&&i==="confirmed"&&(h=f&&f>=e.status.block_height?f-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:h,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:u,inputs:l,outputs:s}}function mT(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=ib(e.address,a.slice(0,25));return{address:e.address,addressType:Aa(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function pT(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:Aa(e.address),balance:l,totalReceived:(a.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(a.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(a.tx_count??0)+(i.tx_count??0),utxoCount:(a.funded_txo_count??0)-(a.spent_txo_count??0)}}function ib(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:hT(e,i),blockHeight:i.status.block_height}))}async function hg(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return Yt(e,l,du)}async function yT(e,a,i){return i?Yt(e,`/address/${a}/txs/chain/${i}`,du):Yt(e,`/address/${a}/txs`,du)}function lb({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(h){const p=await Yt(e,`/tx/${h}`,Js);return await(p.status.block_height?Di(e,l,p.status.block_height):Di(e,l)),td(p,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const h=await Yt(e,"/blocks",Is);if(h.length===0)return;const p=h[0];if(p.id!==l.lastBlockHash){l.lastBlockHash=p.id,l.lastKnownHeight=Math.max(p.height,l.lastKnownHeight??0);const m=ql(p);for(const g of a)g({type:"block.new",payload:m})}}catch(h){console.warn("Block polling failed",h)}},15e3))}function f(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(h=10){const p=await Yt(e,"/blocks",Is);return p.length>0&&(l.lastBlockHash=p[0].id,l.lastKnownHeight=Math.max(p[0].height,l.lastKnownHeight??0)),p.slice(0,h).map(m=>ql(m))},async getBlocksBefore(h,p=10){const m=Math.max(h,0),g=await Yt(e,`/blocks/${String(m)}`,Is);return g.length>0&&(l.lastKnownHeight=Math.max(g[0].height,l.lastKnownHeight??0)),g.slice(0,p).map(v=>ql(v))},async getBlockHeader(h){const p=await ed(e,h);await Di(e,l);const[m,g]=await Promise.all([Yt(e,`/block/${p}`,Bd),Yt(e,`/block/${p}/status`,ug).catch(()=>null)]),v=ql(m);l.lastBlockHash=v.hash,l.lastKnownHeight=Math.max(v.height,l.lastKnownHeight??v.height);let x=g?.next_best??null;return x||(x=await dg(e,v.height,l)),{...v,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:x}},getBlockStats(h){return Promise.resolve({})},async getBlock(h){const p=await ed(e,h);await Di(e,l);const m=await Yt(e,`/block/${p}`,Bd),[g,v]=await Promise.allSettled([hg(e,p),Yt(e,`/block/${p}/status`,ug)]);g.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",g.reason),v.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",v.reason);const x=ql(m);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,)DELIM" +R"DELIM(l.lastKnownHeight??x.height);const _=g.status==="fulfilled"?g.value:[];let T=(v.status==="fulfilled"?v.value:null)?.next_best??null;return T||(T=await dg(e,x.height,l)),{...x,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:T,transactions:_.map(k=>td(k,l))}},async getBlockTransactions(h,p=0){const m=await ed(e,h),g=await hg(e,m,p),v=g.reduce((x,_)=>_.status.block_height?x===null?_.status.block_height:Math.max(x,_.status.block_height):x,null);return await(typeof v=="number"?Di(e,l,v):Di(e,l)),g.map(x=>td(x,l))},async getTransactionHeader(h){return s(h)},async getTransaction(h){return s(h)},async getTransactionInputScriptHex(h,p){const m=await Yt(e,`/tx/${h}`,Js);if(p<0||p>=m.vin.length)throw new RangeError(`Input index ${String(p)} not found`);const v=m.vin[p].scriptsig;return typeof v=="string"?v:""},async getTransactionOutputScriptHex(h,p){const m=await Yt(e,`/tx/${h}`,Js);if(p<0||p>=m.vout.length)throw new RangeError(`Output index ${String(p)} not found`);const v=m.vout[p].scriptpubkey;if(typeof v!="string")throw new TypeError("Output script missing in provider response");return v},async getAddressSummary(h){const p=await Yt(e,`/address/${h}`,cg);return pT(p)},async getAddress(h){const p=await Yt(e,`/address/${h}`,cg),m=await Yt(e,`/address/${h}/txs`,du);return mT(p,m)},async getAddressTransactions(h,p){const m=await yT(e,h,p);return ib(h,m)},subscribeToEvents(h){return a.add(h),u(),()=>{a.delete(h),a.size===0&&f()}}}}function vT({baseUrl:e}){const a=lb({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function io(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ob(e,a){return Array.isArray(a)?a.length===0?!0:e?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function sb(e){if(typeof e!="function")throw new Error("function expected");return!0}function lo(e,a){if(typeof a!="string")throw new Error(`${e}: string expected`);return!0}function mo(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function hu(e){if(!Array.isArray(e))throw new Error("array expected")}function ub(e,a){if(!ob(!0,a))throw new Error(`${e}: array of strings expected`)}function uh(e,a){if(!ob(!1,a))throw new Error(`${e}: array of numbers expected`)}function ch(...e){const a=u=>u,i=(u,f)=>h=>u(f(h)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function cb(e){const a=typeof e=="string"?e.split(""):e,i=a.length;ub("alphabet",a);const l=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(hu(s),s.map(u=>{if(!Number.isSafeInteger(u)||u<0||u>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${u}". Allowed: ${e}`);return a[u]})),decode:s=>(hu(s),s.map(u=>{lo("alphabet.decode",u);const f=l.get(u);if(f===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return f}))}}function fb(e=""){return lo("join",e),{encode:a=>(ub("join.decode",a),a.join(e)),decode:a=>(lo("join.decode",a),a.split(e))}}function mg(e,a,i){if(a<2)throw new Error(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new Error(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(hu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,h=>{if(mo(h),h<0||h>=a)throw new Error(`invalid integer: ${h}`);return h}),f=u.length;for(;;){let h=0,p=!0;for(let m=l;ma===0?e:db(a,e%a),mu=(e,a)=>e+(a-db(e,a)),Ws=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function Hd(e,a,i,l){if(hu(e),a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new Error(`convertRadix2: wrong to=${i}`);if(mu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${mu(a,i)}`);let s=0,u=0;const f=Ws[a],h=Ws[i]-1,p=[];for(const m of e){if(mo(m),m>=f)throw new Error(`convertRadix2: invalid data word=${m} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)p.push((s>>u-i&h)>>>0);const g=Ws[u];if(g===void 0)throw new Error("invalid carry");s&=g-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&p.push(s>>>0),p}function gT(e){mo(e);const a=2**8;return{encode:i=>{if(!io(i))throw new Error("radix.encode input should be Uint8Array");return mg(Array.from(i),a,e)},decode:i=>(uh("radix.decode",i),Uint8Array.from(mg(i,e,a)))}}function bT(e,a=!1){if(mo(e),e<=0||e>32)throw new Error("radix2: bits )DELIM" +R"DELIM(should be in (0..32]");if(mu(8,e)>32||mu(e,8)>32)throw new Error("radix2: carry overflow");return{encode:i=>{if(!io(i))throw new Error("radix2.encode input should be Uint8Array");return Hd(Array.from(i),8,e,!a)},decode:i=>(uh("radix2.decode",i),Uint8Array.from(Hd(i,e,8,a)))}}function pg(e){return sb(e),function(...a){try{return e.apply(null,a)}catch{}}}function xT(e,a){return mo(e),sb(a),{encode(i){if(!io(i))throw new Error("checksum.encode: input should be Uint8Array");const l=a(i).slice(0,e),s=new Uint8Array(i.length+e);return s.set(i),s.set(l,i.length),s},decode(i){if(!io(i))throw new Error("checksum.decode: input should be Uint8Array");const l=i.slice(0,-e),s=i.slice(-e),u=a(l).slice(0,e);for(let f=0;fch(gT(58),cb(e),fb("")),wT=ST("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),_T=e=>ch(xT(4,a=>e(e(a))),wT),Ud=ch(cb("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),fb("")),yg=[996825010,642813549,513874426,1027748829,705979059];function Ql(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=yg[l]);return i}function vg(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=Ql(s)^f>>5}s=Ql(s);for(let u=0;u_)throw new TypeError(`Length ${T} exceeds limit ${_}`);const j=v.toLowerCase(),k=vg(j,x,a);return`${j}1${Ud.encode(x)}${k}`}function h(v,x=90){lo("bech32.decode input",v);const _=v.length;if(_<8||x!==!1&&_>x)throw new TypeError(`invalid string length: ${_} (${v}). Expected (8..${x})`);const E=v.toLowerCase();if(v!==E&&v!==v.toUpperCase())throw new Error("String must be lowercase or uppercase");const T=E.lastIndexOf("1");if(T===0||T===-1)throw new Error('Letter "1" must be present between prefix and data only');const j=E.slice(0,T),k=E.slice(T+1);if(k.length<6)throw new Error("Data must be at least 6 characters long");const L=Ud.decode(k).slice(0,-6),U=vg(j,L,a);if(!k.endsWith(U))throw new Error(`Invalid checksum in ${v}: expected "${U}"`);return{prefix:j,words:L}}const p=pg(h);function m(v){const{prefix:x,words:_}=h(v,!1);return{prefix:x,words:_,bytes:l(_)}}function g(v,x){return f(v,s(x))}return{encode:f,decode:h,encodeFromBytes:g,decodeToBytes:m,decodeUnsafe:p,fromWords:l,fromWordsUnsafe:u,toWords:s}}const pu=hb("bech32"),$d=hb("bech32m");function ET(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function fh(e,a,i=""){const l=ET(e),s=e?.length;if(!l||a!==void 0){const f=i&&`"${i}" `,h="",p=l?`length=${s}`:`type=${typeof e}`;throw new Error(f+"expected Uint8Array"+h+", got "+p)}return e}function gg(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function TT(e,a){fh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function Zd(...e){for(let a=0;a>>a}const RT=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",zT=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function eu(e){if(fh(e),RT)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const OT=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function CT(e,a,i){return e&a^~e&i}function MT(e,a,i){return e&a^e&i^a&i}class NT{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffset=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=nd(this.buffer)}update(a){gg(this),fh(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let f=0;fs-f&&(this.process(l,0),f=0);for(let v=f;vg.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v>>3,T=ta(_,17)^ta(_,19)^_>>>10;ir[v]=T+ir[v-7]+E+ir[v-16]|0}let{A:l,B:s,C:u,D:f,E:h,F:p,G:m,H:g}=this;for(let v=0;v<64;v++){const x=ta(h,6)^ta(h,11)^ta(h,25),_=g+x+CT(h,p,m)+jT[v]+ir[v]|0,T=(ta(l,2)^ta(l,13)^ta(l,22))+MT(l,s,u)|0;g=m,m=p,p=h,h=f+_|0,f=u,u=s,s=l,l=_+T|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,f=f+this.D|0,h=h+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(l,s,u,f,h,p,m,g)}roundClean(){Zd(ir)}destroy(){this.set(0,0,0,0,0,0,0,0),Zd(this.buffer)}}class kT extends DT{A=rr[0]|0;B=rr[1]|0;C=rr[2]|0;D=rr[3]|0;E=rr[4]|0;F=rr[5]|0;G=rr[6]|0;H=rr[7]|0;constructor(){super(32)}}const mb=AT(()=>new kT,OT(1)),pb=_T(mb),LT=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function dh(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function hh(e){const a=e.toLowerCase();if(a.includes("dup hash160")&&a.includes("equalverify checksig"))return"p2pkh";if(a.startsWith("hash160")&&a.includes("equal"))return"p2sh";if(a.startsWith("zero [")){const l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function po(){return"mainnet"}function yo(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function bg(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(dh(a),1),pb.encode(i)}function ad(e,a,i){const l=dh(i),s=pu.toWords(l);return s.unshift(a),(a===0?pu:$d).encode(e,s)}function yb(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:bg(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:bg(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:ad(a.hrp,0,u[1]),type:"p2wpkh"};const f=i.match(/^zero \[([0-9a-f]{64})\]/);if(f)return{address:ad(a.hrp,0,f[1]),type:"p2wsh"};const h=i.match(/^1 \[([0-9a-f]{64})\]/);return h?{address:ad(a.hrp,1,h[1]),type:"p2tr"}:{type:hh(e)}}function UT(e,a){try{const s=pb.decode(e),u=s[0],f=eu(s.slice(1));if(f.length===40&&u===a.p2pkh)return{scriptHex:`76a914${f}88ac`,type:"p2pkh"};if(f.length===40&&u===a.p2sh)return{scriptHex:`a914${f}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=p=>{try{return p.decode(s,90)}catch{return null}},f=u(pu);if(f&&f.prefix===a.hrp){const p=f.words[0],m=pu.fromWords(f.words.slice(1)),g=eu(m),v=m.length.toString(16).padStart(2,"0");if(p===0&&(m.length===20||m.length===32))return{scriptHex:`00${v}${g}`,type:m.length===20?"p2wpkh":"p2wsh"}}const h=u($d);if(h&&h.prefix===a.hrp){const p=h.words[0],m=$d.fromWords(h.words.slice(1)),g=eu(m),v=)DELIM" +R"DELIM(m.length.toString(16).padStart(2,"0");if(p===1&&m.length===32)return{scriptHex:`51${v}${g}`,type:"p2tr"}}}return null}function dr(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=UT(e,a);if(!l)return null;const s=mb(dh(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:eu(u),type:l.type}}function Pl(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:BT(e.bits),previousBlockHash:e.previous}}function $T(e){const a=HT(e);return a&&a.length>0?a:void 0}function ZT(e,a,i,l){const s=/^0{64}$/u.test(e.point.hash),u=a?yb(a.script,i):{address:void 0,type:void 0},f=a?a.value:void 0,h=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:f,scriptType:u.type??hh(h??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:$T(e.witness),sequence:e.sequence}}function qT(e,a,i){const l=yb(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??hh(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function QT(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function Zs(e,a,i,l,s){const u=e.outputs.map((g,v)=>qT(g,v,i)),f=u.reduce((g,v)=>g+v.valueSats,0),h=a.reduce((g,v)=>v?(g??0)+v.value:g,null),p=QT(l.tipHeight,l.blockHeight),m=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:m,confirmations:p,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:h,totalOutput:f,inputs:e.inputs.map((g,v)=>ZT(g,a[v],i,v)),outputs:u}}const qs=25,xg=5e3,rd=new Map,id=new Map,yu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function PT(e){if(!e||typeof e!="object"||Array.isArray(e))return yu;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:yu[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function ki(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.wire=="number"?l.wire:void 0;return s===void 0&&u===void 0?null:{count:s,wire:u}}function YT(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function Qs(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?YT(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typeof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function Wt(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=id.get(s);if(u)return u;const f=(async()=>{const h=await fetch(s,{headers:{Accept:"application/json"}});if(!h.ok){const m=await h.text().catch(()=>"");throw new Error(`Request failed ${String(h.status)}: ${m||h.statusText}`)}const p=await h.text();try{return JSON.parse(p)}catch{return p}})();id.set(s,f);try{return await f}finally{id.delete(s)}}async function Nt(e,a,i){try{return await Wt(e,a,i)}catch{return null}}async function vb(e,a){const i=await Wt(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}async function Qr(e,a){const i=Date.now(),l=`${e}|0`,s=rd.get(l);if(s&&s.expiresAt>i)return s.promise;const u=vb(e,a).then(f=>(rd.set(l,{promise:u,value:f,expiresAt:Date.now()+xg}),f));return rd.set(l,{promise:u,value:s?.value??null,expiresAt:i+xg}),u}async function Ps(e,a,i){if(a==="latest"||a==="tip"){const l=await Qr(e,i);return{path:`/v1/block/height/${String(l)}`,height:l}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function GT(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,f=i.get(u);if(f)return f;const h=Wt(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,h),h}}async function Sg(e,a,i,l){return Wt(e,`${a}/tx/${String(i)}?format=json`,l)}async function ld(e,a,i){const l=await Nt(e,`/v1/address/${a}/confirmed?format=json`,i);return l||(await Nt(e,`/v1/address/${a}?format=json`,i)??[])}function KT({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set;let s=null,u=null;const f=yo(po());let h=null,p=null;function m(){return p||(p=Wt(e,"/v1/configuration?format=json").then(E=>{const T=PT(E);return h=T,T}).catch(E=>(console.warn("Libbitcoin configuration)DELIM" +R"DELIM( fetch failed",E),h=yu,yu)),p)}function g(E){return E.address}function v(E){return g(E)&&E.turbo}function x(){s||(s=setInterval(async()=>{try{const E=await vb(e);if(u===null){u=E;return}if(E>u){const[T,j]=await Promise.all([Wt(e,`/v1/block/height/${String(E)}/header?format=json`),Nt(e,`/v1/block/height/${String(E)}/header/context?format=json`)]),k=ki(j),U={...Pl(T,k?.count),size:k?.wire};for(const V of l)V({type:"block.new",payload:U});u=E}}catch(E){console.warn("Libbitcoin poller failed",E)}},a))}function _(){s&&(clearInterval(s),s=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return m()},async getLatestBlocks(E=10){const T=await Qr(e);u=T;const j=Array.from({length:E},(U,V)=>T-V).filter(U=>U>=0),[k,L]=await Promise.all([Promise.all(j.map(U=>Wt(e,`/v1/block/height/${String(U)}/header?format=json`))),Promise.all(j.map(U=>Nt(e,`/v1/block/height/${String(U)}/header/context?format=json`)))]);return k.map((U,V)=>{const X=ki(L[V]);return{...Pl(U,X?.count),size:X?.wire}})},async getBlocksBefore(E,T=10){const j=Array.from({length:T},(U,V)=>E-V).filter(U=>U>=0),[k,L]=await Promise.all([Promise.all(j.map(U=>Wt(e,`/v1/block/height/${String(U)}/header?format=json`))),Promise.all(j.map(U=>Nt(e,`/v1/block/height/${String(U)}/header/context?format=json`)))]);return k.map((U,V)=>{const X=ki(L[V]);return{...Pl(U,X?.count),size:X?.wire}})},async getBlockHeader(E){const{path:T,height:j}=await Ps(e,E),k=j===void 0?Qr(e):Promise.resolve(j),[L,U,V]=await Promise.all([Wt(e,`${T}/header?format=json`),k,Nt(e,`${T}/header/context?format=json`)]);u=Math.max(u??0,U);let X=null;L.heightM),we=(await Promise.all(ne.map(S=>Sg(e,T,S).catch(()=>null)))).filter(S=>S!==null),se=await Promise.all(we.map(S=>Nt(e,`/v1/tx/${S.hash}/details?format=json`))),$=we.map((S,M)=>{const N=se[M],J=Zs(S,[],f,{blockHeight:L.height,blockHash:L.hash,tipHeight:U,timestamp:L.timestamp},typeof N?.fee=="number"?N.fee:void 0);return Qs(J,N)});return{...he,size:C?.wire??X?.maximal,weight:X?.weight,merkleRoot:L.merkle_root,nonce:L.nonce,bits:L.bits,version:L.version,nextBlockHash:ue,feesSats:X?.fees,subsidySats:X?.subsidy,sigops:X?.sigops,transactions:$}},async getBlockTransactions(E,T=0){const{path:j}=await Ps(e,E),[k,L,U]=await Promise.all([Wt(e,`${j}/header?format=json`),Qr(e),Nt(e,`${j}/header/context?format=json`)]);u=Math.max(u??0,L);const V=ki(U)?.count;if(typeof V=="number"&&T>=V)return[];const X=typeof V=="number"?Math.min(T+qs,V):T+qs,ue=Array.from({length:Math.max(0,X-T)},(le,ne)=>T+ne),K=(await Promise.all(ue.map(le=>Sg(e,j,le).catch(()=>null)))).filter(le=>le!==null);if(K.length===0)return[];const he=await Promise.all(K.map(le=>Nt(e,`/v1/tx/${le.hash}/details?format=json`)));return K.map((le,ne)=>{const oe=he[ne],we=Zs(le,[],f,{blockHeight:k.height,blockHash:k.hash,tipHeight:L,timestamp:k.timestamp},typeof oe?.fee=="number"?oe.fee:void 0);return Qs(we,oe)})},async getTransaction(E){const T=await Wt(e,`/v1/tx/${E}?format=json`),j=GT(e),k=Promise.all(T.inputs.map(C=>/^0{64}$/u.test(C.point.hash)?Promise.resolve(null):j(C.point.hash,C.point.index))),[L,U,V,X]=await Promise.all([Nt(e,`/v1/tx/${E}/header?format=json`),Qr(e).catch(()=>null),Nt(e,`/v1/tx/${E}/details?format=json`),k]);typeof U=="number"&&(u=Math.max(u??0,U));const ue=Zs(T,X,f,{blockHeight:L?.height,blockHash:L?.hash,tipHeight:typeof U=="number"?U:void 0,timestamp:L?.timestamp},typeof V?.fee=="number"?V.fee:void 0);return Qs(ue,V)},async getTransactionHeader(E){const T=await Wt(e,`/v1/tx/${E}?format=json`),[j,k,L]=await Promise.all([Nt(e,`/v1/tx/${E}/header?format=json`),Qr(e).catch(()=>null),Nt(e,`/v1/tx/${E}/details?format=json`)]);typeof k=="number"&&(u=Math.max(u??0,k));const U=Zs(T,[],f,{blockHeight:j?.height,blockHash:j?.hash,tipHeight:typeof k=="number"?k:void 0,timestamp:j?.timestamp},typeof L?.fee=="number"?L.fee:void 0);return Qs(U,L)},async getTransactionInputScriptHex(E,T){return(await Wt(e,`/v1/input/${E}/${String(T)}/script?format=text`)).trim())DELIM" +R"DELIM(},async getTransactionOutputScriptHex(E,T){return(await Wt(e,`/v1/output/${E}/${String(T)}/script?format=text`)).trim()},async getAddress(E){const T=dr(E,f);if(!T)throw new Error("Unsupported address format for libbitcoin adapter");const j=h??await m();if(!g(j))throw new Error("Address endpoints are disabled by server configuration");const k=i&&v(j),[L,U]=await Promise.all([Nt(e,`/v1/address/${T.hash}/balance?format=json`,k),ld(e,T.hash,k)]),V=typeof L=="number"?L:Number(L);let X=0;for(const K of U)X+=K.value;const ue=Number.isFinite(V)?V:X,C=U.map(K=>({txid:K.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:K.value}));return{address:E,addressType:T.type,balance:ue,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:U.length,transactions:C}},async getAddressSummary(E){const T=dr(E,f);if(!T)throw new Error("Unsupported address format for libbitcoin adapter");const j=h??await m();if(!g(j))throw new Error("Address endpoints are disabled by server configuration");const k=i&&v(j),[L,U]=await Promise.all([Nt(e,`/v1/address/${T.hash}/balance?format=json`,k),ld(e,T.hash,k)]),V=typeof L=="number"?L:L===null?Number.NaN:Number(L),X=Number.isFinite(V)?V:0;return{address:E,addressType:T.type,balance:X,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:U.length}},async getAddressTransactions(E){const T=dr(E,f);if(!T)return[];const j=h??await m();if(!g(j))return[];const k=i&&v(j);return(await ld(e,T.hash,k)).map(U=>({txid:U.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:U.value}))},subscribeToEvents(E){return l.add(E),x(),()=>{l.delete(E),l.size===0&&_()}}}}const gb=z.createContext(null),bb=z.createContext(null),xb=z.createContext(null);function FT({children:e,client:a}){return b.jsx(gb.Provider,{value:a,children:e})}function VT({children:e,provider:a,setProvider:i,availableProviders:l}){return b.jsx(bb.Provider,{value:{provider:a,setProvider:i,availableProviders:l},children:e})}function XT({children:e,turbo:a,setTurbo:i}){return b.jsx(xb.Provider,{value:{turbo:a,setTurbo:i},children:e})}function kt(){const e=z.useContext(gb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Eu(){return kt().metadata}function Sb(){const e=z.useContext(bb);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function wb(){const e=z.useContext(xb);if(!e)throw new Error("TurboProvider missing in component tree");return e}function JT(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function IT(e,a){if(e==="blockstream")return lb({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return vT({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const i=JT();return KT({baseUrl:i,turbo:a?.turboEnabled})}return e==="external"?(console.warn("No external API URL provided, falling back to mock client"),Jf()):(e==="mock"||console.warn(`Unknown provider "${e}", falling back to mock`),Jf())}function WT(){return[...new Set(["libbitcoin","blockstream","mempool"])]}function e3({children:e}){const a="libbitcoin",i=WT(),l=(()=>{const v=globalThis.window;return v?v.localStorage.getItem("turboEnabled")==="true":!1})(),s=(()=>{const v=globalThis.window;if(!v)return a;const x=v.localStorage.getItem("blockchainProvider");return x&&i.includes(x)?x:a})(),[u,f]=z.useState(l),[h,p]=z.useState(s),[m]=z.useState(()=>new iw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),g=z.useMemo(()=>IT(h,{turboEnabled:u}),[h,u]);return z.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("turboEnabled",u?"true":"false")},[u]),z.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("blockchainProvider",h)},[h]),b.jsx(VT,{provider:h,setProvider:p,availableProviders:i,children:b.jsx(XT,{turbo:u,setTurbo:f,children:b.jsx(FT,{client:g,children:b.jsxs(lw,{client:m,children:[e,null]})})})})}var _b=e=>{throw TypeError(e)},t3=(e,a,i)=>a.has(e)||_b("Cannot "+i),od=(e,a,i)=>(t3(e,a,"read from private field"),i?i.call(e):a.get(e)),n3=(e,a,i)=>a.has(e)?_b("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),wg="popstate";function a3(e={}){function a(l,s){let{pathname:u,search:f,hash:h}=l.location;return oo("",{pathname:u,search:f,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function i(l,s){return typeof s=="string"?s:ra(s)}return i3(a,i,null,e)}function Ne(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function xt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function r3(){return Math.random().toString(36).substring(2,10)}function _g(e,a){return{usr:e.state,key:e.key,idx:a}}function oo(e,a,i=null,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?yr(a):a,state:i,key:a&&a.key||l||r3()}}function ra({pathname:e="/",search:a="",hash:i=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(e+=i.charAt(0)===)DELIM" +R"DELIM("#"?i:"#"+i),e}function yr(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function i3(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,f=s.history,h="POP",p=null,m=g();m==null&&(m=0,f.replaceState({...f.state,idx:m},""));function g(){return(f.state||{idx:null}).idx}function v(){h="POP";let j=g(),k=j==null?null:j-m;m=j,p&&p({action:h,location:T.location,delta:k})}function x(j,k){h="PUSH";let L=oo(T.location,j,k);m=g()+1;let U=_g(L,m),V=T.createHref(L);try{f.pushState(U,"",V)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;s.location.assign(V)}u&&p&&p({action:h,location:T.location,delta:1})}function _(j,k){h="REPLACE";let L=oo(T.location,j,k);m=g();let U=_g(L,m),V=T.createHref(L);f.replaceState(U,"",V),u&&p&&p({action:h,location:T.location,delta:0})}function E(j){return Eb(j)}let T={get action(){return h},get location(){return e(s,f)},listen(j){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(wg,v),p=j,()=>{s.removeEventListener(wg,v),p=null}},createHref(j){return a(s,j)},createURL:E,encodeLocation(j){let k=E(j);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:_,go(j){return f.go(j)}};return T}function Eb(e,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Ne(i,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:ra(e);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}var Xl,Eg=class{constructor(e){if(n3(this,Xl,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(od(this,Xl).has(e))return od(this,Xl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){od(this,Xl).set(e,a)}};Xl=new WeakMap;var l3=new Set(["lazy","caseSensitive","path","id","index","children"]);function o3(e){return l3.has(e)}var s3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function u3(e){return s3.has(e)}function c3(e){return e.index===!0}function so(e,a,i=[],l={},s=!1){return e.map((u,f)=>{let h=[...i,String(f)],p=typeof u.id=="string"?u.id:h.join("-");if(Ne(u.index!==!0||!u.children,"Cannot specify children on an index route"),Ne(s||!l[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),c3(u)){let m={...u,id:p};return l[p]=Tg(m,a(m)),m}else{let m={...u,id:p,children:void 0};return l[p]=Tg(m,a(m)),u.children&&(m.children=so(u.children,a,h,l,s)),m}})}function Tg(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function or(e,a,i="/"){return Jl(e,a,i,!1)}function Jl(e,a,i,l){let s=typeof a=="string"?yr(a):a,u=Ln(s.pathname||"/",i);if(u==null)return null;let f=Tb(e);d3(f);let h=null;for(let p=0;h==null&&p{let g={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&p)return;Ne(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let v=aa([l,g.relativePath]),x=i.concat(g);f.children&&f.children.length>0&&(Ne(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Tb(f.children,a,x,v,p)),!(f.path==null&&!f.index)&&a.push({path:v,score:b3(v,f.index),routesMeta:x})};return e.forEach((f,h)=>{if(f.path===""||!f.path?.includes("?"))u(f,h);else for(let p of Rb(f.path))u(f,h,!0,p)}),a}function Rb(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let f=Rb(l.join("/")),h=[];return h.push(...f.map(p=>p===""?u:[u,p].join("/"))),s&&h.push(...f),h.map(p=>e.startsWith("/")&&p===""?"/":p)}function d3(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:x3(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var h3=/^:[\w-]+$/,m3=3,p3=2,y3=1,v3=10,g3=-2,Rg=e=>e==="*";function b3(e,a){let i=e.split("/"),l=i.length;return i.some(Rg)&&(l+=g3),a&&(l+=p3),i.filter(s=>!Rg(s)).reduce((s,u)=>s+(h3.test(u)?m3:u===""?y3:v3),l)}function x3(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function S3(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",f=[];for(let h=0;h{if(g==="*"){let E=h[x]||"";f=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const _=h[x];return v&&!_?m[g]=void 0:m[g]=(_||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:f,pattern:e}}function w3(e,a=!1,i=!0){xt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,p)=>(l.push({paramName:h,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function _3(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return xt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function Ln(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function E3({basename:e,pathname:a}){return a==="/"?e:aa([e,a])}var zb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mh=e=>zb.test(e);function T3(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?yr(e):e,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=zg(i.substring(1),"/"):u=zg(i,a)):u=a,{pathname:u,search:z3(l),hash:A3(s)}}function zg(e,a){let i=a.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function sd(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Ab(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Tu(e){let a=Ab(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function Ru(e,a,i,l=!1){let s;typeof e=="string"?s=yr(e):(s={...e},Ne(!s.pathname||!s.pathname.includes("?"),sd("?","pathname","search",s)),Ne(!s.pathname||!s.pathname.includes("#"),sd("#","pathname","hash",s)),Ne(!s.search||!s.search.includes("#"),sd("#","search","hash",s)));let u=e===""||s.pathname==="",f=u?"/":s.pathname,h;if(f==null)h=i;else{let v=a.length-1;if(!l&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}h=v>=0?a[v]:"/"}let p=T3(s,h),m=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(m||g)&&(p.pathname+="/"),p}var aa=e=>e.join("/").replace(/\/\/+/g,"/"),R3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),z3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,A3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function uo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function go(e){return e.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ob=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Cb(e,a){let i=e;if(typeof i!="string"||!zb.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(Ob)try{let u=new URL(window.location.href),f=i.startsWith("//")?new URL(u.protocol+i):new URL(i),h=Ln(f.pathname,a);f.origin===u.origin&&h!=null?i=h+f.search+f.hash:s=!0}catch{xt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var cr=Symbol("Uninstrumented");function O3(e,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:a.id,index:a.index,path:a.path,instrument(u){let f=Object.keys(i);for(let h of f)u[h]&&i[h].pu)DELIM" +R"DELIM(sh(u[h])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=Zi(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let f=s[u],h=i[`lazy.${u}`];if(typeof f=="function"&&h.length>0){let p=Zi(h,f,()=>{});p&&(l.lazy=Object.assign(l.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let f=u[cr]??u,h=Zi(i[s],f,(...p)=>Ag(p[0]));h&&(s==="loader"&&f.hydrate===!0&&(h.hydrate=!0),h[cr]=f,l[s]=h)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[cr]??s,f=Zi(i.middleware,u,(...h)=>Ag(h[0]));return f?(f[cr]=u,f):s})),l}function C3(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let f of u)s[f]&&i[f].push(s[f])}})),i.navigate.length>0){let l=e.navigate[cr]??e.navigate,s=Zi(i.navigate,l,(...u)=>{let[f,h]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?ra(f):".",...Og(e,h??{})}});s&&(s[cr]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[cr]??e.fetch,s=Zi(i.fetch,l,(...u)=>{let[f,,h,p]=u;return{href:h??".",fetcherKey:f,...Og(e,p??{})}});s&&(s[cr]=l,e.fetch=s)}return e}function Zi(e,a,i){return e.length===0?null:async(...l)=>{let s=await Mb(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function Mb(e,a,i,l){let s=e[l],u;if(s){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=Mb(e,a,i,l-1),u=await f,Ne(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(h,a)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await h(),await f}else try{u={type:"success",value:await i()}}catch(f){u={type:"error",value:f}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Ag(e){let{request:a,context:i,params:l,unstable_pattern:s}=e;return{request:M3(a),params:{...l},unstable_pattern:s,context:N3(i)}}function Og(e,a){return{currentUrl:ra(e.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function M3(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function N3(e){if(D3(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var j3=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function D3(e){if(e===null||typeof e!="object")return!1;const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===j3}var Nb=["POST","PUT","PATCH","DELETE"],k3=new Set(Nb),L3=["GET",...Nb],B3=new Set(L3),jb=new Set([301,302,303,307,308]),H3=new Set([307,308]),ud={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},U3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Yl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},$3=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Db="remix-router-transitions",kb=Symbol("ResetLoaderData");function Z3(e){const a=e.window?e.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";Ne(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRouteProperties||$3,u=s;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;u=H=>({...s(H),...O3(A.map(Y=>Y.route).filter(Boolean),H)})}let f={},h=so(e.routes,u,void 0,f),p,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=e.dataStrategy||G3,v={...e.future},x=null,_=new Set,E=null,T=null,j=null,k=e.hydrationData!=null,L=or(h,e.history.location,m),U=!1,V=null,X;if(L==null&&!e.patchRoutesOnNavigation){let A=jn(404,{pathname:e.history.location.pathname}),{matches:H,route:Y}=Ys(h);X=!0,L=H,V={[Y.id]:A}}else if(L&&!e.hydrationData&&_r(L,h,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))X=!1;else if(!L.some(A=>ph(A.route)))X=!0;else{let A=e.hydrationData?e.hydrationData.loaderData:null,H=e.hydrationData?e.hydrationData.errors:null;if(H){let Y=L.findIndex(ie=>H[ie.route.id]!==void 0);X=L.slice(0,Y+1).every(ie=>!Qd(ie.route,A,H))}else X=L.every(Y=>!Qd(Y.route,A,H))}else{X=!1,L=[];let A=_r(null,h,e.history.location.pathname);A.active&&A.matches&&(U=!0,L=A.matches)}let ue,C={historyAction:e.history.action,location:e.history.location,matches:L,initialized:X,navigation:ud,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||V,fetchers:new )DELIM" +R"DELIM(Map,blockers:new Map},K="POP",he=null,le=!1,ne,oe=!1,we=new Map,se=null,$=!1,S=!1,M=new Set,N=new Map,J=0,ae=-1,R=new Map,Q=new Set,te=new Map,re=new Map,pe=new Set,Te=new Map,ce,Oe=null;function Ae(){if(x=e.history.listen(({action:A,location:H,delta:Y})=>{if(ce){ce(),ce=void 0;return}xt(Te.size===0||Y!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ie=xr({currentLocation:C.location,nextLocation:H,historyAction:A});if(ie&&Y!=null){let fe=new Promise(xe=>{ce=xe});e.history.go(Y*-1),la(ie,{state:"blocked",location:H,proceed(){la(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),fe.then(()=>e.history.go(Y))},reset(){let xe=new Map(C.blockers);xe.set(ie,Yl),Ye({blockers:xe})}}),he?.resolve(),he=null;return}return De(A,H)}),i){cR(a,we);let A=()=>fR(a,we);a.addEventListener("pagehide",A),se=()=>a.removeEventListener("pagehide",A)}return C.initialized||De("POP",C.location,{initialHydration:!0}),ue}function Ve(){x&&x(),se&&se(),_.clear(),ne&&ne.abort(),C.fetchers.forEach((A,H)=>Ji(H)),C.blockers.forEach((A,H)=>wo(H))}function it(A){return _.add(A),()=>_.delete(A)}function Ye(A,H={}){A.matches&&(A.matches=A.matches.map(fe=>{let xe=f[fe.route.id],me=fe.route;return me.element!==xe.element||me.errorElement!==xe.errorElement||me.hydrateFallbackElement!==xe.hydrateFallbackElement?{...fe,route:xe}:fe})),C={...C,...A};let Y=[],ie=[];C.fetchers.forEach((fe,xe)=>{fe.state==="idle"&&(pe.has(xe)?Y.push(xe):ie.push(xe))}),pe.forEach(fe=>{!C.fetchers.has(fe)&&!N.has(fe)&&Y.push(fe)}),[..._].forEach(fe=>fe(C,{deletedFetchers:Y,newErrors:A.errors??null,viewTransitionOpts:H.viewTransitionOpts,flushSync:H.flushSync===!0})),Y.forEach(fe=>Ji(fe)),ie.forEach(fe=>C.fetchers.delete(fe))}function Lt(A,H,{flushSync:Y}={}){let ie=C.actionData!=null&&C.navigation.formMethod!=null&&Xt(C.navigation.formMethod)&&C.navigation.state==="loading"&&A.state?._isRedirect!==!0,fe;H.actionData?Object.keys(H.actionData).length>0?fe=H.actionData:fe=null:ie?fe=C.actionData:fe=null;let xe=H.loaderData?Ug(C.loaderData,H.loaderData,H.matches||[],H.errors):C.loaderData,me=C.blockers;me.size>0&&(me=new Map(me),me.forEach((Re,Se)=>me.set(Se,Yl)));let de=$?!1:_o(A,H.matches||C.matches),ye=le===!0||C.navigation.formMethod!=null&&Xt(C.navigation.formMethod)&&A.state?._isRedirect!==!0;p&&(h=p,p=void 0),$||K==="POP"||(K==="PUSH"?e.history.push(A,A.state):K==="REPLACE"&&e.history.replace(A,A.state));let be;if(K==="POP"){let Re=we.get(C.location.pathname);Re&&Re.has(A.pathname)?be={currentLocation:C.location,nextLocation:A}:we.has(A.pathname)&&(be={currentLocation:A,nextLocation:C.location})}else if(oe){let Re=we.get(C.location.pathname);Re?Re.add(A.pathname):(Re=new Set([A.pathname]),we.set(C.location.pathname,Re)),be={currentLocation:C.location,nextLocation:A}}Ye({...H,actionData:fe,loaderData:xe,historyAction:K,location:A,initialized:!0,navigation:ud,revalidation:"idle",restoreScrollPosition:de,preventScrollReset:ye,blockers:me},{viewTransitionOpts:be,flushSync:Y===!0}),K="POP",le=!1,oe=!1,$=!1,S=!1,he?.resolve(),he=null,Oe?.resolve(),Oe=null}async function Je(A,H){if(he?.resolve(),he=null,typeof A=="number"){he||(he=Qg());let Ue=he.promise;return e.history.go(A),Ue}let Y=qd(C.location,C.matches,m,A,H?.fromRouteId,H?.relative),{path:ie,submission:fe,error:xe}=Cg(!1,Y,H),me=C.location,de=oo(C.location,ie,H&&H.state);de={...de,...e.history.encodeLocation(de)};let ye=H&&H.replace!=null?H.replace:void 0,be="PUSH";ye===!0?be="REPLACE":ye===!1||fe!=null&&Xt(fe.formMethod)&&fe.formAction===C.location.pathname+C.location.search&&(be="REPLACE");let Re=H&&"preventScrollReset"in H?H.preventScrollReset===!0:void 0,Se=(H&&H.flushSync)===!0,Pe=xr({currentLocation:me,nextLocation:de,historyAction:be});if(Pe){la(Pe,{state:"blocked",location:de,proceed(){la(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:de}),Je(A,H)},reset(){let Ue=new Map(C.blockers);Ue.set(Pe,Yl),Ye({blockers:Ue})}});return}await De(be,de,{submission:fe,pendingError:xe,preventScrollReset:Re,replace:H&&H.replace,enableViewTransition:H&&H.viewTransition,flushSync:Se,callSiteDefaultShouldRevalidate:H&&H.unstable_defaultShouldRevalidate})}function st(){Oe||(Oe=Qg()),ei(),Ye({revalidation:"loading"});let A=Oe.promise;return C.navigation.state==="submitting"?A:C.navigation.state==="idle"?(De(C.historyAction,C.location,{startUninterruptedRevalidation:!0}),A):(De(K||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:oe===!0}),A)}async function De(A,H,Y){ne&&ne.abort(),ne=null,K=A,$=(Y&&Y.startUninterruptedRevalidation)===!0,wr(C.location,C.matches),le=(Y&&Y.preventScrollReset)===!0,oe=(Y&&Y.enableView)DELIM" +R"DELIM(Transition)===!0;let ie=p||h,fe=Y&&Y.overrideNavigation,xe=Y?.initialHydration&&C.matches&&C.matches.length>0&&!U?C.matches:or(ie,H,m),me=(Y&&Y.flushSync)===!0;if(xe&&C.initialized&&!S&&eR(C.location,H)&&!(Y&&Y.submission&&Xt(Y.submission.formMethod))){Lt(H,{matches:xe},{flushSync:me});return}let de=_r(xe,ie,H.pathname);if(de.active&&de.matches&&(xe=de.matches),!xe){let{error:yt,notFoundMatches:vt,route:$e}=Na(H.pathname);Lt(H,{matches:vt,loaderData:{},errors:{[$e.id]:yt}},{flushSync:me});return}ne=new AbortController;let ye=Ui(e.history,H,ne.signal,Y&&Y.submission),be=e.getContext?await e.getContext():new Eg,Re;if(Y&&Y.pendingError)Re=[sr(xe).route.id,{type:"error",error:Y.pendingError}];else if(Y&&Y.submission&&Xt(Y.submission.formMethod)){let yt=await dt(ye,H,Y.submission,xe,be,de.active,Y&&Y.initialHydration===!0,{replace:Y.replace,flushSync:me});if(yt.shortCircuited)return;if(yt.pendingActionResult){let[vt,$e]=yt.pendingActionResult;if(bn($e)&&uo($e.error)&&$e.error.status===404){ne=null,Lt(H,{matches:yt.matches,loaderData:{},errors:{[vt]:$e.error}});return}}xe=yt.matches||xe,Re=yt.pendingActionResult,fe=cd(H,Y.submission),me=!1,de.active=!1,ye=Ui(e.history,ye.url,ye.signal)}let{shortCircuited:Se,matches:Pe,loaderData:Ue,errors:mt}=await Xn(ye,H,xe,be,de.active,fe,Y&&Y.submission,Y&&Y.fetcherSubmission,Y&&Y.replace,Y&&Y.initialHydration===!0,me,Re,Y&&Y.callSiteDefaultShouldRevalidate);Se||(ne=null,Lt(H,{matches:Pe||xe,...$g(Re),loaderData:Ue,errors:mt}))}async function dt(A,H,Y,ie,fe,xe,me,de={}){ei();let ye=sR(H,Y);if(Ye({navigation:ye},{flushSync:de.flushSync===!0}),xe){let Se=await ja(ie,H.pathname,A.signal);if(Se.type==="aborted")return{shortCircuited:!0};if(Se.type==="error"){if(Se.partialMatches.length===0){let{matches:Ue,route:mt}=Ys(h);return{matches:Ue,pendingActionResult:[mt.id,{type:"error",error:Se.error}]}}let Pe=sr(Se.partialMatches).route.id;return{matches:Se.partialMatches,pendingActionResult:[Pe,{type:"error",error:Se.error}]}}else if(Se.matches)ie=Se.matches;else{let{notFoundMatches:Pe,error:Ue,route:mt}=Na(H.pathname);return{matches:Pe,pendingActionResult:[mt.id,{type:"error",error:Ue}]}}}let be,Re=tu(ie,H);if(!Re.route.action&&!Re.route.lazy)be={type:"error",error:jn(405,{method:A.method,pathname:H.pathname,routeId:Re.route.id})};else{let Se=Qi(u,f,A,ie,Re,me?[]:l,fe),Pe=await gr(A,Se,fe,null);if(be=Pe[Re.route.id],!be){for(let Ue of ie)if(Pe[Ue.route.id]){be=Pe[Ue.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(Yr(be)){let Se;return de&&de.replace!=null?Se=de.replace:Se=Lg(be.response.headers.get("Location"),new URL(A.url),m,e.history)===C.location.pathname+C.location.search,await St(A,be,!0,{submission:Y,replace:Se}),{shortCircuited:!0}}if(bn(be)){let Se=sr(ie,Re.route.id);return(de&&de.replace)!==!0&&(K="PUSH"),{matches:ie,pendingActionResult:[Se.route.id,be,Re.route.id]}}return{matches:ie,pendingActionResult:[Re.route.id,be]}}async function Xn(A,H,Y,ie,fe,xe,me,de,ye,be,Re,Se,Pe){let Ue=xe||cd(H,me),mt=me||de||qg(Ue),yt=!$&&!be;if(fe){if(yt){let wt=Ma(Se);Ye({navigation:Ue,...wt!==void 0?{actionData:wt}:{}},{flushSync:Re})}let Ze=await ja(Y,H.pathname,A.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){if(Ze.partialMatches.length===0){let{matches:Qn,route:$t}=Ys(h);return{matches:Qn,loaderData:{},errors:{[$t.id]:Ze.error}}}let wt=sr(Ze.partialMatches).route.id;return{matches:Ze.partialMatches,loaderData:{},errors:{[wt]:Ze.error}}}else if(Ze.matches)Y=Ze.matches;else{let{error:wt,notFoundMatches:Qn,route:$t}=Na(H.pathname);return{matches:Qn,loaderData:{},errors:{[$t.id]:wt}}}}let vt=p||h,{dsMatches:$e,revalidatingFetchers:Bt}=Mg(A,ie,u,f,e.history,C,Y,mt,H,be?[]:l,be===!0,S,M,pe,te,Q,vt,m,e.patchRoutesOnNavigation!=null,Se,Pe);if(ae=++J,!e.dataStrategy&&!$e.some(Ze=>Ze.shouldLoad)&&!$e.some(Ze=>Ze.route.middleware&&Ze.route.middleware.length>0)&&Bt.length===0){let Ze=Ft();return Lt(H,{matches:Y,loaderData:{},errors:Se&&bn(Se[1])?{[Se[0]]:Se[1].error}:null,...$g(Se),...Ze?{fetchers:new Map(C.fetchers)}:{}},{flushSync:Re}),{shortCircuited:!0}}if(yt){let Ze={};if(!fe){Ze.navigation=Ue;let wt=Ma(Se);wt!==void 0&&(Ze.actionData=wt)}Bt.length>0&&(Ze.fetchers=vr(Bt)),Ye(Ze,{flushSync:Re})}Bt.forEach(Ze=>{ht(Ze.key),Ze.controller&&N.set(Ze.key,Ze.controller)});let tn=()=>Bt.forEach(Ze=>ht(Ze.key));ne&&ne.signal.addEventListener("abort",tn);let{loaderResults:ut,fetcherResults:Zn}=await Vi($e,Bt,A,ie);if(A.signal.aborted)return{shortCircuited:!0};ne&&ne.signal.removeEventListener("abort",tn),Bt.forEach(Ze=>N.delete(Ze.key));let fn=Gs(ut);if(fn)return await St(A,fn.result,!0,{replace:ye}),{shortCircuited:!0};if(fn=Gs(Zn),fn)return Q.add(fn.key),await St(A,fn.result,!0,{replace:ye}),{shortCircuited:!0};let{loaderData:qn,errors:wn}=Hg(C,Y,ut,Se,Bt,Zn);be&&C.errors&&(wn={...C.errors,...wn});let sa=Ft(),Er=So(ae),Tr=sa||Er||Bt.length>0;return{matches:Y,loaderData:qn,errors:wn,...Tr?{fetchers:new Map(C.fetchers)}:{}}}function Ma(A){if(A&&!bn(A[1]))r)DELIM" +R"DELIM(eturn{[A[0]]:A[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function vr(A){return A.forEach(H=>{let Y=C.fetchers.get(H.key),ie=Gl(void 0,Y?Y.data:void 0);C.fetchers.set(H.key,ie)}),new Map(C.fetchers)}async function Fi(A,H,Y,ie){ht(A);let fe=(ie&&ie.flushSync)===!0,xe=p||h,me=qd(C.location,C.matches,m,Y,H,ie?.relative),de=or(xe,me,m),ye=_r(de,xe,me);if(ye.active&&ye.matches&&(de=ye.matches),!de){Un(A,H,jn(404,{pathname:me}),{flushSync:fe});return}let{path:be,submission:Re,error:Se}=Cg(!0,me,ie);if(Se){Un(A,H,Se,{flushSync:fe});return}let Pe=e.getContext?await e.getContext():new Eg,Ue=(ie&&ie.preventScrollReset)===!0;if(Re&&Xt(Re.formMethod)){await Mu(A,H,be,de,Pe,ye.active,fe,Ue,Re,ie&&ie.unstable_defaultShouldRevalidate);return}te.set(A,{routeId:H,path:be}),await Nu(A,H,be,de,Pe,ye.active,fe,Ue,Re)}async function Mu(A,H,Y,ie,fe,xe,me,de,ye,be){ei(),te.delete(A);let Re=C.fetchers.get(A);en(A,uR(ye,Re),{flushSync:me});let Se=new AbortController,Pe=Ui(e.history,Y,Se.signal,ye);if(xe){let qe=await ja(ie,new URL(Pe.url).pathname,Pe.signal,A);if(qe.type==="aborted")return;if(qe.type==="error"){Un(A,H,qe.error,{flushSync:me});return}else if(qe.matches)ie=qe.matches;else{Un(A,H,jn(404,{pathname:Y}),{flushSync:me});return}}let Ue=tu(ie,Y);if(!Ue.route.action&&!Ue.route.lazy){let qe=jn(405,{method:ye.formMethod,pathname:Y,routeId:H});Un(A,H,qe,{flushSync:me});return}N.set(A,Se);let mt=J,yt=Qi(u,f,Pe,ie,Ue,l,fe),vt=await gr(Pe,yt,fe,A),$e=vt[Ue.route.id];if(!$e){for(let qe of yt)if(vt[qe.route.id]){$e=vt[qe.route.id];break}}if(Pe.signal.aborted){N.get(A)===Se&&N.delete(A);return}if(pe.has(A)){if(Yr($e)||bn($e)){en(A,Ra(void 0));return}}else{if(Yr($e))if(N.delete(A),ae>mt){en(A,Ra(void 0));return}else return Q.add(A),en(A,Gl(ye)),St(Pe,$e,!1,{fetcherSubmission:ye,preventScrollReset:de});if(bn($e)){Un(A,H,$e.error);return}}let Bt=C.navigation.location||C.location,tn=Ui(e.history,Bt,Se.signal),ut=p||h,Zn=C.navigation.state!=="idle"?or(ut,C.navigation.location,m):C.matches;Ne(Zn,"Didn't find any matches after fetcher action");let fn=++J;R.set(A,fn);let qn=Gl(ye,$e.data);C.fetchers.set(A,qn);let{dsMatches:wn,revalidatingFetchers:sa}=Mg(tn,fe,u,f,e.history,C,Zn,ye,Bt,l,!1,S,M,pe,te,Q,ut,m,e.patchRoutesOnNavigation!=null,[Ue.route.id,$e],be);sa.filter(qe=>qe.key!==A).forEach(qe=>{let Rr=qe.key,To=C.fetchers.get(Rr),Ii=Gl(void 0,To?To.data:void 0);C.fetchers.set(Rr,Ii),ht(Rr),qe.controller&&N.set(Rr,qe.controller)}),Ye({fetchers:new Map(C.fetchers)});let Er=()=>sa.forEach(qe=>ht(qe.key));Se.signal.addEventListener("abort",Er);let{loaderResults:Tr,fetcherResults:Ze}=await Vi(wn,sa,tn,fe);if(Se.signal.aborted)return;if(Se.signal.removeEventListener("abort",Er),R.delete(A),N.delete(A),sa.forEach(qe=>N.delete(qe.key)),C.fetchers.has(A)){let qe=Ra($e.data);C.fetchers.set(A,qe)}let wt=Gs(Tr);if(wt)return St(tn,wt.result,!1,{preventScrollReset:de});if(wt=Gs(Ze),wt)return Q.add(wt.key),St(tn,wt.result,!1,{preventScrollReset:de});let{loaderData:Qn,errors:$t}=Hg(C,Zn,Tr,void 0,sa,Ze);So(fn),C.navigation.state==="loading"&&fn>ae?(Ne(K,"Expected pending action"),ne&&ne.abort(),Lt(C.navigation.location,{matches:Zn,loaderData:Qn,errors:$t,fetchers:new Map(C.fetchers)})):(Ye({errors:$t,loaderData:Ug(C.loaderData,Qn,Zn,$t),fetchers:new Map(C.fetchers)}),S=!1)}async function Nu(A,H,Y,ie,fe,xe,me,de,ye){let be=C.fetchers.get(A);en(A,Gl(ye,be?be.data:void 0),{flushSync:me});let Re=new AbortController,Se=Ui(e.history,Y,Re.signal);if(xe){let $e=await ja(ie,new URL(Se.url).pathname,Se.signal,A);if($e.type==="aborted")return;if($e.type==="error"){Un(A,H,$e.error,{flushSync:me});return}else if($e.matches)ie=$e.matches;else{Un(A,H,jn(404,{pathname:Y}),{flushSync:me});return}}let Pe=tu(ie,Y);N.set(A,Re);let Ue=J,mt=Qi(u,f,Se,ie,Pe,l,fe),vt=(await gr(Se,mt,fe,A))[Pe.route.id];if(N.get(A)===Re&&N.delete(A),!Se.signal.aborted){if(pe.has(A)){en(A,Ra(void 0));return}if(Yr(vt))if(ae>Ue){en(A,Ra(void 0));return}else{Q.add(A),await St(Se,vt,!1,{preventScrollReset:de});return}if(bn(vt)){Un(A,H,vt.error);return}en(A,Ra(vt.data))}}async function St(A,H,Y,{submission:ie,fetcherSubmission:fe,preventScrollReset:xe,replace:me}={}){Y||(he?.resolve(),he=null),H.response.headers.has("X-Remix-Revalidate")&&(S=!0);let de=H.response.headers.get("Location");Ne(de,"Expected a Location header on the redirect Response"),de=Lg(de,new URL(A.url),m,e.history);let ye=oo(C.location,de,{_isRedirect:!0});if(i){let mt=!1;if(H.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(mh(de)){const yt=Eb(de,!0);mt=yt.origin!==a.location.origin||Ln(yt.pathname,m)==null}if(mt){me?a.location.replace(de):a.location.assign(de);return}}ne=null;let be=me===!0||H.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Re,formAction:Se,formEncType:Pe}=C.navigation;!ie&&!fe&&Re&&Se&&Pe&&(ie=qg(C.navigation));let Ue=ie||fe;if(H3.has(H.response.status)&&Ue&&Xt(Ue.formMethod))await De(be,ye,{submission:{...Ue,formAction:de},preventScrollRe)DELIM" +R"DELIM(set:xe||le,enableViewTransition:Y?oe:void 0});else{let mt=cd(ye,ie);await De(be,ye,{overrideNavigation:mt,fetcherSubmission:fe,preventScrollReset:xe||le,enableViewTransition:Y?oe:void 0})}}async function gr(A,H,Y,ie){let fe,xe={};try{fe=await F3(g,A,H,ie,Y,!1)}catch(me){return H.filter(de=>de.shouldLoad).forEach(de=>{xe[de.route.id]={type:"error",error:me}}),xe}if(A.signal.aborted)return xe;if(!Xt(A.method))for(let me of H){if(fe[me.route.id]?.type==="error")break;!fe.hasOwnProperty(me.route.id)&&!C.loaderData.hasOwnProperty(me.route.id)&&(!C.errors||!C.errors.hasOwnProperty(me.route.id))&&me.shouldCallHandler()&&(fe[me.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${me.route.id}`)})}for(let[me,de]of Object.entries(fe))if(rR(de)){let ye=de.result;xe[me]={type:"redirect",response:I3(ye,A,me,H,m)}}else xe[me]=await J3(de);return xe}async function Vi(A,H,Y,ie){let fe=gr(Y,A,ie,null),xe=Promise.all(H.map(async ye=>{if(ye.matches&&ye.match&&ye.request&&ye.controller){let Re=(await gr(ye.request,ye.matches,ie,ye.key))[ye.match.route.id];return{[ye.key]:Re}}else return Promise.resolve({[ye.key]:{type:"error",error:jn(404,{pathname:ye.path})}})})),me=await fe,de=(await xe).reduce((ye,be)=>Object.assign(ye,be),{});return{loaderResults:me,fetcherResults:de}}function ei(){S=!0,te.forEach((A,H)=>{N.has(H)&&M.add(H),ht(H)})}function en(A,H,Y={}){C.fetchers.set(A,H),Ye({fetchers:new Map(C.fetchers)},{flushSync:(Y&&Y.flushSync)===!0})}function Un(A,H,Y,ie={}){let fe=sr(C.matches,H);Ji(A),Ye({errors:{[fe.route.id]:Y},fetchers:new Map(C.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function Xi(A){return re.set(A,(re.get(A)||0)+1),pe.has(A)&&pe.delete(A),C.fetchers.get(A)||U3}function ju(A,H){ht(A,H?.reason),en(A,Ra(null))}function Ji(A){let H=C.fetchers.get(A);N.has(A)&&!(H&&H.state==="loading"&&R.has(A))&&ht(A),te.delete(A),R.delete(A),Q.delete(A),pe.delete(A),M.delete(A),C.fetchers.delete(A)}function br(A){let H=(re.get(A)||0)-1;H<=0?(re.delete(A),pe.add(A)):re.set(A,H),Ye({fetchers:new Map(C.fetchers)})}function ht(A,H){let Y=N.get(A);Y&&(Y.abort(H),N.delete(A))}function $n(A){for(let H of A){let Y=Xi(H),ie=Ra(Y.data);C.fetchers.set(H,ie)}}function Ft(){let A=[],H=!1;for(let Y of Q){let ie=C.fetchers.get(Y);Ne(ie,`Expected fetcher: ${Y}`),ie.state==="loading"&&(Q.delete(Y),A.push(Y),H=!0)}return $n(A),H}function So(A){let H=[];for(let[Y,ie]of R)if(ie0}function Du(A,H){let Y=C.blockers.get(A)||Yl;return Te.get(A)!==H&&Te.set(A,H),Y}function wo(A){C.blockers.delete(A),Te.delete(A)}function la(A,H){let Y=C.blockers.get(A)||Yl;Ne(Y.state==="unblocked"&&H.state==="blocked"||Y.state==="blocked"&&H.state==="blocked"||Y.state==="blocked"&&H.state==="proceeding"||Y.state==="blocked"&&H.state==="unblocked"||Y.state==="proceeding"&&H.state==="unblocked",`Invalid blocker state transition: ${Y.state} -> ${H.state}`);let ie=new Map(C.blockers);ie.set(A,H),Ye({blockers:ie})}function xr({currentLocation:A,nextLocation:H,historyAction:Y}){if(Te.size===0)return;Te.size>1&&xt(!1,"A router only supports one blocker at a time");let ie=Array.from(Te.entries()),[fe,xe]=ie[ie.length-1],me=C.blockers.get(fe);if(!(me&&me.state==="proceeding")&&xe({currentLocation:A,nextLocation:H,historyAction:Y}))return fe}function Na(A){let H=jn(404,{pathname:A}),Y=p||h,{matches:ie,route:fe}=Ys(Y);return{notFoundMatches:ie,route:fe,error:H}}function oa(A,H,Y){if(E=A,j=H,T=Y||null,!k&&C.navigation===ud){k=!0;let ie=_o(C.location,C.matches);ie!=null&&Ye({restoreScrollPosition:ie})}return()=>{E=null,j=null,T=null}}function Sr(A,H){return T&&T(A,H.map(ie=>f3(ie,C.loaderData)))||A.key}function wr(A,H){if(E&&j){let Y=Sr(A,H);E[Y]=j()}}function _o(A,H){if(E){let Y=Sr(A,H),ie=E[Y];if(typeof ie=="number")return ie}return null}function _r(A,H,Y){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Jl(H,Y,m,!0)}}else return{active:!0,matches:Jl(H,Y,m,!0)||[]};return{active:!1,matches:null}}async function ja(A,H,Y,ie){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let fe=A;for(;;){let xe=p==null,me=p||h,de=f;try{await e.patchRoutesOnNavigation({signal:Y,path:H,matches:fe,fetcherKey:ie,patch:(Re,Se)=>{Y.aborted||Ng(Re,Se,me,de,u,!1)}})}catch(Re){return{type:"error",error:Re,partialMatches:fe}}finally{xe&&!Y.aborted&&(h=[...h])}if(Y.aborted)return{type:"aborted"};let ye=or(me,H,m),be=null;if(ye){if(Object.keys(ye[0].params).length===0)return{type:"success",matches:ye};if(be=Jl(me,H,m,!0),!(be&&fe.lengthY.route.id===H[ie].route.id)}function ku(A){f={},p=so(A,u,void 0,f)}function Eo(A,H,Y=!1){let ie=p==null;Ng(A,H,p||h,f,u,Y)DELIM" +R"DELIM(),ie&&(h=[...h],Ye({}))}return ue={get basename(){return m},get future(){return v},get state(){return C},get routes(){return h},get window(){return a},initialize:Ae,subscribe:it,enableScrollRestoration:oa,navigate:Je,fetch:Fi,revalidate:st,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Xi,resetFetcher:ju,deleteFetcher:br,dispose:Ve,getBlocker:Du,deleteBlocker:wo,patchRoutes:Eo,_internalFetchControllers:N,_internalSetRoutes:ku,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){Ye(A)}},e.unstable_instrumentations&&(ue=C3(ue,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),ue}function q3(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qd(e,a,i,l,s,u){let f,h;if(s){f=[];for(let m of a)if(f.push(m),m.route.id===s){h=m;break}}else f=a,h=a[a.length-1];let p=Ru(l||".",Tu(f),Ln(e.pathname,i)||e.pathname,u==="path");if(l==null&&(p.search=e.search,p.hash=e.hash),(l==null||l===""||l===".")&&h){let m=vh(p.search);if(h.route.index&&!m)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&m){let g=new URLSearchParams(p.search),v=g.getAll("index");g.delete("index"),v.filter(_=>_).forEach(_=>g.append("index",_));let x=g.toString();p.search=x?`?${x}`:""}}return i!=="/"&&(p.pathname=E3({basename:i,pathname:p.pathname})),ra(p)}function Cg(e,a,i){if(!i||!q3(i))return{path:a};if(i.formMethod&&!oR(i.formMethod))return{path:a,error:jn(405,{method:i.formMethod})};let l=()=>({path:a,error:jn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),f=Zb(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Xt(u))return l();let v=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[_,E])=>`${x}${_}=${E} +`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!Xt(u))return l();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:f,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}Ne(typeof FormData=="function","FormData is not available in this environment");let h,p;if(i.formData)h=Yd(i.formData),p=i.formData;else if(i.body instanceof FormData)h=Yd(i.body),p=i.body;else if(i.body instanceof URLSearchParams)h=i.body,p=Bg(h);else if(i.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(i.body),p=Bg(h)}catch{return l()}let m={formMethod:u,formAction:f,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Xt(m.formMethod))return{path:a,submission:m};let g=yr(a);return e&&g.search&&vh(g.search)&&h.append("index",""),g.search=`?${h}`,{path:ra(g),submission:m}}function Mg(e,a,i,l,s,u,f,h,p,m,g,v,x,_,E,T,j,k,L,U,V){let X=U?bn(U[1])?U[1].error:U[1].data:void 0,ue=s.createURL(u.location),C=s.createURL(p),K;if(g&&u.errors){let $=Object.keys(u.errors)[0];K=f.findIndex(S=>S.route.id===$)}else if(U&&bn(U[1])){let $=U[0];K=f.findIndex(S=>S.route.id===$)-1}let he=U?U[1].statusCode:void 0,le=he&&he>=400,ne={currentUrl:ue,currentParams:u.matches[0]?.params||{},nextUrl:C,nextParams:f[0].params,...h,actionResult:X,actionStatus:he},oe=go(f),we=f.map(($,S)=>{let{route:M}=$,N=null;if(K!=null&&S>K?N=!1:M.lazy?N=!0:ph(M)?g?N=Qd(M,u.loaderData,u.errors):Q3(u.loaderData,u.matches[S],$)&&(N=!0):N=!1,N!==null)return Pd(i,l,e,oe,$,m,a,N);let J=!1;typeof V=="boolean"?J=V:le?J=!1:(v||ue.pathname+ue.search===C.pathname+C.search||ue.search!==C.search||P3(u.matches[S],$))&&(J=!0);let ae={...ne,defaultShouldRevalidate:J},R=Wl($,ae);return Pd(i,l,e,oe,$,m,a,R,ae,V)}),se=[];return E.forEach(($,S)=>{if(g||!f.some(re=>re.route.id===$.routeId)||_.has(S))return;let M=u.fetchers.get(S),N=M&&M.state!=="idle"&&M.data===void 0,J=or(j,$.path,k);if(!J){if(L&&N)return;se.push({key:S,routeId:$.routeId,path:$.path,matches:null,match:null,request:null,controller:null});return}if(T.has(S))return;let ae=tu(J,$.path),R=new AbortController,Q=Ui(s,$.path,R.signal),te=null;if(x.has(S))x.delete(S),te=Qi(i,l,Q,J,ae,m,a);else if(N)v&&(te=Qi(i,l,Q,J,ae,m,a));else{let re;typeof V=="boolean"?re=V:le?re=!1:re=v;let pe={...ne,defaultShouldRevalidate:re};Wl(ae,pe)&&(te=Qi(i,l,Q,J,ae,m,a,pe))}te&&se.push({key:S,routeId:$.routeId,path:$.path,matches:te,match:ae,request:Q,controller:R})}),{dsMatches:we,revalidatingFetchers:se}}function ph(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Qd(e,a,i){if(e.lazy)return!0;if(!ph(e))return!1;let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;return!l&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!l&&!s}function Q3(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function P3(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"])DELIM" +R"DELIM(!==a.params["*"]}function Wl(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function Ng(e,a,i,l,s,u){let f;if(e){let m=l[e];Ne(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),f=m.children}else f=i;let h=[],p=[];if(a.forEach(m=>{let g=f.find(v=>Lb(m,v));g?p.push({existingRoute:g,newRoute:m}):h.push(m)}),h.length>0){let m=so(h,s,[e||"_","patch",String(f?.length||"0")],l);f.push(...m)}if(u&&p.length>0)for(let m=0;ma.children?.some(s=>Lb(i,s))):!1}var jg=new WeakMap,Bb=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(Ne(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let f=jg.get(s);f||(f={},jg.set(s,f));let h=f[e];if(h)return h;let p=(async()=>{let m=o3(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)xt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),f[e]=Promise.resolve();else if(v)xt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return f[e]=p,p},Dg=new WeakMap;function Y3(e,a,i,l,s){let u=i[e.id];if(Ne(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=Dg.get(u);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{Ne(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),_={};for(let E in x){let T=x[E];if(T===void 0)continue;let j=u3(E),L=u[E]!==void 0&&E!=="hasErrorBoundary";j?xt(!j,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?xt(!L,`Route "${u.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):_[E]=T}Object.assign(u,_),Object.assign(u,{...l(u),lazy:void 0})})();return Dg.set(u,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let f=Object.keys(e.lazy),h=[],p;for(let g of f){if(s&&s.includes(g))continue;let v=Bb({key:g,route:e,manifest:i,mapRouteProperties:l});v&&(h.push(v),g===a&&(p=v))}let m=h.length>0?Promise.all(h).then(()=>{}):void 0;return m?.catch(()=>{}),p?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:p}}async function kg(e){let a=e.matches.filter(s=>s.shouldLoad),i={};return(await Promise.all(a.map(s=>s.resolve()))).forEach((s,u)=>{i[a[u].route.id]=s}),i}async function G3(e){return e.matches.some(a=>a.route.middleware)?Hb(e,()=>kg(e)):kg(e)}function Hb(e,a){return K3(e,a,l=>{if(lR(l))throw l;return l},nR,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:f}=e,h=Math.min(Math.max(f.findIndex(m=>m.route.id===s),0),Math.max(f.findIndex(m=>m.shouldCallHandler()),0)),p=sr(f,f[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:l}})}}}async function K3(e,a,i,l,s){let{matches:u,request:f,params:h,context:p,unstable_pattern:m}=e,g=u.flatMap(x=>x.route.middleware?x.route.middleware.map(_=>[x.route.id,_]):[]);return await Ub({request:f,params:h,context:p,unstable_pattern:m},g,a,i,l,s)}async function Ub(e,a,i,l,s,u,f=0){let{request:h}=e;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let p=a[f];if(!p)return await i();let[m,g]=p,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Ub(e,a,i,l,s,u,f+1)},v.value}catch(_){return v={value:await u(_,m,v)},v.value}};try{let _=await g(e,x),E=_!=null?l(_):void 0;return s(E)?E:v?E??v.value:(v={value:await x()},v.value)}catch(_){return await u(_,m,v)}}function $b(e,a,i,l,s){let u=Bb({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),f=Y3(l.route,Xt(i.method)?"action":"loader",a,e,s);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Pd(e,a,i,l,s,u,f,h,p=null,m){let g=!1,v=$b(e,a,i,s,u);return{...s,_lazyPromises:v,shouldLoad:h,shouldRevalidateArgs:p,shouldCallHandler(x){return g=!0,p?typeof m=="boolean"?Wl(s,{...p,defaultShouldRevalidate:m}):typeof x=="boolean"?Wl(s,{...p,defaultShouldRevalidate:x}):Wl(s,p):h},resolve(x){let{)DELIM" +R"DELIM(lazy:_,loader:E,middleware:T}=s.route,j=g||h||x&&!Xt(i.method)&&(_||E),k=T&&T.length>0&&!E&&!_;return j&&(Xt(i.method)||!k)?V3({request:i,unstable_pattern:l,match:s,lazyHandlerPromise:v?.handler,lazyRoutePromise:v?.route,handlerOverride:x,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function Qi(e,a,i,l,s,u,f,h=null){return l.map(p=>p.route.id!==s.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:$b(e,a,i,p,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Pd(e,a,i,go(l),p,u,f,!0,h))}async function F3(e,a,i,l,s,u){i.some(m=>m._lazyPromises?.middleware)&&await Promise.all(i.map(m=>m._lazyPromises?.middleware));let f={request:a,unstable_pattern:go(i),params:i[0].params,context:s,matches:i},p=await e({...f,fetcherKey:l,runClientMiddleware:m=>{let g=f;return Hb(g,()=>m({...g,fetcherKey:l,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(m=>[m._lazyPromises?.handler,m._lazyPromises?.route]))}catch{}return p}async function V3({request:e,unstable_pattern:a,match:i,lazyHandlerPromise:l,lazyRoutePromise:s,handlerOverride:u,scopedContext:f}){let h,p,m=Xt(e.method),g=m?"action":"loader",v=x=>{let _,E=new Promise((k,L)=>_=L);p=()=>_(),e.signal.addEventListener("abort",p);let T=k=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${i.route.id}]`)):x({request:e,unstable_pattern:a,params:i.params,context:f},...k!==void 0?[k]:[]),j=(async()=>{try{return{type:"data",result:await(u?u(L=>T(L)):T())}}catch(k){return{type:"error",result:k}}})();return Promise.race([j,E])};try{let x=m?i.route.action:i.route.loader;if(l||s)if(x){let _,[E]=await Promise.all([v(x).catch(T=>{_=T}),l,s]);if(_!==void 0)throw _;h=E}else{await l;let _=m?i.route.action:i.route.loader;if(_)[h]=await Promise.all([v(_),s]);else if(g==="action"){let E=new URL(e.url),T=E.pathname+E.search;throw jn(405,{method:e.method,pathname:T,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(x)h=await v(x);else{let _=new URL(e.url),E=_.pathname+_.search;throw jn(404,{pathname:E})}}catch(x){return{type:"error",result:x}}finally{p&&e.signal.removeEventListener("abort",p)}return h}async function X3(e){let a=e.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?e.body==null?null:e.json():e.text()}async function J3(e){let{result:a,type:i}=e;if(yh(a)){let l;try{l=await X3(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new vo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?Zg(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:tR(a),statusCode:uo(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:uo(a)?a.status:void 0}:Zg(a)?{type:"data",data:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function I3(e,a,i,l,s){let u=e.headers.get("Location");if(Ne(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!mh(u)){let f=l.slice(0,l.findIndex(h=>h.route.id===i)+1);u=qd(new URL(a.url),f,s,u),e.headers.set("Location",u)}return e}function Lg(e,a,i,l){let s=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(mh(e)){let u=e,f=u.startsWith("//")?new URL(a.protocol+u):new URL(u);if(s.includes(f.protocol))throw new Error("Invalid redirect location");let h=Ln(f.pathname,i)!=null;if(f.origin===a.origin&&h)return f.pathname+f.search+f.hash}try{let u=l.createURL(e);if(s.includes(u.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ui(e,a,i,l){let s=e.createURL(Zb(a)).toString(),u={signal:i};if(l&&Xt(l.formMethod)){let{formMethod:f,formEncType:h}=l;u.method=f.toUpperCase(),h==="application/json"?(u.headers=new Headers({"Content-Type":h}),u.body=JSON.stringify(l.json)):h==="text/plain"?u.body=l.text:h==="application/x-www-form-urlencoded"&&l.formData?u.body=Yd(l.formData):u.body=l.formData}return new Request(s,u)}function Yd(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function Bg(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function W3(e,a,i,l=!1,s=!1){let u={},f=null,h,p=!1,m={},g=i&&bn(i[1])?i[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in a))return;let x=v.route.id,_=a[x];if(Ne(!Yr(_),"Cannot handle redirect results in processLoaderData"),bn(_)){let E=_.error;if(g!==void 0&&(E=g,g=void 0),f=f||{},s)f[x]=E;else{let T=sr(e,x);f[T.route.id]==null&&(f[T.route.id]=E)}l||(u[x]=kb),p||(p=!0,h=uo(_.error)?_.error.status:500),_.headers&&(m[x)DELIM" +R"DELIM(]=_.headers)}else u[x]=_.data,_.statusCode&&_.statusCode!==200&&!p&&(h=_.statusCode),_.headers&&(m[x]=_.headers)}),g!==void 0&&i&&(f={[i[0]]:g},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:f,statusCode:h||200,loaderHeaders:m}}function Hg(e,a,i,l,s,u){let{loaderData:f,errors:h}=W3(a,i,l);return s.filter(p=>!p.matches||p.matches.some(m=>m.shouldLoad)).forEach(p=>{let{key:m,match:g,controller:v}=p;if(v&&v.signal.aborted)return;let x=u[m];if(Ne(x,"Did not find corresponding fetcher result"),bn(x)){let _=sr(e.matches,g?.route.id);h&&h[_.route.id]||(h={...h,[_.route.id]:x.error}),e.fetchers.delete(m)}else if(Yr(x))Ne(!1,"Unhandled fetcher revalidation redirect");else{let _=Ra(x.data);e.fetchers.set(m,_)}}),{loaderData:f,errors:h}}function Ug(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==kb).reduce((u,[f,h])=>(u[f]=h,u),{});for(let u of i){let f=u.route.id;if(!a.hasOwnProperty(f)&&e.hasOwnProperty(f)&&u.route.loader&&(s[f]=e[f]),l&&l.hasOwnProperty(f))break}return s}function $g(e){return e?bn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function sr(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function Ys(e){let a=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function jn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(f="Bad Request",l&&a&&i?h=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(h="Unable to encode submission body")):e===403?(f="Forbidden",h=`Route "${i}" does not match URL "${a}"`):e===404?(f="Not Found",h=`No route matches URL "${a}"`):e===405&&(f="Method Not Allowed",l&&a&&i?h=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(h=`Invalid request method "${l.toUpperCase()}"`)),new vo(e||500,f,new Error(h),!0)}function Gs(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(Yr(s))return{key:l,result:s}}}function Zb(e){let a=typeof e=="string"?yr(e):e;return ra({...a,hash:""})}function eR(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function tR(e){return new vo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function nR(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&aR(i))}function aR(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function rR(e){return yh(e.result)&&jb.has(e.result.status)}function bn(e){return e.type==="error"}function Yr(e){return(e&&e.type)==="redirect"}function Zg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function yh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function iR(e){return jb.has(e)}function lR(e){return yh(e)&&iR(e.status)&&e.headers.has("Location")}function oR(e){return B3.has(e.toUpperCase())}function Xt(e){return k3.has(e.toUpperCase())}function vh(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function tu(e,a){let i=typeof a=="string"?yr(a).search:a.search;if(e[e.length-1].route.index&&vh(i||""))return e[e.length-1];let l=Ab(e);return l[l.length-1]}function qg(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:f}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(f!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:f,text:void 0}}}function cd(e,a){return a?{state:"loading",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function sR(e,a){return{state:"submitting",location:e,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function Gl(e,a){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function uR(e,a){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a?a.data:void 0}}function Ra(e){return{state:"idle",formMethod:void 0,for)DELIM" +R"DELIM(mAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function cR(e,a){try{let i=e.sessionStorage.getItem(Db);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function fR(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem(Db,JSON.stringify(i))}catch(l){xt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function Qg(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var Ir=z.createContext(null);Ir.displayName="DataRouter";var bo=z.createContext(null);bo.displayName="DataRouterState";var qb=z.createContext(!1);function dR(){return z.useContext(qb)}var gh=z.createContext({isTransitioning:!1});gh.displayName="ViewTransition";var Qb=z.createContext(new Map);Qb.displayName="Fetchers";var hR=z.createContext(null);hR.displayName="Await";var Sn=z.createContext(null);Sn.displayName="Navigation";var zu=z.createContext(null);zu.displayName="Location";var Hn=z.createContext({outlet:null,matches:[],isDataRoute:!1});Hn.displayName="Route";var bh=z.createContext(null);bh.displayName="RouteError";var Pb="REACT_ROUTER_ERROR",mR="REDIRECT",pR="ROUTE_ERROR_RESPONSE";function yR(e){if(e.startsWith(`${Pb}:${mR}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function vR(e){if(e.startsWith(`${Pb}:${pR}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new vo(a.status,a.statusText,a.data)}catch{}}function gR(e,{relative:a}={}){Ne(Ki(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=z.useContext(Sn),{hash:s,pathname:u,search:f}=xo(e,{relative:a}),h=u;return i!=="/"&&(h=u==="/"?i:aa([i,u])),l.createHref({pathname:h,search:f,hash:s})}function Ki(){return z.useContext(zu)!=null}function Vn(){return Ne(Ki(),"useLocation() may be used only in the context of a component."),z.useContext(zu).location}var Yb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gb(e){z.useContext(Sn).static||z.useLayoutEffect(e)}function Ca(){let{isDataRoute:e}=z.useContext(Hn);return e?NR():bR()}function bR(){Ne(Ki(),"useNavigate() may be used only in the context of a component.");let e=z.useContext(Ir),{basename:a,navigator:i}=z.useContext(Sn),{matches:l}=z.useContext(Hn),{pathname:s}=Vn(),u=JSON.stringify(Tu(l)),f=z.useRef(!1);return Gb(()=>{f.current=!0}),z.useCallback((p,m={})=>{if(xt(f.current,Yb),!f.current)return;if(typeof p=="number"){i.go(p);return}let g=Ru(p,JSON.parse(u),s,m.relative==="path");e==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:aa([a,g.pathname])),(m.replace?i.replace:i.push)(g,m.state,m)},[a,i,u,s,e])}var xR=z.createContext(null);function SR(e){let a=z.useContext(Hn).outlet;return z.useMemo(()=>a&&z.createElement(xR.Provider,{value:e},a),[a,e])}function xh(){let{matches:e}=z.useContext(Hn),a=e[e.length-1];return a?a.params:{}}function xo(e,{relative:a}={}){let{matches:i}=z.useContext(Hn),{pathname:l}=Vn(),s=JSON.stringify(Tu(i));return z.useMemo(()=>Ru(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function wR(e,a,i,l,s){Ne(Ki(),"useRoutes() may be used only in the context of a component.");let{navigator:u}=z.useContext(Sn),{matches:f}=z.useContext(Hn),h=f[f.length-1],p=h?h.params:{},m=h?h.pathname:"/",g=h?h.pathnameBase:"/",v=h&&h.route;{let L=v&&v.path||"";Vb(m,!v||L.endsWith("*")||L.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${m}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let x=ia(),_;_=x;let E=_.pathname||"/",R=E;if(g!=="/"){let L=g.replace(/^\//,"").split("/");R="/"+E.replace(/^\//,"").split("/").slice(L.length).join("/")}let k=lr(e,{pathname:R});return xt(v||k!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),xt(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),_R(k&&k.map(L=>Object.assign({},L,{params:Object.assign({},p,L.params),pathname:na([g,u.encodeLocation?u.encodeLocation(L.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:L.pathname]),pathnameBase:L.pathnameBase==="/"?g:na([g,u.encodeLocation?u.encodeLocation(L.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:L.pathnameBase])})),d,i,l,s)}function bR(){let e=Yb(),a=so(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:u},"ErrorBoundary")," or"," ",z.createElement("code",{style:u},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},a),i?z.createElement("pre",{style:s},i):null,d)}var xR=z.createElement(bR,null),Pb=class extends z.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,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=hR(e.digest);i&&(e=i)}let a=e!==void 0?z.createElement(Kn.Provider,{value:this.props.routeContext},z.createElement(bh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(SR,{error:e},a):a}};Pb.contextType=Ub;var cd=new WeakMap;function SR({children:e,error:a}){let{basename:i}=z.useContext(Bn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=dR(a.digest);if(l){let s=cd.get(a);if(s)throw s;let u=zb(l.location,i);if(Rb&&!cd.get(a))if(u.isExternal||l.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw cd.set(a,d),d}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function wR({routeContext:e,match:a,children:i}){let l=z.useContext(Ir);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),z.createElement(Kn.Provider,{value:e},i)}function _R(e,a=[],i=null,l=null,s=null){if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(a.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let u=e,d=i?.errors;if(d!=null){let g=u.findIndex(v=>v.route.id&&d?.[v.route.id]!==void 0);je(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let h=!1,p=-1;if(i)for(le)DELIM" -R"DELIM(t g=0;g=0?u=u.slice(0,p+1):u=[u[0]];break}}}let m=i&&l?(g,v)=>{l(g,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:vo(i.matches),errorInfo:v})}:void 0;return u.reduceRight((g,v,x)=>{let _,E=!1,R=null,k=null;i&&(_=d&&v.route.id?d[v.route.id]:void 0,R=v.route.errorElement||xR,h&&(p<0&&x===0?(Gb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,k=null):p===x&&(E=!0,k=v.route.hydrateFallbackElement||null)));let j=a.concat(u.slice(0,x+1)),L=()=>{let U;return _?U=R:E?U=k:v.route.Component?U=z.createElement(v.route.Component,null):v.route.element?U=v.route.element:U=g,z.createElement(wR,{match:v,routeContext:{outlet:g,matches:j,isDataRoute:i!=null},children:U})};return i&&(v.route.ErrorBoundary||v.route.errorElement||x===0)?z.createElement(Pb,{location:i.location,revalidation:i.revalidation,component:R,error:_,children:L(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:m}):L()},null)}function Sh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ER(e){let a=z.useContext(Ir);return je(a,Sh(e)),a}function TR(e){let a=z.useContext(go);return je(a,Sh(e)),a}function RR(e){let a=z.useContext(Kn);return je(a,Sh(e)),a}function wh(e){let a=RR(e),i=a.matches[a.matches.length-1];return je(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function zR(){return wh("useRouteId")}function Yb(){let e=z.useContext(bh),a=TR("useRouteError"),i=wh("useRouteError");return e!==void 0?e:a.errors?.[i]}function AR(){let{router:e}=ER("useNavigate"),a=wh("useNavigate"),i=z.useRef(!1);return Qb(()=>{i.current=!0}),z.useCallback(async(s,u={})=>{xt(i.current,qb),i.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:a,...u}))},[e,a])}var Pg={};function Gb(e,a,i){!a&&!Pg[e]&&(Pg[e]=!0,xt(!1,i))}var Yg={};function Gg(e,a){!e&&!Yg[a]&&(Yg[a]=!0,console.warn(a))}var CR="useOptimistic",Kg=TS[CR],OR=()=>{};function MR(e){return Kg?Kg(e):[e,OR]}function NR(e){let a={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&xt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:z.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&xt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:z.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&xt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:z.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),a}var jR=["HydrateFallback","hydrateFallbackElement"],DR=class{constructor(){this.status="pending",this.promise=new Promise((e,a)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",a(i))}})}};function kR({router:e,flushSync:a,onError:i,unstable_useTransitions:l}){l=sR()||l;let[u,d]=z.useState(e.state),[h,p]=MR(u),[m,g]=z.useState(),[v,x]=z.useState({isTransitioning:!1}),[_,E]=z.useState(),[R,k]=z.useState(),[j,L]=z.useState(),U=z.useRef(new Map),J=z.useCallback((K,{deletedFetchers:me,newErrors:re,flushSync:ne,viewTransitionOpts:se})=>{re&&i&&Object.values(re).forEach(oe=>i(oe,{location:K.location,params:K.matches[0]?.params??{},unstable_pattern:vo(K.matches)})),K.fetchers.forEach((oe,$)=>{oe.data!==void 0&&U.current.set($,oe.data)}),me.forEach(oe=>U.current.delete(oe)),Gg(ne===!1||a!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let ze=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Gg(se==null||ze,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!se||!ze){a&&ne?a(()=>d(K)):l===!1?d(K):z.startTransition(()=>{l===!0&&p(oe=>Fg(oe,K)),d(K)});return}if(a&&ne){a(()=>{R&&(_?.resolve(),R.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let oe=e.window.document.startViewTransition(()=>{a(()=>d(K))});oe.finished.finally(()=>{a(())DELIM" -R"DELIM(=>{E(void 0),k(void 0),g(void 0),x({isTransitioning:!1})})}),a(()=>k(oe));return}R?(_?.resolve(),R.skipTransition(),L({state:K,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(g(K),x({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[e.window,a,R,_,l,p,i]);z.useLayoutEffect(()=>e.subscribe(J),[e,J]),z.useEffect(()=>{v.isTransitioning&&!v.flushSync&&E(new DR)},[v]),z.useEffect(()=>{if(_&&m&&e.window){let K=m,me=_.promise,re=e.window.document.startViewTransition(async()=>{l===!1?d(K):z.startTransition(()=>{l===!0&&p(ne=>Fg(ne,K)),d(K)}),await me});re.finished.finally(()=>{E(void 0),k(void 0),g(void 0),x({isTransitioning:!1})}),k(re)}},[m,_,e.window,l,p]),z.useEffect(()=>{_&&m&&h.location.key===m.location.key&&_.resolve()},[_,R,h.location,m]),z.useEffect(()=>{!v.isTransitioning&&j&&(g(j.state),x({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}),L(void 0))},[v.isTransitioning,j]);let I=z.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:K=>e.navigate(K),push:(K,me,re)=>e.navigate(K,{state:me,preventScrollReset:re?.preventScrollReset}),replace:(K,me,re)=>e.navigate(K,{replace:!0,state:me,preventScrollReset:re?.preventScrollReset})}),[e]),ce=e.basename||"/",O=z.useMemo(()=>({router:e,navigator:I,static:!1,basename:ce,onError:i}),[e,I,ce,i]);return z.createElement(z.Fragment,null,z.createElement(Ir.Provider,{value:O},z.createElement(go.Provider,{value:h},z.createElement($b.Provider,{value:U.current},z.createElement(gh.Provider,{value:v},z.createElement(UR,{basename:ce,location:h.location,navigationType:h.historyAction,navigator:I,unstable_useTransitions:l},z.createElement(LR,{routes:e.routes,future:e.future,state:h,onError:i})))))),null)}function Fg(e,a){return{...e,navigation:a.navigation.state!=="idle"?a.navigation:e.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:e.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:e.actionData,fetchers:a.fetchers}}var LR=z.memo(BR);function BR({routes:e,future:a,state:i,onError:l}){return gR(e,void 0,i,l,a)}function HR(e){return vR(e.context)}function ea(e){je(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function UR({basename:e="/",children:a=null,location:i,navigationType:l="POP",navigator:s,static:u=!1,unstable_useTransitions:d}){je(!bo(),"You cannot render a inside another . You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),p=z.useMemo(()=>({basename:h,navigator:s,static:u,unstable_useTransitions:d,future:{}}),[h,s,u,d]);typeof i=="string"&&(i=mr(i));let{pathname:m="/",search:g="",hash:v="",state:x=null,key:_="default"}=i,E=z.useMemo(()=>{let R=kn(m,h);return R==null?null:{location:{pathname:R,search:g,hash:v,state:x,key:_},navigationType:l}},[h,m,g,v,x,_,l]);return xt(E!=null,` is not able to match the URL "${m}${g}${v}" because it does not start with the basename, so the won't render anything.`),E==null?null:z.createElement(Bn.Provider,{value:p},z.createElement(Ru.Provider,{children:a,value:E}))}function Yd(e,a=[]){let i=[];return z.Children.forEach(e,(l,s)=>{if(!z.isValidElement(l))return;let u=[...a,s];if(l.type===z.Fragment){i.push.apply(i,Yd(l.props.children,u));return}je(l.type===ea,`[${typeof l.type=="string"?l.type:l.type.name}] is not a component. All component children of must be a or `),je(!l.props.index||!l.props.children,"An index route cannot have child routes.");let d={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(d.children=Yd(l.props.children,u)),i.push(d)}),i}var $R=Yd,nu="get",au="application/x-www-form-urlencoded";function zu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ZR(e){return zu(e)&&e.tagName.toLowerCase()==="button"}function qR(e){return zu(e)&&e.tagName.toLowerCase()==="form"}function QR(e){return zu(e)&&e.tagName.toLowerCase()==="input"}function PR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function YR(e,a){return e.button===0&&(!a||a==="_self")&&!PR(e)}function Gd(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,i)=>{let l=e[i];return a.concat(Array.isArray(l)?l.map(s=>[i,s]):[[i,l]])},[]))}function GR(e,a){l)DELIM" -R"DELIM(et i=Gd(e);return a&&a.forEach((l,s)=>{i.has(s)||a.getAll(s).forEach(u=>{i.append(s,u)})}),i}var Ks=null;function KR(){if(Ks===null)try{new FormData(document.createElement("form"),0),Ks=!1}catch{Ks=!0}return Ks}var FR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fd(e){return e!=null&&!FR.has(e)?(xt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${au}"`),null):e}function VR(e,a){let i,l,s,u,d;if(qR(e)){let h=e.getAttribute("action");l=h?kn(h,a):null,i=e.getAttribute("method")||nu,s=fd(e.getAttribute("enctype"))||au,u=new FormData(e)}else if(ZR(e)||QR(e)&&(e.type==="submit"||e.type==="image")){let h=e.form;if(h==null)throw new Error('Cannot submit a