From afc8e6990793f2ced037a4801713592344e56040 Mon Sep 17 00:00:00 2001 From: BOB450 Date: Tue, 20 Jan 2026 01:17:03 -0700 Subject: [PATCH] Updated Block explorer --- console/embedded/explore_css.cpp | 14 +- console/embedded/explore_ecma.cpp | 239 +++++++++++++++--------------- 2 files changed, 130 insertions(+), 123 deletions(-) diff --git a/console/embedded/explore_css.cpp b/console/embedded/explore_css.cpp index 3f83f122..58625817 100644 --- a/console/embedded/explore_css.cpp +++ b/console/embedded/explore_css.cpp @@ -23,15 +23,17 @@ namespace server { // Simple test css for embedded page, links in font. DEFINE_EMBEDDED_PAGE(explore_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-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-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;--ease-out:cubic-bezier(0,0,.2,1);--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:bolder}: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,curr)DELIM" - R"DELIM(entcolor 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.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(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:whe)DELIM" - R"DELIM(re([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}.fixed{position:fixed}.relative{position:relative}.static{position:static}.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%}.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)}.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-reverse: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-st)DELIM" - R"DELIM(yle);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}.rounded{border-radius:.25rem}.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-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\/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)}}.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-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-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)}.text-center{text-align:center}.text-left{text-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(--)DELIM" - R"DELIM(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-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)}.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,)}.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: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\: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)DELIM" - R"DELIM(,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-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{syntax:"*";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/explore_ecma.cpp b/console/embedded/explore_ecma.cpp index 2af1c0fc..dcf80736 100644 --- a/console/embedded/explore_ecma.cpp +++ b/console/embedded/explore_ecma.cpp @@ -23,135 +23,140 @@ namespace server { // Simple test ecma script for embedded page. DEFINE_EMBEDDED_PAGE(explore_pages, char, ecma, - R"DELIM(function jx(t,a){for(var i=0;io[u]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(u){if(u.ep)return;u.ep=!0;const c=i(u);fetch(u.href,c)}})();function Jl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Sf={exports:{}},zl={};var Yy;function kx(){if(Yy)return zl;Yy=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(o,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var h in u)h!=="key"&&(c[h]=u[h])}else c=u;return u=c.ref,{$$typeof:t,type:o,key:d,ref:u!==void 0?u:null,props:c}}return zl.Fragment=a,zl.jsx=i,zl.jsxs=i,zl}var Gy;function Lx(){return Gy||(Gy=1,Sf.exports=kx()),Sf.exports}var S=Lx(),_f={exports:{}},ze={};var Py;function Bx(){if(Py)return ze;Py=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=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"),b=Symbol.iterator;function _(T){return T===null||typeof T!="object"?null:(T=b&&T[b]||T["@@iterator"],typeof T=="function"?T:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,B={};function D(T,Z,W){this.props=T,this.context=Z,this.refs=B,this.updater=W||E}D.prototype.isReactComponent={},D.prototype.setState=function(T,Z){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,Z,"setState")},D.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function Q(){}Q.prototype=D.prototype;function X(T,Z,W){this.props=T,this.context=Z,this.refs=B,this.updater=W||E}var se=X.prototype=new Q;se.constructor=X,A(se,D.prototype),se.isPureReactComponent=!0;var ue=Array.isArray;function me(){}var C={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function ie(T,Z,W){var re=W.ref;return{$$typeof:t,type:T,key:Z,ref:re!==void 0?re:null,props:W}}function V(T,Z){return ie(T.type,Z,T.props)}function ee(T){return typeof T=="object"&&T!==null&&T.$$typeof===t}function _e(T){var Z={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(W){return Z[W]})}var Oe=/\/+/g;function ne(T,Z){return typeof T=="object"&&T!==null&&T.key!=null?_e(""+T.key):Z.toString(36)}function J(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(me,me):(T.status="pending",T.then(function(Z){T.status==="pending"&&(T.status="fulfilled",T.value=Z)},function(Z){T.status==="pending"&&(T.status="rejected",T.reason=Z)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function w(T,Z,W,re,he){var we=typeof T;(we==="undefined"||we==="boolean")&&(T=null);var Re=!1;if(T===null)Re=!0;else switch(we){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(T.$$typeof){case t:case a:Re=!0;break;case g:return Re=T._init,w(Re(T._payload),Z,W,re,he)}}if(Re)return he=he(T),Re=re===""?"."+ne(T,0):re,ue(he)?(W="",Re!=null&&(W=Re.replace(Oe,"$&/")+"/"),w(he,Z,W,"",function(ct){return ct})):he!=null&&(ee(he)&&(he=V(he,W+(he.key==null||T&&T.key===he.key?"":(""+he.key).replace(Oe,"$&/")+"/")+Re)),Z.push(he)),1;Re=0;var Ie=re===""?".":re+":";if(ue(T))for(var Ge=0;Ge>>1,le=w[ae];if(0>>1;aeu(W,L))reu(he,W)?(w[ae]=he,w[)DELIM" - R"DELIM(re]=L,ae=re):(w[ae]=W,w[Z]=L,ae=Z);else if(reu(he,L))w[ae]=he,w[re]=L,ae=re;else break e}}return k}function u(w,k){var L=w.sortIndex-k.sortIndex;return L!==0?L:w.id-k.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var p=[],m=[],g=1,v=null,b=3,_=!1,E=!1,A=!1,B=!1,D=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function se(w){for(var k=i(m);k!==null;){if(k.callback===null)o(m);else if(k.startTime<=w)o(m),k.sortIndex=k.expirationTime,a(p,k);else break;k=i(m)}}function ue(w){if(A=!1,se(w),!E)if(i(p)!==null)E=!0,me||(me=!0,_e());else{var k=i(m);k!==null&&J(ue,k.startTime-w)}}var me=!1,C=-1,I=5,ie=-1;function V(){return B?!0:!(t.unstable_now()-iew&&V());){var ae=v.callback;if(typeof ae=="function"){v.callback=null,b=v.priorityLevel;var le=ae(v.expirationTime<=w);if(w=t.unstable_now(),typeof le=="function"){v.callback=le,se(w),k=!0;break t}v===i(p)&&o(p),se(w)}else o(p);v=i(p)}if(v!==null)k=!0;else{var T=i(m);T!==null&&J(ue,T.startTime-w),k=!1}}break e}finally{v=null,b=L,_=!1}k=void 0}}finally{k?_e():me=!1}}}var _e;if(typeof X=="function")_e=function(){X(ee)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,ne=Oe.port2;Oe.port1.onmessage=ee,_e=function(){ne.postMessage(null)}}else _e=function(){D(ee,0)};function J(w,k){C=D(function(){w(t.unstable_now())},k)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(w){w.callback=null},t.unstable_forceFrameRate=function(w){0>w||125ae?(w.sortIndex=L,a(m,w),i(p)===null&&w===i(m)&&(A?(Q(C),C=-1):A=!0,J(ue,L-ae))):(w.sortIndex=le,a(p,w),E||_||(E=!0,me||(me=!0,_e()))),w},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(w){var k=b;return function(){var L=b;b=k;try{return w.apply(this,arguments)}finally{b=L}}}})(Tf)),Tf}var Ky;function $x(){return Ky||(Ky=1,Ef.exports=Hx()),Ef.exports}var zf={exports:{}},$t={};var Fy;function Zx(){if(Fy)return $t;Fy=1;var t=Il();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(t)}catch(a){console.error(a)}}return t(),zf.exports=Zx(),zf.exports}var Iy;function qx(){if(Iy)return Rl;Iy=1;var t=$x(),a=Il(),i=$g();function o(e){var n="https://react.dev/errors/"+e;if(1le||(e.current=ae[le],ae[le]=null,le--)}function W(e,n){le++,ae[le]=e.current,e.current=n}var re=T(null),he=T(null),we=T(null),Re=T(null);function Ie(e,n){switch(W(we,n),W(he,e),W(re,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?hy(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=hy(n),e=my(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Z(re),W(re,e)}function Ge(){Z(re),Z(he),Z(we)}function ct(e){e.memoizedState!==null&&W(Re,e);var n=re.current,r=my(n,e.type);n!==r&&(W(he,e),W(re,r))}function qt(e){he.current===e&&(Z(re),Z(he)),Re.current===e&&(Z(Re),_l._currentValue=L)}var et,Pt;function Zn(e){if(et===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);et=n&&n[1]||"",Pt=-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 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=-1)":-1s||R[l]!==H[s]){var G=` -`+R[l].replace(" at new "," at ");return e.displayName&&G.includes("")&&(G=G.replace("",e.displayName)),G}while(1<=l&&0<=s);break}}}finally{Ni=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Zn(r):""}function us(e,n){switch(e.tag){case 26:case 27:case 5:return Zn(e.type);case 16:return Zn("Lazy");case 13:return e.child!==n&&n!==null?Zn("Suspense Fallback"):Zn("Suspense");case 19:return Zn("SuspenseList");case 0:case 15:return Mn(e.type,!1);case 11:return Mn(e.type.render,!1);case 1:return Mn(e.type,!0);case 31:return Zn("Activity");default:return""}}function uo(e){try{var n="",r=null;do n+=us(e,r),r=e,e=e.return;while(e);return n}catch(l){return` -Error generating stack: `+l.message+` -`+l.stack}}var Hr=Object.prototype.hasOwnProperty,Di=t.unstable_scheduleCallback,ji=t.unstable_cancelCallback,ss=t.unstable_shouldYield,cs=t.unstable_requestPaint,yt=t.unstable_now,rr=t.unstable_getCurrentPriorityLevel,ki=t.unstable_ImmediatePriority,$r=t.unstable_UserBlockingPriority,Vt=t.unstable_NormalPriority,Cn=t.unstable_LowPriority,Li=t.unstable_IdlePriority,fs=t.log,Bi=t.unstable_setDisableYieldValue,ir=null,ot=null;function Nn(e){if(typeof fs=="function"&&Bi(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(ir,e)}catch{}}var Ht=Math.clz32?Math.clz32:co,so=Math.log,ds=Math.LN2;function co(e){return e>>>=0,e===0?32:31-(so(e)/ds|0)|0}var Jn=256,lr=262144,Sa=4194304;function In(e){var n=e&42;if(n!==0)return n;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function or(e,n,r){var l=e.pendingLanes;if(l===0)return 0;var s=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~f,l!==0?s=In(l):(y&=x,y!==0?s=In(y):r||(r=x&~e,r!==0&&(s=In(r))))):(x=l&~f,x!==0?s=In(x):y!==0?s=In(y):r||(r=l&~e,r!==0&&(s=In(r)))),s===0?0:n!==0&&n!==s&&(n&f)===0&&(f=s&-s,r=n&-n,f)DELIM" -R"DELIM(>=r||f===32&&(r&4194048)!==0)?n:s}function ur(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function fo(e,n){switch(e){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 sr(){var e=Sa;return Sa<<=1,(Sa&62914560)===0&&(Sa=4194304),e}function _a(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function wa(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hs(e,n,r,l,s,f){var y=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var x=e.entanglements,R=e.expirationTimes,H=e.hiddenUpdates;for(r=y&~r;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ob=/[\n"\\]/g;function yn(e){return e.replace(Ob,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ms(e,n,r,l,s,f,y,x){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),n!=null?y==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+He(n)):e.value!==""+He(n)&&(e.value=""+He(n)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),n!=null?ps(e,y,He(n)):r!=null?ps(e,y,He(r)):l!=null&&e.removeAttribute("value"),s==null&&f!=null&&(e.defaultChecked=!!f),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+He(x):e.removeAttribute("name")}function oh(e,n,r,l,s,f,y,x){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Ui(e);return}r=r!=null?""+He(r):"",n=n!=null?""+He(n):r,x||n===e.value||(e.value=n),e.defaultValue=n}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Ui(e)}function ps(e,n,r){n==="number"&&po(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Zr(e,n,r,l){if(e=e.options,n){n={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xs=!1;if(ta)try{var $i={};Object.defineProperty($i,"passive",{get:function(){xs=!0}}),window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{xs=!1}var Ea=null,Ss=null,vo=null;function mh(){if(vo)return vo;var e,n=Ss,r=n.length,l,s="value"in Ea?Ea.value:Ea.textContent,f=s.length;for(e=0;e=Qi),xh=" ",Sh=!1;function _h(e,n){switch(e){case"keyup":return n1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gr=!1;function r1(e,n){switch(e){case"compositionend":return wh(n);case"keypress":return n.which!==32?null:(Sh=!0,xh);case"textInput":return e=n.data,e===xh&&Sh?null:e;default:return null}}function i1(e,n){if(Gr)return e==="compositionend"||!zs&&_h(e,n)?(e=mh(),vo=Ss=Ea=null,Gr=!1,e):null;switch(e){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-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ch(r)}}function Dh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Dh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function jh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=po(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=po(e.document)}return n}function As(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var h1=ta&&"documentMode"in document&&11>=document.documentMode,Pr=null,Ms=null,Vi=null,Cs=!1;function kh(e,n,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cs||Pr==null||Pr!==po(l)||(l=Pr,"selectionStart"in l&&As(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Vi&&Pi(Vi,l)||(Vi=l,l=cu(Ms,"onSelect"),0>=y,s-=y,qn=1<<32-Ht(n)+s|r<Me?(ke=ye,ye=null):ke=ye.sibling;var Ye=$(N,ye,U[Me],P);if(Ye===null){ye===null&&(ye=ke);break}e&&ye&&Ye.alternate===null&&n(N,ye),M=f(Ye,M,Me),Qe===null?xe=Ye:Qe.sibling=Ye,Qe=Ye,ye=ke}if(Me===U.length)return r(N,ye),$e&&aa(N,Me),xe;if(ye===null){for(;MeMe?(ke=ye,ye=null):ke=ye.sibling;var Pa=$(N,ye,Ye.value,P);if(Pa===null){ye===null&&(ye=ke);break}e&&ye&&Pa.alternate===null&&n(N,)DELIM" -R"DELIM(ye),M=f(Pa,M,Me),Qe===null?xe=Pa:Qe.sibling=Pa,Qe=Pa,ye=ke}if(Ye.done)return r(N,ye),$e&&aa(N,Me),xe;if(ye===null){for(;!Ye.done;Me++,Ye=U.next())Ye=K(N,Ye.value,P),Ye!==null&&(M=f(Ye,M,Me),Qe===null?xe=Ye:Qe.sibling=Ye,Qe=Ye);return $e&&aa(N,Me),xe}for(ye=l(ye);!Ye.done;Me++,Ye=U.next())Ye=Y(ye,N,Me,Ye.value,P),Ye!==null&&(e&&Ye.alternate!==null&&ye.delete(Ye.key===null?Me:Ye.key),M=f(Ye,M,Me),Qe===null?xe=Ye:Qe.sibling=Ye,Qe=Ye);return e&&ye.forEach(function(Dx){return n(N,Dx)}),$e&&aa(N,Me),xe}function Je(N,M,U,P){if(typeof U=="object"&&U!==null&&U.type===A&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case _:e:{for(var xe=U.key;M!==null;){if(M.key===xe){if(xe=U.type,xe===A){if(M.tag===7){r(N,M.sibling),P=s(M,U.props.children),P.return=N,N=P;break e}}else if(M.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===I&&_r(xe)===M.type){r(N,M.sibling),P=s(M,U.props),Wi(P,U),P.return=N,N=P;break e}r(N,M);break}else n(N,M);M=M.sibling}U.type===A?(P=vr(U.props.children,N.mode,P,U.key),P.return=N,N=P):(P=Ro(U.type,U.key,U.props,null,N.mode,P),Wi(P,U),P.return=N,N=P)}return y(N);case E:e:{for(xe=U.key;M!==null;){if(M.key===xe)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){r(N,M.sibling),P=s(M,U.children||[]),P.return=N,N=P;break e}else{r(N,M);break}else n(N,M);M=M.sibling}P=Us(U,N.mode,P),P.return=N,N=P}return y(N);case I:return U=_r(U),Je(N,M,U,P)}if(J(U))return pe(N,M,U,P);if(_e(U)){if(xe=_e(U),typeof xe!="function")throw Error(o(150));return U=xe.call(U),Te(N,M,U,P)}if(typeof U.then=="function")return Je(N,M,jo(U),P);if(U.$$typeof===X)return Je(N,M,Mo(N,U),P);ko(N,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(r(N,M.sibling),P=s(M,U),P.return=N,N=P):(r(N,M),P=Bs(U,N.mode,P),P.return=N,N=P),y(N)):r(N,M)}return function(N,M,U,P){try{Ii=0;var xe=Je(N,M,U,P);return ai=null,xe}catch(ye){if(ye===ni||ye===No)throw ye;var Qe=un(29,ye,null,N.mode);return Qe.lanes=P,Qe.return=N,Qe}}}var Er=rm(!0),im=rm(!1),Aa=!1;function Fs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Js(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ca(e,n,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Pe&2)!==0){var s=l.pending;return s===null?n.next=n:(n.next=s.next,s.next=n),l.pending=n,n=zo(e),qh(e,null,r),n}return To(e,l,n,r),zo(e)}function el(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,z(e,r)}}function Is(e,n){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var s=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?s=f=y:f=f.next=y,r=r.next}while(r!==null);f===null?s=f=n:f=f.next=n}else s=f=n;r={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:f,shared:l.shared,callbacks:l.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Ws=!1;function tl(){if(Ws){var e=ti;if(e!==null)throw e}}function nl(e,n,r,l){Ws=!1;var s=e.updateQueue;Aa=!1;var f=s.firstBaseUpdate,y=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var R=x,H=R.next;R.next=null,y===null?f=H:y.next=H,y=R;var G=e.alternate;G!==null&&(G=G.updateQueue,x=G.lastBaseUpdate,x!==y&&(x===null?G.firstBaseUpdate=H:x.next=H,G.lastBaseUpdate=R))}if(f!==null){var K=s.baseState;y=0,G=H=R=null,x=f;do{var $=x.lane&-536870913,Y=$!==x.lane;if(Y?(je&$)===$:(l&$)===$){$!==0&&$===ei&&(Ws=!0),G!==null&&(G=G.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var pe=e,Te=x;$=n;var Je=r;switch(Te.tag){case 1:if(pe=Te.payload,typeof pe=="function"){K=pe.call(Je,K,$);break e}K=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Te.payload,$=typeof pe=="function"?pe.call(Je,K,$):pe,$==null)break e;K=v({},K,$);break e;case 2:Aa=!0}}$=x.callback,$!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=s.callbacks,Y===null?s.callbacks=[$]:Y.push($))}else Y={lane:$,tag:x.tag,payload:x.payload,callback:x.callback,next:null},G===null?(H=G=Y,R=K):G=G.next=Y,y|=$;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;Y=x,x=Y.next,Y.next=null,s.lastBaseUpdate=Y,s.shared.pending=null}}while(!0);G===null&&(R=K),s.baseState=R,s.firstBaseUpdate=H,s.lastBaseUpdate=G,f===null&&(s.shared.lanes=0),La|=y,e.lanes=y,e.memoizedState=K}}function lm(e,n){if(typeof e!="function")throw Error(o(191,e));e.call(n)}function om(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;ef?f:8;var y=w.T,x={};w.T=x,gc(e,!1,n,r);try{var R=s(),H=w.S;if(H!==null&&H(x,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var G=_1(R,l);il(e,n,G,hn(e))}else il(e,n,l,hn(e))}catch(K){il(e,n,{then:function(){},status:"rejected",reason:K},hn())}finally{k.p=f,y!==null&&x.types!==null&&(y.types=x.types),w.T=y}}function O1(){}function yc(e,n,r,l){if(e.tag!==5)throw Error(o(476));var s=Hm(e).queue;Um(e,s,n,L,r===null?O1:function(){return $m(e),r(l)})}function Hm(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:L},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function $m(e){var n=Hm(e);n.next===null&&(n=e.alternate.memoizedState),il(e,n.next.queue,{},hn())}function vc(){return jt(_l)}function Zm(){return bt().memoizedState}function qm(){return bt().memoizedState}function A1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=hn();e=Ma(r);var l=Ca(n,e,r);l!==null&&(en(l,n,r),el(l,n,r)),n={cache:Ps()},e.payload=n;return}n=n.return}}function M1(e,n,r){var l=hn();r={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Go(e)?Ym(n,r):(r=ks(e,n,r,l),r!==null&&(en(r,e,l),Gm(r,n,l)))}function Qm(e,n,r){var l=hn();il(e,n,r,l)}function il(e,n,r,l){var s={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Go(e))Ym(n,s);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,x=f(y,r);if(s.hasEagerState=!0,s.eagerState=x,on(x,y))return To(e,n,s,0),We===null&&Eo(),!1}catch{}if(r=ks(e,n,s,l),r!==null)return en(r,e,l),Gm(r,n,l),!0}return!1}function gc(e,n,r,l){if(l={lane:2,revertLane:Fc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Go(e)){if(n)throw Error(o(479))}else n=ks(e,r,l,2),n!==null&&en(n,e,2)}function Go(e){var n=e.alternate;return e===Ae||n!==null&&n===Ae}function Ym(e,n){ii=Uo=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Gm(e,n,r){if((r&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,z(e,r)}}var ll={readContext:jt,use:Zo,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};ll.useEffectEvent=ht;var Pm={readContext:jt,use:Zo,useCallback:function(e,n){return Qt().memoizedState=[e,n===void 0?null:n],e},useContext:jt,useEffect:Am,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Qo(4194308,4,Dm.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Qo(4194308,4,e,n)},useInsertionEffect:function(e,n){Qo(4,2,e,n)},useMemo:function(e,n){var r=Qt();n=n===void 0?null:n;var l=e();if(Tr){Nn(!0);try{e()}finally{Nn(!1)}}return r.memoizedState=[l,n],l},useReducer:function(e,n,r){var l=Qt();if(r!==void 0){var s=r(n);if(Tr){Nn(!0);try{r(n)}finally{Nn(!1)}}}else s=n;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=M1.bind(null,Ae,e),[l.memoizedState,e]},useRef:function(e){var n=Qt();return e={current:e},n.memoizedState=e},useState:function(e){e=fc(e);var n=e.queue,r=Qm.bind(null,Ae,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:mc,useDeferredValue:function(e,n){var r=Qt();return pc(r,e,n)},useTransition:function(){var e=fc(!1);return e=Um.bind(null,Ae,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var l=Ae,s=Qt();if($e){if(r===void 0)throw Error(o(407));r=r()}else{if(r=n(),We===null)throw Error(o(349));(je&127)!==0||hm(l,n,r)}s.memoizedState=r;var f={value:r,getSnapshot:n};return s.queue=f,Am(pm.bind(null,l,f,e),[e]),l.flags|=2048,oi(9,{destroy:void 0},mm.bind)DELIM" -R"DELIM((null,l,f,r,n),null),r},useId:function(){var e=Qt(),n=We.identifierPrefix;if($e){var r=Qn,l=qn;r=(l&~(1<<32-Ht(l)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ho++,0<\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?f.multiple=!0:l.size&&(f.size=l.size);break;default:f=typeof l.is=="string"?y.createElement(s,{is:l.is}):y.createElement(s)}}f[ce]=n,f[de]=l;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(Lt(f,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&sa(n)}}return at(n),Nc(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&sa(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(e=we.current,Ir(n)){if(e=n.stateNode,r=n.memoizedProps,l=null,s=Dt,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[ce]=n,e=!!(e.nodeValue===r||l!==null&&l.suppressHydrationWarning===!0||fy(e.nodeValue,r)),e||Ra(n,!0)}else e=fu(e).createTextNode(l),e[ce]=n,n.stateNode=e}return at(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(l=Ir(n),r!==null){if(e===null){if(!l)throw Error(o(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ce]=n}else gr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;at(n),e=!1}else r=qs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(cn(n),n):(cn(n),null);if((n.flags&128)!==0)throw Error(o(558))}return at(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ir(n),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=n.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[ce]=n}else gr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;at(n),s=!1}else s=qs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return n.flags&256?(cn(n),n):(cn(n),null)}return cn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=l!==null,e=e!==null&&e.memoizedState!==null,r&&(l=n.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==s&&(l.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),Fo(n,n.updateQueue),at(n),null);case 4:return Ge(),e===null&&ef(n.stateNode.containerInfo),at(n),null;case 10:return ia(n.type),at(n),null;case 19:if(Z(gt),l=n.memoizedState,l===null)return at(n),null;if(s=(n.flags&128)!==0,f=l.rendering,f===null)if(s)ul(l,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=Bo(e),f!==null){for(n.flags|=128,ul(l,!1),e=f.updateQueue,n.updateQueue=e,Fo(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Qh(r,e),r=r.sibling;return W(gt,gt.current&1|2),$e&&aa(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&yt()>tu&&(n.flags|=128,s=!0,ul(l,!1),n.lanes=4194304)}else{if(!s)if(e=Bo(f),e!==null){if(n.flags|=128,s=!0,e=e.updateQueue,n.updateQueue=e,Fo(n,e),ul(l,!0),l.tail===null&&l.tailMode==="hidden"&&!f.alternate&&!$e)return at(n),null}else 2*yt()-l.renderingStartTime>tu&&r!==536870912&&(n.flags|=128,s=!0,ul(l,!1),n.lanes=4194304);l.isBackwards?(f.sibling=n.child,n.child=f):(e=l.last,e!==null?e.sibling=f:n.child=f,l.last=f)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=yt(),e.sibling=null,r=gt.current,W(gt,s?r&1|2:r&1),$e&&aa(n,l.treeForkCount),e):(at(n),null);case 22:case 23:return cn(n),tc(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(r&536870912)!==0&&(n.flags&128)===0&&(at(n),n.subtreeFlags&6&&(n.flags|=8192)):at(n),r=n.updateQueue,r!==null&&Fo(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==r&&(n.flags|=2048),e!==null&&Z(Sr),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ia(St),at(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function k1(e,n){switch($s(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ia(St),Ge(),e=)DELIM" -R"DELIM(n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return qt(n),null;case 31:if(n.memoizedState!==null){if(cn(n),n.alternate===null)throw Error(o(340));gr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(cn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));gr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Z(gt),null;case 4:return Ge(),null;case 10:return ia(n.type),null;case 22:case 23:return cn(n),tc(),e!==null&&Z(Sr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return ia(St),null;case 25:return null;default:return null}}function yp(e,n){switch($s(n),n.tag){case 3:ia(St),Ge();break;case 26:case 27:case 5:qt(n);break;case 4:Ge();break;case 31:n.memoizedState!==null&&cn(n);break;case 13:cn(n);break;case 19:Z(gt);break;case 10:ia(n.type);break;case 22:case 23:cn(n),tc(),e!==null&&Z(Sr);break;case 24:ia(St)}}function sl(e,n){try{var r=n.updateQueue,l=r!==null?r.lastEffect:null;if(l!==null){var s=l.next;r=s;do{if((r.tag&e)===e){l=void 0;var f=r.create,y=r.inst;l=f(),y.destroy=l}r=r.next}while(r!==s)}}catch(x){Xe(n,n.return,x)}}function ja(e,n,r){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var f=s.next;l=f;do{if((l.tag&e)===e){var y=l.inst,x=y.destroy;if(x!==void 0){y.destroy=void 0,s=n;var R=r,H=x;try{H()}catch(G){Xe(s,R,G)}}}l=l.next}while(l!==f)}}catch(G){Xe(n,n.return,G)}}function vp(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{om(n,r)}catch(l){Xe(e,e.return,l)}}}function gp(e,n,r){r.props=zr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(l){Xe(e,n,l)}}function cl(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof r=="function"?e.refCleanup=r(l):r.current=l}}catch(s){Xe(e,n,s)}}function Yn(e,n){var r=e.ref,l=e.refCleanup;if(r!==null)if(typeof l=="function")try{l()}catch(s){Xe(e,n,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(s){Xe(e,n,s)}else r.current=null}function bp(e){var n=e.type,r=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&l.focus();break e;case"img":r.src?l.src=r.src:r.srcSet&&(l.srcset=r.srcSet)}}catch(s){Xe(e,e.return,s)}}function Dc(e,n,r){try{var l=e.stateNode;ax(l,e.type,r,n),l[de]=n}catch(s){Xe(e,e.return,s)}}function xp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function jc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Za(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kc(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ea));else if(l!==4&&(l===27&&Za(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(kc(e,n,r),e=e.sibling;e!==null;)kc(e,n,r),e=e.sibling}function Jo(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(l!==4&&(l===27&&Za(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Jo(e,n,r),e=e.sibling;e!==null;)Jo(e,n,r),e=e.sibling}function Sp(e){var n=e.stateNode,r=e.memoizedProps;try{for(var l=e.type,s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Lt(n,l,r),n[ce]=e,n[de]=r}catch(f){Xe(e,e.return,f)}}var ca=!1,Et=!1,Lc=!1,_p=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function L1(e,n){if(e=e.containerInfo,af=gu,e=jh(e),As(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var s=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var y=0,x=-1,R=-1,H=0,G=0,K=e,$=null;t:for(;;){for(var Y;K!==r||s!==0&&K.nodeType!==3||(x=y+s),K!==f||l!==0&&K.nodeType!==3||(R=y+l),K.nodeType===3&&(y+=K.nodeValue.length),(Y=K.firstChild)!==null;)$=K,K=Y;for(;;){if(K===e)break t;if($===r&&++H===s&&(x=y),$===f&&++G===l&&(R=y),(Y=K.nextSibling)!==null)break;K=$,$=K.parentNode}K=Y}r=x===-1||R===-1?null:{start:x,end:R}}else r=null}r=r||{start:0,end:0}}else r=null;for(rf={focusedElem:e,selectionRange:r},gu=!1,Mt=n;Mt!==null;)if(n=Mt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Mt=e;else for(;Mt!==null;){switch(n=Mt,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r title"))),Lt(f,l,r),f[ce]=e,rt(f),l=f;break e;case"link":var y=Oy("link","href",s).get(l+(r.href||""));if(y){for(var x=0;xJe&&(y=Je,Je=Te,Te=y);var N=Nh(x,Te),M=Nh(x,Je);if(N&&M&&(Y.rangeCount!==1||Y.anchorNode!==N.node||Y.anchorOffset!==N.offset||Y.focusNode!==M.node||Y.focusOffset!==M.offset)){var U=K.createRange();U.setStart(N.node,N.offset),Y.removeAllRanges(),Te>Je?(Y.addRange(U),Y.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),Y.addRange(U))}}}}for(K=[],Y=x;Y=Y.parentNode;)Y.nodeType===1&&K.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;xr?32:r,w.T=null,r=Qc,Qc=null;var f=Ua,y=pa;if(Rt=0,di=Ua=null,pa=0,(Pe&6)!==0)throw Error(o(331));var x=Pe;if(Pe|=4,Dp(f.current),Mp(f,f.current,y,r),Pe=x,yl(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(ir,f)}catch{}return!0}finally{k.p=s,w.T=l,Jp(e,n)}}function Wp(e,n,r){n=gn(r,n),n=_c(e.stateNode,n,2),e=Ca(e,n,2),e!==null&&(wa(e,2),Gn(e))}function Xe(e,n,r){if(e.tag===3)Wp(e,e,r);else for(;n!==null;){if(n.tag===3){Wp(n,e,r);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ba===null||!Ba.has(l))){e=gn)DELIM" -R"DELIM((r,e),r=ep(2),l=Ca(n,r,2),l!==null&&(tp(r,l,n,e),wa(l,2),Gn(l));break}}n=n.return}}function Vc(e,n,r){var l=e.pingCache;if(l===null){l=e.pingCache=new H1;var s=new Set;l.set(n,s)}else s=l.get(n),s===void 0&&(s=new Set,l.set(n,s));s.has(r)||(Hc=!0,s.add(r),e=Y1.bind(null,e,n,r),n.then(e,e))}function Y1(e,n,r){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,We===e&&(je&r)===r&&(mt===4||mt===3&&(je&62914560)===je&&300>yt()-eu?(Pe&2)===0&&hi(e,0):$c|=r,fi===je&&(fi=0)),Gn(e)}function ey(e,n){n===0&&(n=sr()),e=yr(e,n),e!==null&&(wa(e,n),Gn(e))}function G1(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),ey(e,r)}function P1(e,n){var r=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(n),ey(e,r)}function V1(e,n){return Di(e,n)}var ou=null,pi=null,Xc=!1,uu=!1,Kc=!1,$a=0;function Gn(e){e!==pi&&e.next===null&&(pi===null?ou=pi=e:pi=pi.next=e),uu=!0,Xc||(Xc=!0,K1())}function yl(e,n){if(!Kc&&uu){Kc=!0;do for(var r=!1,l=ou;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var f=0;else{var y=l.suspendedLanes,x=l.pingedLanes;f=(1<<31-Ht(42|e)+1)-1,f&=s&~(y&~x),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,ry(l,f))}else f=je,f=or(l,l===We?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(f&3)===0||ur(l,f)||(r=!0,ry(l,f));l=l.next}while(r);Kc=!1}}function X1(){ty()}function ty(){uu=Xc=!1;var e=0;$a!==0&&ix()&&(e=$a);for(var n=yt(),r=null,l=ou;l!==null;){var s=l.next,f=ny(l,n);f===0?(l.next=null,r===null?ou=s:r.next=s,s===null&&(pi=r)):(r=l,(e!==0||(f&3)!==0)&&(uu=!0)),l=s}Rt!==0&&Rt!==5||yl(e),$a!==0&&($a=0)}function ny(e,n){for(var r=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,f=e.pendingLanes&-62914561;0x)break;var G=R.transferSize,K=R.initiatorType;G&&dy(K)&&(R=R.responseEnd,y+=G*(R"u"?null:document;function Ey(e,n,r){var l=yi;if(l&&typeof n=="string"&&n){var s=yn(n);s='link[rel="'+e+'"][href="'+s+'"]',typeof r=="string"&&(s+='[crossorigin="'+r+'"]'),wy.has(s)||(wy.add(s),e={rel:e,crossOrigin:r,href:n},l.querySelector(s)===null&&(n=l.createElement("link"),Lt(n,"link",e),rt(n),l.head.appendChild(n)))}}function mx(e){ya.D(e),Ey("dns-prefetch",e,null)}function px(e,n){ya.C(e,n),Ey("preconnect",e,n)}function yx(e,n,r){ya.L(e,n,r);var l=yi;if(l&&e&&n){var s='link[rel="preload"][as="'+yn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(s+='[imagesrcset="'+yn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(s+='[imagesizes="'+yn(r.imageSizes)+'"]')):s+='[href="'+yn(e)+'"]';var f=s;switch(n){case"style":f=vi(e);break;case"script":f=gi(e)}En.has(f)||(e=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),En.set(f,e),l.querySelector(s)!==null||n==="style"&&l.querySelector(xl(f))||n==="script"&&l.querySelector(Sl(f))||(n=l.createElement("link"),Lt(n,"link",e),rt(n),l.head.appendChild(n)))}}function vx(e,n){ya.m(e,n);var r=yi;if(r&&e){var l=n&&typeof n.as=="string"?n.as:"script",s='link[rel="modulepreload"][as="'+yn(l)+'"][href="'+yn(e)+'"]',f=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":)DELIM" -R"DELIM(f=gi(e)}if(!En.has(f)&&(e=v({rel:"modulepreload",href:e},n),En.set(f,e),r.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Sl(f)))return}l=r.createElement("link"),Lt(l,"link",e),rt(l),r.head.appendChild(l)}}}function gx(e,n,r){ya.S(e,n,r);var l=yi;if(l&&e){var s=Xt(l).hoistableStyles,f=vi(e);n=n||"default";var y=s.get(f);if(!y){var x={loading:0,preload:null};if(y=l.querySelector(xl(f)))x.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},r),(r=En.get(f))&&df(e,r);var R=y=l.createElement("link");rt(R),Lt(R,"link",e),R._p=new Promise(function(H,G){R.onload=H,R.onerror=G}),R.addEventListener("load",function(){x.loading|=1}),R.addEventListener("error",function(){x.loading|=2}),x.loading|=4,hu(y,n,l)}y={type:"stylesheet",instance:y,count:1,state:x},s.set(f,y)}}}function bx(e,n){ya.X(e,n);var r=yi;if(r&&e){var l=Xt(r).hoistableScripts,s=gi(e),f=l.get(s);f||(f=r.querySelector(Sl(s)),f||(e=v({src:e,async:!0},n),(n=En.get(s))&&hf(e,n),f=r.createElement("script"),rt(f),Lt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(s,f))}}function xx(e,n){ya.M(e,n);var r=yi;if(r&&e){var l=Xt(r).hoistableScripts,s=gi(e),f=l.get(s);f||(f=r.querySelector(Sl(s)),f||(e=v({src:e,async:!0,type:"module"},n),(n=En.get(s))&&hf(e,n),f=r.createElement("script"),rt(f),Lt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(s,f))}}function Ty(e,n,r,l){var s=(s=we.current)?du(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=vi(r.href),r=Xt(s).hoistableStyles,l=r.get(n),l||(l={type:"style",instance:null,count:0,state:null},r.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=vi(r.href);var f=Xt(s).hoistableStyles,y=f.get(e);if(y||(s=s.ownerDocument||s,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=s.querySelector(xl(e)))&&!f._p&&(y.instance=f,y.state.loading=5),En.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},En.set(e,r),f||Sx(s,e,r,y.state))),n&&l===null)throw Error(o(528,""));return y}if(n&&l!==null)throw Error(o(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=gi(r),r=Xt(s).hoistableScripts,l=r.get(n),l||(l={type:"script",instance:null,count:0,state:null},r.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function vi(e){return'href="'+yn(e)+'"'}function xl(e){return'link[rel="stylesheet"]['+e+"]"}function zy(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function Sx(e,n,r,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),Lt(n,"link",r),rt(n),e.head.appendChild(n))}function gi(e){return'[src="'+yn(e)+'"]'}function Sl(e){return"script[async]"+e}function Ry(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+yn(r.href)+'"]');if(l)return n.instance=l,rt(l),l;var s=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),rt(l),Lt(l,"style",s),hu(l,r.precedence,e),n.instance=l;case"stylesheet":s=vi(r.href);var f=e.querySelector(xl(s));if(f)return n.state.loading|=4,n.instance=f,rt(f),f;l=zy(r),(s=En.get(s))&&df(l,s),f=(e.ownerDocument||e).createElement("link"),rt(f);var y=f;return y._p=new Promise(function(x,R){y.onload=x,y.onerror=R}),Lt(f,"link",l),n.state.loading|=4,hu(f,r.precedence,e),n.instance=f;case"script":return f=gi(r.src),(s=e.querySelector(Sl(f)))?(n.instance=s,rt(s),s):(l=r,(s=En.get(f))&&(l=v({},r),hf(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),rt(s),Lt(s,"link",l),e.head.appendChild(s),n.instance=s);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,hu(l,r.precedence,e));return n.instance}function hu(e,n,r){for(var l=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,f=s,y=0;y title"):null)}function _x(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){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"?(e=n.disabled,typeof n.precedence=="string"&&e==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 My(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function wx(e,n,r,l){if(r.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var s=vi(l.href),f=n.querySelector(xl(s));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=pu.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=f,rt(f);return}f=n.ownerDocument||n,l=zy(l),(s=En.get(s))&&df(l,s),f=f.createElement("link"),rt(f);var y=f;y._p=new Promise(function(x,R){y.onload=x,y.onerror=R}),Lt(f,"link",l),r.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=pu.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var mf=0;function Ex(e,n){return e.stylesheets&&e.count===0&&vu(e,e.stylesheets),0mf?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yu=null;function vu(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yu=new Map,n.forEach(Tx,e),yu=null,pu.call(e))}function Tx(e,n){if(!(n.state.loading&4)){var r=yu.get(e);if(r)var l=r.get(null);else{r=new Map,yu.set(e,r);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),wf.exports=qx(),wf.exports}var Yx=Qx();const Gx=Jl(Yx);var Wl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Px={setTimeout:(t,a)=>setTimeout(t,a),clearTimeout:t=>clearTimeout(t),setInterval:(t,a)=>setInterval(t,a),clearInterval:t=>clearInterval(t)},Vx=class{#e=Px;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,a){return this.#e.setTimeout(t,a)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,a){return this.#e.setInterval(t,a)}clearInterval(t){this.#e.clearInterval(t)}},Ar=new Vx;function Xx(t){setTimeout(t,0)}var Dr=typeof window>"u"||"Deno"in globalThis;function tn(){}function Kx(t,a){return typeof t=="function"?)DELIM" -R"DELIM(t(a):t}function ld(t){return typeof t=="number"&&t>=0&&t!==1/0}function Zg(t,a){return Math.max(t+(a||0)-Date.now(),0)}function er(t,a){return typeof t=="function"?t(a):t}function zn(t,a){return typeof t=="function"?t(a):t}function ev(t,a){const{type:i="all",exact:o,fetchStatus:u,predicate:c,queryKey:d,stale:h}=t;if(d){if(o){if(a.queryHash!==Rd(d,a.options))return!1}else if(!Ql(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||u&&u!==a.state.fetchStatus||c&&!c(a))}function tv(t,a){const{exact:i,status:o,predicate:u,mutationKey:c}=t;if(c){if(!a.options.mutationKey)return!1;if(i){if(ql(a.options.mutationKey)!==ql(c))return!1}else if(!Ql(a.options.mutationKey,c))return!1}return!(o&&a.state.status!==o||u&&!u(a))}function Rd(t,a){return(a?.queryKeyHashFn||ql)(t)}function ql(t){return JSON.stringify(t,(a,i)=>ud(i)?Object.keys(i).sort().reduce((o,u)=>(o[u]=i[u],o),{}):i)}function Ql(t,a){return t===a?!0:typeof t!=typeof a?!1:t&&a&&typeof t=="object"&&typeof a=="object"?Object.keys(a).every(i=>Ql(t[i],a[i])):!1}var Fx=Object.prototype.hasOwnProperty;function qg(t,a){if(t===a)return t;const i=nv(t)&&nv(a);if(!i&&!(ud(t)&&ud(a)))return a;const u=(i?t:Object.keys(t)).length,c=i?a:Object.keys(a),d=c.length,h=i?new Array(d):{};let p=0;for(let m=0;m{Ar.setTimeout(a,t)})}function sd(t,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(t,a):i.structuralSharing!==!1?qg(t,a):a}function Ix(t,a,i=0){const o=[...t,a];return i&&o.length>i?o.slice(1):o}function Wx(t,a,i=0){const o=[a,...t];return i&&o.length>i?o.slice(0,-1):o}var Od=Symbol();function Qg(t,a){return!t.queryFn&&a?.initialPromise?()=>a.initialPromise:!t.queryFn||t.queryFn===Od?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function eS(t,a){return typeof t=="function"?t(...a):!!t}var tS=class extends Wl{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!Dr&&window.addEventListener){const a=()=>t();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(t){this.#n=t,this.#t?.(),this.#t=t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(a=>{a(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ad=new tS;function cd(){let t,a;const i=new Promise((u,c)=>{t=u,a=c});i.status="pending",i.catch(()=>{});function o(u){Object.assign(i,u),delete i.resolve,delete i.reject}return i.resolve=u=>{o({status:"fulfilled",value:u}),t(u)},i.reject=u=>{o({status:"rejected",reason:u}),a(u)},i}var nS=Xx;function aS(){let t=[],a=0,i=h=>{h()},o=h=>{h()},u=nS;const c=h=>{a?t.push(h):u(()=>{i(h)})},d=()=>{const h=t;t=[],h.length&&u(()=>{o(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{u=h}}}var Bt=aS(),rS=class extends Wl{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!Dr&&window.addEventListener){const a=()=>t(!0),i=()=>t(!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(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(i=>{i(t)}))}isOnline(){return this.#e}},Yu=new rS;function iS(t){return Math.min(1e3*2**t,3e4)}function Yg(t){return(t??"online")==="online"?Yu.isOnline():!0}var fd=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Gg(t){let a=!1,i=0,o;const u=cd(),c=()=>u.status!=="pending",d=A=>{if(!c()){const B=new fd(A);b(B),t.onCancel?.(B)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>Ad.isFocused()DELIM" -R"DELIM()&&(t.networkMode==="always"||Yu.isOnline())&&t.canRun(),g=()=>Yg(t.networkMode)&&t.canRun(),v=A=>{c()||(o?.(),u.resolve(A))},b=A=>{c()||(o?.(),u.reject(A))},_=()=>new Promise(A=>{o=B=>{(c()||m())&&A(B)},t.onPause?.()}).then(()=>{o=void 0,c()||t.onContinue?.()}),E=()=>{if(c())return;let A;const B=i===0?t.initialPromise:void 0;try{A=B??t.fn()}catch(D){A=Promise.reject(D)}Promise.resolve(A).then(v).catch(D=>{if(c())return;const Q=t.retry??(Dr?0:3),X=t.retryDelay??iS,se=typeof X=="function"?X(i,D):X,ue=Q===!0||typeof Q=="number"&&im()?void 0:_()).then(()=>{a?b(D):E()})})};return{promise:u,status:()=>u.status,cancel:d,continue:()=>(o?.(),u),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?E():_().then(E),u)}}var Pg=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ld(this.gcTime)&&(this.#e=Ar.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Dr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Ar.clearTimeout(this.#e),this.#e=void 0)}},lS=class extends Pg{#e;#t;#n;#r;#a;#o;#l;constructor(t){super(),this.#l=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=iv(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(t){if(this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=iv(this.options);a.data!==void 0&&(this.setState(rv(a.data,a.dataUpdatedAt)),this.#e=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,a){const i=sd(this.state.data,t,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(t,a){this.#i({type:"setState",state:t,setStateOptions:a})}cancel(t){const a=this.#a?.promise;return this.#a?.cancel(t),a?a.then(tn).catch(tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>zn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Od||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>er(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Zg(this.state.dataUpdatedAt,t)}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(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(a=>a!==t),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:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(t,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(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},u=()=>{const h=Qg(this.options,a),m=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(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:u};return o(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=Gg({initialPromise:a?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof fd&&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.options.networkMode,canRun:()DELIM" -R"DELIM()=>!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 fd){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(t){const a=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Vg(i.data,this.options),fetchMeta:t.meta??null};case"success":const o={...i,...rv(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?o:void 0,o;case"error":const u=t.error;return{...i,error:u,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=a(this.state),Bt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function Vg(t,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yg(a.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function rv(t,a){return{data:t,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function iv(t){const a=typeof t.initialData=="function"?t.initialData():t.initialData,i=a!==void 0,o=i?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var oS=class extends Wl{constructor(t,a){super(),this.options=a,this.#e=t,this.#i=null,this.#l=cd(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#o;#l;#i;#p;#d;#h;#s;#c;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),lv(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),a._defaulted&&!od(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&ov(this.#t,i,this.options,a)&&this.#f(),this.updateResult(),o&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||er(this.options.staleTime,this.#t)!==er(a.staleTime,this.#t))&&this.#y();const u=this.#v();o&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||u!==this.#u)&&this.#g(u)}getOptimisticResult(t){const a=this.#e.getQueryCache().build(this.#e,t),i=this.createResult(a,t);return sS(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(t,a){return new Proxy(t,{get:(i,o)=>(this.trackProp(o),a?.(o),o==="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,o))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const a=this.#e.defaultQueryOptions(t),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(t){this.#_();let a=this.#t.fetch(this.options,t);return t?.throwOnError||(a=a.catch(tn)),a}#y(){this.#x();const t=er(this.options.staleTime,this.#t);if(Dr||this.#r.isStale||!ld(t))return;const i=Zg(this.#r.dataUpdatedAt,t)+1;this.#s=Ar.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.optio)DELIM" -R"DELIM(ns.refetchInterval)??!1}#g(t){this.#S(),this.#u=t,!(Dr||zn(this.options.enabled,this.#t)===!1||!ld(this.#u)||this.#u===0)&&(this.#c=Ar.setInterval(()=>{(this.options.refetchIntervalInBackground||Ad.isFocused())&&this.#f()},this.#u))}#b(){this.#y(),this.#g(this.#v())}#x(){this.#s&&(Ar.clearTimeout(this.#s),this.#s=void 0)}#S(){this.#c&&(Ar.clearInterval(this.#c),this.#c=void 0)}createResult(t,a){const i=this.#t,o=this.options,u=this.#r,c=this.#a,d=this.#o,p=t!==i?t.state:this.#n,{state:m}=t;let g={...m},v=!1,b;if(a._optimisticResults){const I=this.hasListeners(),ie=!I&&lv(t,a),V=I&&ov(t,i,a,o);(ie||V)&&(g={...g,...Vg(m.data,t.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:_,errorUpdatedAt:E,status:A}=g;b=g.data;let B=!1;if(a.placeholderData!==void 0&&b===void 0&&A==="pending"){let I;u?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(I=u.data,B=!0):I=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,I!==void 0&&(A="success",b=sd(u?.data,I,a),v=!0)}if(a.select&&b!==void 0&&!B)if(u&&b===c?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=sd(u?.data,b,a),this.#d=b,this.#i=null}catch(I){this.#i=I}this.#i&&(_=this.#i,b=this.#d,E=Date.now(),A="error");const D=g.fetchStatus==="fetching",Q=A==="pending",X=A==="error",se=Q&&D,ue=b!==void 0,C={status:A,fetchStatus:g.fetchStatus,isPending:Q,isSuccess:A==="success",isError:X,isInitialLoading:se,isLoading:se,data:b,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:D,isRefetching:D&&!Q,isLoadingError:X&&!ue,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:X&&ue,isStale:Md(t,a),refetch:this.refetch,promise:this.#l,isEnabled:zn(a.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=ee=>{C.status==="error"?ee.reject(C.error):C.data!==void 0&&ee.resolve(C.data)},ie=()=>{const ee=this.#l=C.promise=cd();I(ee)},V=this.#l;switch(V.status){case"pending":t.queryHash===i.queryHash&&I(V);break;case"fulfilled":(C.status==="error"||C.data!==V.value)&&ie();break;case"rejected":(C.status!=="error"||C.error!==V.reason)&&ie();break}}return C}updateResult(){const t=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),od(a,t))return;this.#r=a;const i=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,u=typeof o=="function"?o():o;if(u==="all"||!u&&!this.#m.size)return!0;const c=new Set(u??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#r).some(d=>{const h=d;return this.#r[h]!==t[h]&&c.has(h)})};this.#w({listeners:i()})}#_(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const a=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(a?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uS(t,a){return zn(a.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&a.retryOnMount===!1)}function lv(t,a){return uS(t,a)||t.state.data!==void 0&&dd(t,a,a.refetchOnMount)}function dd(t,a,i){if(zn(a.enabled,t)!==!1&&er(a.staleTime,t)!=="static"){const o=typeof i=="function"?i(t):i;return o==="always"||o!==!1&&Md(t,a)}return!1}function ov(t,a,i,o){return(t!==a||zn(o.enabled,t)===!1)&&(!i.suspense||t.state.status!=="error")&&Md(t,i)}function Md(t,a){return zn(a.enabled,t)!==!1&&t.isStaleByTime(er(a.staleTime,t))}function sS(t,a){return!od(t.getCurrentResult(),a)}function uv(t){return{onFetch:(a,i)=>{const o=a.options,u=a.fetchOptions?.meta?.fetchMore?.direction,c=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)})},b=Qg(a.options,a.fetchOptions),_=async(E,A,B)=>{if(g)return Promise.reject();if(A==null&&E.pages.length)return Promise.resolve(E);const Q=(()=>{const me={client:a.client,queryKey:a.queryKey,pageParam:A,direction:B?"backward":"forward",meta:a.options.meta};return v(me),me})(),X=await b(Q),{maxPages:se}=a.options,ue=B?Wx:Ix;return{pages:ue(E.pages,X,se),pageParams:ue(E.pageParams,A,se)}};if(u&&c.length){const E=u==="backward",A=E?cS:sv,B={pages:c,pageParams:d},D=A(o,B);h=await _(B,D,E)}else{const E=t??c.length;do{const A=p===0?d[0]??o.initialPageParam:sv(o,h);if(p>0&&A==null)break;h=await _(h,A),p++}while(pa.options.persister?.(m,{cli)DELIM" -R"DELIM(ent:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function sv(t,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?t.getNextPageParam(a[o],a,i[o],i):void 0}function cS(t,{pages:a,pageParams:i}){return a.length>0?t.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var fS=class extends Pg{#e;#t;#n;#r;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||dS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(a=>a!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}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(t){const a=()=>{this.#a({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Gg({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#a({type:"failed",failureCount:c,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 o=this.state.status==="pending",u=!this.#r.canStart();try{if(o)a();else{this.#a({type:"pending",variables:t,isPaused:u}),await this.#n.config.onMutate?.(t,this,i);const d=await this.options.onMutate?.(t,i);d!==this.state.context&&this.#a({type:"pending",context:d,variables:t,isPaused:u})}const c=await this.#r.start();return await this.#n.config.onSuccess?.(c,t,this.state.context,this,i),await this.options.onSuccess?.(c,t,this.state.context,i),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(c,null,t,this.state.context,i),this.#a({type:"success",data:c}),c}catch(c){try{throw await this.#n.config.onError?.(c,t,this.state.context,this,i),await this.options.onError?.(c,t,this.state.context,i),await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,c,t,this.state.context,i),c}finally{this.#a({type:"error",error:c})}}finally{this.#n.runNext(this)}}#a(t){const a=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Bt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function dS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hS=class extends Wl{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,a,i){const o=new fS({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(a),state:i});return this.add(o),o}add(t){this.#e.add(t);const a=Tu(t);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(t):this.#t.set(a,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const a=Tu(t);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const o=i.indexOf(t);o!==-1&&i.splice(o,1)}else i[0]===t&&this.#t.delete(a)}}this.notify({type:"removed",mutation:t})}canRun(t){const a=Tu(t);if(typeof a=="string"){const o=this.#t.get(a)?.find(u=>u.state.status==="pending");return!o||o===t}else return!0}runNext(t){const a=Tu(t);return typeof a=="string"?this.#t.get(a)?.find(o=>o!==t&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bt.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const a={exact:!0,...t};return this.getAll().find(i=>tv(a,i))}findAll(t={}){return this.getAll().filter(a=>tv(t,a))}notify(t){Bt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}resumePausedMutations(){const t=this.getAll().filter(a=>a.state.isPaused);return Bt.batch(()=>Promise.all(t.map(a=>a.continue().catch(tn))))}};function Tu(t){return t.options.scope?.id}var mS=class extends Wl{constructor(t={}){super(),this.co)DELIM" -R"DELIM(nfig=t,this.#e=new Map}#e;build(t,a,i){const o=a.queryKey,u=a.queryHash??Rd(o,a);let c=this.get(u);return c||(c=new lS({client:t,queryKey:o,queryHash:u,options:t.defaultQueryOptions(a),state:i,defaultOptions:t.getQueryDefaults(o)}),this.add(c)),c}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const a=this.#e.get(t.queryHash);a&&(t.destroy(),a===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const a={exact:!0,...t};return this.getAll().find(i=>ev(a,i))}findAll(t={}){const a=this.getAll();return Object.keys(t).length>0?a.filter(i=>ev(t,i)):a}notify(t){Bt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},pS=class{#e;#t;#n;#r;#a;#o;#l;#i;constructor(t={}){this.#e=t.queryCache||new mS,this.#t=t.mutationCache||new hS,this.#n=t.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#l=Ad.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Yu.subscribe(async t=>{t&&(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(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const a=this.defaultQueryOptions({queryKey:t});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(t){const a=this.defaultQueryOptions(t),i=this.#e.build(this,a),o=i.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&i.isStaleByTime(er(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(t,a,i){const o=this.defaultQueryOptions({queryKey:t}),c=this.#e.get(o.queryHash)?.state.data,d=Kx(a,c);if(d!==void 0)return this.#e.build(this,o).setData(d,{...i,manual:!0})}setQueriesData(t,a,i){return Bt.batch(()=>this.#e.findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(t){const a=this.defaultQueryOptions({queryKey:t});return this.#e.get(a.queryHash)?.state}removeQueries(t){const a=this.#e;Bt.batch(()=>{a.findAll(t).forEach(i=>{a.remove(i)})})}resetQueries(t,a){const i=this.#e;return Bt.batch(()=>(i.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...t},a)))}cancelQueries(t,a={}){const i={revert:!0,...a},o=Bt.batch(()=>this.#e.findAll(t).map(u=>u.cancel(i)));return Promise.all(o).then(tn).catch(tn)}invalidateQueries(t,a={}){return Bt.batch(()=>(this.#e.findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},a)))}refetchQueries(t,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},o=Bt.batch(()=>this.#e.findAll(t).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let c=u.fetch(void 0,i);return i.throwOnError||(c=c.catch(tn)),u.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(o).then(tn)}fetchQuery(t){const a=this.defaultQueryOptions(t);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(er(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tn).catch(tn)}fetchInfiniteQuery(t){return t.behavior=uv(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tn).catch(tn)}ensureInfiniteQueryData(t){return t.behavior=uv(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Yu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,a){this.#r.set(ql(t),{queryKey:t,defaultOptions:a})}getQueryDefaults(t){const a=[...this.#r.values()],i={};return a.forEach(o=>{Ql(t,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(t,a){this.#a.set(ql(t),{mutationKey:t,defaultOptions:a})}getMutationDefaults(t){const a=[...this.#a.values()],i={};return a.forEach(o=>{Ql(t,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const a={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return a.queryHash||(a.queryHash=Rd(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===Od&&(a.enabled=!1),a}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_d)DELIM" -R"DELIM(efaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Xg=O.createContext(void 0),Kg=t=>{const a=O.useContext(Xg);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},yS=({client:t,children:a})=>(O.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(Xg.Provider,{value:t,children:a})),Fg=O.createContext(!1),vS=()=>O.useContext(Fg);Fg.Provider;function gS(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var bS=O.createContext(gS()),xS=()=>O.useContext(bS),SS=(t,a)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(a.isReset()||(t.retryOnMount=!1))},_S=t=>{O.useEffect(()=>{t.clearReset()},[t])},wS=({result:t,errorResetBoundary:a,throwOnError:i,query:o,suspense:u})=>t.isError&&!a.isReset()&&!t.isFetching&&o&&(u&&t.data===void 0||eS(i,[t.error,o])),ES=t=>{if(t.suspense){const i=u=>u==="static"?u:Math.max(u??1e3,1e3),o=t.staleTime;t.staleTime=typeof o=="function"?(...u)=>i(o(...u)):i(o),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},TS=(t,a)=>t.isLoading&&t.isFetching&&!a,zS=(t,a)=>t?.suspense&&a.isPending,cv=(t,a,i)=>a.fetchOptimistic(t).catch(()=>{i.clearReset()});function RS(t,a,i){const o=vS(),u=xS(),c=Kg(),d=c.defaultQueryOptions(t);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=o?"isRestoring":"optimistic",ES(d),SS(d,u),_S(u);const h=!c.getQueryCache().get(d.queryHash),[p]=O.useState(()=>new a(c,d)),m=p.getOptimisticResult(d),g=!o&&t.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(v=>{const b=g?p.subscribe(Bt.batchCalls(v)):tn;return p.updateResult(),b},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),O.useEffect(()=>{p.setOptions(d)},[d,p]),zS(d,m))throw cv(d,p,u);if(wS({result:m,errorResetBoundary:u,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Dr&&TS(m,o)&&(h?cv(d,p,u):c.getQueryCache().get(d.queryHash)?.promise)?.catch(tn).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function xa(t,a){return RS(t,oS)}const OS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let fv=(t=21)=>{let a="",i=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)a+=OS[i[t]&63];return a};var ku={exports:{}},AS=ku.exports,dv;function MS(){return dv||(dv=1,(function(t,a){(function(i,o){t.exports=o()})(AS,(function(){var i=1e3,o=6e4,u=36e5,c="millisecond",d="second",h="minute",p="hour",m="day",g="week",v="month",b="quarter",_="year",E="date",A="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|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,Q={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(ne){var J=["th","st","nd","rd"],w=ne%100;return"["+ne+(J[(w-20)%10]||J[w]||J[0])+"]"}},X=function(ne,J,w){var k=String(ne);return!k||k.length>=J?ne:""+Array(J+1-k.length).join(w)+ne},se={s:X,z:function(ne){var J=-ne.utcOffset(),w=Math.abs(J),k=Math.floor(w/60),L=w%60;return(J<=0?"+":"-")+X(k,2,"0")+":"+X(L,2,"0")},m:function ne(J,w){if(J.date()1)return ne(le[0])}else{var T=J.name;me[T]=J,L=T}return!k&&L&&(ue=L),L||!k&&ue},V=function(ne,J){if(I(ne))return ne.clone();var w=typeof J=="object"?J:{};return w.date=ne,w.args=arguments,new _e(w)},ee=se;ee.l=ie,ee.i=I,ee.w=function(ne,J){return V(ne,{locale:J.$L,utc:J.$u,x:J.$x,$offset:J.$offset})};var _e=(function(){function ne(w){this.$L=ie(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[C]=!0}var J=ne.prototype;return J.parse=function(w){this.$d=(function(k){var L=k.date,ae=k.utc;if(L===null)return new Date(NaN);if(ee.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var le=L.match(B);if(le){var T=le[2]-1||0,Z=(le[7]||"0").substring(0,3);return ae?new Date(Date.UTC(le[1],T,le[3]||1,le[4]||0,le[5]||0,le[6]||0,Z)):new Date(le[1],T,le[3]||1,le[4]||0,le[5]||0,le[6]||0,Z)}}return new Date(L)})(w),this.init()},J.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.get)DELIM" -R"DELIM(Date(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},J.$utils=function(){return ee},J.isValid=function(){return this.$d.toString()!==A},J.isSame=function(w,k){var L=V(w);return this.startOf(k)<=L&&L<=this.endOf(k)},J.isAfter=function(w,k){return V(w)-1&&w%1==0&&w0?k[Q(0,L-1)]:void 0}function me(w){return ie(w)&&g.call(w,"callee")&&(!b.call(w,"callee")||v.call(w)==a)}var C=Array.isArray;function I(w){return w!=null&&ee(w.length)&&!V(w)}function ie(w){return Oe(w)&&I(w)}function V(w){var k=_e(w)?v.call(w):"";return k==i||k==o}function ee(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=t}function _e(w){var k=typeof w;return!!w&&(k=="object"||k=="function")}function Oe(w){return!!w&&typeof w=="object"}function ne(w){return I(w)?B(w):D(w)}function J(w){return w?h(w,ne(w)):[]}return Rf=ue,Rf}var DS=NS();const jS=Jl(DS);function eo(t){if(!t)return;const a=t.toLowerCase(),i=a.indexOf("1");if(i>0){const u=a.slice(0,i);if(["bc","tb","bcrt","ltc","sb"].includes(u)){const c=a.slice(i+1),d=c.charAt(0);return d==="p"?"p2tr":d==="q"?c.length===39||c.length===40||t.length===42?"p2wpkh":c.length===59||c.length===60||t.length===62?"p2wsh":"segwit":"segwit"}}switch(a[0]){case"1":case"m":case"n":return"p2pkh";case"3":case"2":return"p2sh";default:return}}const kl=new Set;let Of=0;function mv(t){for(const a of kl)a(t)}const Ig=Jg().subtract(2,"hour").unix(),Ai=Array.from({length:20}).map((t,a)=>{const i=`mock-tx-${a.toString().padStart(4,"0")}`,o=[{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:Ig+a*60,feeSats:250+a,feeRate:12+a*.1,size:225+a,weight:900+a*4,version:2,locktime:0,totalInput:1005e3,totalOutput:o.reduce((u,c)=>u+c.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:o}}),ba=[];for(let t=0;t<6;t+=1){const a=8e5+t,i=`mock-block-${String(a)}`,o=Ai.slice(t*3,t*3+3);ba.push({hash:i,height:a,timestamp:Ig+t*600,txCount:o.length,size:12e5,weight:4e6,difficulty:5e10,previousBlockHash:t===0?null:ba[t-1]?.hash,merkleRoot:`mock-merkle-${String(t)}`,nonce:1e3+t,bits:486604799,version:2,nextBlockHash:null,transactions:o}),t>0&&(ba[t-1].nextBlockHash=i)}const kS={bcrt1qmock0:{address:"bcrt1qmock0",addressType:eo("bcrt1qmock0"),balance:2345678,totalReceived:5e6,totalSent:2654322,txCount:5,utxoCount:3,transactions:Ai.slice(0,5).map(t=>({txid:t.txid,timestamp:t.receivedTime,valueChange:t.outputs[0]?.valueSats??0,blockHeight:t.blockHeight}))}};function Af(t){if(t==="latest"){const i=ba.at(-1);if(!i)throw new Error("No blocks available");return i}const a=ba.find(i=>i.hash===t||i.height.toString()===t);if(!a)throw new Error("Block not found");return a}function Cd(t){return kS[t]??{address:t,addressType:eo(t),balance:0,totalReceived:0,totalSent:0,txCount:0,utxoCount:0,transactions:[]}}function LS(t){const{transactions:a,...i}=Cd(t);return i}function BS(t,a){const i=Cd(t),o=10,u=a?i.transactions.findIndex(c=>c.txid===a)+1:0;return u<=0&&a?[]:i.transactions.slice(u,u+o)}function Mf(){return{metadata:{id:"mock",label:"Mock data (offline)",type:"mock",connectionState:"connected",supportsWebsocket:!0,endpoint:"offline",description:"Generates synthetic blockchain data for development."},getLatestBlocks(t=10){const a=[...ba].reverse().slice(0,t).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(t){const{transactions:a,...i}=Af(t);return Promise.resolve(i)},getBlock(t){return Promise.resolve(Af(t))},getBlocksBefore(t,a=10){const i=ba.filter(o=>o.height<=t).reverse().slice(0,a).map(o=>({hash:o.hash,height:o.height,timestamp:o.timestamp,txCount:o.txCount,size:o.size,weight:o.weight,difficulty:o.difficulty,previousBlockHash:o.previousBlockHash}));return Promise.resolve(i))DELIM" -R"DELIM(},getBlockTransactions(t,a=0){const i=Af(t);return Promise.resolve(i.transactions.slice(a,a+25))},getTransactionHeader(t){const a=Ai.find(i=>i.txid===t||i.hash===t);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getTransaction(t){const a=Ai.find(i=>i.txid===t||i.hash===t);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getAddressSummary(t){return Promise.resolve(LS(t))},getAddress(t){return Promise.resolve(Cd(t))},getAddressTransactions(t,a){return Promise.resolve(BS(t,a))},subscribeToEvents(t){return kl.add(t),kl.size===1&&US(),()=>{kl.delete(t),kl.size===0&&HS()}}}}let $l=null;function US(){$l||($l=setInterval(()=>{const t=ZS();ba.push(t),mv({type:"block.new",payload:$S(t)});const a=jS(Ai);a&&mv({type:"tx.new",payload:a})},15e3))}function HS(){$l&&(clearInterval($l),$l=null)}function $S(t){return{hash:t.hash,height:t.height,timestamp:t.timestamp,txCount:t.txCount,size:t.size,weight:t.weight,difficulty:t.difficulty,previousBlockHash:t.previousBlockHash}}function ZS(){Of+=1;const t=ba.at(-1);if(!t)throw new Error("No blocks available");const a=t.height+1,i=`mock-block-${String(a)}-${fv(6)}`,o=Jg().unix(),u=Ai.slice(0,2).map(d=>({...d,blockHash:i,blockHeight:a})),c={hash:i,height:a,timestamp:o,txCount:u.length,size:12e5+Of*1e3,weight:4e6,difficulty:5e10,previousBlockHash:t.hash,merkleRoot:`mock-merkle-${fv(10)}`,nonce:1e3+Of,bits:486604799,version:2,nextBlockHash:null,transactions:u};return t.nextBlockHash=i,c}function F(t,a,i){function o(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(t))return;h._zod.traits.add(t),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(t)}),Object.defineProperty(d,"name",{value:t}),d}class zi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Wg extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const e0={};function jr(t){return e0}function t0(t){const a=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,u])=>a.indexOf(+o)===-1).map(([o,u])=>u)}function hd(t,a){return typeof a=="bigint"?a.toString():a}function Nd(t){return{get value(){{const a=t();return Object.defineProperty(this,"value",{value:a}),a}}}}function Dd(t){return t==null}function jd(t){const a=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(a,i)}function qS(t,a){const i=(t.toString().split(".")[1]||"").length,o=a.toString();let u=(o.split(".")[1]||"").length;if(u===0&&/\d?e-\d?/.test(o)){const p=o.match(/\d?e-(\d?)/);p?.[1]&&(u=Number.parseInt(p[1]))}const c=i>u?i:u,d=Number.parseInt(t.toFixed(c).replace(".","")),h=Number.parseInt(a.toFixed(c).replace(".",""));return d%h/10**c}const pv=Symbol("evaluating");function tt(t,a,i){let o;Object.defineProperty(t,a,{get(){if(o!==pv)return o===void 0&&(o=pv,o=i()),o},set(u){Object.defineProperty(t,a,{value:u})},configurable:!0})}function Lr(t,a,i){Object.defineProperty(t,a,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Br(...t){const a={};for(const i of t){const o=Object.getOwnPropertyDescriptors(i);Object.assign(a,o)}return Object.defineProperties({},a)}function yv(t){return JSON.stringify(t)}function QS(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const n0="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Gu(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const YS=Nd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Yl(t){if(Gu(t)===!1)return!1;const a=t.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Gu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function a0(t){return Yl(t)?{...t}:Array.isArray(t)?[...t]:t}const GS=new Set(["string","number","symbol"]);function es(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tr(t,a,i){const o=new t._zod.constr(a??t._zod.def);return(!a||i?.parent)&&(o._zod.parent=t),o}function Se(t){const a=t;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 PS(t){return Object.keys(t).filter)DELIM" -R"DELIM((a=>t[a]._zod.optin==="optional"&&t[a]._zod.optout==="optional")}const VS={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 XS(t,a){const i=t._zod.def,o=Br(t._zod.def,{get shape(){const u={};for(const c in a){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);a[c]&&(u[c]=i.shape[c])}return Lr(this,"shape",u),u},checks:[]});return tr(t,o)}function KS(t,a){const i=t._zod.def,o=Br(t._zod.def,{get shape(){const u={...t._zod.def.shape};for(const c in a){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);a[c]&&delete u[c]}return Lr(this,"shape",u),u},checks:[]});return tr(t,o)}function FS(t,a){if(!Yl(a))throw new Error("Invalid input to extend: expected a plain object");const i=t._zod.def.checks;if(i&&i.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const u=Br(t._zod.def,{get shape(){const c={...t._zod.def.shape,...a};return Lr(this,"shape",c),c},checks:[]});return tr(t,u)}function JS(t,a){if(!Yl(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i={...t._zod.def,get shape(){const o={...t._zod.def.shape,...a};return Lr(this,"shape",o),o},checks:t._zod.def.checks};return tr(t,i)}function IS(t,a){const i=Br(t._zod.def,{get shape(){const o={...t._zod.def.shape,...a._zod.def.shape};return Lr(this,"shape",o),o},get catchall(){return a._zod.def.catchall},checks:[]});return tr(t,i)}function WS(t,a,i){const o=Br(a._zod.def,{get shape(){const u=a._zod.def.shape,c={...u};if(i)for(const d in i){if(!(d in u))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=t?new t({type:"optional",innerType:u[d]}):u[d])}else for(const d in u)c[d]=t?new t({type:"optional",innerType:u[d]}):u[d];return Lr(this,"shape",c),c},checks:[]});return tr(a,o)}function e2(t,a,i){const o=Br(a._zod.def,{get shape(){const u=a._zod.def.shape,c={...u};if(i)for(const d in i){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=new t({type:"nonoptional",innerType:u[d]}))}else for(const d in u)c[d]=new t({type:"nonoptional",innerType:u[d]});return Lr(this,"shape",c),c},checks:[]});return tr(a,o)}function Ei(t,a=0){if(t.aborted===!0)return!0;for(let i=a;i{var o;return(o=i).path??(o.path=[]),i.path.unshift(t),i})}function zu(t){return typeof t=="string"?t:t?.message}function kr(t,a,i){const o={...t,path:t.path??[]};if(!t.message){const u=zu(t.inst?._zod.def?.error?.(t))??zu(a?.error?.(t))??zu(i.customError?.(t))??zu(i.localeError?.(t))??"Invalid input";o.message=u}return delete o.inst,delete o.continue,a?.reportInput||delete o.input,o}function kd(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Gl(...t){const[a,i,o]=t;return typeof a=="string"?{message:a,code:"custom",input:i,inst:o}:{...a}}const i0=(t,a)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:a,enumerable:!1}),t.message=JSON.stringify(a,hd,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},l0=F("$ZodError",i0),o0=F("$ZodError",i0,{Parent:Error});function t2(t,a=i=>i.message){const i={},o=[];for(const u of t.issues)u.path.length>0?(i[u.path[0]]=i[u.path[0]]||[],i[u.path[0]].push(a(u))):o.push(a(u));return{formErrors:o,fieldErrors:i}}function n2(t,a=i=>i.message){const i={_errors:[]},o=u=>{for(const c of u.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>o({issues:d}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)i._errors.push(a(c));else{let d=i,h=0;for(;h(a,i,o,u)=>{const c=o?Object.assign(o,{async:!1}):{async:!1},d=a._zod.run({value:i,issues:[]},c);if(d instanceof Promise)throw new zi;if(d.issues.length){const h=new(u?.Err??t)(d.issues.map(p=>kr(p,c,jr())));throw n0(h,u?.callee),h}return d.value},Bd=t=>async(a,i,o,u)=>{const c=o?Object.assign(o,{async:!0}):{async:!0};let d=a._zod.run({value:i,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const h=new(u?.Err??t)(d.issues.map(p=>kr(p,c,jr())));throw n0(h,u?.callee),h}return d.value},ts=t=>(a,i,o)=>{const u=o?{...o,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new zi;return c.issues.length?{success:!1,error:new(t??l0)(c.issues.map(d=>kr(d,u,jr())))}:{success:!0,data:c.value}},a2=ts(o0),ns=t=>async(a,i,o)=>{const u=o?Object.assign(o,{async:!0}):{async:!0};let c=a._zod.run({value:i,issues:[]},u);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new t(c.issues.map)DELIM" -R"DELIM((d=>kr(d,u,jr())))}:{success:!0,data:c.value}},r2=ns(o0),i2=t=>(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ld(t)(a,i,u)},l2=t=>(a,i,o)=>Ld(t)(a,i,o),o2=t=>async(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Bd(t)(a,i,u)},u2=t=>async(a,i,o)=>Bd(t)(a,i,o),s2=t=>(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ts(t)(a,i,u)},c2=t=>(a,i,o)=>ts(t)(a,i,o),f2=t=>async(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ns(t)(a,i,u)},d2=t=>async(a,i,o)=>ns(t)(a,i,o),h2=/^[cC][^\s-]{8,}$/,m2=/^[0-9a-z]+$/,p2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,y2=/^[0-9a-vA-V]{20}$/,v2=/^[A-Za-z0-9]{27}$/,g2=/^[a-zA-Z0-9_-]{21}$/,b2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,x2=/^([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})$/,vv=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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,}$/,_2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function w2(){return new RegExp(_2,"u")}const E2=/^(?:(?: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])$/,T2=/^(([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}|:))$/,z2=/^((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])$/,R2=/^(([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])$/,O2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,u0=/^[A-Za-z0-9_-]*$/,A2=/^\+(?:[0-9]){6,14}[0-9]$/,s0="(?:(?:\\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])))",M2=new RegExp(`^${s0}$`);function c0(t){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${a}`:t.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${t.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function C2(t){return new RegExp(`^${c0(t)}$`)}function N2(t){const a=c0({precision:t.precision}),i=["Z"];t.local&&i.push(""),t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${a}(?:${i.join("|")})`;return new RegExp(`^${s0}T(?:${o})$`)}const D2=t=>{const a=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},j2=/^-?\d+$/,k2=/^-?\d+(?:\.\d+)?/,L2=/^(?:true|false)$/i,B2=/^[^A-Z]*$/,U2=/^[^a-z]*$/,an=F("$ZodCheck",(t,a)=>{var i;t._zod??(t._zod={}),t._zod.def=a,(i=t._zod).onattach??(i.onattach=[])}),f0={number:"number",bigint:"bigint",object:"date"},d0=F("$ZodCheckLessThan",(t,a)=>{an.init(t,a);const i=f0[typeof a.value];t._zod.onattach.push(o=>{const u=o._zod.bag,c=(a.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?o.value<=a.value:o.value{an.init(t,a);const i=f0[typeof a.value];t._zod.onattach.push(o=>{const u=o._zod.bag,c=(a.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>c&&(a.inclusive?u.minimum=a.value:u.exclusiveMinimum=a.value)}),t._zod.check=o=>{(a.inclusive?o.value>=a.value:o.value>a.value)||o.issues.push({origin:i,code:"too_small",minimum:a.value,input:o.value,inclusive:a.inclusive,inst:t,continue:!a.abort})}}),H2=F("$ZodCheckMultipleOf",(t,a)=>{an.init(t,a),t._zod.onattach.push(i=>{var o;(o=i._zod.bag).multipleOf??(o.multipleOf=a.value)}),t._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):qS(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:t,continue:!a.abort})}}),$2=F("$ZodCheckNumberFormat",(t,a)=>{an.init(t,a),a.format=a.format||"float64";const i=a.format?.includes("int"),o=i?"int":"number",[u,c]=VS[a.format];t._zod.onattach.push(d=>{const h=d._zod.bag;h.format=a.format,h.minim)DELIM" -R"DELIM(um=u,h.maximum=c,i&&(h.pattern=j2)}),t._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:o,format:a.format,code:"invalid_type",continue:!1,input:h,inst:t});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:t,origin:o,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:t,origin:o,continue:!a.abort});return}}hc&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inst:t})}}),Z2=F("$ZodCheckMaxLength",(t,a)=>{var i;an.init(t,a),(i=t._zod.def).when??(i.when=o=>{const u=o.value;return!Dd(u)&&u.length!==void 0}),t._zod.onattach.push(o=>{const u=o._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const u=o.value;if(u.length<=a.maximum)return;const d=kd(u);o.issues.push({origin:d,code:"too_big",maximum:a.maximum,inclusive:!0,input:u,inst:t,continue:!a.abort})}}),q2=F("$ZodCheckMinLength",(t,a)=>{var i;an.init(t,a),(i=t._zod.def).when??(i.when=o=>{const u=o.value;return!Dd(u)&&u.length!==void 0}),t._zod.onattach.push(o=>{const u=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>u&&(o._zod.bag.minimum=a.minimum)}),t._zod.check=o=>{const u=o.value;if(u.length>=a.minimum)return;const d=kd(u);o.issues.push({origin:d,code:"too_small",minimum:a.minimum,inclusive:!0,input:u,inst:t,continue:!a.abort})}}),Q2=F("$ZodCheckLengthEquals",(t,a)=>{var i;an.init(t,a),(i=t._zod.def).when??(i.when=o=>{const u=o.value;return!Dd(u)&&u.length!==void 0}),t._zod.onattach.push(o=>{const u=o._zod.bag;u.minimum=a.length,u.maximum=a.length,u.length=a.length}),t._zod.check=o=>{const u=o.value,c=u.length;if(c===a.length)return;const d=kd(u),h=c>a.length;o.issues.push({origin:d,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!a.abort})}}),as=F("$ZodCheckStringFormat",(t,a)=>{var i,o;an.init(t,a),t._zod.onattach.push(u=>{const c=u._zod.bag;c.format=a.format,a.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(a.pattern))}),a.pattern?(i=t._zod).check??(i.check=u=>{a.pattern.lastIndex=0,!a.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:a.format,input:u.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:t,continue:!a.abort})}):(o=t._zod).check??(o.check=()=>{})}),Y2=F("$ZodCheckRegex",(t,a)=>{as.init(t,a),t._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:t,continue:!a.abort})}}),G2=F("$ZodCheckLowerCase",(t,a)=>{a.pattern??(a.pattern=B2),as.init(t,a)}),P2=F("$ZodCheckUpperCase",(t,a)=>{a.pattern??(a.pattern=U2),as.init(t,a)}),V2=F("$ZodCheckIncludes",(t,a)=>{an.init(t,a);const i=es(a.includes),o=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=o,t._zod.onattach.push(u=>{const c=u._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(o)}),t._zod.check=u=>{u.value.includes(a.includes,a.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:u.value,inst:t,continue:!a.abort})}}),X2=F("$ZodCheckStartsWith",(t,a)=>{an.init(t,a);const i=new RegExp(`^${es(a.prefix)}.*`);a.pattern??(a.pattern=i),t._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(i)}),t._zod.check=o=>{o.value.startsWith(a.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:o.value,inst:t,continue:!a.abort})}}),K2=F("$ZodCheckEndsWith",(t,a)=>{an.init(t,a);const i=new RegExp(`.*${es(a.suffix)}$`);a.pattern??(a.pattern=i),t._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(i)}),t._zod.check=o=>{o.value.endsWith(a.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:o.value,inst:t,continue:!a.abort})}}),F2=F("$ZodCheckOverwrite",(t,a)=>{an.init(t,a),t._zod.check=i=>{i.value=a.tx(i.value)}});class J2{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 o=a.split(` -`).filter(d=>d),u=Math.min(...o.map(d=>d.length-d.trimStart().length)),c=o.map(d=>d.slice(u)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const a=Function,i=this?.args,u=[...(this?.content??[""]).map(c=>` ${c}`)];return new a(...i,u.join(` -`))}}const I2={major:4,minor:2,patch:1},xt=F("$ZodType",(t,a)=>{var i;t??(t={}),t._zod.def=a,t._zod.bag=t._zod.bag||{},t._zod.version=I2;const o=[)DELIM" -R"DELIM(...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(const u of o)for(const c of u._zod.onattach)c(t);if(o.length===0)(i=t._zod).deferred??(i.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const u=(d,h,p)=>{let m=Ei(d),g;for(const v of h){if(v._zod.def.when){if(!v._zod.def.when(d))continue}else if(m)continue;const b=d.issues.length,_=v._zod.check(d);if(_ instanceof Promise&&p?.async===!1)throw new zi;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,d.issues.length!==b&&(m||(m=Ei(d,b)))});else{if(d.issues.length===b)continue;m||(m=Ei(d,b))}}return g?g.then(()=>d):d},c=(d,h,p)=>{if(Ei(d))return d.aborted=!0,d;const m=u(h,o,p);if(m instanceof Promise){if(p.async===!1)throw new zi;return m.then(g=>t._zod.parse(g,p))}return t._zod.parse(m,p)};t._zod.run=(d,h)=>{if(h.skipChecks)return t._zod.parse(d,h);if(h.direction==="backward"){const m=t._zod.parse({value:d.value,issues:[]},{...h,skipChecks:!0});return m instanceof Promise?m.then(g=>c(g,d,h)):c(m,d,h)}const p=t._zod.parse(d,h);if(p instanceof Promise){if(h.async===!1)throw new zi;return p.then(m=>u(m,o,h))}return u(p,o,h)}}t["~standard"]={validate:u=>{try{const c=a2(t,u);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return r2(t,u).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}}),Ud=F("$ZodString",(t,a)=>{xt.init(t,a),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??D2(t._zod.bag),t._zod.parse=(i,o)=>{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:t}),i}}),lt=F("$ZodStringFormat",(t,a)=>{as.init(t,a),Ud.init(t,a)}),W2=F("$ZodGUID",(t,a)=>{a.pattern??(a.pattern=x2),lt.init(t,a)}),e_=F("$ZodUUID",(t,a)=>{if(a.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(o===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=vv(o))}else a.pattern??(a.pattern=vv());lt.init(t,a)}),t_=F("$ZodEmail",(t,a)=>{a.pattern??(a.pattern=S2),lt.init(t,a)}),n_=F("$ZodURL",(t,a)=>{lt.init(t,a),t._zod.check=i=>{try{const o=i.value.trim(),u=new URL(o);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(u.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:t,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:t,continue:!a.abort})),a.normalize?i.value=u.href:i.value=o;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:t,continue:!a.abort})}}}),a_=F("$ZodEmoji",(t,a)=>{a.pattern??(a.pattern=w2()),lt.init(t,a)}),r_=F("$ZodNanoID",(t,a)=>{a.pattern??(a.pattern=g2),lt.init(t,a)}),i_=F("$ZodCUID",(t,a)=>{a.pattern??(a.pattern=h2),lt.init(t,a)}),l_=F("$ZodCUID2",(t,a)=>{a.pattern??(a.pattern=m2),lt.init(t,a)}),o_=F("$ZodULID",(t,a)=>{a.pattern??(a.pattern=p2),lt.init(t,a)}),u_=F("$ZodXID",(t,a)=>{a.pattern??(a.pattern=y2),lt.init(t,a)}),s_=F("$ZodKSUID",(t,a)=>{a.pattern??(a.pattern=v2),lt.init(t,a)}),c_=F("$ZodISODateTime",(t,a)=>{a.pattern??(a.pattern=N2(a)),lt.init(t,a)}),f_=F("$ZodISODate",(t,a)=>{a.pattern??(a.pattern=M2),lt.init(t,a)}),d_=F("$ZodISOTime",(t,a)=>{a.pattern??(a.pattern=C2(a)),lt.init(t,a)}),h_=F("$ZodISODuration",(t,a)=>{a.pattern??(a.pattern=b2),lt.init(t,a)}),m_=F("$ZodIPv4",(t,a)=>{a.pattern??(a.pattern=E2),lt.init(t,a),t._zod.bag.format="ipv4"}),p_=F("$ZodIPv6",(t,a)=>{a.pattern??(a.pattern=T2),lt.init(t,a),t._zod.bag.format="ipv6",t._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:t,continue:!a.abort})}}}),y_=F("$ZodCIDRv4",(t,a)=>{a.pattern??(a.pattern=z2),lt.init(t,a)}),v_=F("$ZodCIDRv6",(t,a)=>{a.pattern??(a.pattern=R2),lt.init(t,a),t._zod.check=i=>{const o=i.value.split("/");try{if(o.length!==2)throw new Error;const[u,c]=o;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${u}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:t,continue:!a.abort})}}});function m0(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const g_=F("$ZodBase64",(t,a)=>{a.pattern??(a.pattern=O2),lt.init(t,a),t._zod.bag.contentEncoding="base64",t._zod.check=i=>{m0(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:t,continue:!a.abort})}});function b_(t){if(!u0.test(t))return!1;const a=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return m0(i)}const x_=F("$ZodBase64URL",(t,a)=>{a.pattern??(a.pattern=u0),lt.init(t,a),t._zod.bag.contentEncoding="base64url",t._zod.check=i=>{b_(i.value)||i.issues.push({code:"invalid_format",format:"base64url)DELIM" -R"DELIM(",input:i.value,inst:t,continue:!a.abort})}}),S_=F("$ZodE164",(t,a)=>{a.pattern??(a.pattern=A2),lt.init(t,a)});function __(t,a=null){try{const i=t.split(".");if(i.length!==3)return!1;const[o]=i;if(!o)return!1;const u=JSON.parse(atob(o));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||a&&(!("alg"in u)||u.alg!==a))}catch{return!1}}const w_=F("$ZodJWT",(t,a)=>{lt.init(t,a),t._zod.check=i=>{__(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:t,continue:!a.abort})}}),p0=F("$ZodNumber",(t,a)=>{xt.init(t,a),t._zod.pattern=t._zod.bag.pattern??k2,t._zod.parse=(i,o)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const u=i.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return i;const c=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:u,inst:t,...c?{received:c}:{}}),i}}),E_=F("$ZodNumberFormat",(t,a)=>{$2.init(t,a),p0.init(t,a)}),T_=F("$ZodBoolean",(t,a)=>{xt.init(t,a),t._zod.pattern=L2,t._zod.parse=(i,o)=>{if(a.coerce)try{i.value=!!i.value}catch{}const u=i.value;return typeof u=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:t}),i}}),z_=F("$ZodUnknown",(t,a)=>{xt.init(t,a),t._zod.parse=i=>i}),R_=F("$ZodNever",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:t}),i)});function gv(t,a,i){t.issues.length&&a.issues.push(...r0(i,t.issues)),a.value[i]=t.value}const O_=F("$ZodArray",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>{const u=i.value;if(!Array.isArray(u))return i.issues.push({expected:"array",code:"invalid_type",input:u,inst:t}),i;i.value=Array(u.length);const c=[];for(let d=0;dgv(m,i,d))):gv(p,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function Pu(t,a,i,o){t.issues.length&&a.issues.push(...r0(i,t.issues)),t.value===void 0?i in o&&(a.value[i]=void 0):a.value[i]=t.value}function y0(t){const a=Object.keys(t.shape);for(const o of a)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const i=PS(t.shape);return{...t,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function v0(t,a,i,o,u,c){const d=[],h=u.keySet,p=u.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:[]},o);v instanceof Promise?t.push(v.then(b=>Pu(b,i,g,a))):Pu(v,i,g,a)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:a,inst:c}),t.length?Promise.all(t).then(()=>i):i}const A_=F("$ZodObject",(t,a)=>{if(xt.init(t,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 o=Nd(()=>y0(a));tt(t._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 u=Gu,c=a.catchall;let d;t._zod.parse=(h,p)=>{d??(d=o.value);const m=h.value;if(!u(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),h;h.value={};const g=[],v=d.shape;for(const b of d.keys){const E=v[b]._zod.run({value:m[b],issues:[]},p);E instanceof Promise?g.push(E.then(A=>Pu(A,h,b,m))):Pu(E,h,b,m)}return c?v0(g,m,h,p,o.value,t):g.length?Promise.all(g).then(()=>h):h}}),M_=F("$ZodObjectJIT",(t,a)=>{A_.init(t,a);const i=t._zod.parse,o=Nd(()=>y0(a)),u=b=>{const _=new J2(["shape","payload","ctx"]),E=o.value,A=X=>{const se=yv(X);return`shape[${se}]._zod.run({ value: input[${se}], issues: [] }, ctx)`};_.write("const input = payload.value;");const B=Object.create(null);let D=0;for(const X of E.keys)B[X]=`key_${D++}`;_.write("const newResult = {};");for(const X of E.keys){const se=B[X],ue=yv(X);_.write(`const ${se} = ${A(X)};`),_.write(` - if (${se}.issues.length) { - payload.issues = payload.issues.concat(${se}.issues.map(iss => ({ +`+Ye+t+Lt}var st=!1;function De(t,n){if(!t||st)return"";st=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(G){var P=G}Reflect.construct(t,[],W)}else{try{W.call()}catch(G){P=G}t.call(W.prototype)}}else{try{throw Error()}catch(G){P=G}(W=t())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(G){if(G&&P&&typeof G.stack=="string")return[G.stack,P.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=o.DetermineComponentFrameRoot(),y=f[0],w=f[1];if(y&&w){var C=y.split(` +`),q=w.split(` +`);for(c=o=0;oc||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` +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 => ({ ...iss, - path: iss.path ? [${ue}, ...iss.path] : [${ue}] + path: iss.path ? [${I}, ...iss.path] : [${I}] }))); } - if (${se}.value === undefined) { - if (${ue} in input) { - newResult[${ue}] = undefined; + if (${J}.value === undefined) { + if (${I} in input) { + newResult[${I}] = undefined; } } else { - newResult[${ue}] = ${se}.value; + newResult[${I}] = ${J}.value; } - `)}_.write("payload.value = newResult;"),_.write("return payload;");const Q=_.compile();return(X,se)=>Q(b,X,se)};let c;const d=Gu,h=!e0.jitless,m=h&&YS.value,g=a.catchall;let v;t._zod.parse=(b,_)=>{v??(v=o.value);const E=b.value;return d(E)?h&&m&&_?.async===!1&&_.jitless!==!0?(c||(c=u(a.shape)),b=c(b,_),g?v0([],E,b,_,v,t):b):i(b,_):(b.issues.push({expected:"object",code:"invalid_type",input:E,inst:t}),b)}});function bv(t,a,i,o){for(const c of t)if(c.issues.length===0)return a.value=c.value,a;const u=t.filter(c=>!Ei(c));return u.length===1?(a.val)DELIM" - R"DELIM(ue=u[0].value,u[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:t.map(c=>c.issues.map(d=>kr(d,o,jr())))}),a)}const C_=F("$ZodUnion",(t,a)=>{xt.init(t,a),tt(t._zod,"optin",()=>a.options.some(u=>u._zod.optin==="optional")?"optional":void 0),tt(t._zod,"optout",()=>a.options.some(u=>u._zod.optout==="optional")?"optional":void 0),tt(t._zod,"values",()=>{if(a.options.every(u=>u._zod.values))return new Set(a.options.flatMap(u=>Array.from(u._zod.values)))}),tt(t._zod,"pattern",()=>{if(a.options.every(u=>u._zod.pattern)){const u=a.options.map(c=>c._zod.pattern);return new RegExp(`^(${u.map(c=>jd(c.source)).join("|")})$`)}});const i=a.options.length===1,o=a.options[0]._zod.run;t._zod.parse=(u,c)=>{if(i)return o(u,c);let d=!1;const h=[];for(const p of a.options){const m=p._zod.run({value:u.value,issues:[]},c);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=>bv(p,u,t,c)):bv(h,u,t,c)}}),N_=F("$ZodIntersection",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>{const u=i.value,c=a.left._zod.run({value:u,issues:[]},o),d=a.right._zod.run({value:u,issues:[]},o);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([p,m])=>xv(i,p,m)):xv(i,c,d)}});function md(t,a){if(t===a)return{valid:!0,data:t};if(t instanceof Date&&a instanceof Date&&+t==+a)return{valid:!0,data:t};if(Yl(t)&&Yl(a)){const i=Object.keys(a),o=Object.keys(t).filter(c=>i.indexOf(c)!==-1),u={...t,...a};for(const c of o){const d=md(t[c],a[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};u[c]=d.data}return{valid:!0,data:u}}if(Array.isArray(t)&&Array.isArray(a)){if(t.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let o=0;o{xt.init(t,a);const i=t0(a.entries),o=new Set(i);t._zod.values=o,t._zod.pattern=new RegExp(`^(${i.filter(u=>GS.has(typeof u)).map(u=>typeof u=="string"?es(u):u.toString()).join("|")})$`),t._zod.parse=(u,c)=>{const d=u.value;return o.has(d)||u.issues.push({code:"invalid_value",values:i,input:d,inst:t}),u}}),j_=F("$ZodTransform",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>{if(o.direction==="backward")throw new Wg(t.constructor.name);const u=a.transform(i.value,i);if(o.async)return(u instanceof Promise?u:Promise.resolve(u)).then(d=>(i.value=d,i));if(u instanceof Promise)throw new zi;return i.value=u,i}});function Sv(t,a){return t.issues.length&&a===void 0?{issues:[],value:void 0}:t}const k_=F("$ZodOptional",(t,a)=>{xt.init(t,a),t._zod.optin="optional",t._zod.optout="optional",tt(t._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),tt(t._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jd(i.source)})?$`):void 0}),t._zod.parse=(i,o)=>{if(a.innerType._zod.optin==="optional"){const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>Sv(c,i.value)):Sv(u,i.value)}return i.value===void 0?i:a.innerType._zod.run(i,o)}}),L_=F("$ZodNullable",(t,a)=>{xt.init(t,a),tt(t._zod,"optin",()=>a.innerType._zod.optin),tt(t._zod,"optout",()=>a.innerType._zod.optout),tt(t._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jd(i.source)}|null)$`):void 0}),tt(t._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),t._zod.parse=(i,o)=>i.value===null?i:a.innerType._zod.run(i,o)}),B_=F("$ZodDefault",(t,a)=>{xt.init(t,a),t._zod.optin="optional",tt(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);if(i.value===void 0)return i.value=a.defaultValue,i;const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>_v(c,a)):_v(u,a)}});function _v(t,a){return t.value===void 0&&(t.value=a.defaultValue),t}const U_=F("$ZodPrefault",(t,a)=>{xt.init(t,a),t._zod.optin="optional",tt(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(i,o)=>(o.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,o))}),H_=F("$ZodNonOptional",(t,a)=>{xt.init(t,a),tt(t._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(o=>o!==void 0)):void 0}),t._zod.parse=(i,o)=>{const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>wv(c,t)):wv(u,t)}});function wv(t,a){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:a}),t}const $_=F("$ZodCatch",(t,a)=>{xt.init(t,a),tt(t._zod,"optin",()=>a.innerType._zod.optin)DELIM" - R"DELIM(),tt(t._zod,"optout",()=>a.innerType._zod.optout),tt(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>(i.value=c.value,c.issues.length&&(i.value=a.catchValue({...i,error:{issues:c.issues.map(d=>kr(d,o,jr()))},input:i.value}),i.issues=[]),i)):(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(c=>kr(c,o,jr()))},input:i.value}),i.issues=[]),i)}}),Z_=F("$ZodPipe",(t,a)=>{xt.init(t,a),tt(t._zod,"values",()=>a.in._zod.values),tt(t._zod,"optin",()=>a.in._zod.optin),tt(t._zod,"optout",()=>a.out._zod.optout),tt(t._zod,"propValues",()=>a.in._zod.propValues),t._zod.parse=(i,o)=>{if(o.direction==="backward"){const c=a.out._zod.run(i,o);return c instanceof Promise?c.then(d=>Ru(d,a.in,o)):Ru(c,a.in,o)}const u=a.in._zod.run(i,o);return u instanceof Promise?u.then(c=>Ru(c,a.out,o)):Ru(u,a.out,o)}});function Ru(t,a,i){return t.issues.length?(t.aborted=!0,t):a._zod.run({value:t.value,issues:t.issues},i)}const q_=F("$ZodReadonly",(t,a)=>{xt.init(t,a),tt(t._zod,"propValues",()=>a.innerType._zod.propValues),tt(t._zod,"values",()=>a.innerType._zod.values),tt(t._zod,"optin",()=>a.innerType?._zod?.optin),tt(t._zod,"optout",()=>a.innerType?._zod?.optout),t._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(Ev):Ev(u)}});function Ev(t){return t.value=Object.freeze(t.value),t}const Q_=F("$ZodCustom",(t,a)=>{an.init(t,a),xt.init(t,a),t._zod.parse=(i,o)=>i,t._zod.check=i=>{const o=i.value,u=a.fn(o);if(u instanceof Promise)return u.then(c=>Tv(c,i,o,t));Tv(u,i,o,t)}});function Tv(t,a,i,o){if(!t){const u={code:"custom",input:i,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(u.params=o._zod.def.params),a.issues.push(Gl(u))}}var zv;class Y_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const o=i[0];if(this._map.set(a,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.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 o={...this.get(i)??{}};delete o.id;const u={...o,...this._map.get(a)};return Object.keys(u).length?u:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function G_(){return new Y_}(zv=globalThis).__zod_globalRegistry??(zv.__zod_globalRegistry=G_());const Ll=globalThis.__zod_globalRegistry;function P_(t,a){return new t({type:"string",...Se(a)})}function V_(t,a){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Se(a)})}function Rv(t,a){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Se(a)})}function X_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Se(a)})}function K_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Se(a)})}function F_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Se(a)})}function J_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Se(a)})}function I_(t,a){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Se(a)})}function W_(t,a){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Se(a)})}function ew(t,a){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Se(a)})}function tw(t,a){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Se(a)})}function nw(t,a){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Se(a)})}function aw(t,a){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Se(a)})}function rw(t,a){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Se(a)})}function iw(t,a){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Se(a)})}function lw(t,a){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Se(a)})}function ow(t,a){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Se(a)})}function uw(t,a){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Se(a)})}function sw(t,a){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Se(a)})}function cw(t,a){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Se(a)})}function fw(t,a){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Se(a)})}function dw(t,a){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Se(a)})}function hw(t,a){return )DELIM" - R"DELIM(new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Se(a)})}function mw(t,a){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Se(a)})}function pw(t,a){return new t({type:"string",format:"date",check:"string_format",...Se(a)})}function yw(t,a){return new t({type:"string",format:"time",check:"string_format",precision:null,...Se(a)})}function vw(t,a){return new t({type:"string",format:"duration",check:"string_format",...Se(a)})}function gw(t,a){return new t({type:"number",checks:[],...Se(a)})}function bw(t,a){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Se(a)})}function xw(t,a){return new t({type:"boolean",...Se(a)})}function Sw(t){return new t({type:"unknown"})}function _w(t,a){return new t({type:"never",...Se(a)})}function Ov(t,a){return new d0({check:"less_than",...Se(a),value:t,inclusive:!1})}function Cf(t,a){return new d0({check:"less_than",...Se(a),value:t,inclusive:!0})}function Av(t,a){return new h0({check:"greater_than",...Se(a),value:t,inclusive:!1})}function Nf(t,a){return new h0({check:"greater_than",...Se(a),value:t,inclusive:!0})}function Mv(t,a){return new H2({check:"multiple_of",...Se(a),value:t})}function g0(t,a){return new Z2({check:"max_length",...Se(a),maximum:t})}function Vu(t,a){return new q2({check:"min_length",...Se(a),minimum:t})}function b0(t,a){return new Q2({check:"length_equals",...Se(a),length:t})}function ww(t,a){return new Y2({check:"string_format",format:"regex",...Se(a),pattern:t})}function Ew(t){return new G2({check:"string_format",format:"lowercase",...Se(t)})}function Tw(t){return new P2({check:"string_format",format:"uppercase",...Se(t)})}function zw(t,a){return new V2({check:"string_format",format:"includes",...Se(a),includes:t})}function Rw(t,a){return new X2({check:"string_format",format:"starts_with",...Se(a),prefix:t})}function Ow(t,a){return new K2({check:"string_format",format:"ends_with",...Se(a),suffix:t})}function Ci(t){return new F2({check:"overwrite",tx:t})}function Aw(t){return Ci(a=>a.normalize(t))}function Mw(){return Ci(t=>t.trim())}function Cw(){return Ci(t=>t.toLowerCase())}function Nw(){return Ci(t=>t.toUpperCase())}function Dw(){return Ci(t=>QS(t))}function jw(t,a,i){return new t({type:"array",element:a,...Se(i)})}function kw(t,a,i){return new t({type:"custom",check:"custom",fn:a,...Se(i)})}function Lw(t){const a=Bw(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(Gl(o,i.value,a._zod.def));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=i.value),u.inst??(u.inst=a),u.continue??(u.continue=!a._zod.def.abort),i.issues.push(Gl(u))}},t(i.value,i)));return a}function Bw(t,a){const i=new an({check:"custom",...Se(a)});return i._zod.check=t,i}function x0(t){let a=t?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Ll,target:a,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Ut(t,a,i={path:[],schemaPath:[]}){var o;const u=t._zod.def,c=a.seen.get(t);if(c)return c.count++,i.schemaPath.includes(t)&&(c.cycle=i.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(t,d);const h=t._zod.toJSONSchema?.();if(h)d.schema=h;else{const g={...i,schemaPath:[...i.schemaPath,t],path:i.path},v=t._zod.parent;if(v)d.ref=v,Ut(v,a,g),a.seen.get(v).isParent=!0;else if(t._zod.processJSONSchema)t._zod.processJSONSchema(a,d.schema,g);else{const b=d.schema,_=a.processors[u.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);_(t,a,b,g)}}const p=a.metadataRegistry.get(t);return p&&Object.assign(d.schema,p),a.io==="input"&&Yt(t)&&(delete d.schema.examples,delete d.schema.default),a.io==="input"&&d.schema._prefault&&((o=d.schema).default??(o.default=d.schema._prefault)),delete d.schema._prefault,a.seen.get(t).schema}function S0(t,a){const i=t.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=c=>{const d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const g=t.external.registry.get(c[0])?.id,v=t.external.uri??(_=>_);if(g)return{ref:v(g)};const b=c[1].defId??c[1].schema.id??`schema${t.counter++}`;return c[1].defId=b,{defId:b,ref:`${v("__shared")}#/${d}/${b}`}}if(c[1]===i)return{ref:"#"};const p=`#/${d}/`,m=c[1].schema.id??`__schema${t.counter++}`;return{defId:m,ref:p+m}},u=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:h,defId:p}=o(c);d.def={...d.schema},p&&(d.defId=p);const m=d.schema;for(const g in m)delete m[g];m.$ref=h};if(t.cycles==="throw")for(const c of t.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ + `)}_.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("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of t.seen.entries())DELIM" -R"DELIM(){const d=c[1];if(a===c[0]){u(c);continue}if(t.external){const p=t.external.registry.get(c[0])?.id;if(a!==c[0]&&p){u(c);continue}}if(t.metadataRegistry.get(c[0])?.id){u(c);continue}if(d.cycle){u(c);continue}if(d.count>1&&t.reused==="ref"){u(c);continue}}}function _0(t,a){const i=t.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=d=>{const h=t.seen.get(d),p=h.def??h.schema,m={...p};if(h.ref===null)return;const g=h.ref;if(h.ref=null,g){o(g);const v=t.seen.get(g).schema;v.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):(Object.assign(p,v),Object.assign(p,m))}h.isParent||t.override({zodSchema:d,jsonSchema:p,path:h.path??[]})};for(const d of[...t.seen.entries()].reverse())o(d[0]);const u={};if(t.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const d=t.external.registry.get(a)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=t.external.uri(d)}Object.assign(u,i.def??i.schema);const c=t.external?.defs??{};for(const d of t.seen.entries()){const h=d[1];h.def&&h.defId&&(c[h.defId]=h.def)}t.external||Object.keys(c).length>0&&(t.target==="draft-2020-12"?u.$defs=c:u.definitions=c);try{const d=JSON.parse(JSON.stringify(u));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:Xu(a,"input"),output:Xu(a,"output")}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Yt(t,a){const i=a??{seen:new Set};if(i.seen.has(t))return!1;i.seen.add(t);const o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Yt(o.element,i);if(o.type==="set")return Yt(o.valueType,i);if(o.type==="lazy")return Yt(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Yt(o.innerType,i);if(o.type==="intersection")return Yt(o.left,i)||Yt(o.right,i);if(o.type==="record"||o.type==="map")return Yt(o.keyType,i)||Yt(o.valueType,i);if(o.type==="pipe")return Yt(o.in,i)||Yt(o.out,i);if(o.type==="object"){for(const u in o.shape)if(Yt(o.shape[u],i))return!0;return!1}if(o.type==="union"){for(const u of o.options)if(Yt(u,i))return!0;return!1}if(o.type==="tuple"){for(const u of o.items)if(Yt(u,i))return!0;return!!(o.rest&&Yt(o.rest,i))}return!1}const Uw=(t,a={})=>i=>{const o=x0({...i,processors:a});return Ut(t,o),S0(o,t),_0(o,t)},Xu=(t,a)=>i=>{const{libraryOptions:o,target:u}=i??{},c=x0({...o??{},target:u,io:a,processors:{}});return Ut(t,c),S0(c,t),_0(c,t)},Hw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$w=(t,a,i,o)=>{const u=i;u.type="string";const{minimum:c,maximum:d,format:h,patterns:p,contentEncoding:m}=t._zod.bag;if(typeof c=="number"&&(u.minLength=c),typeof d=="number"&&(u.maxLength=d),h&&(u.format=Hw[h]??h,u.format===""&&delete u.format),m&&(u.contentEncoding=m),p&&p.size>0){const g=[...p];g.length===1?u.pattern=g[0].source:g.length>1&&(u.allOf=[...g.map(v=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},Zw=(t,a,i,o)=>{const u=i,{minimum:c,maximum:d,format:h,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:g}=t._zod.bag;typeof h=="string"&&h.includes("int")?u.type="integer":u.type="number",typeof g=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(u.minimum=g,u.exclusiveMinimum=!0):u.exclusiveMinimum=g),typeof c=="number"&&(u.minimum=c,typeof g=="number"&&a.target!=="draft-04"&&(g>=c?delete u.minimum:delete u.exclusiveMinimum)),typeof m=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(u.maximum=m,u.exclusiveMaximum=!0):u.exclusiveMaximum=m),typeof d=="number"&&(u.maximum=d,typeof m=="number"&&a.target!=="draft-04"&&(m<=d?delete u.maximum:delete u.exclusiveMaximum)),typeof p=="number"&&(u.multipleOf=p)},qw=(t,a,i,o)=>{i.type="boolean"},Qw=(t,a,i,o)=>{i.not={}},Yw=(t,a,i,o)=>{},Gw=(t,a,i,o)=>{const u=t._zod.def,c=t0(u.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},Pw=(t,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vw=(t,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Xw=(t,a,i,o)=>{const u=i,c=t._zod.def,{minimum:d,maximum:h}=t._zod.bag;typeof d=="number"&&(u.minItems=d),typeof h=="number"&&(u.maxItems=h),u.type="array",u.items=Ut(c.element,a,{...o,path:[...o.path,"items"]})},Kw=(t,a,i,o)=>{const u=i,c=t._zod.def;u.type="object",u.properties={};const d=c.shape;for(const m in d)u.properties[m]=Ut(d[m],a,{...o,path:[...o.path,"properties",m]});const h=new Set(Object.keys(d)),p=new Set([...h].filter(m=>{co)DELIM" -R"DELIM(nst g=c.shape[m]._zod;return a.io==="input"?g.optin===void 0:g.optout===void 0}));p.size>0&&(u.required=Array.from(p)),c.catchall?._zod.def.type==="never"?u.additionalProperties=!1:c.catchall?c.catchall&&(u.additionalProperties=Ut(c.catchall,a,{...o,path:[...o.path,"additionalProperties"]})):a.io==="output"&&(u.additionalProperties=!1)},Fw=(t,a,i,o)=>{const u=t._zod.def,c=u.inclusive===!1,d=u.options.map((h,p)=>Ut(h,a,{...o,path:[...o.path,c?"oneOf":"anyOf",p]}));c?i.oneOf=d:i.anyOf=d},Jw=(t,a,i,o)=>{const u=t._zod.def,c=Ut(u.left,a,{...o,path:[...o.path,"allOf",0]}),d=Ut(u.right,a,{...o,path:[...o.path,"allOf",1]}),h=m=>"allOf"in m&&Object.keys(m).length===1,p=[...h(c)?c.allOf:[c],...h(d)?d.allOf:[d]];i.allOf=p},Iw=(t,a,i,o)=>{const u=t._zod.def,c=Ut(u.innerType,a,o),d=a.seen.get(t);a.target==="openapi-3.0"?(d.ref=u.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},Ww=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType},eE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType,i.default=JSON.parse(JSON.stringify(u.defaultValue))},tE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},nE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType;let d;try{d=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=d},aE=(t,a,i,o)=>{const u=t._zod.def,c=a.io==="input"?u.in._zod.def.type==="transform"?u.out:u.in:u.out;Ut(c,a,o);const d=a.seen.get(t);d.ref=c},rE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType,i.readOnly=!0},iE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType},lE=F("ZodISODateTime",(t,a)=>{c_.init(t,a),st.init(t,a)});function oE(t){return mw(lE,t)}const uE=F("ZodISODate",(t,a)=>{f_.init(t,a),st.init(t,a)});function sE(t){return pw(uE,t)}const cE=F("ZodISOTime",(t,a)=>{d_.init(t,a),st.init(t,a)});function fE(t){return yw(cE,t)}const dE=F("ZodISODuration",(t,a)=>{h_.init(t,a),st.init(t,a)});function hE(t){return vw(dE,t)}const mE=(t,a)=>{l0.init(t,a),t.name="ZodError",Object.defineProperties(t,{format:{value:i=>n2(t,i)},flatten:{value:i=>t2(t,i)},addIssue:{value:i=>{t.issues.push(i),t.message=JSON.stringify(t.issues,hd,2)}},addIssues:{value:i=>{t.issues.push(...i),t.message=JSON.stringify(t.issues,hd,2)}},isEmpty:{get(){return t.issues.length===0}}})},On=F("ZodError",mE,{Parent:Error}),pE=Ld(On),yE=Bd(On),vE=ts(On),gE=ns(On),bE=i2(On),xE=l2(On),SE=o2(On),_E=u2(On),wE=s2(On),EE=c2(On),TE=f2(On),zE=d2(On),zt=F("ZodType",(t,a)=>(xt.init(t,a),Object.assign(t["~standard"],{jsonSchema:{input:Xu(t,"input"),output:Xu(t,"output")}}),t.toJSONSchema=Uw(t,{}),t.def=a,t.type=a.type,Object.defineProperty(t,"_def",{value:a}),t.check=(...i)=>t.clone(Br(a,{checks:[...a.checks??[],...i.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),t.clone=(i,o)=>tr(t,i,o),t.brand=()=>t,t.register=((i,o)=>(i.add(t,o),t)),t.parse=(i,o)=>pE(t,i,o,{callee:t.parse}),t.safeParse=(i,o)=>vE(t,i,o),t.parseAsync=async(i,o)=>yE(t,i,o,{callee:t.parseAsync}),t.safeParseAsync=async(i,o)=>gE(t,i,o),t.spa=t.safeParseAsync,t.encode=(i,o)=>bE(t,i,o),t.decode=(i,o)=>xE(t,i,o),t.encodeAsync=async(i,o)=>SE(t,i,o),t.decodeAsync=async(i,o)=>_E(t,i,o),t.safeEncode=(i,o)=>wE(t,i,o),t.safeDecode=(i,o)=>EE(t,i,o),t.safeEncodeAsync=async(i,o)=>TE(t,i,o),t.safeDecodeAsync=async(i,o)=>zE(t,i,o),t.refine=(i,o)=>t.check(v4(i,o)),t.superRefine=i=>t.check(g4(i)),t.overwrite=i=>t.check(Ci(i)),t.optional=()=>jv(t),t.nullable=()=>kv(t),t.nullish=()=>jv(kv(t)),t.nonoptional=i=>c4(t,i),t.array=()=>Mi(t),t.or=i=>WE([t,i]),t.and=i=>t4(t,i),t.transform=i=>Lv(t,r4(i)),t.default=i=>o4(t,i),t.prefault=i=>s4(t,i),t.catch=i=>d4(t,i),t.pipe=i=>Lv(t,i),t.readonly=()=>p4(t),t.describe=i=>{const o=t.clone();return Ll.add(o,{description:i}),o},Object.defineProperty(t,"description",{get(){return Ll.get(t)?.description},configurable:!0}),t.meta=(...i)=>{if(i.length===0)return Ll.get(t);const o=t.clone();return Ll.add(o,i[0]),o},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),w0=F("_ZodString",(t,a)=>{Ud.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(o,u,c)=>$w(t,o,u);const i=t._zod.bag;t.format=i.format??null,t.minLength=i.minimum??null,t.maxLength=i.maximum??null,t.regex=(...o)=>t.check(ww(...o)),t.includes=(...o)=>t.check(zw(...o)),t.startsWith=(...o)=>t.check(Rw(...o)),t.endsWith=(...o)=>t.check(Ow(...o)),t.min=(...o)=>t.check(Vu(...o)),t.max=(...o)=>t.check(g0(...o)),t.length=(...o)=>t.check(b0(...o)),t.nonempty=(...o)=>t.check(Vu(1,...o)),t.lowercase=o=>t.check(Ew(o)),t.uppercase=o=>t.check(Tw(o)),t.trim=()=>t.check(Mw()),t.normalize=(...o)=>t.check(Aw(...o)),t.toLowerCase=()=>t.check(Cw()),t.toUpperCase=()=>t.check(Nw()),t.slugify=()=>t.check)DELIM" -R"DELIM((Dw())}),RE=F("ZodString",(t,a)=>{Ud.init(t,a),w0.init(t,a),t.email=i=>t.check(V_(OE,i)),t.url=i=>t.check(I_(AE,i)),t.jwt=i=>t.check(hw(YE,i)),t.emoji=i=>t.check(W_(ME,i)),t.guid=i=>t.check(Rv(Cv,i)),t.uuid=i=>t.check(X_(Ou,i)),t.uuidv4=i=>t.check(K_(Ou,i)),t.uuidv6=i=>t.check(F_(Ou,i)),t.uuidv7=i=>t.check(J_(Ou,i)),t.nanoid=i=>t.check(ew(CE,i)),t.guid=i=>t.check(Rv(Cv,i)),t.cuid=i=>t.check(tw(NE,i)),t.cuid2=i=>t.check(nw(DE,i)),t.ulid=i=>t.check(aw(jE,i)),t.base64=i=>t.check(cw(ZE,i)),t.base64url=i=>t.check(fw(qE,i)),t.xid=i=>t.check(rw(kE,i)),t.ksuid=i=>t.check(iw(LE,i)),t.ipv4=i=>t.check(lw(BE,i)),t.ipv6=i=>t.check(ow(UE,i)),t.cidrv4=i=>t.check(uw(HE,i)),t.cidrv6=i=>t.check(sw($E,i)),t.e164=i=>t.check(dw(QE,i)),t.datetime=i=>t.check(oE(i)),t.date=i=>t.check(sE(i)),t.time=i=>t.check(fE(i)),t.duration=i=>t.check(hE(i))});function Tt(t){return P_(RE,t)}const st=F("ZodStringFormat",(t,a)=>{lt.init(t,a),w0.init(t,a)}),OE=F("ZodEmail",(t,a)=>{t_.init(t,a),st.init(t,a)}),Cv=F("ZodGUID",(t,a)=>{W2.init(t,a),st.init(t,a)}),Ou=F("ZodUUID",(t,a)=>{e_.init(t,a),st.init(t,a)}),AE=F("ZodURL",(t,a)=>{n_.init(t,a),st.init(t,a)}),ME=F("ZodEmoji",(t,a)=>{a_.init(t,a),st.init(t,a)}),CE=F("ZodNanoID",(t,a)=>{r_.init(t,a),st.init(t,a)}),NE=F("ZodCUID",(t,a)=>{i_.init(t,a),st.init(t,a)}),DE=F("ZodCUID2",(t,a)=>{l_.init(t,a),st.init(t,a)}),jE=F("ZodULID",(t,a)=>{o_.init(t,a),st.init(t,a)}),kE=F("ZodXID",(t,a)=>{u_.init(t,a),st.init(t,a)}),LE=F("ZodKSUID",(t,a)=>{s_.init(t,a),st.init(t,a)}),BE=F("ZodIPv4",(t,a)=>{m_.init(t,a),st.init(t,a)}),UE=F("ZodIPv6",(t,a)=>{p_.init(t,a),st.init(t,a)}),HE=F("ZodCIDRv4",(t,a)=>{y_.init(t,a),st.init(t,a)}),$E=F("ZodCIDRv6",(t,a)=>{v_.init(t,a),st.init(t,a)}),ZE=F("ZodBase64",(t,a)=>{g_.init(t,a),st.init(t,a)}),qE=F("ZodBase64URL",(t,a)=>{x_.init(t,a),st.init(t,a)}),QE=F("ZodE164",(t,a)=>{S_.init(t,a),st.init(t,a)}),YE=F("ZodJWT",(t,a)=>{w_.init(t,a),st.init(t,a)}),E0=F("ZodNumber",(t,a)=>{p0.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(o,u,c)=>Zw(t,o,u),t.gt=(o,u)=>t.check(Av(o,u)),t.gte=(o,u)=>t.check(Nf(o,u)),t.min=(o,u)=>t.check(Nf(o,u)),t.lt=(o,u)=>t.check(Ov(o,u)),t.lte=(o,u)=>t.check(Cf(o,u)),t.max=(o,u)=>t.check(Cf(o,u)),t.int=o=>t.check(Nv(o)),t.safe=o=>t.check(Nv(o)),t.positive=o=>t.check(Av(0,o)),t.nonnegative=o=>t.check(Nf(0,o)),t.negative=o=>t.check(Ov(0,o)),t.nonpositive=o=>t.check(Cf(0,o)),t.multipleOf=(o,u)=>t.check(Mv(o,u)),t.step=(o,u)=>t.check(Mv(o,u)),t.finite=()=>t;const i=t._zod.bag;t.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),t.isFinite=!0,t.format=i.format??null});function qe(t){return gw(E0,t)}const GE=F("ZodNumberFormat",(t,a)=>{E_.init(t,a),E0.init(t,a)});function Nv(t){return bw(GE,t)}const PE=F("ZodBoolean",(t,a)=>{T_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>qw(t,i,o)});function Hd(t){return xw(PE,t)}const VE=F("ZodUnknown",(t,a)=>{z_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Yw()});function Dv(){return Sw(VE)}const XE=F("ZodNever",(t,a)=>{R_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Qw(t,i,o)});function KE(t){return _w(XE,t)}const FE=F("ZodArray",(t,a)=>{O_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Xw(t,i,o,u),t.element=a.element,t.min=(i,o)=>t.check(Vu(i,o)),t.nonempty=i=>t.check(Vu(1,i)),t.max=(i,o)=>t.check(g0(i,o)),t.length=(i,o)=>t.check(b0(i,o)),t.unwrap=()=>t.element});function Mi(t,a){return jw(FE,t,a)}const JE=F("ZodObject",(t,a)=>{M_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Kw(t,i,o,u),tt(t,"shape",()=>a.shape),t.keyof=()=>n4(Object.keys(t._zod.def.shape)),t.catchall=i=>t.clone({...t._zod.def,catchall:i}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Dv()}),t.loose=()=>t.clone({...t._zod.def,catchall:Dv()}),t.strict=()=>t.clone({...t._zod.def,catchall:KE()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=i=>FS(t,i),t.safeExtend=i=>JS(t,i),t.merge=i=>IS(t,i),t.pick=i=>XS(t,i),t.omit=i=>KS(t,i),t.partial=(...i)=>WS(T0,t,i[0]),t.required=(...i)=>e2(z0,t,i[0])});function Xn(t,a){const i={type:"object",shape:t??{},...Se(a)};return new JE(i)}const IE=F("ZodUnion",(t,a)=>{C_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Fw(t,i,o,u),t.options=a.options});function WE(t,a){return new IE({type:"union",options:t,...Se(a)})}const e4=F("ZodIntersection",(t,a)=>{N_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Jw(t,i,o,u)});function t4(t,a){return new e4({type:"intersection",left:t,right:a})}const pd=F("ZodEnum",(t,a)=>{D_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(o,u,c)=>Gw(t,o,u),t.enum=a.entries,t.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));t.extract=(o,u)=>{const c={};for(const d of o)if(i.has(d))c[d]=a.entries[d];else throw new Error(`Key ${d} not found in enum`))DELIM" -R"DELIM(;return new pd({...a,checks:[],...Se(u),entries:c})},t.exclude=(o,u)=>{const c={...a.entries};for(const d of o)if(i.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new pd({...a,checks:[],...Se(u),entries:c})}});function n4(t,a){const i=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new pd({type:"enum",entries:i,...Se(a)})}const a4=F("ZodTransform",(t,a)=>{j_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Vw(t,i),t._zod.parse=(i,o)=>{if(o.direction==="backward")throw new Wg(t.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(Gl(c,i.value,a));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=i.value),d.inst??(d.inst=t),i.issues.push(Gl(d))}};const u=a.transform(i.value,i);return u instanceof Promise?u.then(c=>(i.value=c,i)):(i.value=u,i)}});function r4(t){return new a4({type:"transform",transform:t})}const T0=F("ZodOptional",(t,a)=>{k_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>iE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function jv(t){return new T0({type:"optional",innerType:t})}const i4=F("ZodNullable",(t,a)=>{L_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Iw(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function kv(t){return new i4({type:"nullable",innerType:t})}const l4=F("ZodDefault",(t,a)=>{B_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>eE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function o4(t,a){return new l4({type:"default",innerType:t,get defaultValue(){return typeof a=="function"?a():a0(a)}})}const u4=F("ZodPrefault",(t,a)=>{U_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>tE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function s4(t,a){return new u4({type:"prefault",innerType:t,get defaultValue(){return typeof a=="function"?a():a0(a)}})}const z0=F("ZodNonOptional",(t,a)=>{H_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Ww(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function c4(t,a){return new z0({type:"nonoptional",innerType:t,...Se(a)})}const f4=F("ZodCatch",(t,a)=>{$_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>nE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function d4(t,a){return new f4({type:"catch",innerType:t,catchValue:typeof a=="function"?a:()=>a})}const h4=F("ZodPipe",(t,a)=>{Z_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>aE(t,i,o,u),t.in=a.in,t.out=a.out});function Lv(t,a){return new h4({type:"pipe",in:t,out:a})}const m4=F("ZodReadonly",(t,a)=>{q_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>rE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function p4(t){return new m4({type:"readonly",innerType:t})}const y4=F("ZodCustom",(t,a)=>{Q_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Pw(t,i)});function v4(t,a={}){return kw(y4,t,a)}function g4(t){return Lw(t)}class $d extends Error{constructor(a,i){super(a),this.status=i}}const yd=Xn({id:Tt(),height:qe(),timestamp:qe().optional(),mediantime:qe().optional(),tx_count:qe().optional(),size:qe().optional(),weight:qe().optional(),difficulty:qe().optional(),bits:qe().optional(),merkle_root:Tt().optional(),previousblockhash:Tt().nullable().optional(),nonce:qe().optional(),version:qe().optional()}).loose(),b4=Xn({confirmed:Hd(),block_height:qe().optional(),block_hash:Tt().optional(),block_time:qe().optional()}),x4=Xn({txid:Tt().optional().nullable(),vout:qe().optional().nullable(),sequence:qe().optional(),scriptsig:Tt().optional().nullable(),scriptsig_asm:Tt().optional().nullable(),witness:Mi(Tt()).optional(),is_coinbase:Hd().optional(),prevout:Xn({scriptpubkey_type:Tt().optional(),scriptpubkey_address:Tt().optional(),scriptpubkey:Tt().optional(),scriptpubkey_asm:Tt().optional(),value:qe().optional()}).partial().nullable().optional()}).loose(),S4=Xn({scriptpubkey_type:Tt().optional(),scriptpubkey_address:Tt().optional(),scriptpubkey:Tt().optional(),scriptpubkey_asm:Tt().optional(),value:qe(),n:qe().optional()}).loose(),R0=Xn({txid:Tt(),hash:Tt().optional(),fee:qe().optional(),version:qe(),locktime:qe(),vin:Mi(x4),vout:Mi(S4),size:qe(),weight:qe(),status:b4}).loose(),Lu=Mi(yd),Ku=Mi(R0),Bv=Xn({in_best_chain:Hd(),next_best:Tt().optional(),height:qe().optional()}),Uv=Xn({address:Tt(),chain_stats:Xn({funded_txo_count:qe().optional(),funded_txo_sum:qe().optional(),spent_txo_count:qe().optional(),spent_txo_sum:qe().optional(),tx_count:qe().optional()}),mempool_stats:Xn({funded_txo_count:qe().optional(),funded_txo_sum:qe().optional(),spent_txo_count:qe().optional(),spent_txo_sum:qe().optional(),tx_count:qe().optional()})});async function Gt(t,a,i){const o=a.startsWith("/")?a:`/${a}`,u=await fetch(`${t}${o}`);if(!u.ok)throw new $d(`Request to ${a} failed with status ${String(u.status)}`,u.status);const c=await u.json();return i.parse(c)}async function Hv(t,a){const i=await fetch(`${t}/blocks/tip/height`);if(!i.ok)throw new $d("Unable to fetch tip height",i.status);const o=await i.text(),u=Numb)DELIM" -R"DELIM(er(o.trim());if(!Number.isFinite(u))throw new TypeError("Invalid tip height response");return a.lastKnownHeight=u,u}async function xi(t,a,i){if(a.lastKnownHeight===null){await Hv(t,a);return}typeof i=="number"&&a.lastKnownHeightc.scriptpubkey_address===t?u+c.value:u,0),o=a.vin.reduce((u,c)=>{const d=c.prevout;return d?.scriptpubkey_address===t&&typeof d.value=="number"?u+d.value:u},0);return i-o}async function Df(t,a){if(a==="latest"||a==="tip"){const i=await Gt(t,"/blocks",Lu);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${t}/block-height/${a}`);if(!i.ok)throw new $d("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function $v(t,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const o=a+1;try{const u=await fetch(`${t}/block-height/${String(o)}`);return u.ok&&(await u.text()).trim()||null}catch(u){return console.warn(`Failed to resolve hash for height ${String(o)}`,u),null}}function Ol(t){return{hash:t.id,height:t.height,timestamp:t.timestamp??t.mediantime??0,txCount:t.tx_count??0,size:t.size??0,weight:t.weight??0,difficulty:t.difficulty,previousBlockHash:t.previousblockhash??null}}function jf(t,a){const i=t.status.confirmed?"confirmed":"unconfirmed",o=t.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}}),u=t.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})),c=u.reduce((p,m)=>p+m.valueSats,0),d=a.lastKnownHeight;let h=0;return t.status.block_height&&i==="confirmed"&&(h=d&&d>=t.status.block_height?d-t.status.block_height+1:1),{txid:t.txid,hash:t.hash??t.txid,status:i,confirmations:h,blockHeight:t.status.block_height,blockHash:t.status.block_hash,receivedTime:t.status.block_time,feeSats:t.fee??null,feeRate:t.fee?t.fee/t.weight*4:null,size:t.size,weight:t.weight,version:t.version,locktime:t.locktime,totalInput:null,totalOutput:c,inputs:o,outputs:u}}function w4(t,a){const i=t.chain_stats,o=t.mempool_stats,u=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),c=O0(t.address,a.slice(0,25));return{address:t.address,addressType:eo(t.address),balance:u,totalReceived:(i.funded_txo_sum??0)+(o.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(o.spent_txo_sum??0),txCount:(i.tx_count??0)+(o.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:c}}function E4(t){const a=t.chain_stats,i=t.mempool_stats,o=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:t.address,addressType:eo(t.address),balance:o,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 O0(t,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:_4(t,i),blockHeight:i.status.block_height}))}async function Zv(t,a,i=0){const o=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return Gt(t,o,Ku)}async function T4(t,a,i){return i?Gt(t,`/address/${a}/txs/chain/${i}`,Ku):Gt(t,`/address/${a}/txs`,Ku)}function A0({baseUrl:t}){const a=new Set;let i=null;const o={lastBlockHash:null,lastKnownHeight:null};async function u(h){const p=await Gt(t,`/tx/${h}`,R0);return await(p.status.block_height?xi(t,o,p.status.block_height):xi(t,o)),jf(p,o)}function c(){i||a.size===0||(i=setInterval(async()=>{try{const h=await Gt(t,"/blocks",Lu);if(h.length===0)return;const p=h[0];if(p.id!==o.lastBlockHash){o.lastBlockHash=p.id,o.lastKnownHeight=Math.max(p.height,o.lastKnownHeight??0);const m=Ol(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:t,description:"Read-only adapter using Blockstream public REST API."},async getLatestBlocks(h=10){const p=await Gt(t,"/blocks",Lu);return p.length>0&&(o.lastBlockHash=p[0].id,o.lastKnownHeight=Math.max(p[0].height,o.lastKnownHeight??0)),p.slice(0,h).map(m=>Ol(m))},async getBlocksBefore(h,p=10){const m=Math.max(h,0),g=await Gt(t,`/blocks/${String(m)}`,Lu);return g.length>0&&(o.lastKnownHeight=Math.max(g[0].height,o.lastKnownHeight??0)),g.slice(0,p).map(v=>Ol(v))},async getBlockHeader(h){const p=await Df(t,h);await xi(t,)DELIM" -R"DELIM(o);const[m,g]=await Promise.all([Gt(t,`/block/${p}`,yd),Gt(t,`/block/${p}/status`,Bv).catch(()=>null)]),v=Ol(m);o.lastBlockHash=v.hash,o.lastKnownHeight=Math.max(v.height,o.lastKnownHeight??v.height);let b=g?.next_best??null;return b||(b=await $v(t,v.height,o)),{...v,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:b}},async getBlock(h){const p=await Df(t,h);await xi(t,o);const m=await Gt(t,`/block/${p}`,yd),[g,v]=await Promise.allSettled([Zv(t,p),Gt(t,`/block/${p}/status`,Bv)]);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 b=Ol(m);o.lastBlockHash=b.hash,o.lastKnownHeight=Math.max(b.height,o.lastKnownHeight??b.height);const _=g.status==="fulfilled"?g.value:[];let A=(v.status==="fulfilled"?v.value:null)?.next_best??null;return A||(A=await $v(t,b.height,o)),{...b,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:A,transactions:_.map(D=>jf(D,o))}},async getBlockTransactions(h,p=0){const m=await Df(t,h),g=await Zv(t,m,p),v=g.reduce((b,_)=>_.status.block_height?b===null?_.status.block_height:Math.max(b,_.status.block_height):b,null);return await(typeof v=="number"?xi(t,o,v):xi(t,o)),g.map(b=>jf(b,o))},async getTransactionHeader(h){return u(h)},async getTransaction(h){return u(h)},async getAddressSummary(h){const p=await Gt(t,`/address/${h}`,Uv);return E4(p)},async getAddress(h){const p=await Gt(t,`/address/${h}`,Uv),m=await Gt(t,`/address/${h}/txs`,Ku);return w4(p,m)},async getAddressTransactions(h,p){const m=await T4(t,h,p);return O0(h,m)},subscribeToEvents(h){return a.add(h),c(),()=>{a.delete(h),a.size===0&&d()}}}}function z4({baseUrl:t}){const a=A0({baseUrl:t});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:t,description:"Adapter backed by mempool.space REST API."}}}function Pl(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function M0(t,a){return Array.isArray(a)?a.length===0?!0:t?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function C0(t){if(typeof t!="function")throw new Error("function expected");return!0}function Vl(t,a){if(typeof a!="string")throw new Error(`${t}: string expected`);return!0}function to(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function Fu(t){if(!Array.isArray(t))throw new Error("array expected")}function N0(t,a){if(!M0(!0,a))throw new Error(`${t}: array of strings expected`)}function Zd(t,a){if(!M0(!1,a))throw new Error(`${t}: array of numbers expected`)}function qd(...t){const a=c=>c,i=(c,d)=>h=>c(d(h)),o=t.map(c=>c.encode).reduceRight(i,a),u=t.map(c=>c.decode).reduce(i,a);return{encode:o,decode:u}}function D0(t){const a=typeof t=="string"?t.split(""):t,i=a.length;N0("alphabet",a);const o=new Map(a.map((u,c)=>[u,c]));return{encode:u=>(Fu(u),u.map(c=>{if(!Number.isSafeInteger(c)||c<0||c>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${c}". Allowed: ${t}`);return a[c]})),decode:u=>(Fu(u),u.map(c=>{Vl("alphabet.decode",c);const d=o.get(c);if(d===void 0)throw new Error(`Unknown letter: "${c}". Allowed: ${t}`);return d}))}}function j0(t=""){return Vl("join",t),{encode:a=>(N0("join.decode",a),a.join(t)),decode:a=>(Vl("join.decode",a),a.split(t))}}function qv(t,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(Fu(t),!t.length)return[];let o=0;const u=[],c=Array.from(t,h=>{if(to(h),h<0||h>=a)throw new Error(`invalid integer: ${h}`);return h}),d=c.length;for(;;){let h=0,p=!0;for(let m=o;ma===0?t:k0(a,t%a),Ju=(t,a)=>t+(a-k0(t,a)),Bu=(()=>{let t=[];for(let a=0;a<40;a++)t.push(2**a);return t})();function vd(t,a,i,o){if(Fu(t),a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new Error(`convertRadix2: wrong to=${i}`);if(Ju(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Ju(a,i)}`);let u=0,c=0;const d=Bu[a],h=Bu[i]-1,p=[];for(const m of t){if(to(m),m>=d)throw new Error(`convertRadix2: invalid data word=${m} from=${a}`);if(u=u<32)throw new Error(`convertRadix2: carry overflow pos=${c} from=${a}`);for(c+=a;c>=i;c-=i)p.push((u>>c-i&h)>>>0);const g=Bu[c];if(g===void 0)throw new Error("invalid carry");u&=g-1}if(u=u<=a)throw new Error("Excess padding");if(!o&&u>0)throw new Error(`Non-zero padding: ${u}`);return o&&c>0&&p.push)DELIM" -R"DELIM((u>>>0),p}function R4(t){to(t);const a=2**8;return{encode:i=>{if(!Pl(i))throw new Error("radix.encode input should be Uint8Array");return qv(Array.from(i),a,t)},decode:i=>(Zd("radix.decode",i),Uint8Array.from(qv(i,t,a)))}}function O4(t,a=!1){if(to(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Ju(8,t)>32||Ju(t,8)>32)throw new Error("radix2: carry overflow");return{encode:i=>{if(!Pl(i))throw new Error("radix2.encode input should be Uint8Array");return vd(Array.from(i),8,t,!a)},decode:i=>(Zd("radix2.decode",i),Uint8Array.from(vd(i,t,8,a)))}}function Qv(t){return C0(t),function(...a){try{return t.apply(null,a)}catch{}}}function A4(t,a){return to(t),C0(a),{encode(i){if(!Pl(i))throw new Error("checksum.encode: input should be Uint8Array");const o=a(i).slice(0,t),u=new Uint8Array(i.length+t);return u.set(i),u.set(o,i.length),u},decode(i){if(!Pl(i))throw new Error("checksum.decode: input should be Uint8Array");const o=i.slice(0,-t),u=i.slice(-t),c=a(o).slice(0,t);for(let d=0;dqd(R4(58),D0(t),j0("")),C4=M4("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),N4=t=>qd(A4(4,a=>t(t(a))),C4),gd=qd(D0("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),j0("")),Yv=[996825010,642813549,513874426,1027748829,705979059];function Al(t){const a=t>>25;let i=(t&33554431)<<5;for(let o=0;o>o&1)===1&&(i^=Yv[o]);return i}function Gv(t,a,i=1){const o=t.length;let u=1;for(let c=0;c126)throw new Error(`Invalid prefix (${t})`);u=Al(u)^d>>5}u=Al(u);for(let c=0;c_)throw new TypeError(`Length ${A} exceeds limit ${_}`);const B=v.toLowerCase(),D=Gv(B,b,a);return`${B}1${gd.encode(b)}${D}`}function h(v,b=90){Vl("bech32.decode input",v);const _=v.length;if(_<8||b!==!1&&_>b)throw new TypeError(`invalid string length: ${_} (${v}). Expected (8..${b})`);const E=v.toLowerCase();if(v!==E&&v!==v.toUpperCase())throw new Error("String must be lowercase or uppercase");const A=E.lastIndexOf("1");if(A===0||A===-1)throw new Error('Letter "1" must be present between prefix and data only');const B=E.slice(0,A),D=E.slice(A+1);if(D.length<6)throw new Error("Data must be at least 6 characters long");const Q=gd.decode(D).slice(0,-6),X=Gv(B,Q,a);if(!D.endsWith(X))throw new Error(`Invalid checksum in ${v}: expected "${X}"`);return{prefix:B,words:Q}}const p=Qv(h);function m(v){const{prefix:b,words:_}=h(v,!1);return{prefix:b,words:_,bytes:o(_)}}function g(v,b){return d(v,u(b))}return{encode:d,decode:h,encodeFromBytes:g,decodeToBytes:m,decodeUnsafe:p,fromWords:o,fromWordsUnsafe:c,toWords:u}}const Iu=L0("bech32"),bd=L0("bech32m");function D4(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Qd(t,a,i=""){const o=D4(t),u=t?.length;if(!o||a!==void 0){const d=i&&`"${i}" `,h="",p=o?`length=${u}`:`type=${typeof t}`;throw new Error(d+"expected Uint8Array"+h+", got "+p)}return t}function Pv(t,a=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(a&&t.finished)throw new Error("Hash#digest() has already been called")}function j4(t,a){Qd(t,void 0,"digestInto() output");const i=a.outputLen;if(t.length='+i)}function xd(...t){for(let a=0;a>>a}const k4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",L4=Array.from({length:256},(t,a)=>a.toString(16).padStart(2,"0"));function Uu(t){if(Qd(t),k4)return t.toHex();let a="";for(let i=0;it(c).update(u).digest(),o=t(void 0);return i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.create=u=>t(u),Object.assign(i,a),Object.freeze(i)}const U4=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function H4(t,a,i){return t&a^~t&i}function $4(t,a,i){return t&a^t&i^a&i}class Z4{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,o,u){this.blockLen=a,this.outputLen=i,this.padOffset=o,this.isLE=u,this.buffer=new Uint8Array(a),this.view=kf(this.buffer)}update(a){Pv(this),Qd(a);const{view:i,buffer:o,blockLen:u}=this,c=a.length;for(let d=0;du-d&&(this.process(o,0),d=0);for(let v=d;vg.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v>>3,A=Pn(_,17)^Pn(_,19)^_>>>10;Xa[v]=A+Xa[v-7]+E+Xa[v-16]|0}let{A:o,B:u,C:c,D:d,E:h,F:p,G:m,H:g}=this;for(let v=0;v<64;v++){const b=Pn(h,6)^Pn(h,11)^Pn(h,25),_=g+b+H4(h,p,m)+q4[v]+Xa[v]|0,A=(Pn(o,2)^Pn(o,13)^Pn(o,22))+$4(o,u,c)|0;g=m,m=p,p=h,h=d+_|0,d=c,c=u,u=o,o=_+A|0}o=o+this.A|0,u=u+this.B|0,c=c+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(o,u,c,d,h,p,m,g)}roundClean(){xd(Xa)}destroy(){this.set(0,0,0,0,0,0,0,0),xd(this.buffer)}}class Y4 extends Q4{A=Va[0]|0;B=Va[1]|0;C=Va[2]|0;D=Va[3]|0;E=Va[4]|0;F=Va[5]|0;G=Va[6]|0;H=Va[7]|0;constructor(){super(32)}}const B0=B4(()=>new Y4,U4(1)),U0=N4(B0),G4=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function Yd(t){if(t.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(t.length/2);for(let i=0;i>>24,i=t&8388607;if(i===0||a<3)return;const o=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[t]}function Gd(t){const a=t.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 o=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return o.length===40?"p2wpkh":o.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function X4(){return"mainnet"}function K4(t){return t==="testnet"||t==="regtest"?{p2pkh:111,p2sh:196,hrp:t==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Vv(t,a){const i=new Uint8Array(a.length/2+1);return i[0]=t,i.set(Yd(a),1),U0.encode(i)}function Lf(t,a,i){const o=Yd(i),u=Iu.toWords(o);return u.unshift(a),(a===0?Iu:bd).encode(t,u)}function H0(t,a){const i=t.toLowerCase(),o=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(o)return{address:Vv(a.p2pkh,o[1]),type:"p2pkh"};const u=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(u)return{address:Vv(a.p2sh,u[1]),type:"p2sh"};const c=i.match(/^zero \[([0-9a-f]{40})\]/);if(c)return{address:Lf(a.hrp,0,c[1]),type:"p2wpkh"};const d=i.match(/^zero \[([0-9a-f]{64})\]/);if(d)return{address:Lf(a.hrp,0,d[1]),type:"p2wsh"};const h=i.match(/^1 \[([0-9a-f]{64})\]/);return h?{address:Lf(a.hrp,1,h[1]),type:"p2tr"}:{type:Gd(t)}}function F4(t,a){try{const u=U0.decode(t),c=u[0],d=Uu(u.slice(1));if(d.length===40&&c===a.p2pkh)return{scriptHex:`76a914${d}88ac`,type:"p2pkh"};if(d.length===40&&c===a.p2sh)return{scriptHex:`a914${d}87`,type:"p2sh"}}catch{}const i=t.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const u=i,c=p=>{try{return p.decode(u,90)}catch{return null}},d=c(Iu);if(d&&d.prefix===a.hrp){const p=d.words[)DELIM" -R"DELIM(0],m=Iu.fromWords(d.words.slice(1)),g=Uu(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=c(bd);if(h&&h.prefix===a.hrp){const p=h.words[0],m=bd.fromWords(h.words.slice(1)),g=Uu(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 Bf(t,a){const i=t.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const o=F4(t,a);if(!o)return null;const u=B0(Yd(o.scriptHex)),c=Uint8Array.from(u).reverse();return{hash:Uu(c),type:o.type}}function Ml(t,a){return{hash:t.hash,height:t.height,timestamp:t.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:P4(t.bits),previousBlockHash:t.previous}}function J4(t){const a=V4(t);return a&&a.length>0?a:void 0}function I4(t,a,i,o){const u=/^0{64}$/u.test(t.point.hash),c=a?H0(a.script,i):{address:void 0,type:void 0},d=a?a.value:void 0,h=a?a.script:void 0;return{index:o,prevTxId:u?void 0:t.point.hash,prevOutputIndex:u?void 0:t.point.index,address:c.address,valueSats:d,scriptType:c.type??Gd(h??t.script),isCoinbase:u,script:t.script?{mnemonic:t.script}:void 0,witness:J4(t.witness),sequence:t.sequence}}function W4(t,a,i){const o=H0(t.script,i);return{index:a,address:o.address,valueSats:t.value,scriptType:o.type??Gd(t.script),spent:void 0,script:t.script?{mnemonic:t.script}:void 0}}function eT(t,a){return typeof t!="number"||typeof a!="number"?0:Math.max(0,t-a+1)}function Au(t,a,i,o,u){const c=t.outputs.map((g,v)=>W4(g,v,i)),d=c.reduce((g,v)=>g+v.valueSats,0),h=a.reduce((g,v)=>v?(g??0)+v.value:g,null),p=eT(o.tipHeight,o.blockHeight),m=typeof o.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:t.hash,hash:t.hash,status:m,confirmations:p,blockHeight:o.blockHeight,blockHash:o.blockHash,receivedTime:o.timestamp,feeSats:Number.isFinite(u)?u:void 0,feeRate:null,size:void 0,weight:void 0,version:t.version,locktime:t.locktime,totalInput:h,totalOutput:d,inputs:t.inputs.map((g,v)=>I4(g,a[v],i,v)),outputs:c}}const tT=25,Xv=5e3,Uf=new Map,Hf=new Map;async function nn(t,a,i){const o=a.startsWith("/")?a:`/${a}`;let u=o.includes("?")?`${t}${o}`:`${t}${o}?format=json`;i&&(u+=u.includes("?")?"&turbo=true":"?turbo=true");const c=Hf.get(u);if(c)return c;const d=(async()=>{const h=await fetch(u);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}})();Hf.set(u,d);try{return await d}finally{Hf.delete(u)}}async function Ka(t,a,i){try{return await nn(t,a,i)}catch{return null}}async function Hu(t,a){const i=await nn(t,"/v1/top?format=json",a),o=typeof i=="number"?i:Number(i);if(!Number.isFinite(o))throw new Error("Invalid top height");return o}async function Bl(t,a){const i=Date.now(),o=`${t}|${a?"1":"0"}`,u=Uf.get(o);if(u&&u.expiresAt>i)return u.promise;const c=Hu(t,a).then(d=>(Uf.set(o,{promise:c,value:d,expiresAt:Date.now()+Xv}),d));return Uf.set(o,{promise:c,value:u?.value??null,expiresAt:i+Xv}),c}async function $f(t,a,i){if(a==="latest"||a==="tip"){const o=await Bl(t,i);return{path:`/v1/block/height/${String(o)}`,height:o}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function nT(t,a){const i=new Map;return(o,u)=>{const c=`${o}:${String(u)}`,d=i.get(c);if(d)return d;const h=nn(t,`/v1/output/${o}/${String(u)}?format=json`,a).catch(()=>null);return i.set(c,h),h}}async function aT(t,a,i){return nn(t,`${a}/txs?format=json`,i)}async function rT(t,a,i,o){return nn(t,`${a}/tx/${String(i)}?format=json`,o)}async function iT(t,a,i){return await nn(t,`${a}?format=json`,i)}async function Kv(t,a,i){return await nn(t,`/v1/address/${a}?format=json`,i).catch(()=>[])}function lT({baseUrl:t,pollIntervalMs:a=15e3,turbo:i=!1}){const o=new Set;let u=null,c=null;const d=K4(X4());function h(){u||(u=setInterval(async()=>{try{const m=await Hu(t,i);if(c===null){c=m;return}if(m>c){const g=await nn(t,`/v1/block/height/${String(m)}/header?format=json`,i),v=Ml(g);for(const b of o)b({type:"block.new",payload:v});c=m}}catch(m){console.warn("Libbitcoin poller failed",m)}},a))}function p(){u&&(clearInterval(u),u=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,endpoint:t,description:"Adapter for the libbitcoin embedded REST API."},async getLatestBlocks(m=10){const g=await Bl(t,i);c=g;const v=Array.from({length:m},(_,E)=>g-E).filter(_=>_>=0);return(await Promise.all(v.map(_=>nn(t,`/v1/block/height/${String(_)}/header?format=json`,i)))).map(_=>Ml(_))},async getBlocksBefore(m,g=10){const v=Array.from({length:g},(_,E)=>m-E).filter(_=>_>=0);return(await Promise.all(v.map(_=>nn(t,`/v1/block/height/${String(_)}/header?format=json`,i)))).map(_=>Ml(_))},async getBlockHeader(m){const{path:g,height:v}=await $f(t,m,i),[b,_]=await Promise.all([nn(t,`${g}/header?format=json`,i),v===void 0?Bl(t,i):Promi)DELIM" -R"DELIM(se.resolve(v)]);c=Math.max(c??0,_);let E=null;return b.height<_&&(E=(await Ka(t,`/v1/block/height/${String(b.height+1)}/header?format=json`,i))?.hash??null),{...Ml(b),merkleRoot:b.merkle_root,nonce:b.nonce,bits:b.bits,version:b.version,nextBlockHash:E}},async getBlock(m){const{path:g}=await $f(t,m,i),[v,b]=await Promise.all([iT(t,g,i),Bl(t,i)]);c=Math.max(c??0,b);let _=null;v.header.heightAu(D,[],d,{blockHeight:v.header.height,blockHash:v.header.hash,tipHeight:b,timestamp:v.header.timestamp}));return{...A,merkleRoot:v.header.merkle_root,nonce:v.header.nonce,bits:v.header.bits,version:v.header.version,nextBlockHash:_,transactions:B}},async getBlockTransactions(m,g=0){const{path:v}=await $f(t,m,i),b=await nn(t,`${v}/header?format=json`,i),[_,E]=await Promise.all([aT(t,v,i),Bl(t,i)]);c=Math.max(c??0,E);const A=_.slice(g,g+tT);return await Promise.all(A.map((D,Q)=>rT(t,v,g+Q,i).then(X=>Au(X,[],d,{blockHeight:b.height,blockHash:b.hash,tipHeight:E,timestamp:b.timestamp}))))},async getTransaction(m){const g=await nn(t,`/v1/tx/${m}?format=json`,i),[v,b,_]=await Promise.all([Ka(t,`/v1/tx/${m}/header?format=json`,i),Hu(t,i).catch(()=>null),Ka(t,`/v1/tx/${m}/fee?format=json`,i)]),E=nT(t,i),A=typeof _=="number"?_:Number(_),B=await Promise.all(g.inputs.map(D=>/^0{64}$/u.test(D.point.hash)?Promise.resolve(null):E(D.point.hash,D.point.index)));return Au(g,B,d,{blockHeight:v?.height,blockHash:v?.hash,tipHeight:typeof b=="number"?b:void 0,timestamp:v?.timestamp},Number.isFinite(A)?A:void 0)},async getTransactionHeader(m){const g=await nn(t,`/v1/tx/${m}?format=json`,i),[v,b,_]=await Promise.all([Ka(t,`/v1/tx/${m}/header?format=json`,i),Hu(t,i).catch(()=>null),Ka(t,`/v1/tx/${m}/fee?format=json`,i)]),E=typeof _=="number"?_:Number(_);return Au(g,[],d,{blockHeight:v?.height,blockHash:v?.hash,tipHeight:typeof b=="number"?b:void 0,timestamp:v?.timestamp},Number.isFinite(E)?E:void 0)},async getAddress(m){const g=Bf(m,d);if(!g)throw new Error("Unsupported address format for libbitcoin adapter");const[v,b]=await Promise.all([Ka(t,`/v1/address/${g.hash}/balance?format=json`,i),Kv(t,g.hash,i)]),_=typeof v=="number"?v:Number(v);let E=0;for(const D of b)E+=D.value;const A=Number.isFinite(_)?_:E,B=b.map(D=>({txid:D.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:D.value}));return{address:m,addressType:g.type,balance:A,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:void 0,transactions:B}},async getAddressSummary(m){const g=Bf(m,d);if(!g)throw new Error("Unsupported address format for libbitcoin adapter");const v=await Ka(t,`/v1/address/${g.hash}/balance?format=json`,i),b=typeof v=="number"?v:v===null?Number.NaN:Number(v),_=Number.isFinite(b)?b:0;return{address:m,addressType:g.type,balance:_,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:void 0}},async getAddressTransactions(m){const g=Bf(m,d);return g?(await Kv(t,g.hash,i)).map(b=>({txid:b.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:b.value})):[]},subscribeToEvents(m){return o.add(m),h(),()=>{o.delete(m),o.size===0&&p()}}}}const $0=O.createContext(null),Z0=O.createContext(null),q0=O.createContext(null);function oT({children:t,client:a}){return S.jsx($0.Provider,{value:a,children:t})}function uT({children:t,provider:a,setProvider:i,availableProviders:o}){return S.jsx(Z0.Provider,{value:{provider:a,setProvider:i,availableProviders:o},children:t})}function sT({children:t,turbo:a,setTurbo:i}){return S.jsx(q0.Provider,{value:{turbo:a,setTurbo:i},children:t})}function rn(){const t=O.useContext($0);if(!t)throw new Error("BlockchainClientProvider missing in component tree");return t}function Q0(){return rn().metadata}function cT(){const t=O.useContext(Z0);if(!t)throw new Error("ProviderSwitcherProvider missing in component tree");return t}function fT(){const t=O.useContext(q0);if(!t)throw new Error("TurboProvider missing in component tree");return t}function dT(){const t=globalThis.window;return t?.location.origin?t.location.origin:"http://localhost:8080"}function hT(t,a){if(t==="blockstream")return A0({baseUrl:"https://blockstream.info/api"});if(t==="mempool")return z4({baseUrl:"https://mempool.space/api"});if(t==="libbitcoin"){const i=dT();return lT({baseUrl:i,turbo:a?.turboEnabled})}return t==="external"?(console.warn("No external API URL provided, falling back to mock client"),Mf()):(t==="mock"||console.warn(`Unknown provider "${t}", falling back to mock`),Mf())}function mT(){return[...new Set(["libbitcoin","blockstream","mempool"])]}function pT({children:t}){const a="libbitcoin",i=mT(),o=(()=>{const v=globalThis.window;return v?v.localStorage.getItem("turboEnabled")==="true":!1})(),u=(()=>{const v=globalThis.window;if(!v)return a;const b=v.localStorage.getItem("blockchainProvider");return b&&i.includes(b)?b:a})(),[c,d]=O.useState(o),[h,p]=O.useState(u),[m]=O.useSta)DELIM" -R"DELIM(te(()=>new pS({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),g=O.useMemo(()=>hT(h,{turboEnabled:c}),[h,c]);return O.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("turboEnabled",c?"true":"false")},[c]),O.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("blockchainProvider",h)},[h]),S.jsx(uT,{provider:h,setProvider:p,availableProviders:i,children:S.jsx(sT,{turbo:c,setTurbo:d,children:S.jsx(oT,{client:g,children:S.jsxs(yS,{client:m,children:[t,null]})})})})}var Y0=t=>{throw TypeError(t)},yT=(t,a,i)=>a.has(t)||Y0("Cannot "+i),Zf=(t,a,i)=>(yT(t,a,"read from private field"),i?i.call(t):a.get(t)),vT=(t,a,i)=>a.has(t)?Y0("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,i),Fv="popstate";function gT(t={}){function a(o,u){let{pathname:c,search:d,hash:h}=o.location;return Xl("",{pathname:c,search:d,hash:h},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function i(o,u){return typeof u=="string"?u:Fn(u)}return xT(a,i,null,t)}function Ce(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function pt(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function bT(){return Math.random().toString(36).substring(2,10)}function Jv(t,a){return{usr:t.state,key:t.key,idx:a}}function Xl(t,a,i=null,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?nr(a):a,state:i,key:a&&a.key||o||bT()}}function Fn({pathname:t="/",search:a="",hash:i=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function nr(t){let a={};if(t){let i=t.indexOf("#");i>=0&&(a.hash=t.substring(i),t=t.substring(0,i));let o=t.indexOf("?");o>=0&&(a.search=t.substring(o),t=t.substring(0,o)),t&&(a.pathname=t)}return a}function xT(t,a,i,o={}){let{window:u=document.defaultView,v5Compat:c=!1}=o,d=u.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 B=g(),D=B==null?null:B-m;m=B,p&&p({action:h,location:A.location,delta:D})}function b(B,D){h="PUSH";let Q=Xl(A.location,B,D);m=g()+1;let X=Jv(Q,m),se=A.createHref(Q);try{d.pushState(X,"",se)}catch(ue){if(ue instanceof DOMException&&ue.name==="DataCloneError")throw ue;u.location.assign(se)}c&&p&&p({action:h,location:A.location,delta:1})}function _(B,D){h="REPLACE";let Q=Xl(A.location,B,D);m=g();let X=Jv(Q,m),se=A.createHref(Q);d.replaceState(X,"",se),c&&p&&p({action:h,location:A.location,delta:0})}function E(B){return G0(B)}let A={get action(){return h},get location(){return t(u,d)},listen(B){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(Fv,v),p=B,()=>{u.removeEventListener(Fv,v),p=null}},createHref(B){return a(u,B)},createURL:E,encodeLocation(B){let D=E(B);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:b,replace:_,go(B){return d.go(B)}};return A}function G0(t,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Ce(i,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Fn(t);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}var Ul,Iv=class{constructor(t){if(vT(this,Ul,new Map),t)for(let[a,i]of t)this.set(a,i)}get(t){if(Zf(this,Ul).has(t))return Zf(this,Ul).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Zf(this,Ul).set(t,a)}};Ul=new WeakMap;var ST=new Set(["lazy","caseSensitive","path","id","index","children"]);function _T(t){return ST.has(t)}var wT=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function ET(t){return wT.has(t)}function TT(t){return t.index===!0}function Kl(t,a,i=[],o={},u=!1){return t.map((c,d)=>{let h=[...i,String(d)],p=typeof c.id=="string"?c.id:h.join("-");if(Ce(c.index!==!0||!c.children,"Cannot specify children on an index route"),Ce(u||!o[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),TT(c)){let m={...c,id:p};return o[p]=Wv(m,a(m)),m}else{let m={...c,id:p,children:void 0};return o[p]=Wv(m,a(m)),c.children&&(m.children=Kl(c.children,a,h,o,u)),m}})}function Wv(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function Ja(t,a,i="/"){return Hl(t,a,i,!1)}function Hl(t,a,i,o){let u=typeof a=="string"?nr(a):a,c=Rn(u.pathname||"/",i);if(c==null)return null;let d=P0(t);RT(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.startsWi)DELIM" -R"DELIM(th("/")){if(!g.relativePath.startsWith(o)&&p)return;Ce(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let v=Kn([o,g.relativePath]),b=i.concat(g);d.children&&d.children.length>0&&(Ce(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),P0(d.children,a,b,v,p)),!(d.path==null&&!d.index)&&a.push({path:v,score:jT(v,d.index),routesMeta:b})};return t.forEach((d,h)=>{if(d.path===""||!d.path?.includes("?"))c(d,h);else for(let p of V0(d.path))c(d,h,!0,p)}),a}function V0(t){let a=t.split("/");if(a.length===0)return[];let[i,...o]=a,u=i.endsWith("?"),c=i.replace(/\?$/,"");if(o.length===0)return u?[c,""]:[c];let d=V0(o.join("/")),h=[];return h.push(...d.map(p=>p===""?c:[c,p].join("/"))),u&&h.push(...d),h.map(p=>t.startsWith("/")&&p===""?"/":p)}function RT(t){t.sort((a,i)=>a.score!==i.score?i.score-a.score:kT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var OT=/^:[\w-]+$/,AT=3,MT=2,CT=1,NT=10,DT=-2,eg=t=>t==="*";function jT(t,a){let i=t.split("/"),o=i.length;return i.some(eg)&&(o+=DT),a&&(o+=MT),i.filter(u=>!eg(u)).reduce((u,c)=>u+(OT.test(c)?AT:c===""?CT:NT),o)}function kT(t,a){return t.length===a.length&&t.slice(0,-1).every((o,u)=>o===a[u])?t[t.length-1]-a[a.length-1]:0}function LT(t,a,i=!1){let{routesMeta:o}=t,u={},c="/",d=[];for(let h=0;h{if(g==="*"){let E=h[b]||"";d=c.slice(0,c.length-E.length).replace(/(.)\/+$/,"$1")}const _=h[b];return v&&!_?m[g]=void 0:m[g]=(_||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:d,pattern:t}}function BT(t,a=!1,i=!0){pt(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],u="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,p)=>(o.push({paramName:h,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),u+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?u+="\\/*$":t!==""&&t!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,a?void 0:"i"),o]}function UT(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return pt(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function Rn(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=t.charAt(i);return o&&o!=="/"?null:t.slice(i)||"/"}function HT({basename:t,pathname:a}){return a==="/"?t:Kn([t,a])}var X0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rs=t=>X0.test(t);function $T(t,a="/"){let{pathname:i,search:o="",hash:u=""}=typeof t=="string"?nr(t):t,c;if(i)if(rs(i))c=i;else{if(i.includes("//")){let d=i;i=i.replace(/\/\/+/g,"/"),pt(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${i}`)}i.startsWith("/")?c=tg(i.substring(1),"/"):c=tg(i,a)}else c=a;return{pathname:c,search:qT(o),hash:QT(u)}}function tg(t,a){let i=a.replace(/\/+$/,"").split("/");return t.split("/").forEach(u=>{u===".."?i.length>1&&i.pop():u!=="."&&i.push(u)}),i.length>1?i.join("/"):"/"}function qf(t,a,i,o){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. 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 K0(t){return t.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Pd(t){let a=K0(t);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Vd(t,a,i,o=!1){let u;typeof t=="string"?u=nr(t):(u={...t},Ce(!u.pathname||!u.pathname.includes("?"),qf("?","pathname","search",u)),Ce(!u.pathname||!u.pathname.includes("#"),qf("#","pathname","hash",u)),Ce(!u.search||!u.search.includes("#"),qf("#","se)DELIM" -R"DELIM(arch","hash",u)));let c=t===""||u.pathname==="",d=c?"/":u.pathname,h;if(d==null)h=i;else{let v=a.length-1;if(!o&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),v-=1;u.pathname=b.join("/")}h=v>=0?a[v]:"/"}let p=$T(u,h),m=d&&d!=="/"&&d.endsWith("/"),g=(c||d===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(m||g)&&(p.pathname+="/"),p}var Kn=t=>t.join("/").replace(/\/\/+/g,"/"),ZT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,QT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,no=class{constructor(t,a,i,o=!1){this.status=t,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Fl(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function ao(t){return t.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var F0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function J0(t,a){let i=t;if(typeof i!="string"||!X0.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,u=!1;if(F0)try{let c=new URL(window.location.href),d=i.startsWith("//")?new URL(c.protocol+i):new URL(i),h=Rn(d.pathname,a);d.origin===c.origin&&h!=null?i=h+d.search+d.hash:u=!0}catch{pt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:u,to:i}}var Wa=Symbol("Uninstrumented");function YT(t,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(u=>u({id:a.id,index:a.index,path:a.path,instrument(c){let d=Object.keys(i);for(let h of d)c[h]&&i[h].push(c[h])}}));let o={};if(typeof a.lazy=="function"&&i.lazy.length>0){let u=Ti(i.lazy,a.lazy,()=>{});u&&(o.lazy=u)}if(typeof a.lazy=="object"){let u=a.lazy;["middleware","loader","action"].forEach(c=>{let d=u[c],h=i[`lazy.${c}`];if(typeof d=="function"&&h.length>0){let p=Ti(h,d,()=>{});p&&(o.lazy=Object.assign(o.lazy||{},{[c]:p}))}})}return["loader","action"].forEach(u=>{let c=a[u];if(typeof c=="function"&&i[u].length>0){let d=c[Wa]??c,h=Ti(i[u],d,(...p)=>ng(p[0]));h&&(h[Wa]=d,o[u]=h)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(o.middleware=a.middleware.map(u=>{let c=u[Wa]??u,d=Ti(i.middleware,c,(...h)=>ng(h[0]));return d?(d[Wa]=c,d):u})),o}function GT(t,a){let i={navigate:[],fetch:[]};if(a.forEach(o=>o({instrument(u){let c=Object.keys(u);for(let d of c)u[d]&&i[d].push(u[d])}})),i.navigate.length>0){let o=t.navigate[Wa]??t.navigate,u=Ti(i.navigate,o,(...c)=>{let[d,h]=c;return{to:typeof d=="number"||typeof d=="string"?d:d?Fn(d):".",...ag(t,h??{})}});u&&(u[Wa]=o,t.navigate=u)}if(i.fetch.length>0){let o=t.fetch[Wa]??t.fetch,u=Ti(i.fetch,o,(...c)=>{let[d,,h,p]=c;return{href:h??".",fetcherKey:d,...ag(t,p??{})}});u&&(u[Wa]=o,t.fetch=u)}return t}function Ti(t,a,i){return t.length===0?null:async(...o)=>{let u=await I0(t,i(...o),()=>a(...o),t.length-1);if(u.type==="error")throw u.value;return u.value}}async function I0(t,a,i,o){let u=t[o],c;if(u){let d,h=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=I0(t,a,i,o-1),c=await d,Ce(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await u(h,a)}catch(p){console.error("An instrumentation function threw an error:",p)}d||await h(),await d}else try{c={type:"success",value:await i()}}catch(d){c={type:"error",value:d}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function ng(t){let{request:a,context:i,params:o,unstable_pattern:u}=t;return{request:PT(a),params:{...o},unstable_pattern:u,context:VT(i)}}function ag(t,a){return{currentUrl:Fn(t.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 PT(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function VT(t){if(KT(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var XT=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function KT(t){if(t===null||typeof t!="object")return!1;const a=Object.getPrototypeOf(t);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===XT}var W0=["POST","PUT","PATCH","DELETE"],FT=new Set(W0),JT=["GET",...W0],IT=new Set(JT),eb=new Set([301,302,303,307,308]),WT=new Set([307,308]),Qf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},e3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Cl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},t3=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),tb="remix-router-trans)DELIM" -R"DELIM(itions",nb=Symbol("ResetLoaderData");function n3(t){const a=t.window?t.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";Ce(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let o=t.hydrationRouteProperties||[],u=t.mapRouteProperties||t3,c=u;if(t.unstable_instrumentations){let z=t.unstable_instrumentations;c=j=>({...u(j),...YT(z.map(q=>q.route).filter(Boolean),j)})}let d={},h=Kl(t.routes,c,void 0,d),p,m=t.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=t.dataStrategy||o3,v={...t.future},b=null,_=new Set,E=null,A=null,B=null,D=t.hydrationData!=null,Q=Ja(h,t.history.location,m),X=!1,se=null,ue;if(Q==null&&!t.patchRoutesOnNavigation){let z=Tn(404,{pathname:t.history.location.pathname}),{matches:j,route:q}=Mu(h);ue=!0,Q=j,se={[q.id]:z}}else if(Q&&!t.hydrationData&&sr(Q,h,t.history.location.pathname).active&&(Q=null),Q)if(Q.some(z=>z.route.lazy))ue=!1;else if(!Q.some(z=>Xd(z.route)))ue=!0;else{let z=t.hydrationData?t.hydrationData.loaderData:null,j=t.hydrationData?t.hydrationData.errors:null;if(j){let q=Q.findIndex(te=>j[te.route.id]!==void 0);ue=Q.slice(0,q+1).every(te=>!_d(te.route,z,j))}else ue=Q.every(q=>!_d(q.route,z,j))}else{ue=!1,Q=[];let z=sr(null,h,t.history.location.pathname);z.active&&z.matches&&(X=!0,Q=z.matches)}let me,C={historyAction:t.history.action,location:t.history.location,matches:Q,initialized:ue,navigation:Qf,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||se,fetchers:new Map,blockers:new Map},I="POP",ie=null,V=!1,ee,_e=!1,Oe=new Map,ne=null,J=!1,w=!1,k=new Set,L=new Map,ae=0,le=-1,T=new Map,Z=new Set,W=new Map,re=new Map,he=new Set,we=new Map,Re,Ie=null;function Ge(){if(b=t.history.listen(({action:z,location:j,delta:q})=>{if(Re){Re(),Re=void 0;return}pt(we.size===0||q!=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 te=lr({currentLocation:C.location,nextLocation:j,historyAction:z});if(te&&q!=null){let oe=new Promise(ge=>{Re=ge});t.history.go(q*-1),Jn(te,{state:"blocked",location:j,proceed(){Jn(te,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),oe.then(()=>t.history.go(q))},reset(){let ge=new Map(C.blockers);ge.set(te,Cl),et({blockers:ge})}}),ie?.resolve(),ie=null;return}return Mn(z,j)}),i){T3(a,Oe);let z=()=>z3(a,Oe);a.addEventListener("pagehide",z),ne=()=>a.removeEventListener("pagehide",z)}return C.initialized||Mn("POP",C.location,{initialHydration:!0}),me}function ct(){b&&b(),ne&&ne(),_.clear(),ee&&ee.abort(),C.fetchers.forEach((z,j)=>Bi(j)),C.blockers.forEach((z,j)=>co(j))}function qt(z){return _.add(z),()=>_.delete(z)}function et(z,j={}){z.matches&&(z.matches=z.matches.map(oe=>{let ge=d[oe.route.id],fe=oe.route;return fe.element!==ge.element||fe.errorElement!==ge.errorElement||fe.hydrateFallbackElement!==ge.hydrateFallbackElement?{...oe,route:ge}:oe})),C={...C,...z};let q=[],te=[];C.fetchers.forEach((oe,ge)=>{oe.state==="idle"&&(he.has(ge)?q.push(ge):te.push(ge))}),he.forEach(oe=>{!C.fetchers.has(oe)&&!L.has(oe)&&q.push(oe)}),[..._].forEach(oe=>oe(C,{deletedFetchers:q,newErrors:z.errors??null,viewTransitionOpts:j.viewTransitionOpts,flushSync:j.flushSync===!0})),q.forEach(oe=>Bi(oe)),te.forEach(oe=>C.fetchers.delete(oe))}function Pt(z,j,{flushSync:q}={}){let te=C.actionData!=null&&C.navigation.formMethod!=null&&Zt(C.navigation.formMethod)&&C.navigation.state==="loading"&&z.state?._isRedirect!==!0,oe;j.actionData?Object.keys(j.actionData).length>0?oe=j.actionData:oe=null:te?oe=C.actionData:oe=null;let ge=j.loaderData?hg(C.loaderData,j.loaderData,j.matches||[],j.errors):C.loaderData,fe=C.blockers;fe.size>0&&(fe=new Map(fe),fe.forEach((Ee,be)=>fe.set(be,Cl)));let ce=J?!1:fo(z,j.matches||C.matches),de=V===!0||C.navigation.formMethod!=null&&Zt(C.navigation.formMethod)&&z.state?._isRedirect!==!0;p&&(h=p,p=void 0),J||I==="POP"||(I==="PUSH"?t.history.push(z,z.state):I==="REPLACE"&&t.history.replace(z,z.state));let ve;if(I==="POP"){let Ee=Oe.get(C.location.pathname);Ee&&Ee.has(z.pathname)?ve={currentLocation:C.location,nextLocation:z}:Oe.has(z.pathname)&&(ve={currentLocation:z,nextLocation:C.location})}else if(_e){let Ee=Oe.get(C.location.pathname);Ee?Ee.add(z.pathname):(Ee=new Set([z.pathname]),Oe.set(C.location.pathname,Ee)),ve={currentLocation:C.location,nextLocation:z}}et({...j,actionData:oe,loaderData:ge,historyAction:I,location:z,initialized:!0,navigation:Qf,revalidation:"idle",restoreScrollPosition:ce,preventScrollRese)DELIM" -R"DELIM(t:de,blockers:fe},{viewTransitionOpts:ve,flushSync:q===!0}),I="POP",V=!1,_e=!1,J=!1,w=!1,ie?.resolve(),ie=null,Ie?.resolve(),Ie=null}async function Zn(z,j){if(ie?.resolve(),ie=null,typeof z=="number"){ie||(ie=vg());let Le=ie.promise;return t.history.go(z),Le}let q=Sd(C.location,C.matches,m,z,j?.fromRouteId,j?.relative),{path:te,submission:oe,error:ge}=rg(!1,q,j),fe=C.location,ce=Xl(C.location,te,j&&j.state);ce={...ce,...t.history.encodeLocation(ce)};let de=j&&j.replace!=null?j.replace:void 0,ve="PUSH";de===!0?ve="REPLACE":de===!1||oe!=null&&Zt(oe.formMethod)&&oe.formAction===C.location.pathname+C.location.search&&(ve="REPLACE");let Ee=j&&"preventScrollReset"in j?j.preventScrollReset===!0:void 0,be=(j&&j.flushSync)===!0,Ze=lr({currentLocation:fe,nextLocation:ce,historyAction:ve});if(Ze){Jn(Ze,{state:"blocked",location:ce,proceed(){Jn(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),Zn(z,j)},reset(){let Le=new Map(C.blockers);Le.set(Ze,Cl),et({blockers:Le})}});return}await Mn(ve,ce,{submission:oe,pendingError:ge,preventScrollReset:Ee,replace:j&&j.replace,enableViewTransition:j&&j.viewTransition,flushSync:be,callSiteDefaultShouldRevalidate:j&&j.unstable_defaultShouldRevalidate})}function Ni(){Ie||(Ie=vg()),$r(),et({revalidation:"loading"});let z=Ie.promise;return C.navigation.state==="submitting"?z:C.navigation.state==="idle"?(Mn(C.historyAction,C.location,{startUninterruptedRevalidation:!0}),z):(Mn(I||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:_e===!0}),z)}async function Mn(z,j,q){ee&&ee.abort(),ee=null,I=z,J=(q&&q.startUninterruptedRevalidation)===!0,ur(C.location,C.matches),V=(q&&q.preventScrollReset)===!0,_e=(q&&q.enableViewTransition)===!0;let te=p||h,oe=q&&q.overrideNavigation,ge=q?.initialHydration&&C.matches&&C.matches.length>0&&!X?C.matches:Ja(te,j,m),fe=(q&&q.flushSync)===!0;if(ge&&C.initialized&&!w&&p3(C.location,j)&&!(q&&q.submission&&Zt(q.submission.formMethod))){Pt(j,{matches:ge},{flushSync:fe});return}let ce=sr(ge,te,j.pathname);if(ce.active&&ce.matches&&(ge=ce.matches),!ge){let{error:ft,notFoundMatches:dt,route:Be}=Sa(j.pathname);Pt(j,{matches:dt,loaderData:{},errors:{[Be.id]:ft}},{flushSync:fe});return}ee=new AbortController;let de=wi(t.history,j,ee.signal,q&&q.submission),ve=t.getContext?await t.getContext():new Iv,Ee;if(q&&q.pendingError)Ee=[Ia(ge).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&Zt(q.submission.formMethod)){let ft=await us(de,j,q.submission,ge,ve,ce.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:fe});if(ft.shortCircuited)return;if(ft.pendingActionResult){let[dt,Be]=ft.pendingActionResult;if(mn(Be)&&Fl(Be.error)&&Be.error.status===404){ee=null,Pt(j,{matches:ft.matches,loaderData:{},errors:{[dt]:Be.error}});return}}ge=ft.matches||ge,Ee=ft.pendingActionResult,oe=Yf(j,q.submission),fe=!1,ce.active=!1,de=wi(t.history,de.url,de.signal)}let{shortCircuited:be,matches:Ze,loaderData:Le,errors:ut}=await uo(de,j,ge,ve,ce.active,oe,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,fe,Ee,q&&q.callSiteDefaultShouldRevalidate);be||(ee=null,Pt(j,{matches:Ze||ge,...mg(Ee),loaderData:Le,errors:ut}))}async function us(z,j,q,te,oe,ge,fe,ce={}){$r();let de=w3(j,q);if(et({navigation:de},{flushSync:ce.flushSync===!0}),ge){let be=await _a(te,j.pathname,z.signal);if(be.type==="aborted")return{shortCircuited:!0};if(be.type==="error"){if(be.partialMatches.length===0){let{matches:Le,route:ut}=Mu(h);return{matches:Le,pendingActionResult:[ut.id,{type:"error",error:be.error}]}}let Ze=Ia(be.partialMatches).route.id;return{matches:be.partialMatches,pendingActionResult:[Ze,{type:"error",error:be.error}]}}else if(be.matches)te=be.matches;else{let{notFoundMatches:Ze,error:Le,route:ut}=Sa(j.pathname);return{matches:Ze,pendingActionResult:[ut.id,{type:"error",error:Le}]}}}let ve,Ee=$u(te,j);if(!Ee.route.action&&!Ee.route.lazy)ve={type:"error",error:Tn(405,{method:z.method,pathname:j.pathname,routeId:Ee.route.id})};else{let be=Ri(c,d,z,te,Ee,fe?[]:o,oe),Ze=await rr(z,be,oe,null);if(ve=Ze[Ee.route.id],!ve){for(let Le of te)if(Ze[Le.route.id]){ve=Ze[Le.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(Mr(ve)){let be;return ce&&ce.replace!=null?be=ce.replace:be=cg(ve.response.headers.get("Location"),new URL(z.url),m)===C.location.pathname+C.location.search,await yt(z,ve,!0,{submission:q,replace:be}),{shortCircuited:!0}}if(mn(ve)){let be=Ia(te,Ee.route.id);return(ce&&ce.replace)!==!0&&(I="PUSH"),{matches:te,pendingActionResult:[be.route.id,ve,Ee.route.id]}}return{matches:te,pendingActionResult:[Ee.route.id,ve]}}async function uo(z,j,q,te,oe,ge,fe,ce,de,ve,Ee,be,Ze){let Le=ge||Yf(j,fe),ut=fe||ce||yg(Le),ft=!J&&!ve;if(oe){if(ft){let vt=Hr(be);et({navigation:Le,...vt!==void 0?{actionData:vt}:{}},{flushSync:Ee})}let Ue=await _a(q,j.pathname,z.signal);if(Ue.type==="aborted")return{shortCircuited:!0};if(Ue.type==="error"){if(Ue.partialMatches.length===0){let{matches:kn,route:Nt)DELIM" -R"DELIM(}=Mu(h);return{matches:kn,loaderData:{},errors:{[Nt.id]:Ue.error}}}let vt=Ia(Ue.partialMatches).route.id;return{matches:Ue.partialMatches,loaderData:{},errors:{[vt]:Ue.error}}}else if(Ue.matches)q=Ue.matches;else{let{error:vt,notFoundMatches:kn,route:Nt}=Sa(j.pathname);return{matches:kn,loaderData:{},errors:{[Nt.id]:vt}}}}let dt=p||h,{dsMatches:Be,revalidatingFetchers:At}=ig(z,te,c,d,t.history,C,q,ut,j,ve?[]:o,ve===!0,w,k,he,W,Z,dt,m,t.patchRoutesOnNavigation!=null,be,Ze);if(le=++ae,!t.dataStrategy&&!Be.some(Ue=>Ue.shouldLoad)&&!Be.some(Ue=>Ue.route.middleware&&Ue.route.middleware.length>0)&&At.length===0){let Ue=Ht();return Pt(j,{matches:q,loaderData:{},errors:be&&mn(be[1])?{[be[0]]:be[1].error}:null,...mg(be),...Ue?{fetchers:new Map(C.fetchers)}:{}},{flushSync:Ee}),{shortCircuited:!0}}if(ft){let Ue={};if(!oe){Ue.navigation=Le;let vt=Hr(be);vt!==void 0&&(Ue.actionData=vt)}At.length>0&&(Ue.fetchers=Di(At)),et(Ue,{flushSync:Ee})}At.forEach(Ue=>{ot(Ue.key),Ue.controller&&L.set(Ue.key,Ue.controller)});let Xt=()=>At.forEach(Ue=>ot(Ue.key));ee&&ee.signal.addEventListener("abort",Xt);let{loaderResults:rt,fetcherResults:Dn}=await ki(Be,At,z,te);if(z.signal.aborted)return{shortCircuited:!0};ee&&ee.signal.removeEventListener("abort",Xt),At.forEach(Ue=>L.delete(Ue.key));let ln=Cu(rt);if(ln)return await yt(z,ln.result,!0,{replace:de}),{shortCircuited:!0};if(ln=Cu(Dn),ln)return Z.add(ln.key),await yt(z,ln.result,!0,{replace:de}),{shortCircuited:!0};let{loaderData:jn,errors:pn}=dg(C,q,rt,be,At,Dn);ve&&C.errors&&(pn={...C.errors,...pn});let Wn=Ht(),cr=so(le),fr=Wn||cr||At.length>0;return{matches:q,loaderData:jn,errors:pn,...fr?{fetchers:new Map(C.fetchers)}:{}}}function Hr(z){if(z&&!mn(z[1]))return{[z[0]]:z[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function Di(z){return z.forEach(j=>{let q=C.fetchers.get(j.key),te=Nl(void 0,q?q.data:void 0);C.fetchers.set(j.key,te)}),new Map(C.fetchers)}async function ji(z,j,q,te){ot(z);let oe=(te&&te.flushSync)===!0,ge=p||h,fe=Sd(C.location,C.matches,m,q,j,te?.relative),ce=Ja(ge,fe,m),de=sr(ce,ge,fe);if(de.active&&de.matches&&(ce=de.matches),!ce){Cn(z,j,Tn(404,{pathname:fe}),{flushSync:oe});return}let{path:ve,submission:Ee,error:be}=rg(!0,fe,te);if(be){Cn(z,j,be,{flushSync:oe});return}let Ze=t.getContext?await t.getContext():new Iv,Le=(te&&te.preventScrollReset)===!0;if(Ee&&Zt(Ee.formMethod)){await ss(z,j,ve,ce,Ze,de.active,oe,Le,Ee,te&&te.unstable_defaultShouldRevalidate);return}W.set(z,{routeId:j,path:ve}),await cs(z,j,ve,ce,Ze,de.active,oe,Le,Ee)}async function ss(z,j,q,te,oe,ge,fe,ce,de,ve){$r(),W.delete(z);let Ee=C.fetchers.get(z);Vt(z,E3(de,Ee),{flushSync:fe});let be=new AbortController,Ze=wi(t.history,q,be.signal,de);if(ge){let He=await _a(te,new URL(Ze.url).pathname,Ze.signal,z);if(He.type==="aborted")return;if(He.type==="error"){Cn(z,j,He.error,{flushSync:fe});return}else if(He.matches)te=He.matches;else{Cn(z,j,Tn(404,{pathname:q}),{flushSync:fe});return}}let Le=$u(te,q);if(!Le.route.action&&!Le.route.lazy){let He=Tn(405,{method:de.formMethod,pathname:q,routeId:j});Cn(z,j,He,{flushSync:fe});return}L.set(z,be);let ut=ae,ft=Ri(c,d,Ze,te,Le,o,oe),dt=await rr(Ze,ft,oe,z),Be=dt[Le.route.id];if(!Be){for(let He of ft)if(dt[He.route.id]){Be=dt[He.route.id];break}}if(Ze.signal.aborted){L.get(z)===be&&L.delete(z);return}if(he.has(z)){if(Mr(Be)||mn(Be)){Vt(z,va(void 0));return}}else{if(Mr(Be))if(L.delete(z),le>ut){Vt(z,va(void 0));return}else return Z.add(z),Vt(z,Nl(de)),yt(Ze,Be,!1,{fetcherSubmission:de,preventScrollReset:ce});if(mn(Be)){Cn(z,j,Be.error);return}}let At=C.navigation.location||C.location,Xt=wi(t.history,At,be.signal),rt=p||h,Dn=C.navigation.state!=="idle"?Ja(rt,C.navigation.location,m):C.matches;Ce(Dn,"Didn't find any matches after fetcher action");let ln=++ae;T.set(z,ln);let jn=Nl(de,Be.data);C.fetchers.set(z,jn);let{dsMatches:pn,revalidatingFetchers:Wn}=ig(Xt,oe,c,d,t.history,C,Dn,de,At,o,!1,w,k,he,W,Z,rt,m,t.patchRoutesOnNavigation!=null,[Le.route.id,Be],ve);Wn.filter(He=>He.key!==z).forEach(He=>{let dr=He.key,mo=C.fetchers.get(dr),Ui=Nl(void 0,mo?mo.data:void 0);C.fetchers.set(dr,Ui),ot(dr),He.controller&&L.set(dr,He.controller)}),et({fetchers:new Map(C.fetchers)});let cr=()=>Wn.forEach(He=>ot(He.key));be.signal.addEventListener("abort",cr);let{loaderResults:fr,fetcherResults:Ue}=await ki(pn,Wn,Xt,oe);if(be.signal.aborted)return;if(be.signal.removeEventListener("abort",cr),T.delete(z),L.delete(z),Wn.forEach(He=>L.delete(He.key)),C.fetchers.has(z)){let He=va(Be.data);C.fetchers.set(z,He)}let vt=Cu(fr);if(vt)return yt(Xt,vt.result,!1,{preventScrollReset:ce});if(vt=Cu(Ue),vt)return Z.add(vt.key),yt(Xt,vt.result,!1,{preventScrollReset:ce});let{loaderData:kn,errors:Nt}=dg(C,Dn,fr,void 0,Wn,Ue);so(ln),C.navigation.state==="loading"&&ln>le?(Ce(I,"Expected pending action"),ee&&ee.abort(),Pt(C.navigation.location,{matches:Dn,loaderData:kn,errors:Nt,fetchers:new Map(C.fetchers)})):(et({errors:Nt,loaderData:hg(C.loaderData,kn,Dn,Nt),fe)DELIM" -R"DELIM(tchers:new Map(C.fetchers)}),w=!1)}async function cs(z,j,q,te,oe,ge,fe,ce,de){let ve=C.fetchers.get(z);Vt(z,Nl(de,ve?ve.data:void 0),{flushSync:fe});let Ee=new AbortController,be=wi(t.history,q,Ee.signal);if(ge){let Be=await _a(te,new URL(be.url).pathname,be.signal,z);if(Be.type==="aborted")return;if(Be.type==="error"){Cn(z,j,Be.error,{flushSync:fe});return}else if(Be.matches)te=Be.matches;else{Cn(z,j,Tn(404,{pathname:q}),{flushSync:fe});return}}let Ze=$u(te,q);L.set(z,Ee);let Le=ae,ut=Ri(c,d,be,te,Ze,o,oe),dt=(await rr(be,ut,oe,z))[Ze.route.id];if(L.get(z)===Ee&&L.delete(z),!be.signal.aborted){if(he.has(z)){Vt(z,va(void 0));return}if(Mr(dt))if(le>Le){Vt(z,va(void 0));return}else{Z.add(z),await yt(be,dt,!1,{preventScrollReset:ce});return}if(mn(dt)){Cn(z,j,dt.error);return}Vt(z,va(dt.data))}}async function yt(z,j,q,{submission:te,fetcherSubmission:oe,preventScrollReset:ge,replace:fe}={}){q||(ie?.resolve(),ie=null),j.response.headers.has("X-Remix-Revalidate")&&(w=!0);let ce=j.response.headers.get("Location");Ce(ce,"Expected a Location header on the redirect Response"),ce=cg(ce,new URL(z.url),m);let de=Xl(C.location,ce,{_isRedirect:!0});if(i){let ut=!1;if(j.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(rs(ce)){const ft=G0(ce,!0);ut=ft.origin!==a.location.origin||Rn(ft.pathname,m)==null}if(ut){fe?a.location.replace(ce):a.location.assign(ce);return}}ee=null;let ve=fe===!0||j.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ee,formAction:be,formEncType:Ze}=C.navigation;!te&&!oe&&Ee&&be&&Ze&&(te=yg(C.navigation));let Le=te||oe;if(WT.has(j.response.status)&&Le&&Zt(Le.formMethod))await Mn(ve,de,{submission:{...Le,formAction:ce},preventScrollReset:ge||V,enableViewTransition:q?_e:void 0});else{let ut=Yf(de,te);await Mn(ve,de,{overrideNavigation:ut,fetcherSubmission:oe,preventScrollReset:ge||V,enableViewTransition:q?_e:void 0})}}async function rr(z,j,q,te){let oe,ge={};try{oe=await s3(g,z,j,te,q,!1)}catch(fe){return j.filter(ce=>ce.shouldLoad).forEach(ce=>{ge[ce.route.id]={type:"error",error:fe}}),ge}if(z.signal.aborted)return ge;if(!Zt(z.method))for(let fe of j){if(oe[fe.route.id]?.type==="error")break;!oe.hasOwnProperty(fe.route.id)&&!C.loaderData.hasOwnProperty(fe.route.id)&&(!C.errors||!C.errors.hasOwnProperty(fe.route.id))&&fe.shouldCallHandler()&&(oe[fe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${fe.route.id}`)})}for(let[fe,ce]of Object.entries(oe))if(b3(ce)){let de=ce.result;ge[fe]={type:"redirect",response:h3(de,z,fe,j,m)}}else ge[fe]=await d3(ce);return ge}async function ki(z,j,q,te){let oe=rr(q,z,te,null),ge=Promise.all(j.map(async de=>{if(de.matches&&de.match&&de.request&&de.controller){let Ee=(await rr(de.request,de.matches,te,de.key))[de.match.route.id];return{[de.key]:Ee}}else return Promise.resolve({[de.key]:{type:"error",error:Tn(404,{pathname:de.path})}})})),fe=await oe,ce=(await ge).reduce((de,ve)=>Object.assign(de,ve),{});return{loaderResults:fe,fetcherResults:ce}}function $r(){w=!0,W.forEach((z,j)=>{L.has(j)&&k.add(j),ot(j)})}function Vt(z,j,q={}){C.fetchers.set(z,j),et({fetchers:new Map(C.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Cn(z,j,q,te={}){let oe=Ia(C.matches,j);Bi(z),et({errors:{[oe.route.id]:q},fetchers:new Map(C.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Li(z){return re.set(z,(re.get(z)||0)+1),he.has(z)&&he.delete(z),C.fetchers.get(z)||e3}function fs(z,j){ot(z,j?.reason),Vt(z,va(null))}function Bi(z){let j=C.fetchers.get(z);L.has(z)&&!(j&&j.state==="loading"&&T.has(z))&&ot(z),W.delete(z),T.delete(z),Z.delete(z),he.delete(z),k.delete(z),C.fetchers.delete(z)}function ir(z){let j=(re.get(z)||0)-1;j<=0?(re.delete(z),he.add(z)):re.set(z,j),et({fetchers:new Map(C.fetchers)})}function ot(z,j){let q=L.get(z);q&&(q.abort(j),L.delete(z))}function Nn(z){for(let j of z){let q=Li(j),te=va(q.data);C.fetchers.set(j,te)}}function Ht(){let z=[],j=!1;for(let q of Z){let te=C.fetchers.get(q);Ce(te,`Expected fetcher: ${q}`),te.state==="loading"&&(Z.delete(q),z.push(q),j=!0)}return Nn(z),j}function so(z){let j=[];for(let[q,te]of T)if(te0}function ds(z,j){let q=C.blockers.get(z)||Cl;return we.get(z)!==j&&we.set(z,j),q}function co(z){C.blockers.delete(z),we.delete(z)}function Jn(z,j){let q=C.blockers.get(z)||Cl;Ce(q.state==="unblocked"&&j.state==="blocked"||q.state==="blocked"&&j.state==="blocked"||q.state==="blocked"&&j.state==="proceeding"||q.state==="blocked"&&j.state==="unblocked"||q.state==="proceeding"&&j.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${j.state}`);let te=new Map(C.blockers);te.set(z,j),et({blockers:te})}function lr({currentLocation:z,nextLocation:j,historyAction:q}){if(we.size===0)return;we.size>1&&pt(!1,"A router only supports one blocker at a time");let te=Array.from(we.entries()),[oe,ge]=te[te.length-1],fe=C.blockers.get(oe))DELIM" -R"DELIM(;if(!(fe&&fe.state==="proceeding")&&ge({currentLocation:z,nextLocation:j,historyAction:q}))return oe}function Sa(z){let j=Tn(404,{pathname:z}),q=p||h,{matches:te,route:oe}=Mu(q);return{notFoundMatches:te,route:oe,error:j}}function In(z,j,q){if(E=z,B=j,A=q||null,!D&&C.navigation===Qf){D=!0;let te=fo(C.location,C.matches);te!=null&&et({restoreScrollPosition:te})}return()=>{E=null,B=null,A=null}}function or(z,j){return A&&A(z,j.map(te=>zT(te,C.loaderData)))||z.key}function ur(z,j){if(E&&B){let q=or(z,j);E[q]=B()}}function fo(z,j){if(E){let q=or(z,j),te=E[q];if(typeof te=="number")return te}return null}function sr(z,j,q){if(t.patchRoutesOnNavigation)if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:Hl(j,q,m,!0)}}else return{active:!0,matches:Hl(j,q,m,!0)||[]};return{active:!1,matches:null}}async function _a(z,j,q,te){if(!t.patchRoutesOnNavigation)return{type:"success",matches:z};let oe=z;for(;;){let ge=p==null,fe=p||h,ce=d;try{await t.patchRoutesOnNavigation({signal:q,path:j,matches:oe,fetcherKey:te,patch:(Ee,be)=>{q.aborted||lg(Ee,be,fe,ce,c,!1)}})}catch(Ee){return{type:"error",error:Ee,partialMatches:oe}}finally{ge&&!q.aborted&&(h=[...h])}if(q.aborted)return{type:"aborted"};let de=Ja(fe,j,m),ve=null;if(de){if(Object.keys(de[0].params).length===0)return{type:"success",matches:de};if(ve=Hl(fe,j,m,!0),!(ve&&oe.lengthq.route.id===j[te].route.id)}function hs(z){d={},p=Kl(z,c,void 0,d)}function ho(z,j,q=!1){let te=p==null;lg(z,j,p||h,d,c,q),te&&(h=[...h],et({}))}return me={get basename(){return m},get future(){return v},get state(){return C},get routes(){return h},get window(){return a},initialize:Ge,subscribe:qt,enableScrollRestoration:In,navigate:Zn,fetch:ji,revalidate:Ni,createHref:z=>t.history.createHref(z),encodeLocation:z=>t.history.encodeLocation(z),getFetcher:Li,resetFetcher:fs,deleteFetcher:ir,dispose:ct,getBlocker:ds,deleteBlocker:co,patchRoutes:ho,_internalFetchControllers:L,_internalSetRoutes:hs,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){et(z)}},t.unstable_instrumentations&&(me=GT(me,t.unstable_instrumentations.map(z=>z.router).filter(Boolean))),me}function a3(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Sd(t,a,i,o,u,c){let d,h;if(u){d=[];for(let m of a)if(d.push(m),m.route.id===u){h=m;break}}else d=a,h=a[a.length-1];let p=Vd(o||".",Pd(d),Rn(t.pathname,i)||t.pathname,c==="path");if(o==null&&(p.search=t.search,p.hash=t.hash),(o==null||o===""||o===".")&&h){let m=Fd(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 b=g.toString();p.search=b?`?${b}`:""}}return i!=="/"&&(p.pathname=HT({basename:i,pathname:p.pathname})),Fn(p)}function rg(t,a,i){if(!i||!a3(i))return{path:a};if(i.formMethod&&!_3(i.formMethod))return{path:a,error:Tn(405,{method:i.formMethod})};let o=()=>({path:a,error:Tn(400,{type:"invalid-body"})}),c=(i.formMethod||"get").toUpperCase(),d=ub(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Zt(c))return o();let v=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((b,[_,E])=>`${b}${_}=${E} -`,""):String(i.body);return{path:a,submission:{formMethod:c,formAction:d,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!Zt(c))return o();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:c,formAction:d,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return o()}}}Ce(typeof FormData=="function","FormData is not available in this environment");let h,p;if(i.formData)h=Ed(i.formData),p=i.formData;else if(i.body instanceof FormData)h=Ed(i.body),p=i.body;else if(i.body instanceof URLSearchParams)h=i.body,p=fg(h);else if(i.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(i.body),p=fg(h)}catch{return o()}let m={formMethod:c,formAction:d,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Zt(m.formMethod))return{path:a,submission:m};let g=nr(a);return t&&g.search&&Fd(g.search)&&h.append("index",""),g.search=`?${h}`,{path:Fn(g),submission:m}}function ig(t,a,i,o,u,c,d,h,p,m,g,v,b,_,E,A,B,D,Q,X,se){let ue=X?mn(X[1])?X[1].error:X[1].data:void 0,me=u.createURL(c.location),C=u.createURL(p),I;if(g&&c.errors){let J=Object.keys(c.errors)[0];I=d.findIndex(w=>w.route.id===J)}else if(X&&mn(X[1])){let J=X[0];I=d.findIndex(w=>w.route.id===J)-1}let ie=X?X[1].statusCode:void 0,V=ie&&ie>=400,ee={currentUrl:me,currentParams:c.matches[0]?.params||{},nextUrl:C,nextP)DELIM" -R"DELIM(arams:d[0].params,...h,actionResult:ue,actionStatus:ie},_e=ao(d),Oe=d.map((J,w)=>{let{route:k}=J,L=null;if(I!=null&&w>I?L=!1:k.lazy?L=!0:Xd(k)?g?L=_d(k,c.loaderData,c.errors):r3(c.loaderData,c.matches[w],J)&&(L=!0):L=!1,L!==null)return wd(i,o,t,_e,J,m,a,L);let ae=!1;typeof se=="boolean"?ae=se:V?ae=!1:(v||me.pathname+me.search===C.pathname+C.search||me.search!==C.search||i3(c.matches[w],J))&&(ae=!0);let le={...ee,defaultShouldRevalidate:ae},T=Zl(J,le);return wd(i,o,t,_e,J,m,a,T,le,se)}),ne=[];return E.forEach((J,w)=>{if(g||!d.some(re=>re.route.id===J.routeId)||_.has(w))return;let k=c.fetchers.get(w),L=k&&k.state!=="idle"&&k.data===void 0,ae=Ja(B,J.path,D);if(!ae){if(Q&&L)return;ne.push({key:w,routeId:J.routeId,path:J.path,matches:null,match:null,request:null,controller:null});return}if(A.has(w))return;let le=$u(ae,J.path),T=new AbortController,Z=wi(u,J.path,T.signal),W=null;if(b.has(w))b.delete(w),W=Ri(i,o,Z,ae,le,m,a);else if(L)v&&(W=Ri(i,o,Z,ae,le,m,a));else{let re;typeof se=="boolean"?re=se:V?re=!1:re=v;let he={...ee,defaultShouldRevalidate:re};Zl(le,he)&&(W=Ri(i,o,Z,ae,le,m,a,he))}W&&ne.push({key:w,routeId:J.routeId,path:J.path,matches:W,match:le,request:Z,controller:T})}),{dsMatches:Oe,revalidatingFetchers:ne}}function Xd(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function _d(t,a,i){if(t.lazy)return!0;if(!Xd(t))return!1;let o=a!=null&&t.id in a,u=i!=null&&i[t.id]!==void 0;return!o&&u?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!o&&!u}function r3(t,a,i){let o=!a||i.route.id!==a.route.id,u=!t.hasOwnProperty(i.route.id);return o||u}function i3(t,a){let i=t.route.path;return t.pathname!==a.pathname||i!=null&&i.endsWith("*")&&t.params["*"]!==a.params["*"]}function Zl(t,a){if(t.route.shouldRevalidate){let i=t.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function lg(t,a,i,o,u,c){let d;if(t){let m=o[t];Ce(m,`No route found to patch children into: routeId = ${t}`),m.children||(m.children=[]),d=m.children}else d=i;let h=[],p=[];if(a.forEach(m=>{let g=d.find(v=>ab(m,v));g?p.push({existingRoute:g,newRoute:m}):h.push(m)}),h.length>0){let m=Kl(h,u,[t||"_","patch",String(d?.length||"0")],o);d.push(...m)}if(c&&p.length>0)for(let m=0;ma.children?.some(u=>ab(i,u))):!1}var og=new WeakMap,rb=({key:t,route:a,manifest:i,mapRouteProperties:o})=>{let u=i[a.id];if(Ce(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let c=u.lazy[t];if(!c)return;let d=og.get(u);d||(d={},og.set(u,d));let h=d[t];if(h)return h;let p=(async()=>{let m=_T(t),v=u[t]!==void 0&&t!=="hasErrorBoundary";if(m)pt(!m,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),d[t]=Promise.resolve();else if(v)pt(!1,`Route "${u.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let b=await c();b!=null&&(Object.assign(u,{[t]:b}),Object.assign(u,o(u)))}typeof u.lazy=="object"&&(u.lazy[t]=void 0,Object.values(u.lazy).every(b=>b===void 0)&&(u.lazy=void 0))})();return d[t]=p,p},ug=new WeakMap;function l3(t,a,i,o,u){let c=i[t.id];if(Ce(c,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let g=ug.get(c);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{Ce(typeof t.lazy=="function","No lazy route function found");let b=await t.lazy(),_={};for(let E in b){let A=b[E];if(A===void 0)continue;let B=ET(E),Q=c[E]!==void 0&&E!=="hasErrorBoundary";B?pt(!B,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Q?pt(!Q,`Route "${c.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]=A}Object.assign(c,_),Object.assign(c,{...o(c),lazy:void 0})})();return ug.set(c,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let d=Object.keys(t.lazy),h=[],p;for(let g of d){if(u&&u.includes(g))continue;let v=rb({key:g,route:t,manifest:i,mapRouteProperties:o});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 sg(t){let a=t.matches.filter(u=>u.shouldLoad),i={};return(await Promise.all(a.map(u=>u.resolve()))).forEach((u,c)=>{i[a[c].route.id]=u}),i}async function o3(t){return t.matches.some(a=>a.route.middl)DELIM" -R"DELIM(eware)?ib(t,()=>sg(t)):sg(t)}function ib(t,a){return u3(t,a,o=>{if(S3(o))throw o;return o},v3,i);function i(o,u,c){if(c)return Promise.resolve(Object.assign(c.value,{[u]:{type:"error",result:o}}));{let{matches:d}=t,h=Math.min(Math.max(d.findIndex(m=>m.route.id===u),0),Math.max(d.findIndex(m=>m.shouldCallHandler()),0)),p=Ia(d,d[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:o}})}}}async function u3(t,a,i,o,u){let{matches:c,request:d,params:h,context:p,unstable_pattern:m}=t,g=c.flatMap(b=>b.route.middleware?b.route.middleware.map(_=>[b.route.id,_]):[]);return await lb({request:d,params:h,context:p,unstable_pattern:m},g,a,i,o,u)}async function lb(t,a,i,o,u,c,d=0){let{request:h}=t;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,b=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await lb(t,a,i,o,u,c,d+1)},v.value}catch(_){return v={value:await c(_,m,v)},v.value}};try{let _=await g(t,b),E=_!=null?o(_):void 0;return u(E)?E:v?E??v.value:(v={value:await b()},v.value)}catch(_){return await c(_,m,v)}}function ob(t,a,i,o,u){let c=rb({key:"middleware",route:o.route,manifest:a,mapRouteProperties:t}),d=l3(o.route,Zt(i.method)?"action":"loader",a,t,u);return{middleware:c,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function wd(t,a,i,o,u,c,d,h,p=null,m){let g=!1,v=ob(t,a,i,u,c);return{...u,_lazyPromises:v,shouldLoad:h,shouldRevalidateArgs:p,shouldCallHandler(b){return g=!0,p?typeof m=="boolean"?Zl(u,{...p,defaultShouldRevalidate:m}):typeof b=="boolean"?Zl(u,{...p,defaultShouldRevalidate:b}):Zl(u,p):h},resolve(b){let{lazy:_,loader:E,middleware:A}=u.route,B=g||h||b&&!Zt(i.method)&&(_||E),D=A&&A.length>0&&!E&&!_;return B&&(Zt(i.method)||!D)?c3({request:i,unstable_pattern:o,match:u,lazyHandlerPromise:v?.handler,lazyRoutePromise:v?.route,handlerOverride:b,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Ri(t,a,i,o,u,c,d,h=null){return o.map(p=>p.route.id!==u.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:ob(t,a,i,p,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:wd(t,a,i,ao(o),p,c,d,!0,h))}async function s3(t,a,i,o,u,c){i.some(m=>m._lazyPromises?.middleware)&&await Promise.all(i.map(m=>m._lazyPromises?.middleware));let d={request:a,unstable_pattern:ao(i),params:i[0].params,context:u,matches:i},p=await t({...d,fetcherKey:o,runClientMiddleware:m=>{let g=d;return ib(g,()=>m({...g,fetcherKey:o,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 c3({request:t,unstable_pattern:a,match:i,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let h,p,m=Zt(t.method),g=m?"action":"loader",v=b=>{let _,E=new Promise((D,Q)=>_=Q);p=()=>_(),t.signal.addEventListener("abort",p);let A=D=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${i.route.id}]`)):b({request:t,unstable_pattern:a,params:i.params,context:d},...D!==void 0?[D]:[]),B=(async()=>{try{return{type:"data",result:await(c?c(Q=>A(Q)):A())}}catch(D){return{type:"error",result:D}}})();return Promise.race([B,E])};try{let b=m?i.route.action:i.route.loader;if(o||u)if(b){let _,[E]=await Promise.all([v(b).catch(A=>{_=A}),o,u]);if(_!==void 0)throw _;h=E}else{await o;let _=m?i.route.action:i.route.loader;if(_)[h]=await Promise.all([v(_),u]);else if(g==="action"){let E=new URL(t.url),A=E.pathname+E.search;throw Tn(405,{method:t.method,pathname:A,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(b)h=await v(b);else{let _=new URL(t.url),E=_.pathname+_.search;throw Tn(404,{pathname:E})}}catch(b){return{type:"error",result:b}}finally{p&&t.signal.removeEventListener("abort",p)}return h}async function f3(t){let a=t.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?t.body==null?null:t.json():t.text()}async function d3(t){let{result:a,type:i}=t;if(Kd(a)){let o;try{o=await f3(a)}catch(u){return{type:"error",error:u}}return i==="error"?{type:"error",error:new no(a.status,a.statusText,o),statusCode:a.status,headers:a.headers}:{type:"data",data:o,statusCode:a.status,headers:a.headers}}return i==="error"?pg(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:y3(a),statusCode:Fl(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Fl(a)?a.status:void 0}:pg(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 h3(t,a,i,o,u){let c=t.headers.get("Location");if(Ce(c,"Redirect)DELIM" -R"DELIM(s returned/thrown from loaders/actions must have a Location header"),!rs(c)){let d=o.slice(0,o.findIndex(h=>h.route.id===i)+1);c=Sd(new URL(a.url),d,u,c),t.headers.set("Location",c)}return t}function cg(t,a,i){if(rs(t)){let o=t,u=o.startsWith("//")?new URL(a.protocol+o):new URL(o),c=Rn(u.pathname,i)!=null;if(u.origin===a.origin&&c)return u.pathname+u.search+u.hash}return t}function wi(t,a,i,o){let u=t.createURL(ub(a)).toString(),c={signal:i};if(o&&Zt(o.formMethod)){let{formMethod:d,formEncType:h}=o;c.method=d.toUpperCase(),h==="application/json"?(c.headers=new Headers({"Content-Type":h}),c.body=JSON.stringify(o.json)):h==="text/plain"?c.body=o.text:h==="application/x-www-form-urlencoded"&&o.formData?c.body=Ed(o.formData):c.body=o.formData}return new Request(u,c)}function Ed(t){let a=new URLSearchParams;for(let[i,o]of t.entries())a.append(i,typeof o=="string"?o:o.name);return a}function fg(t){let a=new FormData;for(let[i,o]of t.entries())a.append(i,o);return a}function m3(t,a,i,o=!1,u=!1){let c={},d=null,h,p=!1,m={},g=i&&mn(i[1])?i[1].error:void 0;return t.forEach(v=>{if(!(v.route.id in a))return;let b=v.route.id,_=a[b];if(Ce(!Mr(_),"Cannot handle redirect results in processLoaderData"),mn(_)){let E=_.error;if(g!==void 0&&(E=g,g=void 0),d=d||{},u)d[b]=E;else{let A=Ia(t,b);d[A.route.id]==null&&(d[A.route.id]=E)}o||(c[b]=nb),p||(p=!0,h=Fl(_.error)?_.error.status:500),_.headers&&(m[b]=_.headers)}else c[b]=_.data,_.statusCode&&_.statusCode!==200&&!p&&(h=_.statusCode),_.headers&&(m[b]=_.headers)}),g!==void 0&&i&&(d={[i[0]]:g},i[2]&&(c[i[2]]=void 0)),{loaderData:c,errors:d,statusCode:h||200,loaderHeaders:m}}function dg(t,a,i,o,u,c){let{loaderData:d,errors:h}=m3(a,i,o);return u.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 b=c[m];if(Ce(b,"Did not find corresponding fetcher result"),mn(b)){let _=Ia(t.matches,g?.route.id);h&&h[_.route.id]||(h={...h,[_.route.id]:b.error}),t.fetchers.delete(m)}else if(Mr(b))Ce(!1,"Unhandled fetcher revalidation redirect");else{let _=va(b.data);t.fetchers.set(m,_)}}),{loaderData:d,errors:h}}function hg(t,a,i,o){let u=Object.entries(a).filter(([,c])=>c!==nb).reduce((c,[d,h])=>(c[d]=h,c),{});for(let c of i){let d=c.route.id;if(!a.hasOwnProperty(d)&&t.hasOwnProperty(d)&&c.route.loader&&(u[d]=t[d]),o&&o.hasOwnProperty(d))break}return u}function mg(t){return t?mn(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Ia(t,a){return(a?t.slice(0,t.findIndex(o=>o.route.id===a)+1):[...t]).reverse().find(o=>o.route.hasErrorBoundary===!0)||t[0]}function Mu(t){let a=t.length===1?t[0]:t.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Tn(t,{pathname:a,routeId:i,method:o,type:u,message:c}={}){let d="Unknown Server Error",h="Unknown @remix-run/router error";return t===400?(d="Bad Request",o&&a&&i?h=`You made a ${o} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:u==="invalid-body"&&(h="Unable to encode submission body")):t===403?(d="Forbidden",h=`Route "${i}" does not match URL "${a}"`):t===404?(d="Not Found",h=`No route matches URL "${a}"`):t===405&&(d="Method Not Allowed",o&&a&&i?h=`You made a ${o.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:o&&(h=`Invalid request method "${o.toUpperCase()}"`)),new no(t||500,d,new Error(h),!0)}function Cu(t){let a=Object.entries(t);for(let i=a.length-1;i>=0;i--){let[o,u]=a[i];if(Mr(u))return{key:o,result:u}}}function ub(t){let a=typeof t=="string"?nr(t):t;return Fn({...a,hash:""})}function p3(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function y3(t){return new no(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data)}function v3(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,i])=>typeof a=="string"&&g3(i))}function g3(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function b3(t){return Kd(t.result)&&eb.has(t.result.status)}function mn(t){return t.type==="error"}function Mr(t){return(t&&t.type)==="redirect"}function pg(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Kd(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function x3(t){return eb.has(t)}function S3(t){return Kd(t)&&x3(t.status)&&t.headers.has("Location")}function _3(t){return IT.has(t.toUpperCase())}function Zt(t){return FT.has(t.toUpperCase())}function Fd(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function $u(t,a){let i=typeof a=="string"?nr(a).search:a.search;if(t[t.length-1].route.index&&Fd(i||""))return t[t.length-1];let o=K0(t);return o)DELIM" -R"DELIM([o.length-1]}function yg(t){let{formMethod:a,formAction:i,formEncType:o,text:u,formData:c,json:d}=t;if(!(!a||!i||!o)){if(u!=null)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:void 0,text:u};if(c!=null)return{formMethod:a,formAction:i,formEncType:o,formData:c,json:void 0,text:void 0};if(d!==void 0)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:d,text:void 0}}}function Yf(t,a){return a?{state:"loading",location:t,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function w3(t,a){return{state:"submitting",location:t,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function Nl(t,a){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.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 E3(t,a){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:a?a.data:void 0}}function va(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function T3(t,a){try{let i=t.sessionStorage.getItem(tb);if(i){let o=JSON.parse(i);for(let[u,c]of Object.entries(o||{}))c&&Array.isArray(c)&&a.set(u,new Set(c||[]))}}catch{}}function z3(t,a){if(a.size>0){let i={};for(let[o,u]of a)i[o]=[...u];try{t.sessionStorage.setItem(tb,JSON.stringify(i))}catch(o){pt(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function vg(){let t,a,i=new Promise((o,u)=>{t=async c=>{o(c);try{await i}catch{}},a=async c=>{u(c);try{await i}catch{}}});return{promise:i,resolve:t,reject:a}}var Ur=O.createContext(null);Ur.displayName="DataRouter";var ro=O.createContext(null);ro.displayName="DataRouterState";var sb=O.createContext(!1);function R3(){return O.useContext(sb)}var Jd=O.createContext({isTransitioning:!1});Jd.displayName="ViewTransition";var cb=O.createContext(new Map);cb.displayName="Fetchers";var O3=O.createContext(null);O3.displayName="Await";var An=O.createContext(null);An.displayName="Navigation";var is=O.createContext(null);is.displayName="Location";var $n=O.createContext({outlet:null,matches:[],isDataRoute:!1});$n.displayName="Route";var Id=O.createContext(null);Id.displayName="RouteError";var fb="REACT_ROUTER_ERROR",A3="REDIRECT",M3="ROUTE_ERROR_RESPONSE";function C3(t){if(t.startsWith(`${fb}:${A3}:{`))try{let a=JSON.parse(t.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 N3(t){if(t.startsWith(`${fb}:${M3}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new no(a.status,a.statusText,a.data)}catch{}}function D3(t,{relative:a}={}){Ce(io(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:o}=O.useContext(An),{hash:u,pathname:c,search:d}=oo(t,{relative:a}),h=c;return i!=="/"&&(h=c==="/"?i:Kn([i,c])),o.createHref({pathname:h,search:d,hash:u})}function io(){return O.useContext(is)!=null}function ar(){return Ce(io(),"useLocation() may be used only in the context of a component."),O.useContext(is).location}var db="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hb(t){O.useContext(An).static||O.useLayoutEffect(t)}function lo(){let{isDataRoute:t}=O.useContext($n);return t?V3():j3()}function j3(){Ce(io(),"useNavigate() may be used only in the context of a component.");let t=O.useContext(Ur),{basename:a,navigator:i}=O.useContext(An),{matches:o}=O.useContext($n),{pathname:u}=ar(),c=JSON.stringify(Pd(o)),d=O.useRef(!1);return hb(()=>{d.current=!0}),O.useCallback((p,m={})=>{if(pt(d.current,db),!d.current)return;if(typeof p=="number"){i.go(p);return}let g=Vd(p,JSON.parse(c),u,m.relative==="path");t==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:Kn([a,g.pathname])),(m.replace?i.replace:i.push)(g,m.state,m)},[a,i,c,u,t])}var k3=O.createContext(null);function L3(t){let a=O.useContext($n).outlet;return O.useMemo(()=>a&&O.createElement(k3.Provider,{value:t},a),[a,t])}function Wd(){let{matches:t}=O.useContext($n),a=t[t.length-1];return a?a.params:{}}function oo(t,{relative:a}={}){let{matches:i}=O.useContext($n),{pathname:o}=ar(),u=JSON.stringify(Pd(i));return O.useMemo(()=>Vd(t,JSON.parse(u),o,a==="path"),[t,u,o,a])}function B3(t,a,i,o,u){Ce(io(),"useRoutes() may be used only in the context of a component.");let{navigator:c}=O.useContext(An),{matches:)DELIM" -R"DELIM(d}=O.useContext($n),h=d[d.length-1],p=h?h.params:{},m=h?h.pathname:"/",g=h?h.pathnameBase:"/",v=h&&h.route;{let Q=v&&v.path||"";yb(m,!v||Q.endsWith("*")||Q.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 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. -Please change the parent to .`)}let b=ar(),_;_=b;let E=_.pathname||"/",A=E;if(g!=="/"){let Q=g.replace(/^\//,"").split("/");A="/"+E.replace(/^\//,"").split("/").slice(Q.length).join("/")}let B=Ja(t,{pathname:A});return pt(v||B!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),pt(B==null||B[B.length-1].route.element!==void 0||B[B.length-1].route.Component!==void 0||B[B.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.`),q3(B&&B.map(Q=>Object.assign({},Q,{params:Object.assign({},p,Q.params),pathname:Kn([g,c.encodeLocation?c.encodeLocation(Q.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Q.pathname]),pathnameBase:Q.pathnameBase==="/"?g:Kn([g,c.encodeLocation?c.encodeLocation(Q.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Q.pathnameBase])})),d,i,o,u)}function U3(){let t=pb(),a=Fl(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:o},c={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=O.createElement(O.Fragment,null,O.createElement("p",null,"💿 Hey developer 👋"),O.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",O.createElement("code",{style:c},"ErrorBoundary")," or"," ",O.createElement("code",{style:c},"errorElement")," prop on your route.")),O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},a),i?O.createElement("pre",{style:u},i):null,d)}var H3=O.createElement(U3,null),mb=class extends O.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const i=N3(t.digest);i&&(t=i)}let a=t!==void 0?O.createElement($n.Provider,{value:this.props.routeContext},O.createElement(Id.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?O.createElement($3,{error:t},a):a}};mb.contextType=sb;var Gf=new WeakMap;function $3({children:t,error:a}){let{basename:i}=O.useContext(An);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=C3(a.digest);if(o){let u=Gf.get(a);if(u)throw u;let c=J0(o.location,i);if(F0&&!Gf.get(a))if(c.isExternal||o.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:o.replace}));throw Gf.set(a,d),d}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return t}function Z3({routeContext:t,match:a,children:i}){let o=O.useContext(Ur);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),O.createElement($n.Provider,{value:t},i)}function q3(t,a=[],i=null,o=null,u=null){if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(a.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let c=t,d=i?.errors;if(d!=null){let g=c.findIndex(v=>v.route.id&&d?.[v.route.id]!==void 0);Ce(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let h=!1,p=-1;if(i)for(let g=0;g=0?c=c.slice(0,p+1):c=[c[0]];break}}}let m=i&&o?(g,v)=>{o(g,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:ao(i.matches),er)DELIM" -R"DELIM(rorInfo:v})}:void 0;return c.reduceRight((g,v,b)=>{let _,E=!1,A=null,B=null;i&&(_=d&&v.route.id?d[v.route.id]:void 0,A=v.route.errorElement||H3,h&&(p<0&&b===0?(yb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,B=null):p===b&&(E=!0,B=v.route.hydrateFallbackElement||null)));let D=a.concat(c.slice(0,b+1)),Q=()=>{let X;return _?X=A:E?X=B:v.route.Component?X=O.createElement(v.route.Component,null):v.route.element?X=v.route.element:X=g,O.createElement(Z3,{match:v,routeContext:{outlet:g,matches:D,isDataRoute:i!=null},children:X})};return i&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?O.createElement(mb,{location:i.location,revalidation:i.revalidation,component:A,error:_,children:Q(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:m}):Q()},null)}function eh(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Q3(t){let a=O.useContext(Ur);return Ce(a,eh(t)),a}function Y3(t){let a=O.useContext(ro);return Ce(a,eh(t)),a}function G3(t){let a=O.useContext($n);return Ce(a,eh(t)),a}function th(t){let a=G3(t),i=a.matches[a.matches.length-1];return Ce(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function P3(){return th("useRouteId")}function pb(){let t=O.useContext(Id),a=Y3("useRouteError"),i=th("useRouteError");return t!==void 0?t:a.errors?.[i]}function V3(){let{router:t}=Q3("useNavigate"),a=th("useNavigate"),i=O.useRef(!1);return hb(()=>{i.current=!0}),O.useCallback(async(u,c={})=>{pt(i.current,db),i.current&&(typeof u=="number"?await t.navigate(u):await t.navigate(u,{fromRouteId:a,...c}))},[t,a])}var gg={};function yb(t,a,i){!a&&!gg[t]&&(gg[t]=!0,pt(!1,i))}var bg={};function xg(t,a){!t&&!bg[a]&&(bg[a]=!0,console.warn(a))}var X3="useOptimistic",Sg=Ux[X3],K3=()=>{};function F3(t){return Sg?Sg(t):[t,K3]}function J3(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&pt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:O.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&pt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:O.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&pt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:O.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),a}var I3=["HydrateFallback","hydrateFallbackElement"],W3=class{constructor(){this.status="pending",this.promise=new Promise((t,a)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",t(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",a(i))}})}};function ez({router:t,flushSync:a,onError:i,unstable_useTransitions:o}){o=R3()||o;let[c,d]=O.useState(t.state),[h,p]=F3(c),[m,g]=O.useState(),[v,b]=O.useState({isTransitioning:!1}),[_,E]=O.useState(),[A,B]=O.useState(),[D,Q]=O.useState(),X=O.useRef(new Map),se=O.useCallback((I,{deletedFetchers:ie,newErrors:V,flushSync:ee,viewTransitionOpts:_e})=>{V&&i&&Object.values(V).forEach(ne=>i(ne,{location:I.location,params:I.matches[0]?.params??{},unstable_pattern:ao(I.matches)})),I.fetchers.forEach((ne,J)=>{ne.data!==void 0&&X.current.set(J,ne.data)}),ie.forEach(ne=>X.current.delete(ne)),xg(ee===!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 Oe=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(xg(_e==null||Oe,"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."),!_e||!Oe){a&&ee?a(()=>d(I)):o===!1?d(I):O.startTransition(()=>{o===!0&&p(ne=>_g(ne,I)),d(I)});return}if(a&&ee){a(()=>{A&&(_?.resolve(),A.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation})});let ne=t.window.document.startViewTransition(()=>{a(()=>d(I))});ne.finished.finally(()=>{a(()=>{E(void 0),B(void 0),g(void 0),b({isTransitioning:!1})})}),a(()=>B(ne));return}A?(_?.resolve(),A.skipTransition(),Q({state:I,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation})):(g(I),b({isTransitioning:!0,flushSync:!1,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation}))},[t.window,a,A,_,o,p,i]);O.useLayoutEffect(()=>t.subscribe(se),[t,se]),O.useEffect(()=>{v.isTra)DELIM" -R"DELIM(nsitioning&&!v.flushSync&&E(new W3)},[v]),O.useEffect(()=>{if(_&&m&&t.window){let I=m,ie=_.promise,V=t.window.document.startViewTransition(async()=>{o===!1?d(I):O.startTransition(()=>{o===!0&&p(ee=>_g(ee,I)),d(I)}),await ie});V.finished.finally(()=>{E(void 0),B(void 0),g(void 0),b({isTransitioning:!1})}),B(V)}},[m,_,t.window,o,p]),O.useEffect(()=>{_&&m&&h.location.key===m.location.key&&_.resolve()},[_,A,h.location,m]),O.useEffect(()=>{!v.isTransitioning&&D&&(g(D.state),b({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),Q(void 0))},[v.isTransitioning,D]);let ue=O.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:I=>t.navigate(I),push:(I,ie,V)=>t.navigate(I,{state:ie,preventScrollReset:V?.preventScrollReset}),replace:(I,ie,V)=>t.navigate(I,{replace:!0,state:ie,preventScrollReset:V?.preventScrollReset})}),[t]),me=t.basename||"/",C=O.useMemo(()=>({router:t,navigator:ue,static:!1,basename:me,onError:i}),[t,ue,me,i]);return O.createElement(O.Fragment,null,O.createElement(Ur.Provider,{value:C},O.createElement(ro.Provider,{value:h},O.createElement(cb.Provider,{value:X.current},O.createElement(Jd.Provider,{value:v},O.createElement(rz,{basename:me,location:h.location,navigationType:h.historyAction,navigator:ue,unstable_useTransitions:o},O.createElement(tz,{routes:t.routes,future:t.future,state:h,onError:i})))))),null)}function _g(t,a){return{...t,navigation:a.navigation.state!=="idle"?a.navigation:t.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:t.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:t.actionData,fetchers:a.fetchers}}var tz=O.memo(nz);function nz({routes:t,future:a,state:i,onError:o}){return B3(t,void 0,i,o,a)}function az(t){return L3(t.context)}function ga(t){Ce(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function rz({basename:t="/",children:a=null,location:i,navigationType:o="POP",navigator:u,static:c=!1,unstable_useTransitions:d}){Ce(!io(),"You cannot render a inside another . You should never have more than one in your app.");let h=t.replace(/^\/*/,"/"),p=O.useMemo(()=>({basename:h,navigator:u,static:c,unstable_useTransitions:d,future:{}}),[h,u,c,d]);typeof i=="string"&&(i=nr(i));let{pathname:m="/",search:g="",hash:v="",state:b=null,key:_="default"}=i,E=O.useMemo(()=>{let A=Rn(m,h);return A==null?null:{location:{pathname:A,search:g,hash:v,state:b,key:_},navigationType:o}},[h,m,g,v,b,_,o]);return pt(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:O.createElement(An.Provider,{value:p},O.createElement(is.Provider,{children:a,value:E}))}function Td(t,a=[]){let i=[];return O.Children.forEach(t,(o,u)=>{if(!O.isValidElement(o))return;let c=[...a,u];if(o.type===O.Fragment){i.push.apply(i,Td(o.props.children,c));return}Ce(o.type===ga,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),Ce(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||c.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Td(o.props.children,c)),i.push(d)}),i}var iz=Td,Zu="get",qu="application/x-www-form-urlencoded";function ls(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function lz(t){return ls(t)&&t.tagName.toLowerCase()==="button"}function oz(t){return ls(t)&&t.tagName.toLowerCase()==="form"}function uz(t){return ls(t)&&t.tagName.toLowerCase()==="input"}function sz(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function cz(t,a){return t.button===0&&(!a||a==="_self")&&!sz(t)}function zd(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,i)=>{let o=t[i];return a.concat(Array.isArray(o)?o.map(u=>[i,u]):[[i,o]])},[]))}function fz(t,a){let i=zd(t);return a&&a.forEach((o,u)=>{i.has(u)||a.getAll(u).forEach(c=>{i.append(u,c)})}),i}var Nu=null;function dz(){if(Nu===null)try{new FormData(document.createElement("form"),0),Nu=!1}catch{Nu=!0}return Nu}var hz=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pf(t){return t!=null&&!hz.has(t)?(pt(!1,`"${t}" is not a valid \`encType\` for \`
\`)DELIM" -R"DELIM(/\`\` and will default to "${qu}"`),null):t}function mz(t,a){let i,o,u,c,d;if(oz(t)){let h=t.getAttribute("action");o=h?Rn(h,a):null,i=t.getAttribute("method")||Zu,u=Pf(t.getAttribute("enctype"))||qu,c=new FormData(t)}else if(lz(t)||uz(t)&&(t.type==="submit"||t.type==="image")){let h=t.form;if(h==null)throw new Error('Cannot submit a