diff --git a/builds/msvc/vs2026/bs/bs.vcxproj b/builds/msvc/vs2026/bs/bs.vcxproj index 8f68dd71..0a4ac263 100644 --- a/builds/msvc/vs2026/bs/bs.vcxproj +++ b/builds/msvc/vs2026/bs/bs.vcxproj @@ -172,6 +172,7 @@ + diff --git a/builds/msvc/vs2026/bs/bs.vcxproj.filters b/builds/msvc/vs2026/bs/bs.vcxproj.filters index 1a50879f..2f29dccf 100644 --- a/builds/msvc/vs2026/bs/bs.vcxproj.filters +++ b/builds/msvc/vs2026/bs/bs.vcxproj.filters @@ -19,55 +19,55 @@ {F45B7D90-90BC-41EF-0000-000000000003} - + {F45B7D90-90BC-41EF-0000-000000000004} - + {F45B7D90-90BC-41EF-0000-000000000005} - + {F45B7D90-90BC-41EF-0000-000000000006} - + {F45B7D90-90BC-41EF-0000-000000000007} - + {F45B7D90-90BC-41EF-0000-000000000008} - + {F45B7D90-90BC-41EF-0000-000000000009} - + {F45B7D90-90BC-41EF-0000-00000000000A} - + {F45B7D90-90BC-41EF-0000-00000000000B} - + {F45B7D90-90BC-41EF-0000-00000000000C} - + {F45B7D90-90BC-41EF-0000-00000000000D} - + {F45B7D90-90BC-41EF-0000-00000000000E} - + {F45B7D90-90BC-41EF-0000-00000000000F} - + {F45B7D90-90BC-41EF-0000-000000000001} - + {F45B7D90-90BC-41EF-0000-000000000002} - + {F45B7D90-90BC-41EF-0000-000000000003} - + {F45B7D90-90BC-41EF-0000-000000000004} - + {F45B7D90-90BC-41EF-0000-000000000005} @@ -307,6 +307,9 @@ web\admin_dashboard\src\lib + + web\admin_dashboard\src\lib + web\admin_dashboard\src\lib diff --git a/console/embedded/admin_css.cpp b/console/embedded/admin_css.cpp index 48ae7957..d826f68b 100644 --- a/console/embedded/admin_css.cpp +++ b/console/embedded/admin_css.cpp @@ -76,10 +76,10 @@ R"DELIM(/*! */ .uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) 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-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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-duration:initial}}}@layer theme{:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--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-200:oklch(90.5% .093 164.15);--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-cyan-300:oklch(86.5% .127 207.078);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-500:oklch(60.6% .25 292.717);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-500:oklch(55.4% .046 257.417);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-500:oklch(55.2% .016 285.938);--color-black:#000;--spacing:.25rem;--container-xl:36rem;--container-4xl:56rem;--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-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--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-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--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;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji)DELIM" R"DELIM(;line-height:1.5}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:where(:not(iframe)){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,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-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;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: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' )DELIM" -R"DELIM(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{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.top-0{top:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.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}}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.h-3{height:calc(var(--spacing) * 3)}.h-10{height:calc(var(--spacing) * 10)}.h-\[min\(60vh\,32rem\)\]{height:min(60vh,32rem)}.h-full{height:100%}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[92vh\]{max-height:92vh}.max-h-\[calc\(100vh-2rem\)\]{max-height:calc(100vh - 2rem)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-72{min-height:calc(var(--spacing) * 72)}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-24{width:calc(var(--spacing) * 24)}.w-\[min\(60rem\,90vw\)\]{width:min(60rem,90vw)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\[32rem\]{min-width:32rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-\[5\.5rem_4\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:5.5rem 4.5rem minmax(0,1fr)}.grid-cols-\[8\.5rem_10rem_minmax\(0\,1fr\)\]{grid-template-columns:8.5rem 10rem minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.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}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.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-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * 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-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}: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\/20>:not(:last-child)){border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){:where(.divide-accentSecondary\/20>:not(:last-child)){border-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.self-center{align-self:center}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.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-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/10{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/10{border-color:color-mix(in oklab,var(--theme-accent) 10%,transparent)}}.border-accent\/20{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/20{border-color:color-mix(in oklab,var(--theme-accent) 20%,transparent)}}.border-accent\/30{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/30{border-color:color-mix(in oklab,var(--theme-accent) 30%,transparent)}}.border-accent\/35{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/35{border-color:color-mix(in oklab,var(--theme-accent) 35%,transparent)}}.border-accent\/40{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/40{border-color:color-mix(in oklab,var(--theme-accent) 40%,transparent)}}.border-accentSecondary\/20{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/20{border-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.border-accentSecondary\/30{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary)DELIM" -R"DELIM(\/30{border-color:color-mix(in oklab,var(--theme-accent-secondary) 30%,transparent)}}.border-amber-400\/35{border-color:#fcbb0059}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/35{border-color:color-mix(in oklab,var(--color-amber-400) 35%,transparent)}}.border-amber-400\/60{border-color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/60{border-color:color-mix(in oklab,var(--color-amber-400) 60%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-emerald-400\/35{border-color:#00d29459}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/35{border-color:color-mix(in oklab,var(--color-emerald-400) 35%,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-slate-500\/40{border-color:#62748e66}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/40{border-color:color-mix(in oklab,var(--color-slate-500) 40%,transparent)}}.bg-accent,.bg-accent\/5{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/5{background-color:color-mix(in oklab,var(--theme-accent) 5%,transparent)}}.bg-accent\/15{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/15{background-color:color-mix(in oklab,var(--theme-accent) 15%,transparent)}}.bg-accentSecondary\/10{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/10{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.bg-accentSecondary\/15{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/15{background-color:color-mix(in oklab,var(--theme-accent-secondary) 15%,transparent)}}.bg-accentSecondary\/20{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/20{background-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-background,.bg-background\/60{background-color:var(--theme-background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/60{background-color:color-mix(in oklab,var(--theme-background) 60%,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-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-noticeSuccess\/95{background-color:var(--theme-notice-success)}@supports (color:color-mix(in lab,red,red)){.bg-noticeSuccess\/95{background-color:color-mix(in oklab,var(--theme-notice-success) 95%,transparent)}}.bg-noticeWarning\/95{background-color:var(--theme-notice-warning)}@supports (color:color-mix(in lab,red,red)){.bg-noticeWarning\/95{background-color:color-mix(in oklab,var(--theme-notice-warning) 95%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-sky-500\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/15{background-color:color-mix(in oklab,var(--color-sky-500) 15%,transparent)}}.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,.bg-surface\/80{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/80{background-color:color-mix(in oklab,var(--theme-surface) 80%,transparent)}}.bg-surface\/90{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/90{background-color:color-mix(in oklab,var(--theme-surface) 90%,transparent)}}.bg-surface\/95{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/95{background-color:color-mix(in oklab,var(--theme-surface) 95%,transparent)}}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-zinc-500\/20{background-color:#71717b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\/20{background-color:color-mix(in oklab,var(--color-zinc-500) 20%,transparent)}}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.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-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-3{padding-left:calc(var(--spacing) * 3)}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--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}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-w)DELIM" -R"DELIM(eight: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}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--theme-accent)}.text-accentSecondary{color:var(--theme-accent-secondary)}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-300{color:var(--color-cyan-300)}.text-emerald-200{color:var(--color-emerald-200)}.text-emerald-300{color:var(--color-emerald-300)}.text-indigo-300{color:var(--color-indigo-300)}.text-noticeText\/60{color:var(--theme-notice-text)}@supports (color:color-mix(in lab,red,red)){.text-noticeText\/60{color:color-mix(in oklab,var(--theme-notice-text) 60%,transparent)}}.text-noticeText\/75{color:var(--theme-notice-text)}@supports (color:color-mix(in lab,red,red)){.text-noticeText\/75{color:color-mix(in oklab,var(--theme-notice-text) 75%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-red-300{color:var(--color-red-300)}.text-sky-300{color:var(--color-sky-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:var(--theme-text-muted)}.text-textPrimary{color:var(--theme-text-primary)}.text-violet-300{color:var(--color-violet-300)}.text-zinc-300{color:var(--color-zinc-300)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.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-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px 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)}.shadow-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/60{--tw-shadow-color:#0009}@supports (color:color-mix(in lab,red,red)){.shadow-black\/60{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.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))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-700{--tw-duration:.7s;transition-duration:.7s}.placeholder\:text-textMuted\/50::placeholder{color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-textMuted\/50::placeholder{color:color-mix(in oklab,var(--theme-text-muted) 50%,transparent)}}.placeholder\:text-textMuted\/60::placeholder{color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-textMuted\/60::placeholder{color:color-mix(in oklab,var(--theme-text-muted) 60%,transparent)}}.backdrop\:bg-black\/60::backdrop{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/60::backdrop{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first\:pt-0:first-child{padding-top:0}@media(hover:hover){.hover\:border-accent:hover{border-color:var(--theme-accent)}.hover\:bg-accentSecondary\/10:hover{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accentSecondary\/10:hover{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:text-accent:hover{color:var(--theme-accent)}.hover\:text-accentSecondary:hover{color:var(--theme-accent-secondary)}.hover\:text-noticeText:hover{color:var(--theme-notice-text)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-accent:focus{border-color:var(--theme-accent)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-accent:focus{--tw-ring-color:var(--theme-accent)}.focus-visible\:bg-accentSecondary\/20:focus-visible{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:bg-accentSecondary\/20:focus-visible{background-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-textMuted:disabled{color:var(--theme-text-muted)}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:left-auto{left:auto}.sm\:w-96{width:calc(var(--spacing) * 96)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[7\.5rem_7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem 7.5rem minmax(0,1fr)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:w-auto{width:auto}.md\:grid-cols-\[minmax\(0\,1fr\)_11rem_11rem\]{grid-te)DELIM" -R"DELIM(mplate-columns:minmax(0,1fr) 11rem 11rem}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(12rem\,1\.2fr\)_minmax\(11rem\,1fr\)_minmax\(9rem\,0\.8fr\)_3\.5rem_auto\]{grid-template-columns:minmax(12rem,1.2fr) minmax(11rem,1fr) minmax(9rem,.8fr) 3.5rem auto}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}}:root{color-scheme:dark;--theme-background:#272822;--theme-surface:#1f211c;--theme-accent:#ffa022;--theme-accent-secondary:#c85637;--theme-text-primary:#ededed;--theme-text-muted:#cfcfcf;--theme-inset:#0000004d;--theme-notice-success:#022c22;--theme-notice-warning:#451a03;--theme-notice-text:#fff;--chart-grid:#c8563733;--chart-ticks:#ffa0224d}:root[data-theme=light]{color-scheme:light;--theme-background:#f5f3ed;--theme-surface:#fff;--theme-accent:#9c4a04;--theme-accent-secondary:#9b4430;--theme-text-primary:#222923;--theme-text-muted:#526052;--theme-inset:#2229230d;--theme-notice-success:#ecfdf5;--theme-notice-warning:#fffbeb;--theme-notice-text:#222923;--chart-grid:#52605226;--chart-ticks:#52605266;--chart-color-0:#9c4a04;--chart-color-1:#0369a1;--chart-color-2:#047857;--chart-color-3:#7e22ce;--chart-color-4:#be123c;--chart-color-5:#a21caf;--chart-color-6:#854d0e;--chart-color-7:#1d4ed8;--color-emerald-200:#065f46;--color-emerald-300:#065f46;--color-amber-200:#92400e;--color-amber-300:#92400e;--color-red-300:#991b1b;--color-rose-300:#9f1239;--color-orange-300:#9a3412;--color-sky-300:#075985;--color-cyan-300:#155e75;--color-blue-300:#1e40af;--color-violet-300:#5b21b6;--color-slate-300:#475569}:root[data-theme=midnight]{color-scheme:dark;--theme-background:#0e1525;--theme-surface:#141e32;--theme-accent:#7dd3fc;--theme-accent-secondary:#a5b4fc;--theme-text-primary:#e6edf7;--theme-text-muted:#a9bad0;--theme-inset:#00000040;--chart-grid:#a5b4fc33;--chart-ticks:#7dd3fc4d}html{scrollbar-gutter:stable}body{background-color:var(--theme-background);color:var(--theme-text-primary);font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}::selection{background-color:var(--theme-accent);color:var(--theme-background)}.uplot{color:var(--color-textMuted);font-family:var(--font-sans)}.uplot .u-legend{margin-bottom:.75rem;font-size:.75rem}.uplot .u-legend .u-series{padding:.2rem .45rem}.uplot .u-select{background:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.uplot .u-select{background:color-mix(in srgb,var(--theme-accent) 12%,transparent)}}.uplot .u-select{border:1px solid var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.uplot .u-select{border:1px solid color-mix(in srgb,var(--theme-accent) 35%,transparent)}}@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-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false} +R"DELIM(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{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.top-0{top:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.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}}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.table{display:table}.h-3{height:calc(var(--spacing) * 3)}.h-10{height:calc(var(--spacing) * 10)}.h-\[min\(60vh\,32rem\)\]{height:min(60vh,32rem)}.h-full{height:100%}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[92vh\]{max-height:92vh}.max-h-\[calc\(100vh-2rem\)\]{max-height:calc(100vh - 2rem)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-72{min-height:calc(var(--spacing) * 72)}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-24{width:calc(var(--spacing) * 24)}.w-\[min\(60rem\,90vw\)\]{width:min(60rem,90vw)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\[32rem\]{min-width:32rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-\[5\.5rem_4\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:5.5rem 4.5rem minmax(0,1fr)}.grid-cols-\[8\.5rem_10rem_minmax\(0\,1fr\)\]{grid-template-columns:8.5rem 10rem minmax(0,1fr)}.grid-cols-\[10rem_max-content\]{grid-template-columns:10rem max-content}.grid-cols-\[10rem_max-content_auto\]{grid-template-columns:10rem max-content auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.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}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.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-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * 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-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}: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\/20>:not(:last-child)){border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){:where(.divide-accentSecondary\/20>:not(:last-child)){border-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.self-center{align-self:center}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.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-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/10{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/10{border-color:color-mix(in oklab,var(--theme-accent) 10%,transparent)}}.border-accent\/20{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/20{border-color:color-mix(in oklab,var(--theme-accent) 20%,transparent)}}.border-accent\/30{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/30{border-color:color-mix(in oklab,var(--theme-accent) 30%,transparent)}}.border-accent\/35{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/35{border-color:color-mix(in oklab,var(--theme-accent) 35%,transparent)}}.border-accent\/40{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/40{border-color:color-mix(in oklab,var(--theme-accent) 40%,transparent)}}.border-accentSecondary\/20{border-color:var(--theme)DELIM" +R"DELIM(-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/20{border-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.border-accentSecondary\/30{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/30{border-color:color-mix(in oklab,var(--theme-accent-secondary) 30%,transparent)}}.border-amber-400\/35{border-color:#fcbb0059}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/35{border-color:color-mix(in oklab,var(--color-amber-400) 35%,transparent)}}.border-amber-400\/60{border-color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/60{border-color:color-mix(in oklab,var(--color-amber-400) 60%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-emerald-400\/35{border-color:#00d29459}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/35{border-color:color-mix(in oklab,var(--color-emerald-400) 35%,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-slate-500\/40{border-color:#62748e66}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/40{border-color:color-mix(in oklab,var(--color-slate-500) 40%,transparent)}}.bg-accent,.bg-accent\/5{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/5{background-color:color-mix(in oklab,var(--theme-accent) 5%,transparent)}}.bg-accent\/15{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/15{background-color:color-mix(in oklab,var(--theme-accent) 15%,transparent)}}.bg-accentSecondary\/10{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/10{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.bg-accentSecondary\/15{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/15{background-color:color-mix(in oklab,var(--theme-accent-secondary) 15%,transparent)}}.bg-accentSecondary\/20{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/20{background-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-background,.bg-background\/60{background-color:var(--theme-background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/60{background-color:color-mix(in oklab,var(--theme-background) 60%,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-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-noticeSuccess\/95{background-color:var(--theme-notice-success)}@supports (color:color-mix(in lab,red,red)){.bg-noticeSuccess\/95{background-color:color-mix(in oklab,var(--theme-notice-success) 95%,transparent)}}.bg-noticeWarning\/95{background-color:var(--theme-notice-warning)}@supports (color:color-mix(in lab,red,red)){.bg-noticeWarning\/95{background-color:color-mix(in oklab,var(--theme-notice-warning) 95%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-sky-500\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/15{background-color:color-mix(in oklab,var(--color-sky-500) 15%,transparent)}}.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,.bg-surface\/80{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/80{background-color:color-mix(in oklab,var(--theme-surface) 80%,transparent)}}.bg-surface\/90{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/90{background-color:color-mix(in oklab,var(--theme-surface) 90%,transparent)}}.bg-surface\/95{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/95{background-color:color-mix(in oklab,var(--theme-surface) 95%,transparent)}}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-zinc-500\/20{background-color:#71717b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\/20{background-color:color-mix(in oklab,var(--color-zinc-500) 20%,transparent)}}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.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-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-3{padding-left:calc(var(--spacing) * 3)}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);)DELIM" +R"DELIM(line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-none{--tw-leading:1;line-height:1}.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}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--theme-accent)}.text-accentSecondary{color:var(--theme-accent-secondary)}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-300{color:var(--color-cyan-300)}.text-emerald-200{color:var(--color-emerald-200)}.text-emerald-300{color:var(--color-emerald-300)}.text-indigo-300{color:var(--color-indigo-300)}.text-noticeText\/60{color:var(--theme-notice-text)}@supports (color:color-mix(in lab,red,red)){.text-noticeText\/60{color:color-mix(in oklab,var(--theme-notice-text) 60%,transparent)}}.text-noticeText\/75{color:var(--theme-notice-text)}@supports (color:color-mix(in lab,red,red)){.text-noticeText\/75{color:color-mix(in oklab,var(--theme-notice-text) 75%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-red-300{color:var(--color-red-300)}.text-sky-300{color:var(--color-sky-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:var(--theme-text-muted)}.text-textPrimary{color:var(--theme-text-primary)}.text-violet-300{color:var(--color-violet-300)}.text-zinc-300{color:var(--color-zinc-300)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.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-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px 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)}.shadow-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/60{--tw-shadow-color:#0009}@supports (color:color-mix(in lab,red,red)){.shadow-black\/60{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.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))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-700{--tw-duration:.7s;transition-duration:.7s}.placeholder\:text-textMuted\/50::placeholder{color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-textMuted\/50::placeholder{color:color-mix(in oklab,var(--theme-text-muted) 50%,transparent)}}.placeholder\:text-textMuted\/60::placeholder{color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-textMuted\/60::placeholder{color:color-mix(in oklab,var(--theme-text-muted) 60%,transparent)}}.backdrop\:bg-black\/60::backdrop{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/60::backdrop{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first\:pt-0:first-child{padding-top:0}@media(hover:hover){.hover\:border-accent:hover{border-color:var(--theme-accent)}.hover\:bg-accentSecondary\/10:hover{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accentSecondary\/10:hover{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:text-accent:hover{color:var(--theme-accent)}.hover\:text-accentSecondary:hover{color:var(--theme-accent-secondary)}.hover\:text-noticeText:hover{color:var(--theme-notice-text)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-accent:focus{border-color:var(--theme-accent)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-accent:focus{--tw-ring-color:var(--theme-accent)}.focus-visible\:bg-accentSecondary\/20:focus-visible{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:bg-accentSecondary\/20:focus-visible{background-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-textMuted:disabled{color:var(--theme-text-muted)}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:left-auto{left:auto}.sm\:w-96{width:calc(var(--spacing) * 96)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[7\.5rem_7\.5r)DELIM" +R"DELIM(em_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem 7.5rem minmax(0,1fr)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:w-auto{width:auto}.md\:grid-cols-\[minmax\(0\,1fr\)_11rem_11rem\]{grid-template-columns:minmax(0,1fr) 11rem 11rem}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(12rem\,1\.2fr\)_minmax\(11rem\,1fr\)_minmax\(9rem\,0\.8fr\)_3\.5rem_auto\]{grid-template-columns:minmax(12rem,1.2fr) minmax(11rem,1fr) minmax(9rem,.8fr) 3.5rem auto}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}}:root{color-scheme:dark;--theme-background:#272822;--theme-surface:#1f211c;--theme-accent:#ffa022;--theme-accent-secondary:#c85637;--theme-text-primary:#ededed;--theme-text-muted:#cfcfcf;--theme-inset:#0000004d;--theme-notice-success:#022c22;--theme-notice-warning:#451a03;--theme-notice-text:#fff;--chart-grid:#c8563733;--chart-ticks:#ffa0224d}:root[data-theme=light]{color-scheme:light;--theme-background:#f5f3ed;--theme-surface:#fff;--theme-accent:#9c4a04;--theme-accent-secondary:#9b4430;--theme-text-primary:#222923;--theme-text-muted:#526052;--theme-inset:#2229230d;--theme-notice-success:#ecfdf5;--theme-notice-warning:#fffbeb;--theme-notice-text:#222923;--chart-grid:#52605226;--chart-ticks:#52605266;--chart-color-0:#9c4a04;--chart-color-1:#0369a1;--chart-color-2:#047857;--chart-color-3:#7e22ce;--chart-color-4:#be123c;--chart-color-5:#a21caf;--chart-color-6:#854d0e;--chart-color-7:#1d4ed8;--color-emerald-200:#065f46;--color-emerald-300:#065f46;--color-amber-200:#92400e;--color-amber-300:#92400e;--color-red-300:#991b1b;--color-rose-300:#9f1239;--color-orange-300:#9a3412;--color-sky-300:#075985;--color-cyan-300:#155e75;--color-blue-300:#1e40af;--color-violet-300:#5b21b6;--color-slate-300:#475569}:root[data-theme=midnight]{color-scheme:dark;--theme-background:#0e1525;--theme-surface:#141e32;--theme-accent:#7dd3fc;--theme-accent-secondary:#a5b4fc;--theme-text-primary:#e6edf7;--theme-text-muted:#a9bad0;--theme-inset:#00000040;--chart-grid:#a5b4fc33;--chart-ticks:#7dd3fc4d}html{scrollbar-gutter:stable}body{background-color:var(--theme-background);color:var(--theme-text-primary);font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}::selection{background-color:var(--theme-accent);color:var(--theme-background)}.uplot{color:var(--color-textMuted);font-family:var(--font-sans)}.uplot .u-legend{margin-bottom:.75rem;font-size:.75rem}.uplot .u-legend .u-series{padding:.2rem .45rem}.uplot .u-select{background:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.uplot .u-select{background:color-mix(in srgb,var(--theme-accent) 12%,transparent)}}.uplot .u-select{border:1px solid var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.uplot .u-select{border:1px solid color-mix(in srgb,var(--theme-accent) 35%,transparent)}}@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-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false} )DELIM" ) diff --git a/console/embedded/admin_ecma.cpp b/console/embedded/admin_ecma.cpp index ad1fa4d9..2c114453 100644 --- a/console/embedded/admin_ecma.cpp +++ b/console/embedded/admin_ecma.cpp @@ -174,85 +174,85 @@ R"DELIM(/*! * SOFTWARE. */ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentia)DELIM" -R"DELIM(ls="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=a(u);fetch(u.href,f)}})();function i1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Om={exports:{}},mu={};var X0;function xz(){if(X0)return mu;X0=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(l,u,f){var d=null;if(f!==void 0&&(d=""+f),u.key!==void 0&&(d=""+u.key),"key"in u){f={};for(var m in u)m!=="key"&&(f[m]=u[m])}else f=u;return u=f.ref,{$$typeof:n,type:l,key:d,ref:u!==void 0?u:null,props:f}}return mu.Fragment=i,mu.jsx=a,mu.jsxs=a,mu}var W0;function wz(){return W0||(W0=1,Om.exports=xz()),Om.exports}var x=wz(),Nm={exports:{}},Ze={};var eb;function zz(){if(eb)return Ze;eb=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),O=Symbol.iterator;function T(M){return M===null||typeof M!="object"?null:(M=O&&M[O]||M["@@iterator"],typeof M=="function"?M:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,L={};function D(M,Q,le){this.props=M,this.context=Q,this.refs=L,this.updater=le||A}D.prototype.isReactComponent={},D.prototype.setState=function(M,Q){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,Q,"setState")},D.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function W(){}W.prototype=D.prototype;function K(M,Q,le){this.props=M,this.context=Q,this.refs=L,this.updater=le||A}var Y=K.prototype=new W;Y.constructor=K,k(Y,D.prototype),Y.isPureReactComponent=!0;var G=Array.isArray;function ne(){}var ae={H:null,A:null,T:null,S:null},ye=Object.prototype.hasOwnProperty;function ue(M,Q,le){var re=le.ref;return{$$typeof:n,type:M,key:Q,ref:re!==void 0?re:null,props:le}}function X(M,Q){return ue(M.type,Q,M.props)}function we(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function he(M){var Q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(le){return Q[le]})}var Oe=/\/+/g;function fe(M,Q){return typeof M=="object"&&M!==null&&M.key!=null?he(""+M.key):Q.toString(36)}function J(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(ne,ne):(M.status="pending",M.then(function(Q){M.status==="pending"&&(M.status="fulfilled",M.value=Q)},function(Q){M.status==="pending"&&(M.status="rejected",M.reason=Q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function ee(M,Q,le,re,$e){var Ue=typeof M;(Ue==="undefined"||Ue==="boolean")&&(M=null);var Ae=!1;if(M===null)Ae=!0;else switch(Ue){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(M.$$typeof){case n:case i:Ae=!0;break;case b:return Ae=M._init,ee(Ae(M._payload),Q,le,re,$e)}}if(Ae)return $e=$e(M),Ae=re===""?"."+fe(M,0):re,G($e)?(le="",Ae!=null&&(le=Ae.replace(Oe,"$&/")+"/"),ee($e,Q,le,"",function(Bt){return Bt})):$e!=null&&(we($e)&&($e=X($e,le+($e.key==null||M&&M.key===$e.key?"":(""+$e.key).replace(Oe,"$&/")+"/")+Ae)),Q.push($e)),1;Ae=0;var pe=re===""?".":re+":";if(G(M))for(var Ne=0;Ne>>1,Se=J[Me];if(0>>1;Meu(be,xe))Mu(Q,be)?(J[Me]=Q,J[M]=xe,Me=M):(J[Me]=be,J[Re]=xe,Me=Re);else if(Mu(Q,xe))J[Me]=Q,J[M]=xe,Me=M;else break e}}return ee}function u(J,ee){var xe=J.sortIndex-ee.sortIndex;return xe!==0?xe:J.id-ee.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();n.unstable_now=function(){return d.now()-m}}var p=[],g=[],b=1,y=null,w=3,O=!1,T=!1,A=!1,k=!1,L=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function K(J){for(var ee=a(g);ee!==null;){if(ee.callback===null)l(g);else if(ee.startTime<=J)l(g),ee.sortIndex=ee.expirationTime,i(p,ee);else break;ee=a(g)}}function Y(J){if(A=!1,K(J),!T)if(a(p)!==null)T=!0,G||(G=!0,we());else{var ee=a(g);ee!==null&&fe(Y,ee.startTime-J)}}var G=!1,ne=-1,ae=5,ye=-1;function ue(){return k?!0:!(n.unstable_now()-yeJ&&ue());){var Me=y.callback;if(typeof Me=="function"){y.callback=null,w=y.priorityLevel;var Se=Me(y.expirationTime<=J);if(J=n.unstable_now(),typeof Se=="function"){y.callback=Se,K(J),ee=!0;break t}y===a(p)&&l(p),K(J)}else l(p);y=a(p)}if(y!==null)ee=!0;else{var Be=a(g);Be!==null&&fe(Y,Be.startTime-J),ee=!1}}break e}finally{y=null,w=xe,O=!1}ee=void 0}}finally{ee?we():G=!1}}}var we;if(typeof W=="function")we=function(){W(X)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Oe=he.port2;he.port1.onmessage=X,we=function(){Oe.postMessage(null)}}else we=function(){L(X,0)};function fe(J,ee){ne=L(function(){J(n.unstable_now())},ee)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(J){J.callback=null},n.unstable_forceFrameRate=function(J){0>J||125Me?(J.sortIndex=xe,i(g,J),a(p)===null&&J===a(g)&&(A?(D(ne),ne=-1):A=!0,fe(Y,xe-Me))):(J.sortIndex=Se,i(p,J),T||O||(T=!0,G||(G=!0,we()))),J},n.unstable_shouldYield=ue,n.unstable_wrapCallback=function(J){var ee=w;return function(){var xe=w;w=ee;try{return J.apply(this,arguments)}finally{w=xe}}}})(jm)),jm}var ib;function Oz(){return ib||(ib=1,Mm.exports=Ez()),Mm.exports}var km={exports:{}},Dn={};var rb;function Nz(){if(rb)return Dn;rb=1;var n=Np();function i(b){var y="https://react.dev/errors/"+b;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),km.exports=Nz(),km.exports}var ab;function Mz(){if(ab)return pu;ab=1;var n=Oz(),i=Np(),a=Az();function l(e){var t="https://react.dev/errors/"+e;if(1bi||(e.current=Li[bi],Li[bi]=null,bi--)}function tt(e,t){bi++,Li[bi]=e.current,e.current=t}var vn=On(null),Gt=On(null),In=On(null),ai=On(null);function Hi(e,t){switch(tt(In,t),tt(Gt,e),tt(vn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?l0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=l0(t),e=o0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ut(vn),tt(vn,e)}function Ce(){Ut(vn),Ut(Gt),Ut(In)}function me(e){var t=e.memoizedState;t!==null&&(Yl._currentValue=t.memoizedState,tt(ai,e)),t=vn.current;var r=o0(t,e.type);t!==r&&(tt(Gt,e),tt(vn,r))}function nt(e){Gt.current===e&&(Ut(vn),Ut(Gt)),ai.current===e&&(Ut(ai),Yl._currentValue=Bt)}var Zt,qr;function Zn(e){if(Zt===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Zt=t&&t[1]||"",qr=-1>>1,Se=Q[Me];if(0>>1;Meu(be,xe))Mu(F,be)?(Q[Me]=F,Q[M]=xe,Me=M):(Q[Me]=be,Q[Re]=xe,Me=Re);else if(Mu(F,xe))Q[Me]=F,Q[M]=xe,Me=M;else break e}}return W}function u(Q,W){var xe=Q.sortIndex-W.sortIndex;return xe!==0?xe:Q.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();n.unstable_now=function(){return d.now()-m}}var p=[],g=[],b=1,y=null,w=3,O=!1,T=!1,A=!1,k=!1,L=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function G(Q){for(var W=a(g);W!==null;){if(W.callback===null)l(g);else if(W.startTime<=Q)l(g),W.sortIndex=W.expirationTime,i(p,W);else break;W=a(g)}}function ee(Q){if(A=!1,G(Q),!T)if(a(p)!==null)T=!0,V||(V=!0,we());else{var W=a(g);W!==null&&fe(ee,W.startTime-Q)}}var V=!1,ne=-1,ae=5,ye=-1;function ue(){return k?!0:!(n.unstable_now()-yeQ&&ue());){var Me=y.callback;if(typeof Me=="function"){y.callback=null,w=y.priorityLevel;var Se=Me(y.expirationTime<=Q);if(Q=n.unstable_now(),typeof Se=="function"){y.callback=Se,G(Q),W=!0;break t}y===a(p)&&l(p),G(Q)}else l(p);y=a(p)}if(y!==null)W=!0;else{var Be=a(g);Be!==null&&fe(ee,Be.startTime-Q),W=!1}}break e}finally{y=null,w=xe,O=!1}W=void 0}}finally{W?we():V=!1}}}var we;if(typeof X=="function")we=function(){X(J)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Oe=he.port2;he.port1.onmessage=J,we=function(){Oe.postMessage(null)}}else we=function(){L(J,0)};function fe(Q,W){ne=L(function(){Q(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(Q){Q.callback=null},n.unstable_forceFrameRate=function(Q){0>Q||125Me?(Q.sortIndex=xe,i(g,Q),a(p)===null&&Q===a(g)&&(A?(D(ne),ne=-1):A=!0,fe(ee,xe-Me))):(Q.sortIndex=Se,i(p,Q),T||O||(T=!0,V||(V=!0,we()))),Q},n.unstable_shouldYield=ue,n.unstable_wrapCallback=function(Q){var W=w;return function(){var xe=w;w=W;try{return Q.apply(this,arguments)}finally{w=xe}}}})(Rm)),Rm}var rb;function Az(){return rb||(rb=1,km.exports=Nz()),km.exports}var Cm={exports:{}},Cn={};var sb;function Mz(){if(sb)return Cn;sb=1;var n=Ap();function i(b){var y="https://react.dev/errors/"+b;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Cm.exports=Mz(),Cm.exports}var lb;function kz(){if(lb)return gu;lb=1;var n=Az(),i=Ap(),a=jz();function l(e){var t="https://react.dev/errors/"+e;if(1bi||(e.current=Li[bi],Li[bi]=null,bi--)}function tt(e,t){bi++,Li[bi]=e.current,e.current=t}var gn=En(null),Gt=En(null),In=En(null),ai=En(null);function Hi(e,t){switch(tt(In,t),tt(Gt,e),tt(gn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?o0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=o0(t),e=u0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ut(gn),tt(gn,e)}function Ce(){Ut(gn),Ut(Gt),Ut(In)}function me(e){var t=e.memoizedState;t!==null&&(Fl._currentValue=t.memoizedState,tt(ai,e)),t=gn.current;var r=u0(t,e.type);t!==r&&(tt(Gt,e),tt(gn,r))}function nt(e){Gt.current===e&&(Ut(gn),Ut(Gt)),ai.current===e&&(Ut(ai),Fl._currentValue=Bt)}var Zt,qr;function Zn(e){if(Zt===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Zt=t&&t[1]||"",qr=-1)":-1o||N[s]!==Z[o]){var q=` +`);for(o=s=0;so||N[s]!==Z[o]){var q=` `+N[s].replace(" at new "," at ");return e.displayName&&q.includes("")&&(q=q.replace("",e.displayName)),q}while(1<=s&&0<=o);break}}}finally{li=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Zn(r):""}function Pn(e,t){switch(e.tag){case 26:case 27:case 5:return Zn(e.type);case 16:return Zn("Lazy");case 13:return e.child!==t&&t!==null?Zn("Suspense Fallback"):Zn("Suspense");case 19:return Zn("SuspenseList");case 0:case 15:return nr(e.type,!1);case 11:return nr(e.type.render,!1);case 1:return nr(e.type,!0);case 31:return Zn("Activity");case 30:return Zn("ViewTransition");default:return""}}function Kn(e){try{var t="",r=null;do t+=Pn(e,r),r=e,e=e.return;while(e);return t}catch(s){return` Error generating stack: `+s.message+` -`+s.stack}}var yn=Object.prototype.hasOwnProperty,Gn=n.unstable_scheduleCallback,ia=n.unstable_cancelCallback,nl=n.unstable_shouldYield,ms=n.unstable_requestPaint,Yt=n.unstable_now,il=n.unstable_getCurrentPriorityLevel,Yn=n.unstable_ImmediatePriority,rl=n.unstable_UserBlockingPriority,ra=n.unstable_NormalPriority,cd=n.unstable_LowPriority,qu=n.unstable_IdlePriority,fd=n.log,dd=n.unstable_setDisableYieldValue,sa=null,Ft=null;function Tt(e){if(typeof fd=="function"&&dd(e),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(sa,e)}catch{}}var Nt=Math.clz32?Math.clz32:oi,ps=Math.log,gs=Math.LN2;function oi(e){return e>>>=0,e===0?32:31-(ps(e)/gs|0)|0}var ir=256,rr=262144,aa=4194304;function Sr(e){var t=e&42;if(t!==0)return t;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&-e;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 sl(e,t,r){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var _=s&134217727;return _!==0?(s=_&~c,s!==0?o=Sr(s):(h&=_,h!==0?o=Sr(h):r||(r=_&~e,r!==0&&(o=Sr(r))))):(_=s&~c,_!==0?o=Sr(_):h!==0?o=Sr(h):r||(r=s&~e,r!==0&&(o=Sr(r)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,r=t&-t,c>=r||c===32&&(r&4194048)!==0)?t:o}function la(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xr(e,t){(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0r;r++)t.push(e);return t}function ui(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function un(e,t,r,s,o,c){var h=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 _=e.entanglements,N=e.expirationTimes,Z=e.hiddenUpdates;for(r=h&~r;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oo=!1;if(ar)try{var ga={};Object.defineProperty(ga,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{Oo=!1}var Er=null,wi=null,zi=null;function Or(){if(zi)return zi;var e,t=wi,r=t.length,s,o="value"in Er?Er.value:Er.textContent,c=o.length;for(e=0;e=I),ce=" ",de=!1;function ge(e,t){switch(e){case"keyup":return R.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function De(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ie=!1;function Je(e,t){switch(e){case"compositionend":return De(t);case"keypress":return t.which!==32?null:(de=!0,ce);case"textInput":return e=t.data,e===ce&&de?null:e;default:return null}}function qe(e,t){if(Ie)return e==="compositionend"||!H&&ge(e,t)?(e=Or(),zi=wi=Er=null,Ie=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _g(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sg(e,t){var r=_g(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=_g(r)}}function xg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bd(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=bd(e.document)}return t}function _d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Mx=ar&&"documentMode"in document&&11>=document.documentMode,vl=null,Sd=null,Co=null,xd=!1;function zg(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;xd||vl==null||vl!==bd(s)||(s=vl,"selectionStart"in s&&_d(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Co&&Ss(Co,s)||(Co=s,s=ef(Sd,"onSelect"),0>=h,o-=h,Ar=1<<32-Nt(t)+o|r<ke?(sn=Ee,Ee=null):sn=Ee.sibling;var Xe=C(U,Ee,$[ke],V);if(Xe===null){Ee===null&&(Ee=sn);break}e&&Ee&&Xe.alternate===null&&t(U,Ee),j=c(Xe,j,ke),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe,Ee=sn}if(ke===$.length)return r(U,Ee),Ve&&ts(U,ke),ve;if(Ee===null){for(;ke<$.length;ke++)Ee=P(U,$[ke],V),Ee!==null&&(j=c(Ee,j,ke),Fe===null?ve=Ee:Fe.sibling=Ee,Fe=Ee);return Ve&&ts(U,ke),ve}for(Ee=s(Ee);ke<$.length;ke++)sn=B(Ee,U,ke,$[ke],V),sn!==null&&(e&&(Xe=sn.alternate,Xe!==null&&Ee.delete(Xe.key===null?ke:Xe.key)),j=c(sn,j,ke),Fe===null?ve=sn:Fe.sibling=sn,Fe=sn);return e&&Ee.forEach(function(Ps){return t(U,Ps)}),Ve&&ts(U,ke),ve}function _e(U,j,$,V){if($==null)throw Error(l(151));for(var ve=null,Fe=null,Ee=j,ke=j=0,sn=null,Xe=$.next();Ee!==null&&!Xe.done;ke++,Xe=$.next()){Ee.index>ke?(sn=Ee,Ee=null):sn=Ee.sibling;var Ps=C(U,Ee,Xe.value,V);if(Ps===null){Ee===null&&(Ee=sn);break}e&&Ee&&Ps.alternate===null&&t(U,Ee),j=c(Ps,j,ke),Fe===null?ve=Ps:Fe.sibling=Ps,Fe=Ps,Ee=sn}if(Xe.done)return r(U,Ee),Ve&&ts(U,ke),ve;if(Ee===null){for(;!Xe.done;ke++,Xe=$.next())Xe=P(U,Xe.value,V),Xe!==null&&(j=c(Xe,j,ke),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe);return Ve&&ts(U,ke),ve}for(Ee=s(Ee);!Xe.done;ke++,Xe=$.next())Xe=B(Ee,U,ke,Xe.value,V),Xe!==null&&(e&&(sn=Xe.alternate,sn!==null&&Ee.delete(sn.key===null?ke:sn.key)),j=c(Xe,j,ke),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe);return e&&Ee.forEach(function(Sz){return t(U,Sz)}),Ve&&ts(U,ke),ve}function He(U,j,$,V){if(typeof $=="object"&&$!==null&&$.type===X&&$.key===null&&$.props.ref===void 0&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case ye:e:{for(var ve=$.key;j!==null;){if(j.key===ve){if(ve=$.type,ve===X){if(j.tag===7){r(U,j.sibling),V=o(j,$.props.children),Es(V,$),V.return=U,U=V;break e}}else if(j.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===Se&&Ca(ve)===j.type){r(U,j.sibling),V=o(j,$.props),Es(V,$),V.return=U,U=V;break e}r(U,j);break}else t(U,j);j=j.sibling}$.type===X?(V=Oa($.props.children,U.mode,V,$.key),Es(V,$),V.return=U,U=V):(V=sc($.type,$.key,$.props,null,U.mode,V),Es(V,$),V.return=U,U=V)}return h(U);case ue:e:{for(ve=$.key;j!==null;){if(j.key===ve)if(j.tag===4&&j.stateNode.containerInfo===$.containerInfo&&j.stateNode.implementation===$.implementation){r(U,j.sibling),V=o(j,$.children||[]),V.return=U,U=V;break e}else{r(U,j);break}else t(U,j);j=j.sibling}V=Ad($,U.mode,V),V.return=U,U=V}return h(U);case Se:return $=Ca($),He(U,j,$,V)}if(Ae($))return oe(U,j,$,V);if(re($)){if(ve=re($),typeof ve!="function")throw Error(l(150));return $=ve.call($),_e(U,j,$,V)}if(typeof $.then=="function")return He(U,j,pc($),V);if($.$$typeof===fe)return He(U,j,fc(U,$),V);gc(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,j!==null&&j.tag===6?(r(U,j.sibling),V=o(j,$),V.return=U,U=V):(r(U,j),V=Nd($,U.mode,V),V.return=U,U=V),h(U)):r(U,j)}return function(U,j,$,V){try{Ho=0;var ve=He(U,j,$,V);return El=null,ve}catch(Ee){if(Ee===Tl||Ee===hc)throw Ee;var Fe=fi(29,Ee,null,U.mode);return Fe.lanes=V,Fe.return=U,Fe}}}var Ua=Yg(!0),Fg=Yg(!1),Os=!1;function Ld(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ns(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function As(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(it&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=rc(e),kg(e,null,r),t}return ic(e,s,t,r),rc(e)}function Bo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Jt(e,r)}}function Bd(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var o=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var h={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,r=r.next}while(r!==null);c===null?o=c=t:c=c.next=t}else o=c=t;r={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var qd=!1;function qo(){if(qd){var e=zl;if(e!==null)throw e}}function Vo(e,t,r,s){qd=!1;var o=e.updateQueue;Os=!1;var c=o.firs)DELIM" -R"DELIM(tBaseUpdate,h=o.lastBaseUpdate,_=o.shared.pending;if(_!==null){o.shared.pending=null;var N=_,Z=N.next;N.next=null,h===null?c=Z:h.next=Z,h=N;var q=e.alternate;q!==null&&(q=q.updateQueue,_=q.lastBaseUpdate,_!==h&&(_===null?q.firstBaseUpdate=Z:_.next=Z,q.lastBaseUpdate=N))}if(c!==null){var P=o.baseState;h=0,q=Z=N=null,_=c;do{var C=_.lane&-536870913,B=C!==_.lane;if(B?(Ye&C)===C:(s&C)===C){C!==0&&C===ka&&(qd=!0),q!==null&&(q=q.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var oe=e,_e=_;C=t;var He=r;switch(_e.tag){case 1:if(oe=_e.payload,typeof oe=="function"){P=oe.call(He,P,C);break e}P=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=_e.payload,C=typeof oe=="function"?oe.call(He,P,C):oe,C==null)break e;P=ne({},P,C);break e;case 2:Os=!0}}C=_.callback,C!==null&&(e.flags|=64,B&&(e.flags|=8192),B=o.callbacks,B===null?o.callbacks=[C]:B.push(C))}else B={lane:C,tag:_.tag,payload:_.payload,callback:_.callback,next:null},q===null?(Z=q=B,N=P):q=q.next=B,h|=C;if(_=_.next,_===null){if(_=o.shared.pending,_===null)break;B=_,_=B.next,B.next=null,o.lastBaseUpdate=B,o.shared.pending=null}}while(!0);q===null&&(N=P),o.baseState=N,o.firstBaseUpdate=Z,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),Us|=h,e.lanes=h,e.memoizedState=P}}function Qg(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Jg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;ec?c:8;var h=pe.T,_={};_.types=h!==null?h.types:null,pe.T=_,oh(e,!1,t,r);try{var N=o(),Z=pe.S;if(Z!==null&&Z(_,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var q=Bx(N,s);Go(e,t,q,ki(e))}else Go(e,t,s,ki(e))}catch(P){Go(e,t,{then:function(){},status:"rejected",reason:P},ki())}finally{Ne.p=c,h!==null&&_.types!==null&&(h.types=_.types),pe.T=h}}function Gx(){}function ah(e,t,r,s){if(e.tag!==5)throw Error(l(476));var o=Av(e).queue;Nv(e,o,t,Bt,r===null?Gx:function(){return Mv(e),r(s)})}function Av(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Bt,baseState:Bt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:Bt},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Mv(e){var t=Av(e);t.next===null&&(t=e.alternate.memoizedState),Go(e,t.next.queue,{},ki())}function lh(){return Mn(Yl)}function jv(){return Xt().memoizedState}function kv(){return Xt().memoizedState}function Yx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=ki();e=Ns(r);var s=As(t,e,r);s!==null&&(pi(s,t,r),Bo(s,t,r)),t={cache:Dd()},e.payload=t;return}t=t.return}}function Fx(e,t,r){var s=ki();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ec(e)?Cv(t,r):(r=Ed(e,t,r,s),r!==null&&(pi(r,e,s),Dv(r,t,s)))}function Rv(e,t,r){var s=ki();Go(e,t,r,s)}function Go(e,t,r,s){var o={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ec(e))Cv(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,_=c(h,r);if(o.hasEagerState=!0,o.eagerState=_,ut(_,h))return ic(e,t,o,0),bt===null&&nc(),!1}catch{}if(r=Ed(e,t,o,s),r!==null)return pi(r,e,s),Dv(r,t,s),!0}return!1}function oh(e,t,r,s){if(s={lane:2,revertLane:Xh(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ec(e)){if(t)throw Error(l(479))}else t=Ed(e,r,s,2),t!==null&&pi(t,e,2)}function Ec(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Cv(e,t){Ol=bc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Dv(e,t,r){if((r&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Jt(e,r)}}var Oc={readContext:Mn,use:xc,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It,useEffectEvent:It},Uv={readContext:Mn,use:xc,useCallback:function(e,t){return ei().memoizedState=[e,t===void 0?null:t],e},useContext:Mn,useEffect:bv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,zc(4194308,4,wv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return zc(4194308,4,e,t)},useInsertionEffect:function(e,t){zc(4,2,e,t)},useMemo:function(e,t){var r=ei();t=t===void 0?null:t;var s=e();if(Za){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[s,t],s},useReducer:function(e,t,r){var s=ei();if(r!==void 0){var o=r(t);if(Za){Tt(!0);try{r(t)}finally{Tt(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Fx.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var t=ei();return e={current:e},t.memoizedState=e},useState)DELIM" -R"DELIM(:function(e){e=th(e);var t=e.queue,r=Rv.bind(null,Le,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:rh,useDeferredValue:function(e,t){var r=ei();return sh(r,e,t)},useTransition:function(){var e=th(!1);return e=Nv.bind(null,Le,e.queue,!0,!1),ei().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var s=Le,o=ei();if(Ve){if(r===void 0)throw Error(l(407));r=r()}else{if(r=t(),bt===null)throw Error(l(349));(Ye&127)!==0||iv(s,t,r)}o.memoizedState=r;var c={value:r,getSnapshot:t};return o.queue=c,bv(sv.bind(null,s,c,e),[e]),s.flags|=2048,Al(9,{destroy:void 0},rv.bind(null,s,c,r,t),null),r},useId:function(){var e=ei(),t=bt.identifierPrefix;if(Ve){var r=Mr,s=Ar;r=(s&~(1<<32-Nt(s)-1)).toString(32)+r,t="_"+t+"R_"+r,r=_c++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}c[At]=t,c[bn]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(Cn(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ls(t)}}return zt(t),t.subtreeFlags&=-33554433,Sh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ls(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=In.current,wl(t)){if(e=t.stateNode,r=t.memoizedProps,s=null,o=xn,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[At]=t,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||s0(e.nodeValue,r)),e||zs(t,!0)}else e=au(e).createTextNode(s),e[At]=t,t.stateNode=e}return zt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(s=wl(t),r!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[At]=t}else Na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),e=!1}else r=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Ni(t),t):(Ni(t),null);if((t.flags&128)!==0)throw Error(l(558))}return zt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=wl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[At]=t}else Na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),o=!1}else o=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Ni(t),t):(Ni(t),null)}return Ni(t),(t.flags&128)!==0?(t.lanes=r,t):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),Rc(t,t.updateQueue),zt(t),null);case 4:return Ce(),e===null&&nm(t.stateNode.containerInfo),t.flags|=67108864,zt(t),null;case 10:return is(t.type),zt(t),null;case 19:if(Kd(t),s=t.memoizedState,s===null)return zt(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)Fo(s,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=yc(e),c!==null){for(t.flags|=128,Fo(s,!1),e=c.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Rg(r,e),r=r.sibling;return Io(t,kn.current&1|2),Ve&&ts(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Yt()>Pc&&(t.flags|=128,o=!0,Fo(s,!1),t.lanes=4194304)}else{if(!o)if(e=yc(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),Fo(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!c.alternate&&!Ve)return zt(t),null}else 2*Yt()-s.renderingStartTime>Pc&&r!==536870912&&(t.flags|=128,o=!0,Fo(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}if(s.tail!==null){e=s.tail;e:{for(r=e;r!==null;){if(r.alternate!==null){r=!1;break e}r=r.sibling}r=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Yt(),e.sibling=null,c=kn.current,c=o?c&1|2:c&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!r||Ve?Io(t,c):(r=c,tt(jn,t),tt(kn,r),Vn===null&&(Vn=t)),Ve&&ts(t,s.treeForkCount),e}return zt(t),null;case 22:case 23:return Ni(t),Id(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(r&536870912)!==0&&(t.flags&128)===0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),r=t.updateQueue,r!==null&&Rc(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==r&&(t.flags|=2048),e!==null&&Ut(Ra),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),is(tn),zt(t),null;case 25:return null;case 30:return t.flags|=33554432,zt(t),null}throw Error(l(156,t.tag))}function nw(e,t){switch(Md(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:ret)DELIM" -R"DELIM(urn is(tn),Ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return nt(t),null;case 31:if(t.memoizedState!==null){if(Ni(t),t.alternate===null)throw Error(l(340));Na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ni(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Kd(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ce(),null;case 10:return is(t.type),null;case 22:case 23:return Ni(t),Id(),e!==null&&Ut(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return is(tn),null;case 25:return null;default:return null}}function ly(e,t){switch(Md(t),t.tag){case 3:is(tn),Ce();break;case 26:case 27:case 5:nt(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&Ni(t);break;case 13:Ni(t);break;case 19:Kd(t);break;case 10:is(t.type);break;case 22:case 23:Ni(t),Id(),e!==null&&Ut(Ra);break;case 24:is(tn)}}function Qo(e,t){try{var r=t.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var o=s.next;r=o;do{if((r.tag&e)===e){s=void 0;var c=r.create,h=r.inst;s=c(),h.destroy=s}r=r.next}while(r!==o)}}catch(_){ft(t,t.return,_)}}function Rs(e,t,r){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var h=s.inst,_=h.destroy;if(_!==void 0){h.destroy=void 0,o=t;var N=r,Z=_;try{Z()}catch(q){ft(o,N,q)}}}s=s.next}while(s!==c)}}catch(q){ft(t,t.return,q)}}function oy(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Jg(t,r)}catch(s){ft(e,e.return,s)}}}function uy(e,t,r){r.props=$a(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){ft(e,t,s)}}function jr(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var o=e.stateNode,c=Xr(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=g0(c)),s=o.ref;break;case 7:if(e.stateNode===null){var h=new Ri(e);y(e.child,!1,Kw,h,void 0,void 0),e.stateNode=h}s=e.stateNode;break;default:s=e.stateNode}typeof r=="function"?e.refCleanup=r(s):r.current=s}}catch(_){ft(e,t,_)}}function Rn(e,t){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(o){ft(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(o){ft(e,t,o)}else r.current=null}function Cc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var r=0;r title"))),Cn(s,t,r),s[At]=e,Wt(s),t=s;break e;case"link":if(c=R0("link","href",o).get(t+(r.href||""))){for(h=0;hHe&&(h=He,He=_e,_e=h);var U=Sg(_,_e),j=Sg(_,He);if(U&&j&&(B.rangeCount!==1||B.anchorNode!==U.node||B.anchorOffset!==U.offset||B.focusNode!==j.node||B.focusOffset!==j.offset)){var $=P.createRange();$.setStart(U.node,U.offset),B.removeAllRanges(),_e>He?(B.addRange($),B.extend(j.node,j.offset)):($.setEnd(j.node,j.offset),B.addRange($))}}}}for(P=[],B=_;B=B.parentNode;)B.nodeType===1&&P.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_r?32:r,pe.T=null,r=qh,qh=null;var c=pr,h=Zr;if(Lt=0,qa=pr=null,Zr=0,(it&6)!==0)throw Error(l(331));var _=it;if(it|=4,ky(c.current),Ay(c,c.current,h,r),it=_,iu(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(sa,c)}catch{}return!0}finally{Ne.p=o,pe.T=s,Gy(e,t)}}function Yy(e,t,r){t=Ii(r,t),t=fh(e.stateNode,t,2),e=As(e,t,2),e!==null&&(ui(e,2),$r(e))}function ft(e,t,r){if(e.tag===3)Yy(e,e,r);else for(;t!==null;){if(t.tag===3){Yy(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Zs===null||!Zs.has(s))){e=Ii(r)DELIM" -R"DELIM(,e),r=Iv(2),s=As(t,r,2),s!==null&&(Pv(r,s,t,e),ui(s,2),$r(s));break}}t=t.return}}function Fh(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new aw;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(r)||(Lh=!0,o.add(r),e=mw.bind(null,e,t,r),t.then(e,e))}function mw(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,bt===e&&(Ye&r)===r&&((Pt===4||Pt===3&&(Ye&62914560)===Ye&&300>Yt()-Ic)&&(it&2)===0?Hl(e,0):Vc|=r,Dl===Ye&&(Dl=0)),$r(e)}function Fy(e,t){t===0&&(t=vs()),e=Ea(e,t),e!==null&&(ui(e,t),$r(e))}function pw(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Fy(e,r)}function gw(e,t){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),Fy(e,r)}function vw(e,t){return Gn(e,t)}var ql=null,Vl=null,Qh=!1,Xc=!1,Jh=!1,Ls=0;function $r(e){e!==Vl&&e.next===null&&(Vl===null?ql=Vl=e:Vl=Vl.next=e),Xc=!0,Qh||(Qh=!0,bw())}function iu(e,t){if(!Jh&&Xc){Jh=!0;do for(var r=!1,s=ql;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var h=s.suspendedLanes,_=s.pingedLanes;c=(1<<31-Nt(42|e)+1)-1,c&=o&~(h&~_),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(r=!0,Wy(s,c))}else c=Ye,c=sl(s,s===bt?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||la(s,c)||(r=!0,Wy(s,c));s=s.next}while(r);Jh=!1}}function yw(){Qy()}function Qy(){Xc=Qh=!1;var e=0;Ls!==0&&Mw()&&(e=Ls);for(var t=Yt(),r=null,s=ql;s!==null;){var o=s.next,c=Jy(s,t);c===0?(s.next=null,r===null?ql=o:r.next=o,o===null&&(Vl=r)):(r=s,(e!==0||(c&3)!==0)&&(Xc=!0)),s=o}Lt!==0&&Lt!==5||iu(e),Ls!==0&&(Ls=0)}function Jy(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0_)break;var q=N.transferSize,P=N.initiatorType;q&&a0(P)&&(N=N.responseEnd,h+=q*(N<_?1:(_-Z)/(N-Z)))}if(--s,t+=8*(c+h)/(o.duration/1e3),e++,10rf){_e.length=oe;break}$=new Promise(Uw.bind($)),_e.push($)}}}if(0<_e.length)return C=Promise.race([Promise.all(_e),new Promise(function(ve){return setTimeout(ve,500)})]).then(o,o),(B?Promise.allSettled([B.finished,C]):C).then(c,c);if(o(),B)return B.finished.then(c,c);c()},types:r});Z.__reactViewTransition=q;var P=[];return q.ready.then(function(){for(var C=Z.documentElement.getAnimations({subtree:!0}),B=0;B"u"?null:document;function A0(e,t,r){var s=Pl;if(s&&typeof t=="string"&&t){var o=Qn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof r=="string"&&(o+='[crossorigin="'+r+'"]'),N0.has(o)||(N0.add(o),e={rel:e,crossOrigin:r,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Cn(t,"link",e),Wt(t),s.head.appendChild(t)))}}function tz(e){us.D(e),A0("dns-prefetch",e,null)}function nz(e,t){us.C(e,t),A0("preconnect",e,t)}function iz(e,t,r){us.L(e,t,r);var s=Pl;if(s&&e&&t){var o='link[rel="preload"][as="'+Qn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(o+='[imagesrcset="'+Qn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(o+='[imagesizes="'+Qn(r.imageSizes)+'"]')):o+='[href="'+Qn(e)+'"]';var c=o;switch(t){case"style":c=Kl(e);break;case"script":c=Gl(e)}if(!(Qi.has(c)||(e=ne({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),Qi.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(ou(c))||t==="script"&&s.querySelector(uu(c))))){var h=s.createElement("link");Cn(h,"link",e),t==="style"&&(h[cn]=!0,h.onload=h.onerror=function(){Vu(h)}),Wt(h),s.head.appendChild(h)}}}function rz(e,t){us.m(e,t);var r=Pl;if(r&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Qn(s)+'"][href="'+Qn(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Gl(e)}if(!Qi.has(c)&&(e=ne({rel:"modulepreload",href:e},t),Qi.set(c,e),r.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(uu(c)))return}s=r.createElement("link"),Cn(s,"link",e),Wt(s),r.head.appendChild(s)}}}function sz(e,t,r){us.S(e,t,r);var s=Pl;if(s&&e){var o=bs(s).hoistableStyles,c=Kl(e);t=t||"default";var h=o.get(c);if(!h){var _={loading:0,preload:null};if(h=s.querySelector(ou(c)))_.loading=5;else{e=ne({rel:"stylesheet",href:e,"data-precedence":t},r),(r=Qi.get(c))&&ym(e,r);var N=h=s.createElement("link");Wt(N),Cn(N,"link",e),N._p=new Promise(function(Z,q){N.onload=Z,N.onerror=q}),N.addEventListener("load",function(){_.loading|=1}),N.addEventListener("error",function(){_.loading|=2}),_.loading|=4,tf(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:_},o.set(c,h)}}}function az(e,t){us.X(e,t);var r=Pl;if(r&&e){var s=bs(r).hoistableScripts,o=Gl(e),c=s.get(o);c||(c=r.querySelector(uu(o)),c||(e=ne({src:e,async:!0},t),(t=Qi.get(o))&&bm(e,t),c=r.createElement("script"),Wt(c),Cn(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function lz(e,t){us.M(e,t);var r=Pl;if(r&&e){var s=bs(r).hoistableScripts,o=Gl(e),c=s.get(o);c||(c=r.querySelector(uu(o)),c||(e=ne({src:e,async:!0,type:"module"},t),(t=Qi.get(o))&&bm(e,t),c=r.createElement("script"),Wt(c),Cn(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function M0(e,t,r,s){var o=(o=In.current)?lu(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(r=Kl(r.href),t=bs(o).hoistableStyles,s=t.get(r),s||(s={type:"style",instance:null,count:0,state:null},t.set(r,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Kl(r.href);var c=bs(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(ou(e)))?c._p||(h.instance=c,h.state.loading=5):(c=Qi.get(e),c||(c={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Qi.set(e,c)),oz(o,e,c,h.state))),t&&s===null)throw Error(l(528,""));return h}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(r=Gl(r),t=bs(o).hoistableScripts,s=t.get(r),s||(s={type:"script",instance:null,count:0,state:null},t.set(r,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Kl(e){return'href="'+Qn(e)+'"'}function ou(e){return'link[rel="stylesheet"]['+e+"]"}function j0(e){return ne({},e,{"data-precedence":e.precedence,precedence:null})}function oz(e,t,r,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[cn]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[cn]=!0,t.onload=t.onerror=Vu.bind(null,t),Cn(t,"link",r),Wt(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Gl(e){return'[src="'+Qn(e)+'"]'}function uu(e){return"script[async]"+e}function k0(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Qn(r.href)+'"]');if(s)return t.instance=s,Wt(s),s;var o=ne({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Wt(s),Cn(s,"style",o),tf(s,r.precedence,e),t.instance=s;case"stylesheet":o=Kl(r.href);var c=e.querySelector(ou(o));if(c)return t.state.loading|=4,t.instance=c,Wt(c),c;s=j0(r),(o=Qi.get(o))&&ym(s,o),c=(e.ownerDocument||e).createElement("link"),Wt(c);var h=c;return h._p=new Promise(function(_,N){h.onload=_,h.onerror=N}),Cn(c,"link",s),t.state.loading|=4,tf(c,r.precedence,e),t.instance=c;case"script":return c=Gl(r.src),(o=e.querySelector(uu(c)))?(t.instance=o,Wt(o),o):(s=r,(o=Qi.get(c))&&(s=ne({},r),bm(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),Wt(o),Cn(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,tf(s,r.precedence,e));return t.instance}function tf(e,t,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,h=0;h title"):null)}function uz(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function C0(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function D0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function U0(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Z0(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=U0(t),e.suspenseyImages.push(t)),e=dz.bind(e),t.decode().then(e,e))}function cz(e,t,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var o=Kl(s.href),c=t.querySelector(ou(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cu.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=c,Wt(c);return}c=t.ownerDocument||t,s=j0(s),(o=Qi.get(o))&&ym(s,o),c=c.createElement("link"),Wt(c);var h=c;h._p=new Promise(function(_,N){h.onload=_,h.onerror=N}),Cn(c,"link",s),r.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=cu.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var rf=0;function fz(e,t){return e.stylesheets&&e.count===0&&af(e,e.stylesheets),0rf?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function $0(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)af(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function cu(){this.count--,$0(this)}function dz(){this.imgCount--,$0(this)}var sf=null;function af(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sf=new Map,t.forEach(hz,e),sf=null,cu.call(e))}function hz(e,t){if(!(t.state.loading&4)){var r=sf.get(e);if(r)var s=r.get(null);else{r=new Map,sf.set(e,r);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Am.exports=Mz(),Am.exports}var kz=jz();const Rz=i1(kz),Cz=[{id:"current",label:"Classic"},{id:"light",label:"Light"},{id:"midnight",label:"Midnight"}],Ap="libbitcoinTheme",jf="libbitcoin-theme-change";function Mp(n){return n==="light"||n==="midnight"?n:"current"}function r1(){try{return Mp(localStorage.getItem(Ap))}catch{return"current"}}function jp(n){document.documentElement.dataset.theme=n;const i=getComputedStyle(document.documentElement).getPropertyValue("--theme-background").trim();i&&document.querySelector('meta[name="theme-color"]')?.setAttribute("content",i)}function Dz(){jp(r1()),globalThis.addEventListener("storage",$z)}function Uz(n){const i=Mp(n);jp(i);try{localStorage.setItem(Ap,i)}catch{}globalThis.dispatchEvent(new Event(jf))}function Zz(){return Mp(document.documentElement.dataset.theme)}function $z(n){n.key!==null&&n.key!==Ap||(jp(r1()),globalThis.dispatchEvent(new Event(jf)))}function Lz(n){return globalThis.addEventListener(jf,n),()=>{globalThis.removeEventListener(jf,n)}}function kp(){return se.useSyncExternalStore(Lz,Zz,()=>"current")}function Hz(){const n=kp();return x.jsx("select",{"aria-label":"Theme",value:n,onChange:i=>{Uz(i.target.value)},className:"border-accent/40 bg-surface text-textP)DELIM" -R"DELIM(rimary focus:border-accent focus:ring-accent rounded-md border py-1.5 pr-8 pl-3 text-sm",children:Cz.map(i=>x.jsx("option",{value:i.id,children:i.label},i.id))})}const s1="libbitcoinAdminDashboardBrowserNotifications";function a1(){try{return globalThis.window?.localStorage??null}catch{return null}}function Rp(){const n=globalThis.Notification;return typeof n=="function"?n:null}function l1(){return Rp()?.permission??"unsupported"}async function Bz(){const n=Rp();return n?n.permission!=="default"?n.permission:n.requestPermission():"unsupported"}function qz(n=a1()){try{return l1()==="granted"&&n?.getItem(s1)==="true"}catch{return!1}}function Vz(n,i=a1()){try{i?.setItem(s1,String(n))}catch{}}function Iz(n,i){const a=Rp();if(!a||a.permission!=="granted")return!1;try{return new a(n,i),!0}catch{return!1}}function Pz({browserNotificationsEnabled:n,onClose:i,onBrowserNotificationsEnabledChange:a}){const[l,u]=se.useState(l1),[f,d]=se.useState(!1),[m,p]=se.useState(null),g=n&&l==="granted";async function b(){if(g){a(!1);return}d(!0),p(null);try{const y=await Bz();u(y),y==="granted"?a(!0):y==="denied"&&p("Permission was denied. It can be changed in your browser settings.")}catch{p("The browser could not enable notifications.")}finally{d(!1)}}return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:y=>{y.target===y.currentTarget&&i()},children:x.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"settings-title",className:"border-accent/30 bg-surface/95 max-h-[calc(100vh-2rem)] w-full max-w-xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/50",children:[x.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[x.jsx("h2",{id:"settings-title",className:"text-accent text-xl font-semibold",children:"Settings"}),x.jsx("button",{type:"button",onClick:i,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close settings",children:"×"})]}),x.jsxs("div",{className:"space-y-5 p-5",children:[x.jsx(Hz,{}),x.jsxs("div",{className:"border-accentSecondary/20 bg-accent/5 space-y-3 rounded-xl border p-4",children:[x.jsxs("div",{children:[x.jsx("h3",{className:"text-textPrimary text-sm font-medium",children:"Browser notifications"}),x.jsx("p",{id:"browser-notifications-help",className:"text-textMuted mt-1 text-xs",children:Gz(l,g,f)})]}),x.jsx("button",{type:"button","aria-describedby":"browser-notifications-help",disabled:f||l==="unsupported"||l==="denied",onClick:()=>{b()},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",children:Kz(l,g,f)}),m&&x.jsx("p",{className:"text-sm text-red-300",role:"alert",children:m})]}),x.jsx("div",{className:"flex justify-end pt-2",children:x.jsx("button",{type:"button",onClick:i,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-4 py-2 text-sm",children:"Done"})})]})]})})}function Kz(n,i,a){return a?"Requesting permission…":n==="unsupported"?"Notifications unavailable":n==="denied"?"Blocked by browser":i?"Disable notifications":"Enable notifications"}function Gz(n,i,a){return a?"Waiting for your browser permission choice.":n==="unsupported"?"This browser does not support system notifications.":n==="denied"?"Notifications are blocked. Allow them in your browser settings to enable this feature.":i?"System notifications will appear when the node enters or leaves the near-current range.":"Get a system notification when the node enters or leaves the near-current range."}function Jm(n){const i=Object.values(n).filter(l=>typeof l=="number");return Object.entries(n).filter(([l,u])=>i.indexOf(+l)===-1).map(([l,u])=>u)}function ob(n,i="|"){return n.map(a=>h1(a)).join(i)}function Xm(n,i){return typeof i=="bigint"?i.toString():i}class Yz{constructor(i){this._getter=i,this._value=void 0}get value(){const i=this._getter;return i!==void 0&&(this._value=i(),this._getter=void 0),this._value}}function Cp(n){return new Yz(n)}function Fz(n){return n==null}function Dp(n){const i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;return n.slice(i,a)}function Qz(n,i){const a=n/i,l=Math.round(a),u=4*Number.EPSILON*Math.max(Math.abs(a),1);return Math.abs(a-l){const m=i._zod.def.shape[f];return l?l(m,f):m}):c1(n,f,l?l(d.value,f):d.value))}}function Jz(n,i){for(const a of Reflect.ownKeys(i)){const l=Object.getOwnPropertyDescriptor(i,a);l.enumerable&&(l.get?u1(n,a,()=>i[a]):c1(n,a,l.value))}}function Di(...n){const i={};for(const a of n){const l=Object.getOwnPropertyDescriptors(a);Object.assign(i,l)}return Object.defineProperties({},i)}function Xz(n){return JSON.stringify(n)}function Wz(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const f1="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function kf(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const eT=Cp(()=>{if(er.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function no(n){if(kf(n)===!1)return!1;const i=n.constructor;if(i===void 0||typeof i!="function")return!0;const a=i.prototype;return!(kf(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function d1(n){return no(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const tT=new Set(["string","number","symbol"]);function io(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function na(n,i,a){const l=new n._zod.constr(i??n._zod.def);return(!i||a?.parent)&&(l._zod.parent=n),l}function Te(n){const i=n;if(!i)return{};if(typeof i=="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");i.error=i.message}return delete i.message,typeof i.error=="string"?{...i,error:()=>i.error}:i}function h1(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function nT(n){return Object.keys(n).filter(i=>n[i]._zod.optin!==void 0&&n[i]._zod.optout==="optional")}const m1={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]},iT={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rT(n,i){const a=n._zod.def,l=a.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const f={};return Xa(f,n,Yf(n,i)),na(n,Di(a,{shape:f,checks:[]}))}function Yf(n,i){const a=hs(n),l=[];for(const u of Reflect.ownKeys(i)){if(!Object.getOwnPropertyDescriptor(a,u)?.enumerable)throw new Error(`Unrecognized key: "${String(u)}"`);i[u]&&l.push(u)}return l}function sT(n,i){const a=n._zod.def,l=a.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const f=new Set(Yf(n,i)),d={};return Xa(d,n,Reflect.ownKeys(hs(n)).filter(m=>!f.has(m))),na(n,Di(a,{shape:d,checks:[]}))}function aT(n,i){if(!no(i))throw new Error("Invalid input to extend: expected a plain object");const a=n._zod.def.checks;if(a&&a.length>0){const u=hs(n);for)DELIM" -R"DELIM((const f of Reflect.ownKeys(i))if(Object.getOwnPropertyDescriptor(u,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return na(n,Di(n._zod.def,{shape:p1(n,i)}))}function p1(n,i){const a={};return Xa(a,n,Reflect.ownKeys(hs(n))),Jz(a,i),a}function lT(n,i){if(!no(i))throw new Error("Invalid input to safeExtend: expected a plain object");return na(n,Di(n._zod.def,{shape:p1(n,i)}))}function oT(n,i){if(!i?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const a={};Xa(a,n,Reflect.ownKeys(hs(n))),Xa(a,i,Reflect.ownKeys(hs(i)));const l=Di(n._zod.def,{shape:a,get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return na(n,l)}function ub(n,i,a,l="partial"){const f=i._zod.def.checks;if(f&&f.length>0)throw new Error(`.${l}() cannot be used on object schemas containing refinements`);const m=a?new Set(Yf(i,a)):void 0,p={};return Xa(p,i,Reflect.ownKeys(hs(i)),n&&((g,b)=>m&&!m.has(b)?g:new n({type:"optional",innerType:g}))),na(i,Di(i._zod.def,{shape:p,checks:[]}))}function uT(n,i,a){const l=a?new Set(Yf(i,a)):void 0,u={};return Xa(u,i,Reflect.ownKeys(hs(i)),(f,d)=>l&&!l.has(d)?f:new n({type:"nonoptional",innerType:f})),na(i,Di(i._zod.def,{shape:u}))}function _r(n,i=0){if(n.aborted===!0)return!0;for(let a=i;a{var l;return(l=a).path??(l.path=[]),a.path.unshift(n),a})}function gu(n){return typeof n=="string"?n:n?.message}function cb(n){const i=[];for(const a of n??[]){const l=a._zod.def;if(!/_(length|size)$|_equals$/.test(l.check))break;const u=l.maximum??l.length??l.size;u>=0&&i.push([u,a])}return i}function Wm(n,i,a){var l;for(let u=i;un;return i[yT]=!0,i}var fb;const Cm={value:void 0,enumerable:!1};let db="captureStackTrace"in Error?Error:null;function _T(n){const i=db;if(i){const a=i.stackTraceLimit;if(typeof a=="number"){try{i.stackTraceLimit=0}catch{return db=null,new n}try{return new n}finally{i.stackTraceLimit=a}}}return new n}function F(n,i,a,l){const u={};function f(w){this.def=w,this.constr=y,this.traits=new Set}f.prototype=u;const d=a,m=d&&new WeakSet;function p(w,O){if(w._zod){if(w._zod.traits.has(n))return}else{Cm.value=new f(O);try{Object.defineProperty(w,"_zod",Cm)}finally{Cm.value=void 0}}if(w._zod.traits.add(n),i(w,O),m){const A=Object.getPrototypeOf(w),k=w._zod.constr.prototype;let L=A;for(;L&&L!==k;)L=Object.getPrototypeOf(L);const D=L??A;m.has(D)||(m.add(D),hT(D,d))}const T=y.prototype;for(const A in T)Object.prototype.hasOwnProperty.call(T,A)&&(A in w||(w[A]=T[A].bind(w)))}const g=l?.Parent??Object;class b extends g{}Object.defineProperty(b,"name",{value:n});function y(w){const O=l?.Parent?_T(b):this;p(O,w);const T=O._zod.deferred;if(T){for(const k of T)k();O._zod.deferred=void 0}const A=globalThis.__zod_globalConfig?.postProcessor;return A&&A(O),O}return Object.defineProperty(y,"init",{value:p}),Object.defineProperty(y,Symbol.hasInstance,{value:w=>l?.Parent&&w instanceof l.Parent?!0:w?._zod?.traits?.has(n)}),Object.defineProperty(y,"name",{value:n}),y}class Qa extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class y1 extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`),this.name="ZodEncodeError"}}(fb=globalThis).__zod_globalConfig??(fb.__zod_globalConfig={});const er=globalThis.__zod_globalConfig;function Br(n){return n&&Object.assign(er,n),er}function ST(){const n=this._zod;return n.message??(n.message=JSON.stringify(n.def,Xm,2)),n.message}function xT(n){this._zod.message=n}const wT={get:ST,set:xT,enumerable:!0,configurable:!0},Dm={value:void 0,enumerable:!1},hb=new WeakSet([Object.prototype,Error.prototype]),zT=(n,i)=>{n.name="$ZodError",Dm.value=i,Object.defineProperty(n,"issues",Dm),Dm.value=void 0,Object.defineProperty(n,"message",wT);const a=Object.getPrototypeOf(n);hb.has(a)||(hb.add(a),Object.defineProperty(a,"toString",{configurable:!0,enumerable:!1,get(){const l=()=>this.message;return Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0})}}))},TT=F("$ZodError",zT);function ET(n,i,a){return Object.prototype.hasOwnProperty.call(n,i)||(i==="__proto__"?Object.defineProperty(n,i,{value:a(),writable:!0,enumerable:!0,configurable:!0}):n[i]=a()),n[i]}function OT(n,i=a=>a.message){const a={},l=[];for(const u of n.issues)u.path.length>0?ET(a,u.path[0],()=>[]).push(i(u)):l.push(i(u));return{formErrors:l,fieldErrors:a}}function NT(n,i=a=>a.message){const a={_errors:[]},l=(u,f=[])=>{for(const d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(m=>l({issues:m},[...f,...d.path]));else if(d)DELIM" -R"DELIM(.code==="invalid_key")l({issues:d.issues},[...f,...d.path]);else if(d.code==="invalid_element")l({issues:d.issues},[...f,...d.path]);else{const m=[...f,...d.path];if(m.length===0)a._errors.push(i(d));else{let p=a,g=0;for(;g{const i=(a,l,u,f)=>{const d=u?{...u,async:!1}:{async:!1},m=a._zod.run({value:l,issues:[]},d);if(m instanceof Promise)throw new Qa;if(m.issues.length){const p=new(f?.Err??n)(m.issues.map(g=>Js(g,d,Br())));throw f1(p,f?.callee??i),p}return m.value};return i},Lp=n=>{const i=async(a,l,u,f)=>{const d=u?{...u,async:!0}:{async:!0};let m=a._zod.run({value:l,issues:[]},d);if(m instanceof Promise&&(m=await m),m.issues.length){const p=new(f?.Err??n)(m.issues.map(g=>Js(g,d,Br())));throw f1(p,f?.callee??i),p}return m.value};return i},Hp=n=>(i,a,l)=>{const u=l?{...l,async:!1}:{async:!1},f=i._zod.run({value:a,issues:[]},u);if(f instanceof Promise)throw new Qa;return f.issues.length?b1(n,f.issues,u):{success:!0,data:f.value}};function b1(n,i,a){let l;return{success:!1,get error(){return l||(l=new n(i.map(u=>Js(u,a,Br()))),i=void 0,a=void 0),l},set error(u){l=u,i=void 0,a=void 0}}}const Bp=n=>async(i,a,l)=>{const u=l?{...l,async:!0}:{async:!0};let f=i._zod.run({value:a,issues:[]},u);return f instanceof Promise&&(f=await f),f.issues.length?b1(n,f.issues,u):{success:!0,data:f.value}},AT=Symbol.for("zod.compile.invalid"),MT=Symbol.for("zod.compile.fallback"),jT=((n,i,a)=>{const l=n._zod.bag.validator;if(l!==void 0){if(l(i)!==AT)return!0;if(l.definite===!0&&a===void 0)return!1}return kT(n,i,a)});function kT(n,i,a){const l=a?{...a,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},u=n._zod.bag.fallbackRun;let f;if(u?(l[MT]=!0,f=u({value:i,issues:[]},l)):f=n._zod.run({value:i,issues:[]},l),f instanceof Promise)throw new Qa;return f.issues.length===0}const RT=async(n,i,a)=>{const l=a?{...a,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let u=n._zod.run({value:i,issues:[]},l);return u instanceof Promise&&(u=await u),u.issues.length===0},CT=n=>{const i=$p(n),a=(l,u,f,d)=>{const m=f?{...f,direction:"backward"}:{direction:"backward"};return i(l,u,m,Ff(a,d))};return a},DT=n=>{const i=$p(n),a=(l,u,f,d)=>i(l,u,f,Ff(a,d));return a},UT=n=>{const i=Lp(n),a=async(l,u,f,d)=>{const m=f?{...f,direction:"backward"}:{direction:"backward"};return await i(l,u,m,Ff(a,d))};return a},ZT=n=>{const i=Lp(n),a=async(l,u,f,d)=>await i(l,u,f,Ff(a,d));return a},$T=n=>(i,a,l)=>{const u=l?{...l,direction:"backward"}:{direction:"backward"};return Hp(n)(i,a,u)},LT=n=>(i,a,l)=>Hp(n)(i,a,l),HT=n=>async(i,a,l)=>{const u=l?{...l,direction:"backward"}:{direction:"backward"};return Bp(n)(i,a,u)},BT=n=>async(i,a,l)=>Bp(n)(i,a,l),qT=/^[cC][0-9a-z]{6,}$/,VT=/^[0-9a-z]+$/,IT=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,PT=/^[0-9a-vA-V]{20}$/,KT=/^[A-Za-z0-9]{27}$/,GT=/^[a-zA-Z0-9_-]{21}$/;function YT(n){return new RegExp(`^[a-zA-Z0-9_-]{${n}}$`)}const FT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,QT=/^([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})$/,mb=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,JT=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,XT="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function WT(){return new RegExp(XT,"u")}const eE=/^(?:(?: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])$/,tE=/^(([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}|:))$/,nE=/^((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])$/,iE=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rE=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sE=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,aE=/^https?$/,lE=/^\+[1-9]\d{6,14}$/,_1="(?:(?:\\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])))";function oE(n){return new RegExp(`^${n}$`)}const uE=oE(_1);function ep(n){const i="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${i}`:n.precision===0?`${i}:[0-5]\\d`:`${i}:[0-5]\\d\\.\\d{${n.precision}}`:n.seconds?`${i}:[0-5]\\d(?:\\.\\d+)?`:`${i}(?::[0-5]\\d(?:\\.\\d+)?)?`}function cE(n){return new RegExp(`^${ep(n)}$`)}function fE(n){const i=["Z"];n.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${ep({precision:n.precision,seconds:!0})}(?:${i.join("|")})`,l=n.local?`${a}|${ep({precision:n.precision})}`:a;return new RegExp(`^${_1}T(?:${l})$`)}const dE=/^[\s\S]{0,}$/,hE=/^-?\d+$/,qp=/^-?\d+(?:\.\d+)?$/,mE=/^(?:true|false)$/i,pE=/^[^A-Z]*$/,gE=/^[^a-z]*$/,yi=F("$ZodCheck",(n,i)=>{var a;n._zod??(n._zod={}),n._zod.def=i,(a=n._zod).onattach??(a.onattach=[])}),Vp=n=>{const i=n.value;return!Fz(i)&&i.length!==void 0},Rf={number:"number",bigint:"bigint",object:"date"},S1=F("$ZodCheckLessThan",(n,i)=>{yi.init(n,i);const a=Rf[typeof i.value];n._zod.check=l=>{(i.inclusive?l.value<=i.value:l.value{yi.init(n,i);const a=Rf[typeof i.value];n._zod.check=l=>{(i.inclusive?l.value>=i.value:l.value>i.value)||l.issues.push({origin:Rf[typeof l.value]??a,code:"too_small",minimum:typeof i.value=="object"?i.value.getTime():i.value,input:l.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),vE=F("$ZodCheckMultipleOf",(n,i)=>{yi.init(n,i),n._zod.check=a=>{if(typeof a.value!=typeof i.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?i.value!==BigInt(0)&&a.value%i.value===BigInt(0):Qz(a.value,i.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:i.value,input:a.value,inst:n,continue:!i.abort})}}),yE=F("$ZodCheckNumberFormat",(n,i)=>{yi.init(n,i),i.format=i.format||"float64";const a=i.format?.includes("int"),l=a?"int":"number",[u,f]=m1[i.format];n._zod.check=d=>{const m=d.value;if(a){if(!Number.isInteger(m)){d.issues.push({expected:l,format:i.format,code:"invalid_type",continue:!1,input:m,inst:n});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:l,inclusive:!0,continue:!i.abort}):d.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must b)DELIM" -R"DELIM(e within the safe integer range.",inst:n,origin:l,inclusive:!0,continue:!i.abort});return}}mf&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:f,inclusive:!0,inst:n,continue:!i.abort})}}),bE=F("$ZodCheckMaxLength",(n,i)=>{var a;yi.init(n,i),(a=n._zod.def).when??(a.when=Vp),n._zod.check=l=>{const u=l.value,f=u.length;if((typeof u=="string"&&f>i.maximum?Up(u):f)<=i.maximum)return;const m=Zp(u);l.issues.push({origin:m,code:"too_big",maximum:i.maximum,inclusive:!0,input:u,inst:n,continue:!i.abort})}}),_E=F("$ZodCheckMinLength",(n,i)=>{var a;yi.init(n,i),(a=n._zod.def).when??(a.when=Vp),n._zod.check=l=>{const u=l.value,f=u.length;if((typeof u=="string"&&f>=i.minimum&&f=i.minimum)return;const m=Zp(u);l.issues.push({origin:m,code:"too_small",minimum:i.minimum,inclusive:!0,input:u,inst:n,continue:!i.abort})}}),SE=F("$ZodCheckLengthEquals",(n,i)=>{var a;yi.init(n,i),(a=n._zod.def).when??(a.when=Vp),n._zod.check=l=>{const u=l.value,f=u.length,d=typeof u=="string"&&f>=i.length&&f<=i.length*2?Up(u):f;if(d===i.length)return;const m=Zp(u),p=d>i.length;l.issues.push({origin:m,...p?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:l.value,inst:n,continue:!i.abort})}}),Qf=F("$ZodCheckStringFormat",(n,i)=>{var a,l;yi.init(n,i),i.pattern?(a=n._zod).check??(a.check=u=>{i.pattern.lastIndex=0,!i.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:i.format,input:u.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})}):(l=n._zod).check??(l.check=()=>{})}),xE=F("$ZodCheckRegex",(n,i)=>{Qf.init(n,i),n._zod.check=a=>{i.pattern.lastIndex=0,!i.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),wE=F("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=pE),Qf.init(n,i)}),zE=F("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=gE),Qf.init(n,i)}),TE=F("$ZodCheckIncludes",(n,i)=>{yi.init(n,i);const a=io(i.includes),l=new RegExp(typeof i.position=="number"?`^.{${i.position},}${a}`:a);i.pattern=l,n._zod.check=u=>{u.value.includes(i.includes,i.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:u.value,inst:n,continue:!i.abort})}}),EE=F("$ZodCheckStartsWith",(n,i)=>{yi.init(n,i);const a=new RegExp(`^${io(i.prefix)}.*`);i.pattern??(i.pattern=a),n._zod.check=l=>{l.value.startsWith(i.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:l.value,inst:n,continue:!i.abort})}}),OE=F("$ZodCheckEndsWith",(n,i)=>{yi.init(n,i);const a=new RegExp(`.*${io(i.suffix)}$`);i.pattern??(i.pattern=a),n._zod.check=l=>{l.value.endsWith(i.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:l.value,inst:n,continue:!i.abort})}}),NE=F("$ZodCheckOverwrite",(n,i)=>{yi.init(n,i),n._zod.check=a=>{a.value=i.tx(a.value)}});class AE{constructor(i=[],a={}){this.content=[],this.indent=0,this.args=i,this.closed=a}indented(i){this.indent+=1;try{i(this)}finally{this.indent-=1}}write(i){if(typeof i=="function"){i(this,{execution:"sync"}),i(this,{execution:"async"});return}const l=i.split(` +`+s.stack}}var vn=Object.prototype.hasOwnProperty,Gn=n.unstable_scheduleCallback,ia=n.unstable_cancelCallback,il=n.unstable_shouldYield,ms=n.unstable_requestPaint,Yt=n.unstable_now,rl=n.unstable_getCurrentPriorityLevel,Yn=n.unstable_ImmediatePriority,sl=n.unstable_UserBlockingPriority,ra=n.unstable_NormalPriority,dd=n.unstable_LowPriority,Vu=n.unstable_IdlePriority,hd=n.log,md=n.unstable_setDisableYieldValue,sa=null,Ft=null;function Tt(e){if(typeof hd=="function"&&md(e),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(sa,e)}catch{}}var Nt=Math.clz32?Math.clz32:oi,ps=Math.log,gs=Math.LN2;function oi(e){return e>>>=0,e===0?32:31-(ps(e)/gs|0)|0}var ir=256,rr=262144,aa=4194304;function Sr(e){var t=e&42;if(t!==0)return t;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&-e;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 al(e,t,r){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var _=s&134217727;return _!==0?(s=_&~c,s!==0?o=Sr(s):(h&=_,h!==0?o=Sr(h):r||(r=_&~e,r!==0&&(o=Sr(r))))):(_=s&~c,_!==0?o=Sr(_):h!==0?o=Sr(h):r||(r=s&~e,r!==0&&(o=Sr(r)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,r=t&-t,c>=r||c===32&&(r&4194048)!==0)?t:o}function la(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xr(e,t){(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0r;r++)t.push(e);return t}function ui(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function un(e,t,r,s,o,c){var h=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 _=e.entanglements,N=e.expirationTimes,Z=e.hiddenUpdates;for(r=h&~r;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),No=!1;if(ar)try{var ga={};Object.defineProperty(ga,"passive",{get:function(){No=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{No=!1}var Er=null,wi=null,zi=null;function Or(){if(zi)return zi;var e,t=wi,r=t.length,s,o="value"in Er?Er.value:Er.textContent,c=o.length;for(e=0;e=P),ce=" ",de=!1;function ge(e,t){switch(e){case"keyup":return R.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function De(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ie=!1;function Je(e,t){switch(e){case"compositionend":return De(t);case"keypress":return t.which!==32?null:(de=!0,ce);case"textInput":return e=t.data,e===ce&&de?null:e;default:return null}}function qe(e,t){if(Ie)return e==="compositionend"||!H&&ge(e,t)?(e=Or(),zi=wi=Er=null,Ie=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Sg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xg(e,t){var r=Sg(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Sg(r)}}function wg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Sd(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Sd(e.document)}return t}function xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var kx=ar&&"documentMode"in document&&11>=document.documentMode,yl=null,wd=null,Do=null,zd=!1;function Tg(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;zd||yl==null||yl!==Sd(s)||(s=yl,"selectionStart"in s&&xd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Do&&Ss(Do,s)||(Do=s,s=tf(wd,"onSelect"),0>=h,o-=h,Ar=1<<32-Nt(t)+o|r<ke?(sn=Ee,Ee=null):sn=Ee.sibling;var Xe=C(U,Ee,$[ke],I);if(Xe===null){Ee===null&&(Ee=sn);break}e&&Ee&&Xe.alternate===null&&t(U,Ee),j=c(Xe,j,ke),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe,Ee=sn}if(ke===$.length)return r(U,Ee),Ve&&ts(U,ke),ve;if(Ee===null){for(;ke<$.length;ke++)Ee=K(U,$[ke],I),Ee!==null&&(j=c(Ee,j,ke),Fe===null?ve=Ee:Fe.sibling=Ee,Fe=Ee);return Ve&&ts(U,ke),ve}for(Ee=s(Ee);ke<$.length;ke++)sn=B(Ee,U,ke,$[ke],I),sn!==null&&(e&&(Xe=sn.alternate,Xe!==null&&Ee.delete(Xe.key===null?ke:Xe.key)),j=c(sn,j,ke),Fe===null?ve=sn:Fe.sibling=sn,Fe=sn);return e&&Ee.forEach(function(Ps){return t(U,Ps)}),Ve&&ts(U,ke),ve}function _e(U,j,$,I){if($==null)throw Error(l(151));for(var ve=null,Fe=null,Ee=j,ke=j=0,sn=null,Xe=$.next();Ee!==null&&!Xe.done;ke++,Xe=$.next()){Ee.index>ke?(sn=Ee,Ee=null):sn=Ee.sibling;var Ps=C(U,Ee,Xe.value,I);if(Ps===null){Ee===null&&(Ee=sn);break}e&&Ee&&Ps.alternate===null&&t(U,Ee),j=c(Ps,j,ke),Fe===null?ve=Ps:Fe.sibling=Ps,Fe=Ps,Ee=sn}if(Xe.done)return r(U,Ee),Ve&&ts(U,ke),ve;if(Ee===null){for(;!Xe.done;ke++,Xe=$.next())Xe=K(U,Xe.value,I),Xe!==null&&(j=c(Xe,j,ke),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe);return Ve&&ts(U,ke),ve}for(Ee=s(Ee);!Xe.done;ke++,Xe=$.next())Xe=B(Ee,U,ke,Xe.value,I),Xe!==null&&(e&&(sn=Xe.alternate,sn!==null&&Ee.delete(sn.key===null?ke:sn.key)),j=c(Xe,j,ke),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe);return e&&Ee.forEach(function(wz){return t(U,wz)}),Ve&&ts(U,ke),ve}function He(U,j,$,I){if(typeof $=="object"&&$!==null&&$.type===J&&$.key===null&&$.props.ref===void 0&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case ye:e:{for(var ve=$.key;j!==null;){if(j.key===ve){if(ve=$.type,ve===J){if(j.tag===7){r(U,j.sibling),I=o(j,$.props.children),Es(I,$),I.return=U,U=I;break e}}else if(j.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===Se&&Ca(ve)===j.type){r(U,j.sibling),I=o(j,$.props),Es(I,$),I.return=U,U=I;break e}r(U,j);break}else t(U,j);j=j.sibling}$.type===J?(I=Oa($.props.children,U.mode,I,$.key),Es(I,$),I.return=U,U=I):(I=ac($.type,$.key,$.props,null,U.mode,I),Es(I,$),I.return=U,U=I)}return h(U);case ue:e:{for(ve=$.key;j!==null;){if(j.key===ve)if(j.tag===4&&j.stateNode.containerInfo===$.containerInfo&&j.stateNode.implementation===$.implementation){r(U,j.sibling),I=o(j,$.children||[]),I.return=U,U=I;break e}else{r(U,j);break}else t(U,j);j=j.sibling}I=jd($,U.mode,I),I.return=U,U=I}return h(U);case Se:return $=Ca($),He(U,j,$,I)}if(Ae($))return oe(U,j,$,I);if(re($)){if(ve=re($),typeof ve!="function")throw Error(l(150));return $=ve.call($),_e(U,j,$,I)}if(typeof $.then=="function")return He(U,j,gc($),I);if($.$$typeof===fe)return He(U,j,dc(U,$),I);vc(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,j!==null&&j.tag===6?(r(U,j.sibling),I=o(j,$),I.return=U,U=I):(r(U,j),I=Md($,U.mode,I),I.return=U,U=I),h(U)):r(U,j)}return function(U,j,$,I){try{Bo=0;var ve=He(U,j,$,I);return Ol=null,ve}catch(Ee){if(Ee===El||Ee===mc)throw Ee;var Fe=fi(29,Ee,null,U.mode);return Fe.lanes=I,Fe.return=U,Fe}}}var Ua=Fg(!0),Qg=Fg(!1),Os=!1;function Bd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ns(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function As(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(it&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=sc(e),Rg(e,null,r),t}return rc(e,s,t,r),sc(e)}function qo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Jt(e,r)}}function Vd(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var o=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var h={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,r=r.next}while(r!==null);c===null?o=c=t:c=c.next=t}else o=c=t;r={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Id=!1;function Vo(){if(Id){var e=Tl;if(e!==null)throw e}}function Io(e,t,r,s){Id=!1;var o=e.updateQueue;Os=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,_=o.share)DELIM" +R"DELIM(d.pending;if(_!==null){o.shared.pending=null;var N=_,Z=N.next;N.next=null,h===null?c=Z:h.next=Z,h=N;var q=e.alternate;q!==null&&(q=q.updateQueue,_=q.lastBaseUpdate,_!==h&&(_===null?q.firstBaseUpdate=Z:_.next=Z,q.lastBaseUpdate=N))}if(c!==null){var K=o.baseState;h=0,q=Z=N=null,_=c;do{var C=_.lane&-536870913,B=C!==_.lane;if(B?(Ye&C)===C:(s&C)===C){C!==0&&C===ka&&(Id=!0),q!==null&&(q=q.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var oe=e,_e=_;C=t;var He=r;switch(_e.tag){case 1:if(oe=_e.payload,typeof oe=="function"){K=oe.call(He,K,C);break e}K=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=_e.payload,C=typeof oe=="function"?oe.call(He,K,C):oe,C==null)break e;K=ne({},K,C);break e;case 2:Os=!0}}C=_.callback,C!==null&&(e.flags|=64,B&&(e.flags|=8192),B=o.callbacks,B===null?o.callbacks=[C]:B.push(C))}else B={lane:C,tag:_.tag,payload:_.payload,callback:_.callback,next:null},q===null?(Z=q=B,N=K):q=q.next=B,h|=C;if(_=_.next,_===null){if(_=o.shared.pending,_===null)break;B=_,_=B.next,B.next=null,o.lastBaseUpdate=B,o.shared.pending=null}}while(!0);q===null&&(N=K),o.baseState=N,o.firstBaseUpdate=Z,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),Us|=h,e.lanes=h,e.memoizedState=K}}function Jg(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Xg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;ec?c:8;var h=pe.T,_={};_.types=h!==null?h.types:null,pe.T=_,ch(e,!1,t,r);try{var N=o(),Z=pe.S;if(Z!==null&&Z(_,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var q=Vx(N,s);Yo(e,t,q,ki(e))}else Yo(e,t,s,ki(e))}catch(K){Yo(e,t,{then:function(){},status:"rejected",reason:K},ki())}finally{Ne.p=c,h!==null&&_.types!==null&&(h.types=_.types),pe.T=h}}function Fx(){}function oh(e,t,r,s){if(e.tag!==5)throw Error(l(476));var o=Mv(e).queue;Av(e,o,t,Bt,r===null?Fx:function(){return jv(e),r(s)})}function Mv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Bt,baseState:Bt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:Bt},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function jv(e){var t=Mv(e);t.next===null&&(t=e.alternate.memoizedState),Yo(e,t.next.queue,{},ki())}function uh(){return An(Fl)}function kv(){return Xt().memoizedState}function Rv(){return Xt().memoizedState}function Qx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=ki();e=Ns(r);var s=As(t,e,r);s!==null&&(pi(s,t,r),qo(s,t,r)),t={cache:Zd()},e.payload=t;return}t=t.return}}function Jx(e,t,r){var s=ki();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Oc(e)?Dv(t,r):(r=Nd(e,t,r,s),r!==null&&(pi(r,e,s),Uv(r,t,s)))}function Cv(e,t,r){var s=ki();Yo(e,t,r,s)}function Yo(e,t,r,s){var o={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Oc(e))Dv(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,_=c(h,r);if(o.hasEagerState=!0,o.eagerState=_,ut(_,h))return rc(e,t,o,0),bt===null&&ic(),!1}catch{}if(r=Nd(e,t,o,s),r!==null)return pi(r,e,s),Uv(r,t,s),!0}return!1}function ch(e,t,r,s){if(s={lane:2,revertLane:em(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Oc(e)){if(t)throw Error(l(479))}else t=Nd(e,r,s,2),t!==null&&pi(t,e,2)}function Oc(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Dv(e,t){Nl=_c=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Uv(e,t,r){if((r&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Jt(e,r)}}var Nc={readContext:An,use:wc,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It,useEffectEvent:It},Zv={readContext:An,use:wc,useCallback:function(e,t){return ei().memoizedState=[e,t===void 0?null:t],e},useContext:An,useEffect:_v,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Tc(4194308,4,zv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Tc(4194308,4,e,t)},useInsertionEffect:function(e,t){Tc(4,2,e,t)},useMemo:function(e,t){var r=ei();t=t===void 0?null:t;var s=e();if(Za){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[s,t],s},useReducer:function(e,t,r){var s=ei();if(r!==void 0){var o=r(t);if(Za){Tt(!0);try{r(t)}finally{Tt(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Jx.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var t=ei();return e={current:e},t.memoizedState=e},useState:function(e){e=ih(e);var t=e.queue,r=Cv.)DELIM" +R"DELIM(bind(null,Le,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:ah,useDeferredValue:function(e,t){var r=ei();return lh(r,e,t)},useTransition:function(){var e=ih(!1);return e=Av.bind(null,Le,e.queue,!0,!1),ei().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var s=Le,o=ei();if(Ve){if(r===void 0)throw Error(l(407));r=r()}else{if(r=t(),bt===null)throw Error(l(349));(Ye&127)!==0||rv(s,t,r)}o.memoizedState=r;var c={value:r,getSnapshot:t};return o.queue=c,_v(av.bind(null,s,c,e),[e]),s.flags|=2048,Ml(9,{destroy:void 0},sv.bind(null,s,c,r,t),null),r},useId:function(){var e=ei(),t=bt.identifierPrefix;if(Ve){var r=Mr,s=Ar;r=(s&~(1<<32-Nt(s)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Sc++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}c[At]=t,c[yn]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(Rn(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ls(t)}}return zt(t),t.subtreeFlags&=-33554433,wh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ls(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=In.current,zl(t)){if(e=t.stateNode,r=t.memoizedProps,s=null,o=Sn,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[At]=t,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||a0(e.nodeValue,r)),e||zs(t,!0)}else e=lu(e).createTextNode(s),e[At]=t,t.stateNode=e}return zt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(s=zl(t),r!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[At]=t}else Na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),e=!1}else r=Cd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Ni(t),t):(Ni(t),null);if((t.flags&128)!==0)throw Error(l(558))}return zt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=zl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[At]=t}else Na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),o=!1}else o=Cd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Ni(t),t):(Ni(t),null)}return Ni(t),(t.flags&128)!==0?(t.lanes=r,t):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),Cc(t,t.updateQueue),zt(t),null);case 4:return Ce(),e===null&&rm(t.stateNode.containerInfo),t.flags|=67108864,zt(t),null;case 10:return is(t.type),zt(t),null;case 19:if(Yd(t),s=t.memoizedState,s===null)return zt(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)Qo(s,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=bc(e),c!==null){for(t.flags|=128,Qo(s,!1),e=c.updateQueue,t.updateQueue=e,Cc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Cg(r,e),r=r.sibling;return Po(t,jn.current&1|2),Ve&&ts(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Yt()>Kc&&(t.flags|=128,o=!0,Qo(s,!1),t.lanes=4194304)}else{if(!o)if(e=bc(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Cc(t,e),Qo(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!c.alternate&&!Ve)return zt(t),null}else 2*Yt()-s.renderingStartTime>Kc&&r!==536870912&&(t.flags|=128,o=!0,Qo(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}if(s.tail!==null){e=s.tail;e:{for(r=e;r!==null;){if(r.alternate!==null){r=!1;break e}r=r.sibling}r=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Yt(),e.sibling=null,c=jn.current,c=o?c&1|2:c&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!r||Ve?Po(t,c):(r=c,tt(Mn,t),tt(jn,r),Vn===null&&(Vn=t)),Ve&&ts(t,s.treeForkCount),e}return zt(t),null;case 22:case 23:return Ni(t),Kd(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(r&536870912)!==0&&(t.flags&128)===0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),r=t.updateQueue,r!==null&&Cc(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==r&&(t.flags|=2048),e!==null&&Ut(Ra),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),is(tn),zt(t),null;case 25:return null;case 30:return t.flags|=33554432,zt(t),null}throw Error(l(156,t.tag))}function rw(e,t){switch(kd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return is(tn),Ce(),e=t.flags,(e&65536)!==0&)DELIM" +R"DELIM(&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return nt(t),null;case 31:if(t.memoizedState!==null){if(Ni(t),t.alternate===null)throw Error(l(340));Na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ni(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yd(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ce(),null;case 10:return is(t.type),null;case 22:case 23:return Ni(t),Kd(),e!==null&&Ut(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return is(tn),null;case 25:return null;default:return null}}function oy(e,t){switch(kd(t),t.tag){case 3:is(tn),Ce();break;case 26:case 27:case 5:nt(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&Ni(t);break;case 13:Ni(t);break;case 19:Yd(t);break;case 10:is(t.type);break;case 22:case 23:Ni(t),Kd(),e!==null&&Ut(Ra);break;case 24:is(tn)}}function Jo(e,t){try{var r=t.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var o=s.next;r=o;do{if((r.tag&e)===e){s=void 0;var c=r.create,h=r.inst;s=c(),h.destroy=s}r=r.next}while(r!==o)}}catch(_){ft(t,t.return,_)}}function Rs(e,t,r){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var h=s.inst,_=h.destroy;if(_!==void 0){h.destroy=void 0,o=t;var N=r,Z=_;try{Z()}catch(q){ft(o,N,q)}}}s=s.next}while(s!==c)}}catch(q){ft(t,t.return,q)}}function uy(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Xg(t,r)}catch(s){ft(e,e.return,s)}}}function cy(e,t,r){r.props=$a(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){ft(e,t,s)}}function jr(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var o=e.stateNode,c=Xr(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=v0(c)),s=o.ref;break;case 7:if(e.stateNode===null){var h=new Ri(e);y(e.child,!1,Yw,h,void 0,void 0),e.stateNode=h}s=e.stateNode;break;default:s=e.stateNode}typeof r=="function"?e.refCleanup=r(s):r.current=s}}catch(_){ft(e,t,_)}}function kn(e,t){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(o){ft(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(o){ft(e,t,o)}else r.current=null}function Dc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var r=0;r title"))),Rn(s,t,r),s[At]=e,Wt(s),t=s;break e;case"link":if(c=C0("link","href",o).get(t+(r.href||""))){for(h=0;hHe&&(h=He,He=_e,_e=h);var U=xg(_,_e),j=xg(_,He);if(U&&j&&(B.rangeCount!==1||B.anchorNode!==U.node||B.anchorOffset!==U.offset||B.focusNode!==j.node||B.focusOffset!==j.offset)){var $=K.createRange();$.setStart(U.node,U.offset),B.removeAllRanges(),_e>He?(B.addRange($),B.extend(j.node,j.offset)):($.setEnd(j.node,j.offset),B.addRange($))}}}}for(K=[],B=_;B=B.parentNode;)B.nodeType===1&&K.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_r?32:r,pe.T=null,r=Ih,Ih=null;var c=pr,h=Zr;if(Lt=0,qa=pr=null,Zr=0,(it&6)!==0)throw Error(l(331));var _=it;if(it|=4,Ry(c.current),My(c,c.current,h,r),it=_,ru(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(sa,c)}catch{}return!0}finally{Ne.p=o,pe.T=s,Yy(e,t)}}function Fy(e,t,r){t=Ii(r,t),t=hh(e.stateNode,t,2),e=As(e,t,2),e!==null&&(ui(e,2),$r(e))}function ft(e,t,r){if(e.tag===3)Fy(e,e,r);else for(;t!==null;){if(t.tag===3){Fy(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Zs===null||!Zs.has(s))){e=Ii(r,e),r=Pv(2),s=As(t,r,2),s!==null&&(Kv(r,)DELIM" +R"DELIM(s,t,e),ui(s,2),$r(s));break}}t=t.return}}function Jh(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new ow;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(r)||(Bh=!0,o.add(r),e=gw.bind(null,e,t,r),t.then(e,e))}function gw(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,bt===e&&(Ye&r)===r&&((Pt===4||Pt===3&&(Ye&62914560)===Ye&&300>Yt()-Pc)&&(it&2)===0?Bl(e,0):Ic|=r,Ul===Ye&&(Ul=0)),$r(e)}function Qy(e,t){t===0&&(t=vs()),e=Ea(e,t),e!==null&&(ui(e,t),$r(e))}function vw(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Qy(e,r)}function yw(e,t){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),Qy(e,r)}function bw(e,t){return Gn(e,t)}var Vl=null,Il=null,Xh=!1,Wc=!1,Wh=!1,Ls=0;function $r(e){e!==Il&&e.next===null&&(Il===null?Vl=Il=e:Il=Il.next=e),Wc=!0,Xh||(Xh=!0,Sw())}function ru(e,t){if(!Wh&&Wc){Wh=!0;do for(var r=!1,s=Vl;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var h=s.suspendedLanes,_=s.pingedLanes;c=(1<<31-Nt(42|e)+1)-1,c&=o&~(h&~_),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(r=!0,e0(s,c))}else c=Ye,c=al(s,s===bt?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||la(s,c)||(r=!0,e0(s,c));s=s.next}while(r);Wh=!1}}function _w(){Jy()}function Jy(){Wc=Xh=!1;var e=0;Ls!==0&&kw()&&(e=Ls);for(var t=Yt(),r=null,s=Vl;s!==null;){var o=s.next,c=Xy(s,t);c===0?(s.next=null,r===null?Vl=o:r.next=o,o===null&&(Il=r)):(r=s,(e!==0||(c&3)!==0)&&(Wc=!0)),s=o}Lt!==0&&Lt!==5||ru(e),Ls!==0&&(Ls=0)}function Xy(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0_)break;var q=N.transferSize,K=N.initiatorType;q&&l0(K)&&(N=N.responseEnd,h+=q*(N<_?1:(_-Z)/(N-Z)))}if(--s,t+=8*(c+h)/(o.duration/1e3),e++,10sf){_e.length=oe;break}$=new Promise($w.bind($)),_e.push($)}}}if(0<_e.length)return C=Promise.race([Promise.all(_e),new Promise(function(ve){return setTimeout(ve,500)})]).then(o,o),(B?Promise.allSettled([B.finished,C]):C).then(c,c);if(o(),B)return B.finished.then(c,c);c()},types:r});Z.__reactViewTransition=q;var K=[];return q.ready.then(function(){for(var C=Z.documentElement.getAnimations({subtree:!0}),B=0;B"u"?null:document;function M0(e,t,r){var s=Kl;if(s&&typeof t=="string"&&t){var o=Qn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof r=="string"&&(o+='[crossorigin="'+r+'"]'),A0.has(o)||(A0.add(o),e={rel:e,crossOrigin:r,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Rn(t,"link",e),Wt(t),s.head.appendChild(t)))}}function iz(e){us.D(e),M0("dns-prefetch",e,null)}function rz(e,t){us.C(e,t),M0("preconnect",e,t)}function sz(e,t,r){us.L(e,t,r);var s=Kl;if(s&&e&&t){var o='link[rel="preload"][as="'+Qn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(o+='[imagesrcset="'+Qn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(o+='[imagesizes="'+Qn(r.imageSizes)+'"]')):o+='[href="'+Qn(e)+'"]';var c=o;switch(t){case"style":c=Gl(e);break;case"script":c=Yl(e)}if(!(Qi.has(c)||(e=ne({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),Qi.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(uu(c))||t==="script"&&s.querySelector(cu(c))))){var h=s.createElement("link");Rn(h,"link",e),t==="style"&&(h[cn]=!0,h.onload=h.onerror=function(){Iu(h)}),Wt(h),s.head.appendChild(h)}}}function az(e,t){us.m(e,t);var r=Kl;if(r&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Qn(s)+'"][href="'+Qn(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Yl(e)}if(!Qi.has(c)&&(e=ne({rel:"modulepreload",href:e},t),Qi.set(c,e),r.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(cu(c)))return}s=r.createElement("link"),Rn(s,"link",e),Wt(s),r.head.appendChild(s)}}}function lz(e,t,r){us.S(e,t,r);var s=Kl;if(s&&e){var o=bs(s).hoistableStyles,c=Gl(e);t=t||"default";var h=o.get(c);if(!h){var _={loading:0,preload:null};if(h=s.querySelector(uu(c)))_.loading=5;else{e=ne({rel:"stylesheet",href:e,"data-precedence":t},r),(r=Qi.get(c))&&_m(e,r);var N=h=s.createElement("link");Wt(N),Rn(N,"link",e),N._p=new Promise(function(Z,q){N.onload=Z,N.onerror=q}),N.addEventListener("load",function(){_.loading|=1}),N.addEventListener("error",function(){_.loading|=2}),_.loading|=4,nf(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:_},o.set(c,h)}}}function oz(e,t){us.X(e,t);var r=Kl;if(r&&e){var s=bs(r).hoistableScripts,o=Yl(e),c=s.get(o);c||(c=r.querySelector(cu(o)),c||(e=ne({src:e,async:!0},t),(t=Qi.get(o))&&Sm(e,t),c=r.createElement("script"),Wt(c),Rn(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function uz(e,t){us.M(e,t);var r=Kl;if(r&&e){var s=bs(r).hoistableScripts,o=Yl(e),c=s.get(o);c||(c=r.querySelector(cu(o)),c||(e=ne({src:e,async:!0,type:"module"},t),(t=Qi.get(o))&&Sm(e,t),c=r.createElement("script"),Wt(c),Rn(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function j0(e,t,r,s){var o=(o=In.current)?ou(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(r=Gl(r.href),t=bs(o).hoistableStyles,s=t.get(r),s||(s={type:"style",instance:null,count:0,state:null},t.set(r,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Gl(r.href);var c=bs(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(uu(e)))?c._p||(h.instance=c,h.state.loading=5):(c=Qi.get(e),c||(c={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Qi.set(e,c)),cz(o,e,c,h.state))),t&&s===null)throw Error(l(528,""));return h}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(r=Yl(r),t=bs(o).hoistableScripts,s=t.get(r),s||(s={type:"script",instance:null,count:0,state:null},t.set(r,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Gl(e){return'href="'+Qn(e)+'"'}function uu(e){return'link[rel="stylesheet"]['+e+"]"}function k0(e){return ne({},e,{"data-precedence":e.precedence,precedence:null})}function cz(e,t,r,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[cn]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[cn]=!0,t.onload=t.onerror=Iu.bind(null,t),Rn(t,"link",r),Wt(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Yl(e){return'[src="'+Qn(e)+'"]'}function cu(e){return"script[async]"+e}function R0(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Qn(r.href)+'"]');if(s)return t.instance=s,Wt(s),s;var o=ne({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Wt(s),Rn(s,"style",o),nf(s,r.precedence,e),t.instance=s;case"stylesheet":o=Gl(r.href);var c=e.querySelector(uu(o));if(c)return t.state.loading|=4,t.instance=c,Wt(c),c;s=k0(r),(o=Qi.get(o))&&_m(s,o),c=(e.ownerDocument||e).createElement("link"),Wt(c);var h=c;return h._p=new Promise(function(_,N){h.onload=_,h.onerror=N}),Rn(c,"link",s),t.state.loading|=4,nf(c,r.precedence,e),t.instance=c;case"script":return c=Yl(r.src),(o=e.querySelector(cu(c)))?(t.instance=o,Wt(o),o):(s=r,(o=Qi.get(c))&&(s=ne({},r),Sm(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),Wt(o),Rn(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,nf(s,r.precedence,e));return t.instance}function nf(e,t,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,h=0;h title"):null)}function fz(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function D0(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function U0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Z0(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function $0(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Z0(t),e.suspenseyImages.push(t)),e=mz.bind(e),t.decode().then(e,e))}function dz(e,t,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var o=Gl(s.href),c=t.querySelector(uu(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=fu.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=c,Wt(c);return}c=t.ownerDocument||t,s=k0(s),(o=Qi.get(o))&&_m(s,o),c=c.createElement("link"),Wt(c);var h=c;h._p=new Promise(function(_,N){h.onload=_,h.onerror=N}),Rn(c,"link",s),r.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=fu.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var sf=0;function hz(e,t){return e.stylesheets&&e.count===0&&lf(e,e.stylesheets),0sf?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function L0(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lf(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fu(){this.count--,L0(this)}function mz(){this.imgCount--,L0(this)}var af=null;function lf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,af=new Map,t.forEach(pz,e),af=null,fu.call(e))}function pz(e,t){if(!(t.state.loading&4)){var r=af.get(e);if(r)var s=r.get(null);else{r=new Map,af.set(e,r);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),jm.exports=kz(),jm.exports}var Cz=Rz();const Dz=r1(Cz),Uz=[{id:"current",label:"Classic"},{id:"light",label:"Light"},{id:"midnight",label:"Midnight"}],Mp="libbitcoinTheme",Rf="libbitcoin-theme-change";function jp(n){return n==="light"||n==="midnight"?n:"current"}function s1(){try{return jp(localStorage.getItem(Mp))}catch{return"current"}}function kp(n){document.documentElement.dataset.theme=n;const i=getComputedStyle(document.documentElement).getPropertyValue("--theme-background").trim();i&&document.querySelector('meta[name="theme-color"]')?.setAttribute("content",i)}function Zz(){kp(s1()),globalThis.addEventListener("storage",Hz)}function $z(n){const i=jp(n);kp(i);try{localStorage.setItem(Mp,i)}catch{}globalThis.dispatchEvent(new Event(Rf))}function Lz(){return jp(document.documentElement.dataset.theme)}function Hz(n){n.key!==null&&n.key!==Mp||(kp(s1()),globalThis.dispatchEvent(new Event(Rf)))}function Bz(n){return globalThis.addEventListener(Rf,n),()=>{globalThis.removeEventListener(Rf,n)}}function Rp(){return se.useSyncExternalStore(Bz,Lz,()=>"current")}function qz(){const n=Rp();return x.jsx("select",{"aria-label":"Theme",value:n,onChange:i=>{$z(i.target.value)},className:"border-accent/40 bg-surface text-textPrimary focus:border-accent focus:ring-)DELIM" +R"DELIM(accent rounded-md border py-1.5 pr-8 pl-3 text-sm",children:Uz.map(i=>x.jsx("option",{value:i.id,children:i.label},i.id))})}const a1="libbitcoinAdminDashboardBrowserNotifications";function l1(){try{return globalThis.window?.localStorage??null}catch{return null}}function Cp(){const n=globalThis.Notification;return typeof n=="function"?n:null}function o1(){return Cp()?.permission??"unsupported"}async function Vz(){const n=Cp();return n?n.permission!=="default"?n.permission:n.requestPermission():"unsupported"}function Iz(n=l1()){try{return o1()==="granted"&&n?.getItem(a1)==="true"}catch{return!1}}function Pz(n,i=l1()){try{i?.setItem(a1,String(n))}catch{}}function Kz(n,i){const a=Cp();if(!a||a.permission!=="granted")return!1;try{return new a(n,i),!0}catch{return!1}}function Gz({browserNotificationsEnabled:n,onClose:i,onBrowserNotificationsEnabledChange:a}){const[l,u]=se.useState(o1),[f,d]=se.useState(!1),[m,p]=se.useState(null),g=n&&l==="granted";async function b(){if(g){a(!1);return}d(!0),p(null);try{const y=await Vz();u(y),y==="granted"?a(!0):y==="denied"&&p("Permission was denied. It can be changed in your browser settings.")}catch{p("The browser could not enable notifications.")}finally{d(!1)}}return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:y=>{y.target===y.currentTarget&&i()},children:x.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"settings-title",className:"border-accent/30 bg-surface/95 max-h-[calc(100vh-2rem)] w-full max-w-xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/50",children:[x.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[x.jsx("h2",{id:"settings-title",className:"text-accent text-xl font-semibold",children:"Settings"}),x.jsx("button",{type:"button",onClick:i,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close settings",children:"×"})]}),x.jsxs("div",{className:"space-y-5 p-5",children:[x.jsx(qz,{}),x.jsxs("div",{className:"border-accentSecondary/20 bg-accent/5 space-y-3 rounded-xl border p-4",children:[x.jsxs("div",{children:[x.jsx("h3",{className:"text-textPrimary text-sm font-medium",children:"Browser notifications"}),x.jsx("p",{id:"browser-notifications-help",className:"text-textMuted mt-1 text-xs",children:Fz(l,g,f)})]}),x.jsx("button",{type:"button","aria-describedby":"browser-notifications-help",disabled:f||l==="unsupported"||l==="denied",onClick:()=>{b()},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",children:Yz(l,g,f)}),m&&x.jsx("p",{className:"text-sm text-red-300",role:"alert",children:m})]}),x.jsx("div",{className:"flex justify-end pt-2",children:x.jsx("button",{type:"button",onClick:i,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-4 py-2 text-sm",children:"Done"})})]})]})})}function Yz(n,i,a){return a?"Requesting permission…":n==="unsupported"?"Notifications unavailable":n==="denied"?"Blocked by browser":i?"Disable notifications":"Enable notifications"}function Fz(n,i,a){return a?"Waiting for your browser permission choice.":n==="unsupported"?"This browser does not support system notifications.":n==="denied"?"Notifications are blocked. Allow them in your browser settings to enable this feature.":i?"System notifications will appear when the node enters or leaves the near-current range.":"Get a system notification when the node enters or leaves the near-current range."}function Xm(n){const i=Object.values(n).filter(l=>typeof l=="number");return Object.entries(n).filter(([l,u])=>i.indexOf(+l)===-1).map(([l,u])=>u)}function ub(n,i="|"){return n.map(a=>m1(a)).join(i)}function Wm(n,i){return typeof i=="bigint"?i.toString():i}class Qz{constructor(i){this._getter=i,this._value=void 0}get value(){const i=this._getter;return i!==void 0&&(this._value=i(),this._getter=void 0),this._value}}function Dp(n){return new Qz(n)}function Jz(n){return n==null}function Up(n){const i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;return n.slice(i,a)}function Xz(n,i){const a=n/i,l=Math.round(a),u=4*Number.EPSILON*Math.max(Math.abs(a),1);return Math.abs(a-l){const m=i._zod.def.shape[f];return l?l(m,f):m}):f1(n,f,l?l(d.value,f):d.value))}}function Wz(n,i){for(const a of Reflect.ownKeys(i)){const l=Object.getOwnPropertyDescriptor(i,a);l.enumerable&&(l.get?c1(n,a,()=>i[a]):f1(n,a,l.value))}}function Di(...n){const i={};for(const a of n){const l=Object.getOwnPropertyDescriptors(a);Object.assign(i,l)}return Object.defineProperties({},i)}function eT(n){return JSON.stringify(n)}function tT(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const d1="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Cf(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const nT=Dp(()=>{if(er.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function io(n){if(Cf(n)===!1)return!1;const i=n.constructor;if(i===void 0||typeof i!="function")return!0;const a=i.prototype;return!(Cf(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function h1(n){return io(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const iT=new Set(["string","number","symbol"]);function ro(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function na(n,i,a){const l=new n._zod.constr(i??n._zod.def);return(!i||a?.parent)&&(l._zod.parent=n),l}function Te(n){const i=n;if(!i)return{};if(typeof i=="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");i.error=i.message}return delete i.message,typeof i.error=="string"?{...i,error:()=>i.error}:i}function m1(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function rT(n){return Object.keys(n).filter(i=>n[i]._zod.optin!==void 0&&n[i]._zod.optout==="optional")}const p1={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]},sT={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function aT(n,i){const a=n._zod.def,l=a.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const f={};return Wa(f,n,Qf(n,i)),na(n,Di(a,{shape:f,checks:[]}))}function Qf(n,i){const a=hs(n),l=[];for(const u of Reflect.ownKeys(i)){if(!Object.getOwnPropertyDescriptor(a,u)?.enumerable)throw new Error(`Unrecognized key: "${String(u)}"`);i[u]&&l.push(u)}return l}function lT(n,i){const a=n._zod.def,l=a.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const f=new Set(Qf(n,i)),d={};return Wa(d,n,Reflect.ownKeys(hs(n)).filter(m=>!f.has(m))),na(n,Di(a,{shape:d,checks:[]}))}function oT(n,i){if(!io(i))throw new Error("Invalid input to extend: expected a plain object");const a=n._zod.def.checks;if(a&&a.length>0){const u=hs(n);for(const f of Reflect.ownKeys(i))if(Obje)DELIM" +R"DELIM(ct.getOwnPropertyDescriptor(u,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return na(n,Di(n._zod.def,{shape:g1(n,i)}))}function g1(n,i){const a={};return Wa(a,n,Reflect.ownKeys(hs(n))),Wz(a,i),a}function uT(n,i){if(!io(i))throw new Error("Invalid input to safeExtend: expected a plain object");return na(n,Di(n._zod.def,{shape:g1(n,i)}))}function cT(n,i){if(!i?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const a={};Wa(a,n,Reflect.ownKeys(hs(n))),Wa(a,i,Reflect.ownKeys(hs(i)));const l=Di(n._zod.def,{shape:a,get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return na(n,l)}function cb(n,i,a,l="partial"){const f=i._zod.def.checks;if(f&&f.length>0)throw new Error(`.${l}() cannot be used on object schemas containing refinements`);const m=a?new Set(Qf(i,a)):void 0,p={};return Wa(p,i,Reflect.ownKeys(hs(i)),n&&((g,b)=>m&&!m.has(b)?g:new n({type:"optional",innerType:g}))),na(i,Di(i._zod.def,{shape:p,checks:[]}))}function fT(n,i,a){const l=a?new Set(Qf(i,a)):void 0,u={};return Wa(u,i,Reflect.ownKeys(hs(i)),(f,d)=>l&&!l.has(d)?f:new n({type:"nonoptional",innerType:f})),na(i,Di(i._zod.def,{shape:u}))}function _r(n,i=0){if(n.aborted===!0)return!0;for(let a=i;a{var l;return(l=a).path??(l.path=[]),a.path.unshift(n),a})}function vu(n){return typeof n=="string"?n:n?.message}function fb(n){const i=[];for(const a of n??[]){const l=a._zod.def;if(!/_(length|size)$|_equals$/.test(l.check))break;const u=l.maximum??l.length??l.size;u>=0&&i.push([u,a])}return i}function ep(n,i,a){var l;for(let u=i;un;return i[_T]=!0,i}var db;const Um={value:void 0,enumerable:!1};let hb="captureStackTrace"in Error?Error:null;function xT(n){const i=hb;if(i){const a=i.stackTraceLimit;if(typeof a=="number"){try{i.stackTraceLimit=0}catch{return hb=null,new n}try{return new n}finally{i.stackTraceLimit=a}}}return new n}function Y(n,i,a,l){const u={};function f(w){this.def=w,this.constr=y,this.traits=new Set}f.prototype=u;const d=a,m=d&&new WeakSet;function p(w,O){if(w._zod){if(w._zod.traits.has(n))return}else{Um.value=new f(O);try{Object.defineProperty(w,"_zod",Um)}finally{Um.value=void 0}}if(w._zod.traits.add(n),i(w,O),m){const A=Object.getPrototypeOf(w),k=w._zod.constr.prototype;let L=A;for(;L&&L!==k;)L=Object.getPrototypeOf(L);const D=L??A;m.has(D)||(m.add(D),pT(D,d))}const T=y.prototype;for(const A in T)Object.prototype.hasOwnProperty.call(T,A)&&(A in w||(w[A]=T[A].bind(w)))}const g=l?.Parent??Object;class b extends g{}Object.defineProperty(b,"name",{value:n});function y(w){const O=l?.Parent?xT(b):this;p(O,w);const T=O._zod.deferred;if(T){for(const k of T)k();O._zod.deferred=void 0}const A=globalThis.__zod_globalConfig?.postProcessor;return A&&A(O),O}return Object.defineProperty(y,"init",{value:p}),Object.defineProperty(y,Symbol.hasInstance,{value:w=>l?.Parent&&w instanceof l.Parent?!0:w?._zod?.traits?.has(n)}),Object.defineProperty(y,"name",{value:n}),y}class Ja extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class b1 extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`),this.name="ZodEncodeError"}}(db=globalThis).__zod_globalConfig??(db.__zod_globalConfig={});const er=globalThis.__zod_globalConfig;function Br(n){return n&&Object.assign(er,n),er}function wT(){const n=this._zod;return n.message??(n.message=JSON.stringify(n.def,Wm,2)),n.message}function zT(n){this._zod.message=n}const TT={get:wT,set:zT,enumerable:!0,configurable:!0},Zm={value:void 0,enumerable:!1},mb=new WeakSet([Object.prototype,Error.prototype]),ET=(n,i)=>{n.name="$ZodError",Zm.value=i,Object.defineProperty(n,"issues",Zm),Zm.value=void 0,Object.defineProperty(n,"message",TT);const a=Object.getPrototypeOf(n);mb.has(a)||(mb.add(a),Object.defineProperty(a,"toString",{configurable:!0,enumerable:!1,get(){const l=()=>this.message;return Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0})}}))},OT=Y("$ZodError",ET);function NT(n,i,a){return Object.prototype.hasOwnProperty.call(n,i)||(i==="__proto__"?Object.defineProperty(n,i,{value:a(),writable:!0,enumerable:!0,configurable:!0}):n[i]=a()),n[i]}function AT(n,i=a=>a.message){const a={},l=[];for(const u of n.issues)u.path.length>0?NT(a,u.path[0],()=>[]).push(i(u)):l.push(i(u));return{formErrors:l,fieldErrors:a}}function MT(n,i=a=>a.message){const a={_errors:[]},l=(u,f=[])=>{for(const d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(m=>l({issues:m},[...f,...d.path]));else if(d.code==="invalid_key")l({issues:d.issu)DELIM" +R"DELIM(es},[...f,...d.path]);else if(d.code==="invalid_element")l({issues:d.issues},[...f,...d.path]);else{const m=[...f,...d.path];if(m.length===0)a._errors.push(i(d));else{let p=a,g=0;for(;g{const i=(a,l,u,f)=>{const d=u?{...u,async:!1}:{async:!1},m=a._zod.run({value:l,issues:[]},d);if(m instanceof Promise)throw new Ja;if(m.issues.length){const p=new(f?.Err??n)(m.issues.map(g=>Js(g,d,Br())));throw d1(p,f?.callee??i),p}return m.value};return i},Hp=n=>{const i=async(a,l,u,f)=>{const d=u?{...u,async:!0}:{async:!0};let m=a._zod.run({value:l,issues:[]},d);if(m instanceof Promise&&(m=await m),m.issues.length){const p=new(f?.Err??n)(m.issues.map(g=>Js(g,d,Br())));throw d1(p,f?.callee??i),p}return m.value};return i},Bp=n=>(i,a,l)=>{const u=l?{...l,async:!1}:{async:!1},f=i._zod.run({value:a,issues:[]},u);if(f instanceof Promise)throw new Ja;return f.issues.length?_1(n,f.issues,u):{success:!0,data:f.value}};function _1(n,i,a){let l;return{success:!1,get error(){return l||(l=new n(i.map(u=>Js(u,a,Br()))),i=void 0,a=void 0),l},set error(u){l=u,i=void 0,a=void 0}}}const qp=n=>async(i,a,l)=>{const u=l?{...l,async:!0}:{async:!0};let f=i._zod.run({value:a,issues:[]},u);return f instanceof Promise&&(f=await f),f.issues.length?_1(n,f.issues,u):{success:!0,data:f.value}},jT=Symbol.for("zod.compile.invalid"),kT=Symbol.for("zod.compile.fallback"),RT=((n,i,a)=>{const l=n._zod.bag.validator;if(l!==void 0){if(l(i)!==jT)return!0;if(l.definite===!0&&a===void 0)return!1}return CT(n,i,a)});function CT(n,i,a){const l=a?{...a,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},u=n._zod.bag.fallbackRun;let f;if(u?(l[kT]=!0,f=u({value:i,issues:[]},l)):f=n._zod.run({value:i,issues:[]},l),f instanceof Promise)throw new Ja;return f.issues.length===0}const DT=async(n,i,a)=>{const l=a?{...a,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let u=n._zod.run({value:i,issues:[]},l);return u instanceof Promise&&(u=await u),u.issues.length===0},UT=n=>{const i=Lp(n),a=(l,u,f,d)=>{const m=f?{...f,direction:"backward"}:{direction:"backward"};return i(l,u,m,Jf(a,d))};return a},ZT=n=>{const i=Lp(n),a=(l,u,f,d)=>i(l,u,f,Jf(a,d));return a},$T=n=>{const i=Hp(n),a=async(l,u,f,d)=>{const m=f?{...f,direction:"backward"}:{direction:"backward"};return await i(l,u,m,Jf(a,d))};return a},LT=n=>{const i=Hp(n),a=async(l,u,f,d)=>await i(l,u,f,Jf(a,d));return a},HT=n=>(i,a,l)=>{const u=l?{...l,direction:"backward"}:{direction:"backward"};return Bp(n)(i,a,u)},BT=n=>(i,a,l)=>Bp(n)(i,a,l),qT=n=>async(i,a,l)=>{const u=l?{...l,direction:"backward"}:{direction:"backward"};return qp(n)(i,a,u)},VT=n=>async(i,a,l)=>qp(n)(i,a,l),IT=/^[cC][0-9a-z]{6,}$/,PT=/^[0-9a-z]+$/,KT=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,GT=/^[0-9a-vA-V]{20}$/,YT=/^[A-Za-z0-9]{27}$/,FT=/^[a-zA-Z0-9_-]{21}$/;function QT(n){return new RegExp(`^[a-zA-Z0-9_-]{${n}}$`)}const JT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XT=/^([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})$/,pb=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,WT=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eE="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function tE(){return new RegExp(eE,"u")}const nE=/^(?:(?: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])$/,iE=/^(([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}|:))$/,rE=/^((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])$/,sE=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,aE=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lE=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,oE=/^https?$/,uE=/^\+[1-9]\d{6,14}$/,S1="(?:(?:\\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])))";function cE(n){return new RegExp(`^${n}$`)}const fE=cE(S1);function tp(n){const i="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${i}`:n.precision===0?`${i}:[0-5]\\d`:`${i}:[0-5]\\d\\.\\d{${n.precision}}`:n.seconds?`${i}:[0-5]\\d(?:\\.\\d+)?`:`${i}(?::[0-5]\\d(?:\\.\\d+)?)?`}function dE(n){return new RegExp(`^${tp(n)}$`)}function hE(n){const i=["Z"];n.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${tp({precision:n.precision,seconds:!0})}(?:${i.join("|")})`,l=n.local?`${a}|${tp({precision:n.precision})}`:a;return new RegExp(`^${S1}T(?:${l})$`)}const mE=/^[\s\S]{0,}$/,pE=/^-?\d+$/,Vp=/^-?\d+(?:\.\d+)?$/,gE=/^(?:true|false)$/i,vE=/^[^A-Z]*$/,yE=/^[^a-z]*$/,yi=Y("$ZodCheck",(n,i)=>{var a;n._zod??(n._zod={}),n._zod.def=i,(a=n._zod).onattach??(a.onattach=[])}),Ip=n=>{const i=n.value;return!Jz(i)&&i.length!==void 0},Df={number:"number",bigint:"bigint",object:"date"},x1=Y("$ZodCheckLessThan",(n,i)=>{yi.init(n,i);const a=Df[typeof i.value];n._zod.check=l=>{(i.inclusive?l.value<=i.value:l.value{yi.init(n,i);const a=Df[typeof i.value];n._zod.check=l=>{(i.inclusive?l.value>=i.value:l.value>i.value)||l.issues.push({origin:Df[typeof l.value]??a,code:"too_small",minimum:typeof i.value=="object"?i.value.getTime():i.value,input:l.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),bE=Y("$ZodCheckMultipleOf",(n,i)=>{yi.init(n,i),n._zod.check=a=>{if(typeof a.value!=typeof i.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?i.value!==BigInt(0)&&a.value%i.value===BigInt(0):Xz(a.value,i.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:i.value,input:a.value,inst:n,continue:!i.abort})}}),_E=Y("$ZodCheckNumberFormat",(n,i)=>{yi.init(n,i),i.format=i.format||"float64";const a=i.format?.includes("int"),l=a?"int":"number",[u,f]=p1[i.format];n._zod.check=d=>{const m=d.value;if(a){if(!Number.isInteger(m)){d.issues.push({expected:l,format:i.format,code:"invalid_type",continue:!1,input:m,inst:n});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:l,inclusive:!0,continue:!i.abort}):d.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst)DELIM" +R"DELIM(:n,origin:l,inclusive:!0,continue:!i.abort});return}}mf&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:f,inclusive:!0,inst:n,continue:!i.abort})}}),SE=Y("$ZodCheckMaxLength",(n,i)=>{var a;yi.init(n,i),(a=n._zod.def).when??(a.when=Ip),n._zod.check=l=>{const u=l.value,f=u.length;if((typeof u=="string"&&f>i.maximum?Zp(u):f)<=i.maximum)return;const m=$p(u);l.issues.push({origin:m,code:"too_big",maximum:i.maximum,inclusive:!0,input:u,inst:n,continue:!i.abort})}}),xE=Y("$ZodCheckMinLength",(n,i)=>{var a;yi.init(n,i),(a=n._zod.def).when??(a.when=Ip),n._zod.check=l=>{const u=l.value,f=u.length;if((typeof u=="string"&&f>=i.minimum&&f=i.minimum)return;const m=$p(u);l.issues.push({origin:m,code:"too_small",minimum:i.minimum,inclusive:!0,input:u,inst:n,continue:!i.abort})}}),wE=Y("$ZodCheckLengthEquals",(n,i)=>{var a;yi.init(n,i),(a=n._zod.def).when??(a.when=Ip),n._zod.check=l=>{const u=l.value,f=u.length,d=typeof u=="string"&&f>=i.length&&f<=i.length*2?Zp(u):f;if(d===i.length)return;const m=$p(u),p=d>i.length;l.issues.push({origin:m,...p?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:l.value,inst:n,continue:!i.abort})}}),Xf=Y("$ZodCheckStringFormat",(n,i)=>{var a,l;yi.init(n,i),i.pattern?(a=n._zod).check??(a.check=u=>{i.pattern.lastIndex=0,!i.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:i.format,input:u.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})}):(l=n._zod).check??(l.check=()=>{})}),zE=Y("$ZodCheckRegex",(n,i)=>{Xf.init(n,i),n._zod.check=a=>{i.pattern.lastIndex=0,!i.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),TE=Y("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=vE),Xf.init(n,i)}),EE=Y("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=yE),Xf.init(n,i)}),OE=Y("$ZodCheckIncludes",(n,i)=>{yi.init(n,i);const a=ro(i.includes),l=new RegExp(typeof i.position=="number"?`^.{${i.position},}${a}`:a);i.pattern=l,n._zod.check=u=>{u.value.includes(i.includes,i.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:u.value,inst:n,continue:!i.abort})}}),NE=Y("$ZodCheckStartsWith",(n,i)=>{yi.init(n,i);const a=new RegExp(`^${ro(i.prefix)}.*`);i.pattern??(i.pattern=a),n._zod.check=l=>{l.value.startsWith(i.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:l.value,inst:n,continue:!i.abort})}}),AE=Y("$ZodCheckEndsWith",(n,i)=>{yi.init(n,i);const a=new RegExp(`.*${ro(i.suffix)}$`);i.pattern??(i.pattern=a),n._zod.check=l=>{l.value.endsWith(i.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:l.value,inst:n,continue:!i.abort})}}),ME=Y("$ZodCheckOverwrite",(n,i)=>{yi.init(n,i),n._zod.check=a=>{a.value=i.tx(a.value)}});class jE{constructor(i=[],a={}){this.content=[],this.indent=0,this.args=i,this.closed=a}indented(i){this.indent+=1;try{i(this)}finally{this.indent-=1}}write(i){if(typeof i=="function"){i(this,{execution:"sync"}),i(this,{execution:"async"});return}const l=i.split(` `).filter(d=>d),u=Math.min(...l.map(d=>d.length-d.trimStart().length)),f=l.map(d=>d.slice(u)).map(d=>" ".repeat(this.indent*2)+d);for(const d of f)this.content.push(d)}compile(){const i=Function,a=this?.content??[""];return new i(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { ${a.join(` `)} -};`)(...Object.values(this.closed))}}const ME={major:4,minor:6,patch:7},Ot=F("$ZodType",(n,i)=>{var a;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=ME;const l=n._zod.def.checks,u=n._zod.traits.has("$ZodCheck")?[n,...l??[]]:l?.length?[...l]:[];for(const f of u)for(const d of f._zod.onattach)d(n);if(u.length===0)(a=n._zod).deferred??(a.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const f=(m,p,g)=>{if(m.memo)return m;let b=_r(m),y;for(const w of p){if(w._zod.def.when){if(cT(m)||!w._zod.def.when(m))continue}else if(b)continue;const O=m.issues.length,T=w._zod.check(m);if(T instanceof Promise&&g?.async===!1)throw new Qa;if(y||T instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await T,m.issues.length!==O&&(Wm(m.issues,O,n),b||(b=_r(m,O)))});else{if(m.issues.length===O)continue;Wm(m.issues,O,n),b||(b=_r(m,O))}}return y?y.then(()=>m):m},d=(m,p,g)=>{if(_r(m))return m.aborted=!0,m;const b=f(p,u,g);if(b instanceof Promise){if(g.async===!1)throw new Qa;return b.then(y=>n._zod.parse(y,g))}return n._zod.parse(b,g)};n._zod.run=(m,p)=>{if(p.skipChecks)return n._zod.parse(m,p);if(p.direction==="backward"){const b=n._zod.parse({value:m.value,issues:[]},{...p,skipChecks:!0});return b instanceof Promise?b.then(y=>d(y,m,p)):d(b,m,p)}const g=n._zod.parse(m,p);if(g instanceof Promise){if(p.async===!1)throw new Qa;return g.then(b=>f(b,u,p))}return f(g,u,p)}}},{get"~standard"(){return g1(this,"~standard",z1(this))},set"~standard"(n){Xs(this,"~standard",n)}}),w1=(n,i)=>n.issues.length?{issues:n.issues.map(a=>Js(a,i,Br()))}:{value:n.value};async function jE(n,i){const a={async:!0};return w1(await n._zod.run({value:i,issues:[]},a),a)}function z1(n){return{validate:i=>{const a={async:!1};try{const l=n._zod.run({value:i,issues:[]},a);if(!(l instanceof Promise))return w1(l,a)}catch{}return jE(n,i)},vendor:"zod",version:1}}const Ip=F("$ZodString",(n,i)=>{Ot.init(n,i),n._zod.pattern=i.pattern??dE,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:n}),a}}),Ct=F("$ZodStringFormat",(n,i)=>{Qf.init(n,i),Ip.init(n,i)}),kE=F("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=QT),Ct.init(n,i)}),RE=F("$ZodUUID",(n,i)=>{if(i.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(l===void 0)throw new Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=mb(l))}else i.pattern??(i.pattern=mb());Ct.init(n,i)}),CE=F("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=JT),Ct.init(n,i)}),T1=1,Cf=2;function E1(n){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(n):(new URL(n),!0)}catch{return!1}}function DE(n,i){return!("normalize"in i)&&!("hostname"in i)&&!("protocol"in i)?E1(n)||Cf:UE(n,i)}function UE(n,i){if(!i.normalize&&i.protocol?.source===aE.source&&!/^https?:\/\//i.test(n))return T1;try{if(typeof URL<"u"){const a=URL;if(typeof a.parse=="function")return a.parse(n)??Cf}return new URL(n)}catch{return Cf}}const ZE=/[\t\n\r]/g;function pb(n){return n.replace(ZE,"")}function $E(n,i){return i.lastIndex=0,i.test(n.hostname)}function LE(n,i){return i.lastIndex=0,i.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)}const HE=F("$ZodURL",(n,i)=>{Ct.init(n,i),n._zod.check=a=>{try{const l=a.value.trim(),u=DE(l,i);if(u===T1){a.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:a.value,inst:n,continue:!i.abort});return}if(u===Cf){a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:n,continue:!i.abort});return}if(u===!0){a.value=pb(l);return}i.hostname&&!$E(u,i.hostname)&&a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:a.value,inst:n,continue:!i.abort}),i.protocol&&!LE(u,i.protocol)&&a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:a.value,inst:n,continue:!i.abort}),a.value=i.normalize?u.href:pb(l);return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:n,continue:!i.abort})}}}),BE=F("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=WT()),Ct.init(n,i)}),qE=F("$ZodNanoID",(n,i)=>{if(i.length!==void 0&&(!Number.isInteger(i.length)||i.length<1))throw new Error(`Invalid nanoid l)DELIM" -R"DELIM(ength: ${i.length}`);i.pattern??(i.pattern=i.length===void 0?GT:YT(i.length)),Ct.init(n,i)}),VE=F("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=qT),Ct.init(n,i)}),IE=F("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=VT),Ct.init(n,i)}),PE=F("$ZodULID",(n,i)=>{i.pattern??(i.pattern=IT),Ct.init(n,i)}),KE=F("$ZodXID",(n,i)=>{i.pattern??(i.pattern=PT),Ct.init(n,i)}),GE=F("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=KT),Ct.init(n,i)}),YE=F("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=fE(i)),Ct.init(n,i)}),FE=F("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=uE),Ct.init(n,i)}),QE=F("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=cE(i)),Ct.init(n,i)}),JE=F("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=FT),Ct.init(n,i)}),XE=F("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=eE),Ct.init(n,i)}),WE=/^[0-9a-fA-F:.]+$/;function O1(n){return WE.test(n)?E1(`http://[${n}]`):!1}const eO=F("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=tE),Ct.init(n,i),n._zod.check=a=>{O1(a.value)||a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:n,continue:!i.abort})}}),tO=F("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=nE),Ct.init(n,i)});function nO(n){const i=n.split("/");if(i.length!==2)return!1;const[a,l]=i;if(!l)return!1;const u=Number(l);return`${u}`!==l||u<0||u>128?!1:O1(a)}const iO=F("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=iE),Ct.init(n,i),n._zod.check=a=>{nO(a.value)||a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:n,continue:!i.abort})}});function N1(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const A1=/^[0-9a-zA-Z+/]*={0,2}$/,rO=F("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=A1),Ct.init(n,i),n._zod.check=a=>{N1(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:n,continue:!i.abort})}}),Pp=/^[A-Za-z0-9_-]*$/;function sO(n){if(!Pp.test(n))return!1;const i=n.replace(/[-_]/g,l=>l==="-"?"+":"/"),a=i.padEnd(Math.ceil(i.length/4)*4,"=");return N1(a)}const aO=F("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=Pp),Ct.init(n,i),n._zod.check=a=>{sO(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:n,continue:!i.abort})}}),lO=F("$ZodE164",(n,i)=>{i.pattern??(i.pattern=lE),Ct.init(n,i)});function oO(n,i=null){try{const a=n.split(".");if(a.length!==3)return!1;const[l]=a;if(!l)return!1;const u=JSON.parse(atob(l));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||i&&(!("alg"in u)||u.alg!==i))}catch{return!1}}const uO=F("$ZodJWT",(n,i)=>{Ct.init(n,i),n._zod.check=a=>{oO(a.value,i.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:n,continue:!i.abort})}}),M1=F("$ZodNumber",(n,i)=>{Ot.init(n,i),n._zod.pattern=qp,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=Number(a.value)}catch{}const u=a.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return a;const f=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:String(u):void 0;return a.issues.push({expected:"number",code:"invalid_type",input:u,inst:n,...f?{received:f}:{}}),a}}),cO=F("$ZodNumberFormat",(n,i)=>{yE.init(n,i),M1.init(n,i)}),fO=F("$ZodBoolean",(n,i)=>{Ot.init(n,i),n._zod.pattern=mE,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=!!a.value}catch{}const u=a.value;return typeof u=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:n}),a}}),dO=F("$ZodUnknown",(n,i)=>{Ot.init(n,i),n._zod.parse=a=>a}),hO=F("$ZodNever",(n,i)=>{Ot.init(n,i),n._zod.parse=(a,l)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:n}),a)});function mO(n,i){const a=cb(n._zod.def.checks);if(!a.length)return;const l=Math.min(...a.map(f=>f[0])),u=n._zod.parse;n._zod.parse=(f,d)=>{const m=i(f.value);if(m>l&&!d?.skipChecks&&d?.direction!=="backward"){for(const[p,g]of cb(n._zod.def.checks))if(m>p&&g._zod.def.when(f)){const b=f.issues.length;return g._zod.check(f),f.issues[b].continue=!1,Wm(f.issues,b,n),f}}return u(f,d)}}const pO=n=>Array.isArray(n)?n.length:-1;function gb(n,i,a){n.issues.length&&i.issues.push(...Qs(a,n.issues)),i.value[a]=n.value}const gO=F("$ZodArray",(n,i)=>{Ot.init(n,i);const a=er.memoizer;a?.attach(n),n._zod.parse=(l,u)=>{const f=l.value;if(!Array.isArray(f))return l.issues.push({expected:"array",code:"invalid_type",input:f,inst:n}),l;l.value=a?a.alloc(n,l,Array(f.length),u):Array(f.length);const d=[],m=u?.abortEarly;for(let p=0;pgb(y,l,p)));else if(gb(b,l,p),m&&b.issues.length!==0&&_r(b))break}return d.length?Promise.all(d).then(()=>l):l},mO(n,pO)});function Df(n,i,a,l,u,f){const d=a in l,m=f==="optional";if(!(!d&&m&&u==="optional")){if(n.issues.length){if(u!==void 0&&m&&!d)return;i.issues.push(...Qs(a,n.issues))}if(!d&&u===void 0){n.issues.length||i.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[a]});return}n.value===void 0?(d||u==="defaulted"&&!m)&&(i.value[a]=void 0):i.value[a]=n.value}}const vO=[];function j1(n){const i=Object.keys(n.shape),a=Object.getOwnPropertySymbols(n.shape),l=a.length?a:vO,u=l.length?[...i,...l]:i;for(const d of u)if(!n.shape?.[d]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(d)}": expected a Zod schema`);const f=nT(n.shape);return{...n,allKeys:u,symbolKeys:l,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(f)}}function k1(n,i,a,l,u,f,d){const m=[],p=u.keySet,g=u.catchall._zod,b=g.def.type,y=g.optin,w=g.optout;let O=0;for(const T in i){if(d&&a.issues.length!==O){if(_r(a,O))break;O=a.issues.length}if(p.has(T))continue;if(T==="__proto__"){b==="never"&&m.push(T);continue}if(b==="never"){m.push(T);continue}const A=g.run({value:i[T],issues:[]},l);A instanceof Promise?n.push(A.then(k=>Df(k,a,T,i,y,w))):Df(A,a,T,i,y,w)}return m.length&&a.issues.push({code:"unrecognized_keys",keys:m,input:i,inst:f,continue:!0}),n.length?Promise.all(n).then(()=>a):a}const yO=F("$ZodObject",(n,i)=>{Ot.init(n,i);const a=Object.getOwnPropertyDescriptor(i,"shape"),l=a?.get?a.get.raw:i.shape??{};if(l){const g=()=>{const b={...l};return Object.defineProperty(i,"shape",{value:b}),g.raw=b,b};g.raw=l,Object.defineProperty(i,"shape",{get:g})}const u=Cp(()=>j1(i));ot(n,"propValues",g=>{const b=g.def.shape,y={};for(const w in b){const O=b[w]._zod;if(O.values){Object.prototype.hasOwnProperty.call(y,w)||ta(y,w,new Set);for(const T of O.values)y[w].add(T);O.optin!==void 0&&y[w].add(void 0)}}return y});const f=kf,d=i.catchall;let m;const p=er.memoizer;p?.attach(n),n._zod.parse=(g,b)=>{m??(m=u.value);const y=g.value;if(!f(y))return g.issues.push({expected:"object",code:"invalid_type",input:y,inst:n}),g;g.value=p?p.alloc(n,g,{},b):{};const w=[],O=m.shape,T=b?.abortEarly;let A=g.issues.length;for(const k of m.allKeys){if(T&&g.issues.length!==A){if(_r(g,A))break;A=g.issues.length}if(k==="__proto__")continue;const L=O[k],D=L._zod.optin,W=L._zod.optout,K=L._zod.run({value:y[k],issues:[]},b);K instanceof Promise?w.push(K.then(Y=>Df(Y,g,k,y,D,W))):Df(K,g,k,y,D,W)}return d?k1(w,y,g,b,u.value,n,T===!0):w.length?Promise.all(w).then(()=>g):g}}),bO=F("$ZodObjectJIT",(n,i)=>{yO.init(n,i);const a=n._zod.parse,l=Cp(()=>j1(i)),u=er.memoizer,f=O=>{const T=l.value,A=T.symbolKeys,k=new AE(["payload","ctx"],{shape:O,inst:n,memo:u,syms:A}),L=Y=>`shape[${Y}]._zod.run({ value: input[${Y}], issues: [] }, ctx)`,D=(Y,G)=>` - let ${Y}_ab = false; - for (let i = 0; i < ${Y}.issues.length; i++) { - const iss = ${Y}.issues[i]; - iss.path = iss.path ? [${G}, ...iss.path] : [${G}]; +};`)(...Object.values(this.closed))}}const kE={major:4,minor:6,patch:7},Ot=Y("$ZodType",(n,i)=>{var a;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=kE;const l=n._zod.def.checks,u=n._zod.traits.has("$ZodCheck")?[n,...l??[]]:l?.length?[...l]:[];for(const f of u)for(const d of f._zod.onattach)d(n);if(u.length===0)(a=n._zod).deferred??(a.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const f=(m,p,g)=>{if(m.memo)return m;let b=_r(m),y;for(const w of p){if(w._zod.def.when){if(dT(m)||!w._zod.def.when(m))continue}else if(b)continue;const O=m.issues.length,T=w._zod.check(m);if(T instanceof Promise&&g?.async===!1)throw new Ja;if(y||T instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await T,m.issues.length!==O&&(ep(m.issues,O,n),b||(b=_r(m,O)))});else{if(m.issues.length===O)continue;ep(m.issues,O,n),b||(b=_r(m,O))}}return y?y.then(()=>m):m},d=(m,p,g)=>{if(_r(m))return m.aborted=!0,m;const b=f(p,u,g);if(b instanceof Promise){if(g.async===!1)throw new Ja;return b.then(y=>n._zod.parse(y,g))}return n._zod.parse(b,g)};n._zod.run=(m,p)=>{if(p.skipChecks)return n._zod.parse(m,p);if(p.direction==="backward"){const b=n._zod.parse({value:m.value,issues:[]},{...p,skipChecks:!0});return b instanceof Promise?b.then(y=>d(y,m,p)):d(b,m,p)}const g=n._zod.parse(m,p);if(g instanceof Promise){if(p.async===!1)throw new Ja;return g.then(b=>f(b,u,p))}return f(g,u,p)}}},{get"~standard"(){return v1(this,"~standard",T1(this))},set"~standard"(n){Xs(this,"~standard",n)}}),z1=(n,i)=>n.issues.length?{issues:n.issues.map(a=>Js(a,i,Br()))}:{value:n.value};async function RE(n,i){const a={async:!0};return z1(await n._zod.run({value:i,issues:[]},a),a)}function T1(n){return{validate:i=>{const a={async:!1};try{const l=n._zod.run({value:i,issues:[]},a);if(!(l instanceof Promise))return z1(l,a)}catch{}return RE(n,i)},vendor:"zod",version:1}}const Pp=Y("$ZodString",(n,i)=>{Ot.init(n,i),n._zod.pattern=i.pattern??mE,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:n}),a}}),Ct=Y("$ZodStringFormat",(n,i)=>{Xf.init(n,i),Pp.init(n,i)}),CE=Y("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=XT),Ct.init(n,i)}),DE=Y("$ZodUUID",(n,i)=>{if(i.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(l===void 0)throw new Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=pb(l))}else i.pattern??(i.pattern=pb());Ct.init(n,i)}),UE=Y("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=WT),Ct.init(n,i)}),E1=1,Uf=2;function O1(n){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(n):(new URL(n),!0)}catch{return!1}}function ZE(n,i){return!("normalize"in i)&&!("hostname"in i)&&!("protocol"in i)?O1(n)||Uf:$E(n,i)}function $E(n,i){if(!i.normalize&&i.protocol?.source===oE.source&&!/^https?:\/\//i.test(n))return E1;try{if(typeof URL<"u"){const a=URL;if(typeof a.parse=="function")return a.parse(n)??Uf}return new URL(n)}catch{return Uf}}const LE=/[\t\n\r]/g;function gb(n){return n.replace(LE,"")}function HE(n,i){return i.lastIndex=0,i.test(n.hostname)}function BE(n,i){return i.lastIndex=0,i.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)}const qE=Y("$ZodURL",(n,i)=>{Ct.init(n,i),n._zod.check=a=>{try{const l=a.value.trim(),u=ZE(l,i);if(u===E1){a.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:a.value,inst:n,continue:!i.abort});return}if(u===Uf){a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:n,continue:!i.abort});return}if(u===!0){a.value=gb(l);return}i.hostname&&!HE(u,i.hostname)&&a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:a.value,inst:n,continue:!i.abort}),i.protocol&&!BE(u,i.protocol)&&a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:a.value,inst:n,continue:!i.abort}),a.value=i.normalize?u.href:gb(l);return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:n,continue:!i.abort})}}}),VE=Y("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=tE()),Ct.init(n,i)}),IE=Y("$ZodNanoID",(n,i)=>{if(i.length!==void 0&&(!Number.isInteger(i.length)||i.length<1))throw new Error(`Invalid nanoid length: ${i.length}`);i.pattern??(i.pat)DELIM" +R"DELIM(tern=i.length===void 0?FT:QT(i.length)),Ct.init(n,i)}),PE=Y("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=IT),Ct.init(n,i)}),KE=Y("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=PT),Ct.init(n,i)}),GE=Y("$ZodULID",(n,i)=>{i.pattern??(i.pattern=KT),Ct.init(n,i)}),YE=Y("$ZodXID",(n,i)=>{i.pattern??(i.pattern=GT),Ct.init(n,i)}),FE=Y("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=YT),Ct.init(n,i)}),QE=Y("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=hE(i)),Ct.init(n,i)}),JE=Y("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=fE),Ct.init(n,i)}),XE=Y("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=dE(i)),Ct.init(n,i)}),WE=Y("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=JT),Ct.init(n,i)}),eO=Y("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=nE),Ct.init(n,i)}),tO=/^[0-9a-fA-F:.]+$/;function N1(n){return tO.test(n)?O1(`http://[${n}]`):!1}const nO=Y("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=iE),Ct.init(n,i),n._zod.check=a=>{N1(a.value)||a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:n,continue:!i.abort})}}),iO=Y("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=rE),Ct.init(n,i)});function rO(n){const i=n.split("/");if(i.length!==2)return!1;const[a,l]=i;if(!l)return!1;const u=Number(l);return`${u}`!==l||u<0||u>128?!1:N1(a)}const sO=Y("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=sE),Ct.init(n,i),n._zod.check=a=>{rO(a.value)||a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:n,continue:!i.abort})}});function A1(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const M1=/^[0-9a-zA-Z+/]*={0,2}$/,aO=Y("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=M1),Ct.init(n,i),n._zod.check=a=>{A1(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:n,continue:!i.abort})}}),Kp=/^[A-Za-z0-9_-]*$/;function lO(n){if(!Kp.test(n))return!1;const i=n.replace(/[-_]/g,l=>l==="-"?"+":"/"),a=i.padEnd(Math.ceil(i.length/4)*4,"=");return A1(a)}const oO=Y("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=Kp),Ct.init(n,i),n._zod.check=a=>{lO(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:n,continue:!i.abort})}}),uO=Y("$ZodE164",(n,i)=>{i.pattern??(i.pattern=uE),Ct.init(n,i)});function cO(n,i=null){try{const a=n.split(".");if(a.length!==3)return!1;const[l]=a;if(!l)return!1;const u=JSON.parse(atob(l));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||i&&(!("alg"in u)||u.alg!==i))}catch{return!1}}const fO=Y("$ZodJWT",(n,i)=>{Ct.init(n,i),n._zod.check=a=>{cO(a.value,i.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:n,continue:!i.abort})}}),j1=Y("$ZodNumber",(n,i)=>{Ot.init(n,i),n._zod.pattern=Vp,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=Number(a.value)}catch{}const u=a.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return a;const f=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:String(u):void 0;return a.issues.push({expected:"number",code:"invalid_type",input:u,inst:n,...f?{received:f}:{}}),a}}),dO=Y("$ZodNumberFormat",(n,i)=>{_E.init(n,i),j1.init(n,i)}),hO=Y("$ZodBoolean",(n,i)=>{Ot.init(n,i),n._zod.pattern=gE,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=!!a.value}catch{}const u=a.value;return typeof u=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:n}),a}}),mO=Y("$ZodUnknown",(n,i)=>{Ot.init(n,i),n._zod.parse=a=>a}),pO=Y("$ZodNever",(n,i)=>{Ot.init(n,i),n._zod.parse=(a,l)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:n}),a)});function gO(n,i){const a=fb(n._zod.def.checks);if(!a.length)return;const l=Math.min(...a.map(f=>f[0])),u=n._zod.parse;n._zod.parse=(f,d)=>{const m=i(f.value);if(m>l&&!d?.skipChecks&&d?.direction!=="backward"){for(const[p,g]of fb(n._zod.def.checks))if(m>p&&g._zod.def.when(f)){const b=f.issues.length;return g._zod.check(f),f.issues[b].continue=!1,ep(f.issues,b,n),f}}return u(f,d)}}const vO=n=>Array.isArray(n)?n.length:-1;function vb(n,i,a){n.issues.length&&i.issues.push(...Qs(a,n.issues)),i.value[a]=n.value}const yO=Y("$ZodArray",(n,i)=>{Ot.init(n,i);const a=er.memoizer;a?.attach(n),n._zod.parse=(l,u)=>{const f=l.value;if(!Array.isArray(f))return l.issues.push({expected:"array",code:"invalid_type",input:f,inst:n}),l;l.value=a?a.alloc(n,l,Array(f.length),u):Array(f.length);const d=[],m=u?.abortEarly;for(let p=0;pvb(y,l,p)));else if(vb(b,l,p),m&&b.issues.length!==0&&_r(b))break}return d.length?Promise.all(d).then(()=>l):l},gO(n,vO)});function Zf(n,i,a,l,u,f){const d=a in l,m=f==="optional";if(!(!d&&m&&u==="optional")){if(n.issues.length){if(u!==void 0&&m&&!d)return;i.issues.push(...Qs(a,n.issues))}if(!d&&u===void 0){n.issues.length||i.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[a]});return}n.value===void 0?(d||u==="defaulted"&&!m)&&(i.value[a]=void 0):i.value[a]=n.value}}const bO=[];function k1(n){const i=Object.keys(n.shape),a=Object.getOwnPropertySymbols(n.shape),l=a.length?a:bO,u=l.length?[...i,...l]:i;for(const d of u)if(!n.shape?.[d]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(d)}": expected a Zod schema`);const f=rT(n.shape);return{...n,allKeys:u,symbolKeys:l,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(f)}}function R1(n,i,a,l,u,f,d){const m=[],p=u.keySet,g=u.catchall._zod,b=g.def.type,y=g.optin,w=g.optout;let O=0;for(const T in i){if(d&&a.issues.length!==O){if(_r(a,O))break;O=a.issues.length}if(p.has(T))continue;if(T==="__proto__"){b==="never"&&m.push(T);continue}if(b==="never"){m.push(T);continue}const A=g.run({value:i[T],issues:[]},l);A instanceof Promise?n.push(A.then(k=>Zf(k,a,T,i,y,w))):Zf(A,a,T,i,y,w)}return m.length&&a.issues.push({code:"unrecognized_keys",keys:m,input:i,inst:f,continue:!0}),n.length?Promise.all(n).then(()=>a):a}const _O=Y("$ZodObject",(n,i)=>{Ot.init(n,i);const a=Object.getOwnPropertyDescriptor(i,"shape"),l=a?.get?a.get.raw:i.shape??{};if(l){const g=()=>{const b={...l};return Object.defineProperty(i,"shape",{value:b}),g.raw=b,b};g.raw=l,Object.defineProperty(i,"shape",{get:g})}const u=Dp(()=>k1(i));ot(n,"propValues",g=>{const b=g.def.shape,y={};for(const w in b){const O=b[w]._zod;if(O.values){Object.prototype.hasOwnProperty.call(y,w)||ta(y,w,new Set);for(const T of O.values)y[w].add(T);O.optin!==void 0&&y[w].add(void 0)}}return y});const f=Cf,d=i.catchall;let m;const p=er.memoizer;p?.attach(n),n._zod.parse=(g,b)=>{m??(m=u.value);const y=g.value;if(!f(y))return g.issues.push({expected:"object",code:"invalid_type",input:y,inst:n}),g;g.value=p?p.alloc(n,g,{},b):{};const w=[],O=m.shape,T=b?.abortEarly;let A=g.issues.length;for(const k of m.allKeys){if(T&&g.issues.length!==A){if(_r(g,A))break;A=g.issues.length}if(k==="__proto__")continue;const L=O[k],D=L._zod.optin,X=L._zod.optout,G=L._zod.run({value:y[k],issues:[]},b);G instanceof Promise?w.push(G.then(ee=>Zf(ee,g,k,y,D,X))):Zf(G,g,k,y,D,X)}return d?R1(w,y,g,b,u.value,n,T===!0):w.length?Promise.all(w).then(()=>g):g}}),SO=Y("$ZodObjectJIT",(n,i)=>{_O.init(n,i);const a=n._zod.parse,l=Dp(()=>k1(i)),u=er.memoizer,f=O=>{const T=l.value,A=T.symbolKeys,k=new jE(["payload","ctx"],{shape:O,inst:n,memo:u,syms:A}),L=ee=>`shape[${ee}]._zod.run({ value: input[${ee}], issues: [] }, ctx)`,D=(ee,V)=>` + let ${ee}_ab = false; + for (let i = 0; i < ${ee}.issues.length; i++) { + const iss = ${ee}.issues[i]; + iss.path = iss.path ? [${V}, ...iss.path] : [${V}]; payload.issues.push(iss); - if (iss.continue !== true) ${Y}_ab = true; + if (iss.continue !== true) ${ee}_ab = true; } - if (${Y}_ab && ctx && ctx.abortEarly) { + if (${ee}_ab && ctx && ctx.abortEarly) { payload.value = newResult; return payload; - }`;k.write("const input = payload.value;");const W=Object.create(null);let K=0;for(const Y of T.allKeys)W[Y]=`key_${K++}`;k.write(u?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const Y of T.allKeys){if(Y==="__prot)DELIM" -R"DELIM(o__")continue;const G=W[Y],ne=typeof Y=="symbol"?`syms[${A.indexOf(Y)}]`:Xz(Y),ae=`${ne} in input`,ye=O[Y],ue=ye?._zod?.optin,X=ue!==void 0,we=ye?._zod?.optout==="optional";if(k.write(`const ${G} = ${L(ne)};`),X&&we){const he=ue==="optional"?`${G}_present`:`${G}.value !== undefined || ${G}_present`;k.write(` - const ${G}_present = ${ae}; - if (!${G}.issues.length || ${G}_present) { - if (${G}.issues.length) {${D(G,ne)} + }`;k.write("const input = payload.value;");const X=Object.create(null);let G=0;for(const ee of T.allKeys)X[ee]=`key_${G++}`;k.write(u?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const ee of T.allKeys){if(ee==="__proto__")continue;const V=X)DELIM" +R"DELIM([ee],ne=typeof ee=="symbol"?`syms[${A.indexOf(ee)}]`:eT(ee),ae=`${ne} in input`,ye=O[ee],ue=ye?._zod?.optin,J=ue!==void 0,we=ye?._zod?.optout==="optional";if(k.write(`const ${V} = ${L(ne)};`),J&&we){const he=ue==="optional"?`${V}_present`:`${V}.value !== undefined || ${V}_present`;k.write(` + const ${V}_present = ${ae}; + if (!${V}.issues.length || ${V}_present) { + if (${V}.issues.length) {${D(V,ne)} } if (${he}) { - newResult[${ne}] = ${G}.value; + newResult[${ne}] = ${V}.value; } } - `)}else X?(k.write(` - if (${G}.issues.length) {${D(G,ne)} + `)}else J?(k.write(` + if (${V}.issues.length) {${D(V,ne)} } - `),ue==="defaulted"?k.write(`newResult[${ne}] = ${G}.value;`):k.write(` - if (${G}.value !== undefined || ${ae}) { - newResult[${ne}] = ${G}.value; + `),ue==="defaulted"?k.write(`newResult[${ne}] = ${V}.value;`):k.write(` + if (${V}.value !== undefined || ${ae}) { + newResult[${ne}] = ${V}.value; } `)):k.write(` - const ${G}_present = ${ae}; - if (${G}.issues.length) {${D(G,ne)} + const ${V}_present = ${ae}; + if (${V}.issues.length) {${D(V,ne)} } - if (!${G}_present && !${G}.issues.length) { + if (!${V}_present && !${V}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", @@ -265,60 +265,60 @@ R"DELIM(o__")continue;const G=W[Y],ne=typeof Y=="symbol"?`syms[${A.indexOf(Y)}]` } } - if (${G}_present) { - newResult[${ne}] = ${G}.value; + if (${V}_present) { + newResult[${ne}] = ${V}.value; } - `)}return k.write("payload.value = newResult;"),k.write("return payload;"),k.compile()};let d;const m=kf,p=!er.jitless,b=p&&eT.value,y=i.catchall;let w;n._zod.parse=(O,T)=>{w??(w=l.value);const A=O.value;return m(A)?p&&b&&T?.async===!1&&T.jitless!==!0?(d||(d=f(i.shape)),O=d(O,T),y?k1([],A,O,T,w,n,T?.abortEarly===!0):O):a(O,T):(O.issues.push({expected:"object",code:"invalid_type",input:A,inst:n}),O)}});function vb(n,i,a,l){for(const f of n)if(f.issues.length===0)return i.value=f.value,i;const u=n.filter(f=>!_r(f));return u.length===1?(i.value=u[0].value,u[0]):(i.issues.push({code:"invalid_union",input:i.value,inst:a,errors:n.map(f=>f.issues.map(d=>Js(d,l,Br())))}),i)}const _O=F("$ZodUnion",(n,i)=>{Ot.init(n,i),ot(n,"optin",l=>l.def.options.some(u=>u._zod.optin==="defaulted")?"defaulted":l.def.options.some(u=>u._zod.optin!==void 0)?"optional":void 0),ot(n,"optout",l=>l.def.options.some(u=>u._zod.optout==="optional")?"optional":void 0),ot(n,"values",l=>{if(l.def.options.every(u=>u._zod.values))return new Set(l.def.options.flatMap(u=>Array.from(u._zod.values)))}),ot(n,"pattern",l=>{if(l.def.options.every(u=>u._zod.pattern)){const u=l.def.options.map(f=>f._zod.pattern);return new RegExp(`^(${u.map(f=>Dp(f.source)).join("|")})$`)}});const a=i.options.length===1?i.options[0]._zod.run:null;n._zod.parse=(l,u)=>{if(a)return a(l,u);let f=!1;const d=[];for(const m of i.options){const p=m._zod.run({value:l.value,issues:[]},u);if(p instanceof Promise)d.push(p),f=!0;else{if(p.issues.length===0)return p;d.push(p)}}return f?Promise.all(d).then(m=>vb(m,l,n,u)):vb(d,l,n,u)}}),SO=F("$ZodIntersection",(n,i)=>{Ot.init(n,i),n._zod.parse=(a,l)=>{const u=a.value,f=i.left._zod.run({value:u,issues:[]},l),d=i.right._zod.run({value:u,issues:[]},l);return f instanceof Promise||d instanceof Promise?Promise.all([f,d]).then(([p,g])=>yb(a,p,g)):yb(a,f,d)}});function tp(n,i){if(n===i)return{valid:!0,data:n};if(n instanceof Date&&i instanceof Date&&+n==+i)return{valid:!0,data:n};if(no(n)&&no(i)){const a=Object.keys(i),l=Object.keys(n).filter(f=>a.indexOf(f)!==-1),u={...n,...i};Object.prototype.hasOwnProperty.call(u,"__proto__")&&delete u.__proto__;for(const f of l){if(f==="__proto__")continue;const d=tp(n[f],i[f]);if(!d.valid)return{valid:!1,mergeErrorPath:[f,...d.mergeErrorPath]};u[f]=d.data}return{valid:!0,data:u}}if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let l=0;l{let y;if(g.code==="unrecognized_keys"&&!g.path?.length)u??(u=g),y=g.keys;else if(g.code==="invalid_key"&&g.origin==="record"&&g.path?.length===1){const w=String(g.path[0]);f.has(w)||f.set(w,g),y=[w]}else return!1;for(const w of y)l.has(w)||l.set(w,{}),l.get(w)[b]=!0;return!0};for(const g of i.issues)d(g,"l")||n.issues.push(g);for(const g of a.issues)d(g,"r")||n.issues.push(g);const m=[...l].filter(([,g])=>g.l&&g.r).map(([g])=>g);if(m.length){const g=u?m.filter(b=>u.keys.includes(b)):[];g.length&&n.issues.push({...u,keys:g});for(const b of m)!g.includes(b)&&f.has(b)&&n.issues.push(f.get(b))}const p=tp(i.value,a.value);if(!p.valid){if(_r(n))return n;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(p.mergeErrorPath)}`)}return n.value=p.data,n}const xO=F("$ZodTuple",(n,i)=>{Ot.init(n,i);const a=i.items,l=er.memoizer;l?.attach(n),n._zod.parse=(u,f)=>{const d=u.value;if(!Array.isArray(d))return u.issues.push({input:d,inst:n,expected:"tuple",code:"invalid_type"}),u;u.value=l?l.alloc(n,u,[],f):[];const m=[],p=bb(a,"optin"),g=bb(a,"optout");if(!i.rest){if(d.lengtha.length&&u.issues.push({code:"too_big",maximum:a.length,inclusive:!0,input:d,inst:n,origin:"array"})}const b=new Array(a.length),y=i.rest?f?.abortEarly:void 0;let w=!1;for(let O=0;O{b[O]=A})):(b[O]=T,y&&!w&&T.issues.length&&(w=_r(T)))}if(i.rest&&!w){let O=a.length-1;const T=d.slice(a.length);let A=u.issues.length;for(const k of T){if(y&&u.issues.length!==A){if(_r(u,A))break;A=u.issues.length}O++;const L=i.rest._zod.run({value:k,issues:[]},f);L instanceof Promise?m.push(L.then(D=>_b(D,u,O))):_b(L,u,O)}}return m.length?Promise.all(m).then(()=>Sb(b,u,a,d,g)):Sb(b,u,a,d,g)}});function bb(n,i){for(let a=n.length-1;a>=0;a--)if(!(i==="optin"?n[a]._zod.optin!==void 0:n[a]._zod.optout==="optional"))return a+1;return 0}function _b(n,i,a){n.issues.length&&i.issues.push(...Qs(a,n.issues)),i.value[a]=n.value}function Sb(n,i,a,l,u){for(let f=0;f=u&&a[f]._zod.optin==="optional"){i.value.length=f;break}if(d.issues.length){if(!m&&f>=u){i.value.length=f;break}i.issues.push(...Qs(f,d.issues))}i.value[f]=d.value}for(let f=i.value.length-1;f>=l.length&&(a[f]._zod.optout==="optional"&&i.value[f]===void 0);f--)i.value.length=f;return i}const wO=F("$ZodRecord",(n,i)=>{Ot.init(n,i);const a=er.memoizer;a?.attach(n),n._zod.parse=(l,u)=>{const f=l.value;if(!no(f))return l.issues.push({expected:"record",code:"invalid_type",input:f,inst:n}),l;const d=[],m=i.keyType._zod.values;if(m&&!i.partial){l.value=a?a.alloc(n,l,{},u):{};const p=new Set;for(const b of m)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){if(p.add(typeof b=="number"?b.toString():b),b==="__proto__")continue;const y=i.keyType._zod.run({value:b,issues:[]},u);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(y.issues.length){l.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(T=>Js(T,u,Br())),input:b,path:[b],inst:n});continue}const w=y.value;if(w==="__proto__")continue;const O=i.valueType._zod.run({value:f[b],issues:[]},u);O instanceof Promise?d.push(O.then(T=>{T.issues.length&&l.issues.push(...Qs(b,T.issues)),l.value[w]=T.value})):(O.issues.length&&l.issues.push(...Qs(b,O.issues)),l.value[w]=O.value)}let g;for(const b in f)if(!p.has(b))if(i.mode==="loose"){if(b==="__proto__")continue;l.value[b]=f[b]}else g=g??[],g.push(b);g&&g.length>0&&l.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:g,continue:!0})}else{l.value=a?a.alloc(n,l,{},u):{};let p;for(const g of Reflect.ownKeys(f)){if(g==="__proto__"||!Object.prototype.propertyIsEnumerable.call(f,g))continue;let b=i.keyType._zod.run({value:g,issues:[]},u);if(b instanceof Promise)t)DELIM" -R"DELIM(hrow new Error("Async schemas not supported in object keys currently");if(typeof g=="string"&&qp.test(g)&&b.issues.length){const T=i.keyType._zod.run({value:Number(g),issues:[]},u);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(b=T)}if(b.issues.length){i.mode==="loose"?l.value[g]=f[g]:m?(p=p??[],p.push(g)):l.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(T=>Js(T,u,Br())),input:g,path:[g],inst:n});continue}const w=b.value;if(w==="__proto__")continue;const O=i.valueType._zod.run({value:f[g],issues:[]},u);O instanceof Promise?d.push(O.then(T=>{T.issues.length&&l.issues.push(...Qs(g,T.issues)),l.value[w]=T.value})):(O.issues.length&&l.issues.push(...Qs(g,O.issues)),l.value[w]=O.value)}p&&p.length>0&&l.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:p,continue:!0})}return d.length?Promise.all(d).then(()=>l):l}}),zO=F("$ZodEnum",(n,i)=>{Ot.init(n,i);const a=Jm(i.entries),l=new Set(a);n._zod.values=l,ot(n,"pattern",u=>{const f=Jm(u.def.entries).filter(d=>tT.has(typeof d));return new RegExp(f.length?`^(${f.map(d=>io(d.toString())).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(u,f)=>{const d=u.value;return l.has(d)||u.issues.push({code:"invalid_value",values:a,input:d,inst:n}),u}}),TO=F("$ZodLiteral",(n,i)=>{Ot.init(n,i);const a=new Set(i.values);n._zod.values=a,ot(n,"pattern",l=>{const u=l.def.values;return new RegExp(u.length?`^(${u.map(f=>typeof f=="string"?io(f):f?io(f.toString()):String(f)).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(l,u)=>{const f=l.value;return a.has(f)||l.issues.push({code:"invalid_value",values:i.values,input:f,inst:n}),l}}),EO=F("$ZodTransform",(n,i)=>{Ot.init(n,i),n._zod.optin="optional",er.memoizer?.guard(n),n._zod.parse=(a,l)=>{if(l.direction==="backward")throw new y1(n.constructor.name);const u=i.transform(a.value,a);if(l.async)return(u instanceof Promise?u:Promise.resolve(u)).then(d=>(a.value=d,a));if(u instanceof Promise)throw new Qa;return a.value=u,a}});function xb(n,i){return n.value=i.issues.length?void 0:i.value,n}const R1=F("$ZodOptional",(n,i)=>{Ot.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),n._zod.optout="optional",ot(n,"values",a=>{const l=a.def.innerType._zod.values;return l?new Set([...l,void 0]):void 0}),ot(n,"pattern",a=>{const l=a.def.innerType._zod.pattern;return l?new RegExp(`^(${Dp(l.source)})?$`):void 0}),n._zod.parse=(a,l)=>{if(a.value===void 0){if(i.innerType._zod.optin!=="defaulted")return a;const u=i.innerType._zod.run({value:a.value,issues:[]},l);return u instanceof Promise?u.then(f=>xb(a,f)):xb(a,u)}return i.innerType._zod.run(a,l)}}),OO=F("$ZodExactOptional",(n,i)=>{R1.init(n,i),ot(n,"values",a=>a.def.innerType._zod.values),ot(n,"pattern",a=>a.def.innerType._zod.pattern),n._zod.parse=(a,l)=>i.innerType._zod.run(a,l)}),NO=F("$ZodNullable",(n,i)=>{Ot.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin),ot(n,"optout",a=>a.def.innerType._zod.optout),ot(n,"pattern",a=>{const l=a.def.innerType._zod.pattern;return l?new RegExp(`^(${Dp(l.source)}|null)$`):void 0}),ot(n,"values",a=>a.def.innerType._zod.values?new Set([...a.def.innerType._zod.values,null]):void 0),n._zod.parse=(a,l)=>a.value===null?a:i.innerType._zod.run(a,l)}),AO=F("$ZodDefault",(n,i)=>{Ot.init(n,i),n._zod.optin="defaulted",ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);if(a.value===void 0)return a.value=i.defaultValue,a;const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(f=>wb(f,i)):wb(u,i)}});function wb(n,i){return n.value===void 0&&(n.value=i.defaultValue),n}const MO=F("$ZodPrefault",(n,i)=>{Ot.init(n,i),n._zod.optin="defaulted",ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>(l.direction==="backward"||a.value===void 0&&(a.value=i.defaultValue),i.innerType._zod.run(a,l))}),jO=F("$ZodNonOptional",(n,i)=>{Ot.init(n,i),ot(n,"values",a=>{const l=a.def.innerType._zod.values;return l?new Set([...l].filter(u=>u!==void 0)):void 0}),n._zod.parse=(a,l)=>{const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(f=>zb(f,n)):zb(u,n)}});function zb(n,i){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:i}),n}function Tb(n,i,a,l){return i.issues.length?(n.value=a.catchValue({...i,value:n.value,error:{issues:i.issues.map(u=>Js(u,l,Br()))},input:n.value}),n):(n.value=i.value,i.memo&&(n.memo=!0),n)}const kO=F("$ZodCatch",(n,i)=>{Ot.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ot(n,"optout",a=>a.def.innerType._zod.optout),ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);const u=i.innerType._zod.run({value:a.value,issues:[]},l);return u instanceof Promise?u.then(f=>Tb(a,f,i,l)):Tb(a,u,i,l)}}),RO=F("$ZodPipe",(n,i)=>{Ot.init(n,i),ot(n,"values",a=>a.def.in._zod.values),ot(n,"optin",a=>a.def.in._zod.optin),ot(n,"optout",a=>a.def.out._zod.optout),ot(n,"propValues",a=>a.def.in._zod.propValues),n._zod.parse=(a,l)=>{if(l.direction==="backward"){const f=i.out._zod.run(a,l);return f instanceof Promise?f.then(d=>hf(d,i.in,l)):hf(f,i.in,l)}const u=i.in._zod.run(a,l);return u instanceof Promise?u.then(f=>hf(f,i.out,l)):hf(u,i.out,l)}});function hf(n,i,a){return n.issues.some(l=>l.code!=="unrecognized_keys")?(n.aborted=!0,n):i._zod.run({value:n.value,issues:n.issues},a)}const CO=F("$ZodReadonly",(n,i)=>{Ot.init(n,i),ot(n,"propValues",a=>a.def.innerType._zod.propValues),ot(n,"values",a=>a.def.innerType._zod.values),ot(n,"optin",a=>a.def.innerType?._zod?.optin),ot(n,"optout",a=>a.def.innerType?._zod?.optout),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(Eb):Eb(u)}});function Eb(n){return n.memo||(n.value=Object.freeze(n.value)),n}const DO=F("$ZodCustom",(n,i)=>{yi.init(n,i),Ot.init(n,i),n._zod.parse=(a,l)=>a,n._zod.check=a=>{const l=a.value,u=i.fn(l);if(u instanceof Promise)return u.then(f=>Ob(f,a,l,n));Ob(u,a,l,n)}});function Ob(n,i,a,l){if(!n){const u={code:"custom",input:a,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(u.params=l._zod.def.params),i.issues.push(ku(u))}}class UO extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const np="~memo",Nb=[];function C1(n){return n!==null&&typeof n=="object"}function Um(n){return n.map(i=>i.path?{...i,path:i.path.slice()}:{...i})}const D1=new WeakMap,Su=0,Tf=1,Eu=2;function Ef(n,i,a){const l=D1.get(n);if(l!==void 0)return l?Eu:Su;if(i.has(n))return Eu;i.add(n);let u=Su;const f=b=>{if(u!==Eu&&b?._zod){const y=Ef(b,i);y>u&&(u=y)}},d=(b,y)=>{let w=Su;for(const O of Reflect.ownKeys(b)){const T=Object.getOwnPropertyDescriptor(b,O);if(!T.enumerable)continue;const A=T.get?Tf:T.value?._zod?Ef(T.value,i):Su;A>w&&(w=A)}return w},m=b=>{b>u&&(u=b)},p=n._zod.def;switch(p.type){case"object":{const b=o1(p);m(b?d(b):Tf),f(p.catchall);break}case"array":f(p.element);break;case"tuple":for(const b of p.items)f(b);f(p.rest);break;case"record":case"map":f(p.keyType),f(p.valueType);break;case"set":f(p.valueType);break;case"union":for(const b of p.options)f(b);break;case"intersection":f(p.left),f(p.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":f(p.innerType);break;case"pipe":f(p.in),f(p.out);break;case"function":f(p.input),f(p.output);break;case"lazy":{const b=p._cachedInner??void 0;m(b?Ef(b,i):Tf);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for()DELIM" -R"DELIM(const b in p){const y=Object.getOwnPropertyDescriptor(p,b);if(!y||y.get)continue;const w=y.value;if(!(!w||typeof w!="object")){if(w._zod)f(w);else if(Array.isArray(w))for(const O of w)f(O)}}}return i.delete(n),ZO(n,u)}function ZO(n,i){return i!==Tf&&D1.set(n,i===Eu),i}function $O(n,i){let a=n.buckets.get(i);return a||(a=new WeakMap,n.buckets.set(i,a)),a}let mf;const pf=[],LO={alloc(n,i,a){const l=mf;if(!l)return a;mf=void 0;const u={value:a,issues:null};return l.set(i.value,u),pf.push(u),a},guard(n){var i;(i=n._zod).deferred??(i.deferred=[]),n._zod.deferred.push(()=>{const a=n._zod.parse,l=(u,f)=>{if(f.direction!=="backward"&&BO(f,u.value))throw new UO;return a(u,f)};n._zod.parse=l,n._zod.run===a&&(n._zod.run=l)})},attach(n){var i;let a,l=!1,u,f;(i=n._zod).deferred??(i.deferred=[]),n._zod.deferred.push(()=>{const d=n._zod.parse,m=(p,g)=>{if(a===void 0){const L=Ef(n,new Set);if(L===Su)return n._zod.parse=d,n._zod.run===m&&(n._zod.run=d),d(p,g);L===Eu||l?a=!0:l=!0}const b=p.value;if(!C1(b))return d(p,g);let y=g[np];y||(y={buckets:new WeakMap,backEdges:void 0},g[np]=y);let w;u===g?w=f:(w=$O(y,n),u=g,f=w);const O=w.get(b);if(O)return p.value=O.value,O.issues?O.issues.length&&p.issues.push(...Um(O.issues)):(p.memo=!0,y.backEdges??(y.backEdges=new WeakSet),y.backEdges.add(O.value)),p;mf=w;const T=pf.length,A=d(p,g);mf=void 0;const k=pf.length>T?pf.pop():void 0;return A instanceof Promise?A.then(L=>(k&&(k.issues=L.issues.length?Um(L.issues):Nb),L)):(k&&(k.issues=A.issues.length?Um(A.issues):Nb),A)};n._zod.parse=m,n._zod.run===d&&(n._zod.run=m)})}};function HO(){return LO}function BO(n,i){const a=n[np]?.backEdges;return a!==void 0&&C1(i)&&a.has(i)}const qO=()=>{const n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function i(f){return n[f]??null}const a={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},l={nan:"NaN"};function u(f,d){return f==="number"&&typeof d=="number"&&!Number.isFinite(d)?String(d):l[f]??f}return f=>{switch(f.code){case"invalid_type":{const d=u(f.expected),m=dT(f.input),p=u(m,f.input);return`Invalid input: expected ${d}, received ${p}`}case"invalid_value":return f.values.length===1?`Invalid input: expected ${h1(f.values[0])}`:`Invalid option: expected one of ${ob(f.values,"|")}`;case"too_big":{const d=f.exact?"exactly ":f.inclusive?"<=":"<",m=i(f.origin);return m?`Too big: expected ${f.origin??"value"} to have ${d}${f.maximum.toString()} ${m.unit??"elements"}`:`Too big: expected ${f.origin??"value"} to be ${d}${f.maximum.toString()}`}case"too_small":{const d=f.exact?"exactly ":f.inclusive?">=":">",m=i(f.origin);return m?`Too small: expected ${f.origin} to have ${d}${f.minimum.toString()} ${m.unit}`:`Too small: expected ${f.origin} to be ${d}${f.minimum.toString()}`}case"invalid_format":{const d=f;return d.format==="starts_with"?`Invalid string: must start with "${d.prefix}"`:d.format==="ends_with"?`Invalid string: must end with "${d.suffix}"`:d.format==="includes"?`Invalid string: must include "${d.includes}"`:d.format==="regex"?`Invalid string: must match pattern ${d.pattern}`:`Invalid ${a[d.format]??f.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${f.divisor}`;case"unrecognized_keys":return`Unrecognized key${f.keys.length>1?"s":""}: ${ob(f.keys,", ")}`;case"invalid_key":return`Invalid key in ${f.origin}`;case"invalid_union":return f.options&&Array.isArray(f.options)&&f.options.length>0?`Invalid discriminator value. Expected ${f.options.map(m=>`'${m}'`).join(" | ")}`:f.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${f.origin}`;default:return"Invalid input"}}};function VO(){return{localeError:qO()}}var Ab;class IO{constructor(){this._map=new WeakMap,this._idmap=new Map}add(i,...a){const l=a[0];return this._map.set(i,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,i),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(i){const a=this._map.get(i);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(i),this}get(i){const a=i._zod.parent;if(a){const l={...this.get(a)??{}};delete l.id;const u={...l,...this._map.get(i)};return Object.keys(u).length?u:void 0}return this._map.get(i)}has(i){return this._map.has(i)}}function PO(){return new IO}(Ab=globalThis).__zod_globalRegistry??(Ab.__zod_globalRegistry=PO());const xu=globalThis.__zod_globalRegistry;function U1(n){return n.checks&&(n.checks=[...n.checks]),n}function KO(n,i){return new n(U1({type:"string",...Te(i)}))}function GO(n,i){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Te(i)})}function YO(n,i){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Te(i)})}function FO(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(i)})}function QO(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(i)})}function JO(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(i)})}function XO(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(i)})}function WO(n,i){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Te(i)})}function e2(n,i){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(i)})}function t2(n,i){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(i)})}function n2(n,i){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(i)})}function i2(n,i){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(i)})}function r2(n,i){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(i)})}function s2(n,i){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Te(i)})}function a2(n,i){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(i)})}function l2(n,i){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(i)})}function o2(n,i){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(i)})}function u2(n,i){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(i)})}function c2(n,i){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(i)})}function f2(n,i){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Te(i)})}function d2(n,i){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(i)})}function h2(n,i){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Te(i)})}function m2(n,i){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(i)})}function p2(n,i){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(i)})}function g2(n,i){return new n({type:"string",format:"date",check:"string_format",...Te(i)})}function v2(n,i){return new n({type:"string",format:"time",check:"string_format",precision:null,...Te(i)})}function y2(n,i){return new n({type:"string",format:"duration",check:"string_format",...Te(i)})}function b2(n,i){return new n(U1({type:"number",checks:[],...Te(i)}))}function _2(n,i){return ne)DELIM" -R"DELIM(w n({type:"number",check:"number_format",abort:!1,format:"safeint",...Te(i)})}function S2(n,i){return new n({type:"boolean",...Te(i)})}function x2(n){return new n({type:"unknown"})}function w2(n,i){return new n({type:"never",...Te(i)})}function Mb(n,i){return new S1({check:"less_than",...Te(i),value:n,inclusive:!1})}function Zm(n,i){return new S1({check:"less_than",...Te(i),value:n,inclusive:!0})}function jb(n,i){return new x1({check:"greater_than",...Te(i),value:n,inclusive:!1})}function $m(n,i){return new x1({check:"greater_than",...Te(i),value:n,inclusive:!0})}function kb(n,i){return new vE({check:"multiple_of",...Te(i),value:n})}function Z1(n,i){return new bE({check:"max_length",...Te(i),maximum:n})}function Uf(n,i){return new _E({check:"min_length",...Te(i),minimum:n})}function $1(n,i){return new SE({check:"length_equals",...Te(i),length:n})}function z2(n,i){return new xE({check:"string_format",format:"regex",...Te(i),pattern:n})}function T2(n){return new wE({check:"string_format",format:"lowercase",...Te(n)})}function E2(n){return new zE({check:"string_format",format:"uppercase",...Te(n)})}function O2(n,i){return new TE({check:"string_format",format:"includes",...Te(i),includes:n})}function N2(n,i){return new EE({check:"string_format",format:"starts_with",...Te(i),prefix:n})}function A2(n,i){return new OE({check:"string_format",format:"ends_with",...Te(i),suffix:n})}function fo(n){return new NE({check:"overwrite",tx:n})}function M2(n){return fo(i=>i.normalize(n))}function j2(){return fo(n=>n.trim())}function k2(){return fo(n=>n.toLowerCase())}function R2(){return fo(n=>n.toUpperCase())}function C2(){return fo(n=>Wz(n))}function D2(n,i,a){return new n({type:"array",element:i,...Te(a)})}function U2(n,i,a){return new n({type:"custom",check:"custom",fn:i,...Te(a)})}function Z2(n,i){const a=$2(l=>(l.addIssue=u=>{if(typeof u=="string")l.issues.push(ku(u,l.value,a._zod.def));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),"input"in f||(f.input=l.value),f.inst??(f.inst=a),f.continue??(f.continue=!a._zod.def.abort),l.issues.push(ku(f))}},n(l.value,l)),i);return a}function $2(n,i){const a=new yi({check:"custom",...Te(i)});return a._zod.check=n,a}function Ou(n,...i){for(const a of i)for(const l of Reflect.ownKeys(a))Object.prototype.propertyIsEnumerable.call(a,l)&&ta(n,l,a[l]);return n}function L1(n){let i=n?.target??"draft-2020-12";return i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??xu,target:i,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:n?.cycles??"ref",reused:n?.reused??"inline",intersections:[],deferred:[],external:n?.external??void 0}}function Ws(n,i,a,l,u){const f=typeof i.unrepresentable=="function"?i.unrepresentable({zodSchema:n,path:l.path,message:u}):i.unrepresentable;if(f==="any")return!1;if(f===void 0||f==="throw")throw new Error(u);return Object.assign(a,f),!0}function Kt(n,i,a={path:[],schemaPath:[]}){var l;const u=n._zod.def,f=i.seen.get(n);if(f)return f.count++,a.schemaPath.includes(n)&&(f.cycle=a.path),f.schema;const d={schema:{},count:1,cycle:void 0,path:a.path};i.seen.set(n,d),i.sharedDefsExtractedFor=void 0,i.sharedEmitDoneFor=void 0;const m=n._zod.toJSONSchema?.();if(m)d.schema=m;else{const b={...a,schemaPath:[...a.schemaPath,n],path:a.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(i,d.schema,b);else{const w=d.schema,O=i.processors[u.type];if(!O)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);O(n,i,w,b)}const y=n._zod.parent;y&&(d.ref||(d.ref=y),Kt(y,i,b),i.seen.get(y).isParent=!0)}const p=i.metadataRegistry.get(n);return p&&Ou(d.schema,p),i.io==="input"&&ii(n)&&(delete d.schema.examples,delete d.schema.default),i.io==="input"&&"_prefault"in d.schema&&((l=d.schema).default??(l.default=d.schema._prefault)),delete d.schema._prefault,i.seen.get(n).schema}function Rb(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}function H1(n,i){const a=n.seen.get(i);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");if(n.external&&n.sharedDefsExtractedFor===n.external)return;const l=new Map;for(const d of n.seen.entries()){const m=n.metadataRegistry.get(d[0])?.id;if(m){const p=l.get(m);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(m,d[0])}}const u=d=>{const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const y=n.external.registry.get(d[0])?.id,w=n.external.uri??(T=>T);if(y)return{ref:w(y)};const O=d[1].defId??d[1].schema.id??`schema${n.counter++}`;return d[1].defId=O,{defId:O,ref:`${w("__shared")}#/${m}/${Rb(O)}`}}const p="#",g=`${p}/${m}/`;if(d[1]===a&&!d[1].schema.id)return{ref:p};const b=d[1].schema.id??`__schema${n.counter++}`;return{defId:b,ref:g+Rb(b)}},f=d=>{if(d[1].schema.$ref)return;const m=d[1],{ref:p,defId:g}=u(d);m.def={...m.schema},g&&(m.defId=g);const b=m.schema;for(const y in b)delete b[y];b.$ref=p};if(n.cycles==="throw")for(const d of n.seen.entries()){const m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/ + `)}return k.write("payload.value = newResult;"),k.write("return payload;"),k.compile()};let d;const m=Cf,p=!er.jitless,b=p&&nT.value,y=i.catchall;let w;n._zod.parse=(O,T)=>{w??(w=l.value);const A=O.value;return m(A)?p&&b&&T?.async===!1&&T.jitless!==!0?(d||(d=f(i.shape)),O=d(O,T),y?R1([],A,O,T,w,n,T?.abortEarly===!0):O):a(O,T):(O.issues.push({expected:"object",code:"invalid_type",input:A,inst:n}),O)}});function yb(n,i,a,l){for(const f of n)if(f.issues.length===0)return i.value=f.value,i;const u=n.filter(f=>!_r(f));return u.length===1?(i.value=u[0].value,u[0]):(i.issues.push({code:"invalid_union",input:i.value,inst:a,errors:n.map(f=>f.issues.map(d=>Js(d,l,Br())))}),i)}const xO=Y("$ZodUnion",(n,i)=>{Ot.init(n,i),ot(n,"optin",l=>l.def.options.some(u=>u._zod.optin==="defaulted")?"defaulted":l.def.options.some(u=>u._zod.optin!==void 0)?"optional":void 0),ot(n,"optout",l=>l.def.options.some(u=>u._zod.optout==="optional")?"optional":void 0),ot(n,"values",l=>{if(l.def.options.every(u=>u._zod.values))return new Set(l.def.options.flatMap(u=>Array.from(u._zod.values)))}),ot(n,"pattern",l=>{if(l.def.options.every(u=>u._zod.pattern)){const u=l.def.options.map(f=>f._zod.pattern);return new RegExp(`^(${u.map(f=>Up(f.source)).join("|")})$`)}});const a=i.options.length===1?i.options[0]._zod.run:null;n._zod.parse=(l,u)=>{if(a)return a(l,u);let f=!1;const d=[];for(const m of i.options){const p=m._zod.run({value:l.value,issues:[]},u);if(p instanceof Promise)d.push(p),f=!0;else{if(p.issues.length===0)return p;d.push(p)}}return f?Promise.all(d).then(m=>yb(m,l,n,u)):yb(d,l,n,u)}}),wO=Y("$ZodIntersection",(n,i)=>{Ot.init(n,i),n._zod.parse=(a,l)=>{const u=a.value,f=i.left._zod.run({value:u,issues:[]},l),d=i.right._zod.run({value:u,issues:[]},l);return f instanceof Promise||d instanceof Promise?Promise.all([f,d]).then(([p,g])=>bb(a,p,g)):bb(a,f,d)}});function np(n,i){if(n===i)return{valid:!0,data:n};if(n instanceof Date&&i instanceof Date&&+n==+i)return{valid:!0,data:n};if(io(n)&&io(i)){const a=Object.keys(i),l=Object.keys(n).filter(f=>a.indexOf(f)!==-1),u={...n,...i};Object.prototype.hasOwnProperty.call(u,"__proto__")&&delete u.__proto__;for(const f of l){if(f==="__proto__")continue;const d=np(n[f],i[f]);if(!d.valid)return{valid:!1,mergeErrorPath:[f,...d.mergeErrorPath]};u[f]=d.data}return{valid:!0,data:u}}if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let l=0;l{let y;if(g.code==="unrecognized_keys"&&!g.path?.length)u??(u=g),y=g.keys;else if(g.code==="invalid_key"&&g.origin==="record"&&g.path?.length===1){const w=String(g.path[0]);f.has(w)||f.set(w,g),y=[w]}else return!1;for(const w of y)l.has(w)||l.set(w,{}),l.get(w)[b]=!0;return!0};for(const g of i.issues)d(g,"l")||n.issues.push(g);for(const g of a.issues)d(g,"r")||n.issues.push(g);const m=[...l].filter(([,g])=>g.l&&g.r).map(([g])=>g);if(m.length){const g=u?m.filter(b=>u.keys.includes(b)):[];g.length&&n.issues.push({...u,keys:g});for(const b of m)!g.includes(b)&&f.has(b)&&n.issues.push(f.get(b))}const p=np(i.value,a.value);if(!p.valid){if(_r(n))return n;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(p.mergeErrorPath)}`)}return n.value=p.data,n}const zO=Y("$ZodTuple",(n,i)=>{Ot.init(n,i);const a=i.items,l=er.memoizer;l?.attach(n),n._zod.parse=(u,f)=>{const d=u.value;if(!Array.isArray(d))return u.issues.push({input:d,inst:n,expected:"tuple",code:"invalid_type"}),u;u.value=l?l.alloc(n,u,[],f):[];const m=[],p=_b(a,"optin"),g=_b(a,"optout");if(!i.rest){if(d.lengtha.length&&u.issues.push({code:"too_big",maximum:a.length,inclusive:!0,input:d,inst:n,origin:"array"})}const b=new Array(a.length),y=i.rest?f?.abortEarly:void 0;let w=!1;for(let O=0;O{b[O]=A})):(b[O]=T,y&&!w&&T.issues.length&&(w=_r(T)))}if(i.rest&&!w){let O=a.length-1;const T=d.slice(a.length);let A=u.issues.length;for(const k of T){if(y&&u.issues.length!==A){if(_r(u,A))break;A=u.issues.length}O++;const L=i.rest._zod.run({value:k,issues:[]},f);L instanceof Promise?m.push(L.then(D=>Sb(D,u,O))):Sb(L,u,O)}}return m.length?Promise.all(m).then(()=>xb(b,u,a,d,g)):xb(b,u,a,d,g)}});function _b(n,i){for(let a=n.length-1;a>=0;a--)if(!(i==="optin"?n[a]._zod.optin!==void 0:n[a]._zod.optout==="optional"))return a+1;return 0}function Sb(n,i,a){n.issues.length&&i.issues.push(...Qs(a,n.issues)),i.value[a]=n.value}function xb(n,i,a,l,u){for(let f=0;f=u&&a[f]._zod.optin==="optional"){i.value.length=f;break}if(d.issues.length){if(!m&&f>=u){i.value.length=f;break}i.issues.push(...Qs(f,d.issues))}i.value[f]=d.value}for(let f=i.value.length-1;f>=l.length&&(a[f]._zod.optout==="optional"&&i.value[f]===void 0);f--)i.value.length=f;return i}const TO=Y("$ZodRecord",(n,i)=>{Ot.init(n,i);const a=er.memoizer;a?.attach(n),n._zod.parse=(l,u)=>{const f=l.value;if(!io(f))return l.issues.push({expected:"record",code:"invalid_type",input:f,inst:n}),l;const d=[],m=i.keyType._zod.values;if(m&&!i.partial){l.value=a?a.alloc(n,l,{},u):{};const p=new Set;for(const b of m)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){if(p.add(typeof b=="number"?b.toString():b),b==="__proto__")continue;const y=i.keyType._zod.run({value:b,issues:[]},u);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(y.issues.length){l.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(T=>Js(T,u,Br())),input:b,path:[b],inst:n});continue}const w=y.value;if(w==="__proto__")continue;const O=i.valueType._zod.run({value:f[b],issues:[]},u);O instanceof Promise?d.push(O.then(T=>{T.issues.length&&l.issues.push(...Qs(b,T.issues)),l.value[w]=T.value})):(O.issues.length&&l.issues.push(...Qs(b,O.issues)),l.value[w]=O.value)}let g;for(const b in f)if(!p.has(b))if(i.mode==="loose"){if(b==="__proto__")continue;l.value[b]=f[b]}else g=g??[],g.push(b);g&&g.length>0&&l.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:g,continue:!0})}else{l.value=a?a.alloc(n,l,{},u):{};let p;for(const g of Reflect.ownKeys(f)){if(g==="__proto__"||!Object.prototype.propertyIsEnumerable.call(f,g))continue;let b=i.keyType._zod.run({value:g,issues:[]},u);if(b instanceof Promise)throw new Error("As)DELIM" +R"DELIM(ync schemas not supported in object keys currently");if(typeof g=="string"&&Vp.test(g)&&b.issues.length){const T=i.keyType._zod.run({value:Number(g),issues:[]},u);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(b=T)}if(b.issues.length){i.mode==="loose"?l.value[g]=f[g]:m?(p=p??[],p.push(g)):l.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(T=>Js(T,u,Br())),input:g,path:[g],inst:n});continue}const w=b.value;if(w==="__proto__")continue;const O=i.valueType._zod.run({value:f[g],issues:[]},u);O instanceof Promise?d.push(O.then(T=>{T.issues.length&&l.issues.push(...Qs(g,T.issues)),l.value[w]=T.value})):(O.issues.length&&l.issues.push(...Qs(g,O.issues)),l.value[w]=O.value)}p&&p.length>0&&l.issues.push({code:"unrecognized_keys",input:f,inst:n,keys:p,continue:!0})}return d.length?Promise.all(d).then(()=>l):l}}),EO=Y("$ZodEnum",(n,i)=>{Ot.init(n,i);const a=Xm(i.entries),l=new Set(a);n._zod.values=l,ot(n,"pattern",u=>{const f=Xm(u.def.entries).filter(d=>iT.has(typeof d));return new RegExp(f.length?`^(${f.map(d=>ro(d.toString())).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(u,f)=>{const d=u.value;return l.has(d)||u.issues.push({code:"invalid_value",values:a,input:d,inst:n}),u}}),OO=Y("$ZodLiteral",(n,i)=>{Ot.init(n,i);const a=new Set(i.values);n._zod.values=a,ot(n,"pattern",l=>{const u=l.def.values;return new RegExp(u.length?`^(${u.map(f=>typeof f=="string"?ro(f):f?ro(f.toString()):String(f)).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(l,u)=>{const f=l.value;return a.has(f)||l.issues.push({code:"invalid_value",values:i.values,input:f,inst:n}),l}}),NO=Y("$ZodTransform",(n,i)=>{Ot.init(n,i),n._zod.optin="optional",er.memoizer?.guard(n),n._zod.parse=(a,l)=>{if(l.direction==="backward")throw new b1(n.constructor.name);const u=i.transform(a.value,a);if(l.async)return(u instanceof Promise?u:Promise.resolve(u)).then(d=>(a.value=d,a));if(u instanceof Promise)throw new Ja;return a.value=u,a}});function wb(n,i){return n.value=i.issues.length?void 0:i.value,n}const C1=Y("$ZodOptional",(n,i)=>{Ot.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),n._zod.optout="optional",ot(n,"values",a=>{const l=a.def.innerType._zod.values;return l?new Set([...l,void 0]):void 0}),ot(n,"pattern",a=>{const l=a.def.innerType._zod.pattern;return l?new RegExp(`^(${Up(l.source)})?$`):void 0}),n._zod.parse=(a,l)=>{if(a.value===void 0){if(i.innerType._zod.optin!=="defaulted")return a;const u=i.innerType._zod.run({value:a.value,issues:[]},l);return u instanceof Promise?u.then(f=>wb(a,f)):wb(a,u)}return i.innerType._zod.run(a,l)}}),AO=Y("$ZodExactOptional",(n,i)=>{C1.init(n,i),ot(n,"values",a=>a.def.innerType._zod.values),ot(n,"pattern",a=>a.def.innerType._zod.pattern),n._zod.parse=(a,l)=>i.innerType._zod.run(a,l)}),MO=Y("$ZodNullable",(n,i)=>{Ot.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin),ot(n,"optout",a=>a.def.innerType._zod.optout),ot(n,"pattern",a=>{const l=a.def.innerType._zod.pattern;return l?new RegExp(`^(${Up(l.source)}|null)$`):void 0}),ot(n,"values",a=>a.def.innerType._zod.values?new Set([...a.def.innerType._zod.values,null]):void 0),n._zod.parse=(a,l)=>a.value===null?a:i.innerType._zod.run(a,l)}),jO=Y("$ZodDefault",(n,i)=>{Ot.init(n,i),n._zod.optin="defaulted",ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);if(a.value===void 0)return a.value=i.defaultValue,a;const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(f=>zb(f,i)):zb(u,i)}});function zb(n,i){return n.value===void 0&&(n.value=i.defaultValue),n}const kO=Y("$ZodPrefault",(n,i)=>{Ot.init(n,i),n._zod.optin="defaulted",ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>(l.direction==="backward"||a.value===void 0&&(a.value=i.defaultValue),i.innerType._zod.run(a,l))}),RO=Y("$ZodNonOptional",(n,i)=>{Ot.init(n,i),ot(n,"values",a=>{const l=a.def.innerType._zod.values;return l?new Set([...l].filter(u=>u!==void 0)):void 0}),n._zod.parse=(a,l)=>{const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(f=>Tb(f,n)):Tb(u,n)}});function Tb(n,i){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:i}),n}function Eb(n,i,a,l){return i.issues.length?(n.value=a.catchValue({...i,value:n.value,error:{issues:i.issues.map(u=>Js(u,l,Br()))},input:n.value}),n):(n.value=i.value,i.memo&&(n.memo=!0),n)}const CO=Y("$ZodCatch",(n,i)=>{Ot.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ot(n,"optout",a=>a.def.innerType._zod.optout),ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);const u=i.innerType._zod.run({value:a.value,issues:[]},l);return u instanceof Promise?u.then(f=>Eb(a,f,i,l)):Eb(a,u,i,l)}}),DO=Y("$ZodPipe",(n,i)=>{Ot.init(n,i),ot(n,"values",a=>a.def.in._zod.values),ot(n,"optin",a=>a.def.in._zod.optin),ot(n,"optout",a=>a.def.out._zod.optout),ot(n,"propValues",a=>a.def.in._zod.propValues),n._zod.parse=(a,l)=>{if(l.direction==="backward"){const f=i.out._zod.run(a,l);return f instanceof Promise?f.then(d=>mf(d,i.in,l)):mf(f,i.in,l)}const u=i.in._zod.run(a,l);return u instanceof Promise?u.then(f=>mf(f,i.out,l)):mf(u,i.out,l)}});function mf(n,i,a){return n.issues.some(l=>l.code!=="unrecognized_keys")?(n.aborted=!0,n):i._zod.run({value:n.value,issues:n.issues},a)}const UO=Y("$ZodReadonly",(n,i)=>{Ot.init(n,i),ot(n,"propValues",a=>a.def.innerType._zod.propValues),ot(n,"values",a=>a.def.innerType._zod.values),ot(n,"optin",a=>a.def.innerType?._zod?.optin),ot(n,"optout",a=>a.def.innerType?._zod?.optout),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(Ob):Ob(u)}});function Ob(n){return n.memo||(n.value=Object.freeze(n.value)),n}const ZO=Y("$ZodCustom",(n,i)=>{yi.init(n,i),Ot.init(n,i),n._zod.parse=(a,l)=>a,n._zod.check=a=>{const l=a.value,u=i.fn(l);if(u instanceof Promise)return u.then(f=>Nb(f,a,l,n));Nb(u,a,l,n)}});function Nb(n,i,a,l){if(!n){const u={code:"custom",input:a,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(u.params=l._zod.def.params),i.issues.push(Ru(u))}}class $O extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const ip="~memo",Ab=[];function D1(n){return n!==null&&typeof n=="object"}function $m(n){return n.map(i=>i.path?{...i,path:i.path.slice()}:{...i})}const U1=new WeakMap,xu=0,Of=1,Ou=2;function Nf(n,i,a){const l=U1.get(n);if(l!==void 0)return l?Ou:xu;if(i.has(n))return Ou;i.add(n);let u=xu;const f=b=>{if(u!==Ou&&b?._zod){const y=Nf(b,i);y>u&&(u=y)}},d=(b,y)=>{let w=xu;for(const O of Reflect.ownKeys(b)){const T=Object.getOwnPropertyDescriptor(b,O);if(!T.enumerable)continue;const A=T.get?Of:T.value?._zod?Nf(T.value,i):xu;A>w&&(w=A)}return w},m=b=>{b>u&&(u=b)},p=n._zod.def;switch(p.type){case"object":{const b=u1(p);m(b?d(b):Of),f(p.catchall);break}case"array":f(p.element);break;case"tuple":for(const b of p.items)f(b);f(p.rest);break;case"record":case"map":f(p.keyType),f(p.valueType);break;case"set":f(p.valueType);break;case"union":for(const b of p.options)f(b);break;case"intersection":f(p.left),f(p.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":f(p.innerType);break;case"pipe":f(p.in),f(p.out);break;case"function":f(p.input),f(p.output);break;case"lazy":{const b=p._cachedInner??void 0;m(b?Nf(b,i):Of);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const b in p){cons)DELIM" +R"DELIM(t y=Object.getOwnPropertyDescriptor(p,b);if(!y||y.get)continue;const w=y.value;if(!(!w||typeof w!="object")){if(w._zod)f(w);else if(Array.isArray(w))for(const O of w)f(O)}}}return i.delete(n),LO(n,u)}function LO(n,i){return i!==Of&&U1.set(n,i===Ou),i}function HO(n,i){let a=n.buckets.get(i);return a||(a=new WeakMap,n.buckets.set(i,a)),a}let pf;const gf=[],BO={alloc(n,i,a){const l=pf;if(!l)return a;pf=void 0;const u={value:a,issues:null};return l.set(i.value,u),gf.push(u),a},guard(n){var i;(i=n._zod).deferred??(i.deferred=[]),n._zod.deferred.push(()=>{const a=n._zod.parse,l=(u,f)=>{if(f.direction!=="backward"&&VO(f,u.value))throw new $O;return a(u,f)};n._zod.parse=l,n._zod.run===a&&(n._zod.run=l)})},attach(n){var i;let a,l=!1,u,f;(i=n._zod).deferred??(i.deferred=[]),n._zod.deferred.push(()=>{const d=n._zod.parse,m=(p,g)=>{if(a===void 0){const L=Nf(n,new Set);if(L===xu)return n._zod.parse=d,n._zod.run===m&&(n._zod.run=d),d(p,g);L===Ou||l?a=!0:l=!0}const b=p.value;if(!D1(b))return d(p,g);let y=g[ip];y||(y={buckets:new WeakMap,backEdges:void 0},g[ip]=y);let w;u===g?w=f:(w=HO(y,n),u=g,f=w);const O=w.get(b);if(O)return p.value=O.value,O.issues?O.issues.length&&p.issues.push(...$m(O.issues)):(p.memo=!0,y.backEdges??(y.backEdges=new WeakSet),y.backEdges.add(O.value)),p;pf=w;const T=gf.length,A=d(p,g);pf=void 0;const k=gf.length>T?gf.pop():void 0;return A instanceof Promise?A.then(L=>(k&&(k.issues=L.issues.length?$m(L.issues):Ab),L)):(k&&(k.issues=A.issues.length?$m(A.issues):Ab),A)};n._zod.parse=m,n._zod.run===d&&(n._zod.run=m)})}};function qO(){return BO}function VO(n,i){const a=n[ip]?.backEdges;return a!==void 0&&D1(i)&&a.has(i)}const IO=()=>{const n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function i(f){return n[f]??null}const a={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},l={nan:"NaN"};function u(f,d){return f==="number"&&typeof d=="number"&&!Number.isFinite(d)?String(d):l[f]??f}return f=>{switch(f.code){case"invalid_type":{const d=u(f.expected),m=mT(f.input),p=u(m,f.input);return`Invalid input: expected ${d}, received ${p}`}case"invalid_value":return f.values.length===1?`Invalid input: expected ${m1(f.values[0])}`:`Invalid option: expected one of ${ub(f.values,"|")}`;case"too_big":{const d=f.exact?"exactly ":f.inclusive?"<=":"<",m=i(f.origin);return m?`Too big: expected ${f.origin??"value"} to have ${d}${f.maximum.toString()} ${m.unit??"elements"}`:`Too big: expected ${f.origin??"value"} to be ${d}${f.maximum.toString()}`}case"too_small":{const d=f.exact?"exactly ":f.inclusive?">=":">",m=i(f.origin);return m?`Too small: expected ${f.origin} to have ${d}${f.minimum.toString()} ${m.unit}`:`Too small: expected ${f.origin} to be ${d}${f.minimum.toString()}`}case"invalid_format":{const d=f;return d.format==="starts_with"?`Invalid string: must start with "${d.prefix}"`:d.format==="ends_with"?`Invalid string: must end with "${d.suffix}"`:d.format==="includes"?`Invalid string: must include "${d.includes}"`:d.format==="regex"?`Invalid string: must match pattern ${d.pattern}`:`Invalid ${a[d.format]??f.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${f.divisor}`;case"unrecognized_keys":return`Unrecognized key${f.keys.length>1?"s":""}: ${ub(f.keys,", ")}`;case"invalid_key":return`Invalid key in ${f.origin}`;case"invalid_union":return f.options&&Array.isArray(f.options)&&f.options.length>0?`Invalid discriminator value. Expected ${f.options.map(m=>`'${m}'`).join(" | ")}`:f.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${f.origin}`;default:return"Invalid input"}}};function PO(){return{localeError:IO()}}var Mb;class KO{constructor(){this._map=new WeakMap,this._idmap=new Map}add(i,...a){const l=a[0];return this._map.set(i,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,i),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(i){const a=this._map.get(i);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(i),this}get(i){const a=i._zod.parent;if(a){const l={...this.get(a)??{}};delete l.id;const u={...l,...this._map.get(i)};return Object.keys(u).length?u:void 0}return this._map.get(i)}has(i){return this._map.has(i)}}function GO(){return new KO}(Mb=globalThis).__zod_globalRegistry??(Mb.__zod_globalRegistry=GO());const wu=globalThis.__zod_globalRegistry;function Z1(n){return n.checks&&(n.checks=[...n.checks]),n}function YO(n,i){return new n(Z1({type:"string",...Te(i)}))}function FO(n,i){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Te(i)})}function QO(n,i){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Te(i)})}function JO(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(i)})}function XO(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(i)})}function WO(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(i)})}function e2(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(i)})}function t2(n,i){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Te(i)})}function n2(n,i){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(i)})}function i2(n,i){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(i)})}function r2(n,i){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(i)})}function s2(n,i){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(i)})}function a2(n,i){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(i)})}function l2(n,i){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Te(i)})}function o2(n,i){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(i)})}function u2(n,i){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(i)})}function c2(n,i){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(i)})}function f2(n,i){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(i)})}function d2(n,i){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(i)})}function h2(n,i){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Te(i)})}function m2(n,i){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(i)})}function p2(n,i){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Te(i)})}function g2(n,i){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(i)})}function v2(n,i){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(i)})}function y2(n,i){return new n({type:"string",format:"date",check:"string_format",...Te(i)})}function b2(n,i){return new n({type:"string",format:"time",check:"string_format",precision:null,...Te(i)})}function _2(n,i){return new n({type:"string",format:"duration",check:"string_format",...Te(i)})}function S2(n,i){return new n(Z1({type:"number",checks:[],...Te(i)}))}function x2(n,i){return new n({type:"number")DELIM" +R"DELIM(,check:"number_format",abort:!1,format:"safeint",...Te(i)})}function w2(n,i){return new n({type:"boolean",...Te(i)})}function z2(n){return new n({type:"unknown"})}function T2(n,i){return new n({type:"never",...Te(i)})}function jb(n,i){return new x1({check:"less_than",...Te(i),value:n,inclusive:!1})}function Lm(n,i){return new x1({check:"less_than",...Te(i),value:n,inclusive:!0})}function kb(n,i){return new w1({check:"greater_than",...Te(i),value:n,inclusive:!1})}function Hm(n,i){return new w1({check:"greater_than",...Te(i),value:n,inclusive:!0})}function Rb(n,i){return new bE({check:"multiple_of",...Te(i),value:n})}function $1(n,i){return new SE({check:"max_length",...Te(i),maximum:n})}function $f(n,i){return new xE({check:"min_length",...Te(i),minimum:n})}function L1(n,i){return new wE({check:"length_equals",...Te(i),length:n})}function E2(n,i){return new zE({check:"string_format",format:"regex",...Te(i),pattern:n})}function O2(n){return new TE({check:"string_format",format:"lowercase",...Te(n)})}function N2(n){return new EE({check:"string_format",format:"uppercase",...Te(n)})}function A2(n,i){return new OE({check:"string_format",format:"includes",...Te(i),includes:n})}function M2(n,i){return new NE({check:"string_format",format:"starts_with",...Te(i),prefix:n})}function j2(n,i){return new AE({check:"string_format",format:"ends_with",...Te(i),suffix:n})}function ho(n){return new ME({check:"overwrite",tx:n})}function k2(n){return ho(i=>i.normalize(n))}function R2(){return ho(n=>n.trim())}function C2(){return ho(n=>n.toLowerCase())}function D2(){return ho(n=>n.toUpperCase())}function U2(){return ho(n=>tT(n))}function Z2(n,i,a){return new n({type:"array",element:i,...Te(a)})}function $2(n,i,a){return new n({type:"custom",check:"custom",fn:i,...Te(a)})}function L2(n,i){const a=H2(l=>(l.addIssue=u=>{if(typeof u=="string")l.issues.push(Ru(u,l.value,a._zod.def));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),"input"in f||(f.input=l.value),f.inst??(f.inst=a),f.continue??(f.continue=!a._zod.def.abort),l.issues.push(Ru(f))}},n(l.value,l)),i);return a}function H2(n,i){const a=new yi({check:"custom",...Te(i)});return a._zod.check=n,a}function Nu(n,...i){for(const a of i)for(const l of Reflect.ownKeys(a))Object.prototype.propertyIsEnumerable.call(a,l)&&ta(n,l,a[l]);return n}function H1(n){let i=n?.target??"draft-2020-12";return i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??wu,target:i,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:n?.cycles??"ref",reused:n?.reused??"inline",intersections:[],deferred:[],external:n?.external??void 0}}function Ws(n,i,a,l,u){const f=typeof i.unrepresentable=="function"?i.unrepresentable({zodSchema:n,path:l.path,message:u}):i.unrepresentable;if(f==="any")return!1;if(f===void 0||f==="throw")throw new Error(u);return Object.assign(a,f),!0}function Kt(n,i,a={path:[],schemaPath:[]}){var l;const u=n._zod.def,f=i.seen.get(n);if(f)return f.count++,a.schemaPath.includes(n)&&(f.cycle=a.path),f.schema;const d={schema:{},count:1,cycle:void 0,path:a.path};i.seen.set(n,d),i.sharedDefsExtractedFor=void 0,i.sharedEmitDoneFor=void 0;const m=n._zod.toJSONSchema?.();if(m)d.schema=m;else{const b={...a,schemaPath:[...a.schemaPath,n],path:a.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(i,d.schema,b);else{const w=d.schema,O=i.processors[u.type];if(!O)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);O(n,i,w,b)}const y=n._zod.parent;y&&(d.ref||(d.ref=y),Kt(y,i,b),i.seen.get(y).isParent=!0)}const p=i.metadataRegistry.get(n);return p&&Nu(d.schema,p),i.io==="input"&&ii(n)&&(delete d.schema.examples,delete d.schema.default),i.io==="input"&&"_prefault"in d.schema&&((l=d.schema).default??(l.default=d.schema._prefault)),delete d.schema._prefault,i.seen.get(n).schema}function Cb(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}function B1(n,i){const a=n.seen.get(i);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");if(n.external&&n.sharedDefsExtractedFor===n.external)return;const l=new Map;for(const d of n.seen.entries()){const m=n.metadataRegistry.get(d[0])?.id;if(m){const p=l.get(m);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(m,d[0])}}const u=d=>{const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const y=n.external.registry.get(d[0])?.id,w=n.external.uri??(T=>T);if(y)return{ref:w(y)};const O=d[1].defId??d[1].schema.id??`schema${n.counter++}`;return d[1].defId=O,{defId:O,ref:`${w("__shared")}#/${m}/${Cb(O)}`}}const p="#",g=`${p}/${m}/`;if(d[1]===a&&!d[1].schema.id)return{ref:p};const b=d[1].schema.id??`__schema${n.counter++}`;return{defId:b,ref:g+Cb(b)}},f=d=>{if(d[1].schema.$ref)return;const m=d[1],{ref:p,defId:g}=u(d);m.def={...m.schema},g&&(m.defId=g);const b=m.schema;for(const y in b)delete b[y];b.$ref=p};if(n.cycles==="throw")for(const d of n.seen.entries()){const m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of n.seen.entries()){const m=d[1];if(i===d[0]){f(d);continue}if(n.external){const g=n.external.registry.get(d[0])?.id;if(i!==d[0]&&g){f(d);continue}}if(n.metadataRegistry.get(d[0])?.id){f(d);continue}if(m.cycle){f(d);continue}m.count>1&&n.reused==="ref"&&f(d)}n.external&&(n.sharedDefsExtractedFor=n.external)}function B1(n){const i=n.anyOf;if(!Array.isArray(i)||i.length===0||n.type!==void 0)return;const a=[];for(const l of i){if(!l||typeof l!="object")return;B1(l);const u=Object.keys(l);if(u.length!==1||u[0]!=="type")return;const f=l.type;for(const d of Array.isArray(f)?f:[f]){if(typeof d!="string")return;a.includes(d)||a.push(d)}}delete n.anyOf,n.type=a.length===1?a[0]:a}const q1=new Set(["type","properties","required","additionalProperties"]),Cb=["oneOf","anyOf"];function Db(n){const i=n.additionalProperties;return i===void 0||i===!1||typeof i!="object"||i===null?null:Object.keys(i).length?i:null}function ip(n){const i=[];for(const f of n){if(typeof f!="object"||f.type!=="object")return null;for(const d in f)if(!q1.has(d))return null;i.push(f)}const a={},l=new Set;for(const f of i){for(const d in f.properties){if(Object.prototype.hasOwnProperty.call(a,d))continue;const m=[];for(const g of i){const b=g.properties?.[d]??Db(g);b!=null&&(m.some(y=>JSON.stringify(y)===JSON.stringify(b))||m.push(b))}const p=m.length===1?m[0]:ip(m)??{allOf:m};ta(a,d,p)}for(const d of f.required??[])l.add(d)}const u={type:"object",properties:a};if(l.size&&(u.required=[...l]),i.every(f=>f.additionalProperties===!1))u.additionalProperties=!1;else{const f=[];for(const d of i){const m=Db(d);m&&!f.some(p=>JSON.stringify(p)===JSON.stringify(m))&&f.push(m)}f.length===1?u.additionalProperties=f[0]:f.length>1&&(u.additionalProperties={allOf:f})}return u}function L2(n){const i=n.allOf;if(!Array.isArray(i)||i.length<2)return;for(const u of q1)if(u in n)return;const a=i.filter(u=>Cb.some(f=>Array.isArray(u[f])));let l=null;if(!a.length)l=ip(i);else{const u=a[0],f=Cb.find(p=>Array.isArray(u[p]));if(Object.keys(u).length!==1)return;const d=i.filter(p=>p!==u),m=u[f].map(p=>ip([...d,p]));if(m.some(p=>!p))return;l={[f]:m}}l&&(delete n.allOf,Ou(n,l))}function V1(n,i){const a=n.seen.get(i);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=m=>{const p=n.seen.get(m);if(p.ref===null)return;const g=p.def??p.schema,b={...g},y=p.ref;if(p.ref=null,y){l(y);const O=n.seen.get(y),T=O.schema;if(T.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(T)):Ou(g,T),Ou(g,b),m._zod.parent===y)for(const k in g)k==="$ref"||k==="allOf"||k in b||delet)DELIM" -R"DELIM(e g[k];if(T.$ref&&O.def)for(const k in g)k==="$ref"||k==="allOf"||k in O.def&&JSON.stringify(g[k])===JSON.stringify(O.def[k])&&delete g[k]}const w=m._zod.parent;if(w&&w!==y){l(w);const O=n.seen.get(w);if(O?.schema.$ref&&(g.$ref=O.schema.$ref,O.def))for(const T in g)T==="$ref"||T==="allOf"||T in O.def&&JSON.stringify(g[T])===JSON.stringify(O.def[T])&&delete g[T]}n.override({zodSchema:m,jsonSchema:g,path:p.path??[]})};if(!n.external||n.sharedEmitDoneFor!==n.external){for(const m of[...n.seen.entries()].reverse())l(m[0]);if(n.target!=="openapi-3.0")for(const m of n.seen.entries())B1(m[1].def??m[1].schema);for(const m of n.deferred)m();if(n.intersections.length){const m=new Map;for(const p of n.seen.values())for(const g of[p.schema,p.def]){const b=g?.allOf;if(!Array.isArray(b))continue;const y=m.get(b);y?y.push(g):m.set(b,[g])}for(const p of n.intersections)for(const g of m.get(p)??[])L2(g)}}const u={};if(n.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const m=n.external.registry.get(i)?.id;if(!m)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(m)}Ou(u,a.defId?a.schema:a.def??a.schema);const f=n.metadataRegistry.get(i)?.id;f!==void 0&&u.id===f&&delete u.id;const d=n.external?.defs??{};if(!n.external||n.sharedEmitDoneFor!==n.external)for(const m of n.seen.entries()){const p=m[1];p.def&&p.defId&&(p.def.id===p.defId&&delete p.def.id,ta(d,p.defId,p.def))}n.external&&(n.sharedEmitDoneFor=n.external),n.external||Object.keys(d).length>0&&(n.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{const m=JSON.parse(JSON.stringify(u));return Object.defineProperty(m,"~standard",{value:{...i["~standard"],jsonSchema:{input:Zf(i,"input",n.processors),output:Zf(i,"output",n.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function ii(n,i){const a=i??{seen:new Set};if(a.seen.has(n))return!1;a.seen.add(n);const l=n._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return ii(l.element,a);if(l.type==="set")return ii(l.valueType,a);if(l.type==="lazy")return ii(l.getter(),a);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault"||l.type==="catch")return ii(l.innerType,a);if(l.type==="intersection")return ii(l.left,a)||ii(l.right,a);if(l.type==="record"||l.type==="map")return ii(l.keyType,a)||ii(l.valueType,a);if(l.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:ii(l.in,a)||ii(l.out,a);if(l.type==="object"){for(const u in l.shape)if(ii(l.shape[u],a))return!0;return!1}if(l.type==="union"){for(const u of l.options)if(ii(u,a))return!0;return!1}if(l.type==="tuple"){for(const u of l.items)if(ii(u,a))return!0;return!!(l.rest&&ii(l.rest,a))}return!1}const H2=(n,i={})=>a=>{const l=L1({...a,processors:i});return Kt(n,l),H1(l,n),V1(l,n)},Zf=(n,i,a={})=>l=>{const{libraryOptions:u,target:f}=l??{},d=L1({...u??{},target:f,io:i,processors:a});return Kt(n,d),H1(d,n),V1(d,n)},ro=(n,i,a)=>{(n[i]===void 0||a>n[i])&&(n[i]=a)},so=(n,i,a)=>{(n[i]===void 0||a{ro(n,"minimum",i),so(n,"maximum",i)},I1=(n,i)=>{n.multipleOf??(n.multipleOf=[]),n.multipleOf.includes(i)||n.multipleOf.push(i)},P1=(n,i)=>{n.patterns??(n.patterns=new Set),n.patterns.add(i)},K1=(n,i)=>{n.mime=n.mime?n.mime.filter(a=>i.includes(a)):[...i]},G1=(n,i)=>{n.format=i,i.includes("int")&&(n.isInt=!0)},Zb=(n,i)=>ro(n,"minimum",i.minimum),$b=(n,i)=>so(n,"maximum",i.maximum),Lb=n=>(i,a)=>{G1(i,a.format);const[l,u]=n[a.format];ro(i,"minimum",l),so(i,"maximum",u)},B2={greater_than:(n,i)=>ro(n,i.inclusive?"minimum":"exclusiveMinimum",i.value),less_than:(n,i)=>so(n,i.inclusive?"maximum":"exclusiveMaximum",i.value),multiple_of:(n,i)=>I1(n,i.value),number_format:Lb(m1),bigint_format:Lb(iT),min_length:Zb,max_length:$b,length_equals:(n,i)=>Ub(n,i.length),min_size:Zb,max_size:$b,size_equals:(n,i)=>Ub(n,i.size),string_format:(n,i)=>{G1(n,i.format),i.pattern&&P1(n,i.pattern),(i.format==="base64"||i.format==="base64url")&&(n.contentEncoding=i.format),(i.local||i.precision===-1)&&(n.laxFormat=!0)},mime_type:(n,i)=>K1(n,i.mime)};function Wi(n){const i={},a=n._zod.def,l=n._zod.traits.has("$ZodCheck")?[n,...a.checks??[]]:a.checks??[];for(const f of l)B2[f._zod.def.check]?.(i,f._zod.def);const u=n._zod.bag;u.minimum!==void 0&&ro(i,"minimum",u.minimum),u.exclusiveMinimum!==void 0&&ro(i,"exclusiveMinimum",u.exclusiveMinimum),u.maximum!==void 0&&so(i,"maximum",u.maximum),u.exclusiveMaximum!==void 0&&so(i,"exclusiveMaximum",u.exclusiveMaximum),u.multipleOf!==void 0&&I1(i,u.multipleOf),u.format!==void 0&&(i.format??(i.format=u.format),u.format.includes("int")&&(i.isInt=!0)),u.mime&&K1(i,u.mime);for(const f of u.patterns??[])P1(i,f);return i}const q2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V2=new Map([[A1,rE],[Pp,sE]]),Y1=n=>V2.get(n)??n,I2=(n,i,a,l)=>{const u=a;u.type="string";const{minimum:f,maximum:d,format:m,patterns:p,contentEncoding:g,laxFormat:b}=Wi(n);if(typeof f=="number"&&(u.minLength=f),typeof d=="number"&&(u.maxLength=d),m&&(u.format=q2[m]??m,u.format===""&&delete u.format,(m==="time"||b)&&delete u.format),g&&(u.contentEncoding=g),p&&p.size>0){const y=[...p].map(Y1);y.length===1?u.pattern=y[0].source:y.length>1&&(u.allOf=[...y.map(w=>({...i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},P2=(n,i,a,l)=>{const u=a,{minimum:f,maximum:d,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:g,isInt:b}=Wi(n);u.type=b?"integer":"number";const y=typeof g=="number"&&g>=(f??Number.NEGATIVE_INFINITY),w=typeof p=="number"&&p<=(d??Number.POSITIVE_INFINITY),O=i.target==="draft-04"||i.target==="openapi-3.0";if(y?O?(u.minimum=g,u.exclusiveMinimum=!0):u.exclusiveMinimum=g:typeof f=="number"&&(u.minimum=f),w?O?(u.maximum=p,u.exclusiveMaximum=!0):u.exclusiveMaximum=p:typeof d=="number"&&(u.maximum=d),m){const T=new Set;for(const L of m)Number.isFinite(L)&&L!==0?T.add(Math.abs(L)):Ws(n,i,u,l,`A multipleOf divisor of ${L} cannot be represented in JSON Schema`);const[A,...k]=T;A!==void 0&&(u.multipleOf=A),k.length&&(u.allOf=[...u.allOf??[],...k.map(L=>({multipleOf:L}))])}},K2=(n,i,a,l)=>{a.type="boolean"},G2=(n,i,a,l)=>{a.not={}},Y2=(n,i,a,l)=>{},F2=(n,i,a,l)=>{const u=n._zod.def,f=Jm(u.entries);if(f.length===0){a.not={};return}f.every(d=>typeof d=="number")&&(a.type="number"),f.every(d=>typeof d=="string")&&(a.type="string"),a.enum=f},Q2=(n,i,a,l)=>{const u=n._zod.def;if(u.values.length===0){a.not={};return}const f=[];for(const d of u.values)if(d===void 0){if(Ws(n,i,a,l,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof d=="bigint"){if(Ws(n,i,a,l,"BigInt literals cannot be represented in JSON Schema"))return;f.push(Number(d))}else f.push(d);if(f.length!==0)if(f.length===1){const d=f[0];a.type=d===null?"null":typeof d,i.target==="draft-04"||i.target==="openapi-3.0"?a.enum=[d]:a.const=d}else f.every(d=>typeof d=="number")&&(a.type="number"),f.every(d=>typeof d=="string")&&(a.type="string"),f.every(d=>typeof d=="boolean")&&(a.type="boolean"),f.every(d=>d===null)&&(a.type="null"),a.enum=f},J2=(n,i,a,l)=>{Ws(n,i,a,l,"Custom types cannot be represented in JSON Schema")},X2=(n,i,a,l)=>{Ws(n,i,a,l,"Transforms cannot be represented in JSON Schema")},W2=(n,i,a,l)=>{const u=a,f=n._zod.def,{minimum:d,maximum:m}=Wi(n);typeof d=="number"&&(u.minItems=d),typeof m=="number"&&(u.maxItems=m),u.type="array",u.items=Kt(f.element,i,{...l,path:[...l.path,"items"]})};function Ru(n){const i=n._zod.def;return i.type==="pipe"&&i.in._zod.traits.has("$ZodTransform")?Ru(i.out):i.type==="catch"?Ru(i.innerType):n._zod.optin}const eN=(n,i,a,l)=>{const u=a,f=n._zod.def,d=f.shape;if(Object.getOwnPropertySymbols(d).length&&Ws(n,i,u,l,"Symbol keys can)DELIM" -R"DELIM(not be represented in JSON Schema"))return;u.type="object",u.properties={};for(const g in d)ta(u.properties,g,Kt(d[g],i,{...l,path:[...l.path,"properties",g]}));const p=[];for(const g of Object.keys(d)){const b=f.shape[g];(i.io==="input"?Ru(b)===void 0:b._zod.optout===void 0)&&p.push(g)}p.length>0&&(u.required=p),f.catchall?._zod.def.type==="never"?u.additionalProperties=!1:f.catchall?f.catchall&&(u.additionalProperties=Kt(f.catchall,i,{...l,path:[...l.path,"additionalProperties"]})):i.io==="output"&&(u.additionalProperties=!1)},tN=(n,i,a,l)=>{const u=n._zod.def,f=u.inclusive===!1,d=u.options.map((m,p)=>Kt(m,i,{...l,path:[...l.path,f?"oneOf":"anyOf",p]}));f?a.oneOf=d:a.anyOf=d},nN=(n,i,a,l)=>{const u=n._zod.def,f=Kt(u.left,i,{...l,path:[...l.path,"allOf",0]}),d=Kt(u.right,i,{...l,path:[...l.path,"allOf",1]}),m=g=>"allOf"in g&&Object.keys(g).length===1,p=[...m(f)?f.allOf:[f],...m(d)?d.allOf:[d]];a.allOf=p,i.intersections.push(p)},iN=(n,i,a,l)=>{const u=a,f=n._zod.def;u.type="array";const d=i.target==="draft-2020-12"?"prefixItems":"items",m=i.target==="draft-2020-12"||i.target==="openapi-3.0"?"items":"additionalItems",p=f.items.map((A,k)=>Kt(A,i,{...l,path:[...l.path,d,k]})),g=f.rest?Kt(f.rest,i,{...l,path:[...l.path,m,...i.target==="openapi-3.0"?[f.items.length]:[]]}):null;let b=f.items.length;for(;b>0;){const A=f.items[b-1];if(!(i.io==="input"?Ru(A)!==void 0:A._zod.optout==="optional"))break;b--}const y=f.items.length,w=!f.rest;i.target==="draft-2020-12"?(u.prefixItems=p,w?u.items=!1:g&&(u.items=g),b>0&&(u.minItems=b),w&&(u.maxItems=y)):i.target==="openapi-3.0"?(u.items={anyOf:p},g&&u.items.anyOf.push(g),b>0&&(u.minItems=b),w&&(u.maxItems=y)):(u.items=p,w?u.additionalItems=!1:g&&(u.additionalItems=g),b>0&&(u.minItems=b),w&&(u.maxItems=y));const{minimum:O,maximum:T}=Wi(n);typeof O=="number"&&(u.minItems=O),typeof T=="number"&&(u.maxItems=T)};function rp(n,i,a){if(i.$ref){if(a.has(i))return i;a.add(i);const T=n.get(i)?.def;if(!T)return i;const A=rp(n,T,a);return A===T?i:A}for(const T of["anyOf","oneOf"]){const A=i[T];if(!Array.isArray(A))continue;const k=A.map(L=>rp(n,L,a));k.some((L,D)=>L!==A[D])&&(i={...i,[T]:k})}const l=Array.isArray(i.type)?i.type:[i.type],u=!l.includes("string")&&l.some(T=>T==="number"||T==="integer"),f=i.enum??(i.const!==void 0?[i.const]:void 0);if(!u&&!f?.some(T=>typeof T=="number"))return i;const{minimum:d,maximum:m,exclusiveMinimum:p,exclusiveMaximum:g,multipleOf:b,format:y,id:w,...O}=i;return O.enum?O.enum=O.enum.map(T=>typeof T=="number"?String(T):T):typeof O.const=="number"&&(O.const=String(O.const)),u&&(O.type="string",f||(O.pattern=(l.includes("number")?qp:hE).source)),O}const sp=new WeakMap;function rN(n){const i=new Map;for(const l of n.seen.values())l.def&&!i.has(l.schema)&&i.set(l.schema,l);const a=new Map;for(const l of sp.get(n)??[]){const u=n.seen.get(l),f=(u?.def??u?.schema)?.propertyNames;if(!f||f===!0||a.has(f))continue;const d=rp(i,f,new Set);d!==f&&a.set(f,d)}if(a.size)for(const l of n.seen.values())for(const u of[l.schema,l.def]){const f=u&&a.get(u.propertyNames);f&&(u.propertyNames=f)}}const sN=(n,i,a,l)=>{const u=a,f=n._zod.def;u.type="object";const d=f.keyType,m=Wi(d).patterns;if(f.mode==="loose"&&m&&m.size>0){const b=Kt(f.valueType,i,{...l,path:[...l.path,"patternProperties","*"]});u.patternProperties={};for(const y of m)ta(u.patternProperties,Y1(y).source,b)}else{if(i.target==="draft-07"||i.target==="draft-2020-12"){u.propertyNames=Kt(f.keyType,i,{...l,path:[...l.path,"propertyNames"]});let b=sp.get(i);b||(b=[],sp.set(i,b),i.deferred.push(()=>rN(i))),b.push(n)}u.additionalProperties=Kt(f.valueType,i,{...l,path:[...l.path,"additionalProperties"]})}const p=d._zod.values,g=i.io==="input"&&Ru(f.valueType)!==void 0;if(p&&!f.partial&&!g){const b=[...p].filter(y=>typeof y=="string"||typeof y=="number");b.length>0&&(u.required=b.map(String))}},aN=(n,i,a,l)=>{const u=n._zod.def,f=Kt(u.innerType,i,l),d=i.seen.get(n);i.target==="openapi-3.0"?(d.ref=u.innerType,a.nullable=!0):a.anyOf=[f,{type:"null"}]},lN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType},Kp=Symbol();function F1(n,i,a,l,u){let f=!1;const d=JSON.stringify(n,(m,p)=>typeof p!="bigint"?p:(f=!0,null));return f?(Ws(i,a,l,u,"BigInt defaults cannot be represented in JSON Schema"),Kp):JSON.parse(d)}const oN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType;const d=F1(u.defaultValue,n,i,a,l);d!==Kp&&(a.default=d)},uN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);if(f.ref=u.innerType,i.io!=="input")return;const d=F1(u.defaultValue,n,i,a,l);d!==Kp&&(a._prefault=d)},cN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType;let d;try{d=u.catchValue(void 0)}catch{Ws(n,i,a,l,"Dynamic catch values are not supported in JSON Schema");return}a.default=d},fN=(n,i,a,l)=>{const u=n._zod.def,f=u.in._zod.traits.has("$ZodTransform"),d=i.io==="input"?f?u.out:u.in:u.out;Kt(d,i,l);const m=i.seen.get(n);m.ref=d},dN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType,a.readOnly=!0},Q1=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType},Hb=new WeakSet([Object.prototype,Error.prototype]);function gf(n,i,a){Object.defineProperty(n,i,{configurable:!0,enumerable:!1,get(){const l=a(this);return Object.defineProperty(this,i,{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,i,{value:l,configurable:!0,writable:!0})}})}const hN=(n,i)=>{TT.init(n,i),n.name="ZodError";const a=Object.getPrototypeOf(n);Hb.has(a)||(Hb.add(a),gf(a,"format",l=>u=>NT(l,u)),gf(a,"flatten",l=>u=>OT(l,u)),gf(a,"addIssue",l=>u=>{l.issues.push(u),l.message=JSON.stringify(l.issues,Xm,2)}),gf(a,"addIssues",l=>u=>{l.issues.push(...u),l.message=JSON.stringify(l.issues,Xm,2)}),Object.defineProperty(a,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},tr=F("ZodError",hN,void 0,{Parent:Error}),mN=$p(tr),pN=Lp(tr),gN=Hp(tr),vN=Bp(tr),yN=CT(tr),bN=DT(tr),_N=UT(tr),SN=ZT(tr),xN=$T(tr),wN=LT(tr),zN=HT(tr),TN=BT(tr);function EN(){er.localeError||Br(VO())}function Lu(){er.memoizer||Br({memoizer:HO()})}const Dt=F("ZodType",(n,i)=>(EN(),Ot.init(n,i),n.def=i,n.type=i.type,n),{check(...n){const i=this.def;return this.clone(Di(i,{checks:[...i.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return na(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(TA(n,i))},superRefine(n,i){return this.check(EA(n,i))},overwrite(n){return this.check(fo(n))},optional(){return Ib(this)},exactOptional(){return dA(this)},nullable(){return Pb(this)},nullish(){return Ib(Pb(this))},nonoptional(n){return yA(this,n)},array(){return Jf(this)},or(n){return Xf([this,n])},and(n){return sA(this,n)},transform(n){return Kb(this,fA(n))},default(n){return pA(this,n)},prefault(n){return vA(this,n)},catch(n){return _A(this,n)},pipe(n){return Kb(this,n)},readonly(){return wA(this)},describe(n){const i=this.clone();return xu.add(i,{description:n}),i},meta(...n){if(n.length===0)return xu.get(this);const i=this.clone();return xu.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n,...i){return i.length===0?n(this):n(this,...i)},get"~standard"(){return g1(this,"~standard",{...z1(this),jsonSchema:{input:Zf(this,"input"),output:Zf(this,"output")}})},set"~standard"(n){Xs(this,"~standard",n)},parse:function n(i,a){return mN(this,i,a,{callee:n})},parseAsync:async function n(i,a){return await pN(this,i,a,{callee:n})},safeParse(n,i){return gN(this,n,i)},async safeParseAsync(n,i){return vN(this,n,i)},get spa(){return this?.safeParseAsync},set spa(n){Xs(this,"spa",n)},validate(n,i){return jT(this,n,i)},validateAsync(n,i){return RT(this,n,i)},encode:function n(i,a){return yN(t)DELIM" -R"DELIM(his,i,a,{callee:n})},decode:function n(i,a){return bN(this,i,a,{callee:n})},encodeAsync:async function n(i,a){return await _N(this,i,a,{callee:n})},decodeAsync:async function n(i,a){return await SN(this,i,a,{callee:n})},safeEncode(n,i){return xN(this,n,i)},safeDecode(n,i){return wN(this,n,i)},async safeEncodeAsync(n,i){return zN(this,n,i)},async safeDecodeAsync(n,i){return TN(this,n,i)},toJSONSchema(n){return H2(this,{})(n)},get description(){return xu.get(this)?.description},get _def(){return this._zod.def}}),J1=F("_ZodString",(n,i)=>{Ip.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>I2(n,a,l)},v1({format:n=>Wi(n).format??null,minLength:n=>Wi(n).minimum??null,maxLength:n=>Wi(n).maximum??null},{regex(...n){return this.check(z2(...n))},includes(...n){return this.check(O2(...n))},startsWith(...n){return this.check(N2(...n))},endsWith(...n){return this.check(A2(...n))},min(...n){return this.check(Uf(...n))},max(...n){return this.check(Z1(...n))},length(...n){return this.check($1(...n))},nonempty(...n){return this.check(Uf(1,...n))},lowercase(n){return this.check(T2(n))},uppercase(n){return this.check(E2(n))},trim(){return this.check(j2())},normalize(...n){return this.check(M2(...n))},toLowerCase(){return this.check(k2())},toUpperCase(){return this.check(R2())},slugify(){return this.check(C2())}})),ON=F("ZodString",(n,i)=>{Ip.init(n,i),J1.init(n,i)},{email(n){return this.check(GO(kN,n))},url(n){return this.check(WO(CN,n))},jwt(n){return this.check(m2(FN,n))},emoji(n){return this.check(e2(DN,n))},guid(n){return this.check(YO(RN,n))},uuid(n){return this.check(FO(vf,n))},uuidv4(n){return this.check(QO(vf,n))},uuidv6(n){return this.check(JO(vf,n))},uuidv7(n){return this.check(XO(vf,n))},nanoid(n){return this.check(t2(UN,n))},cuid(n){return this.check(n2(ZN,n))},cuid2(n){return this.check(i2($N,n))},ulid(n){return this.check(r2(LN,n))},base64(n){return this.check(f2(KN,n))},base64url(n){return this.check(d2(GN,n))},xid(n){return this.check(s2(HN,n))},ksuid(n){return this.check(a2(BN,n))},ipv4(n){return this.check(l2(qN,n))},ipv6(n){return this.check(o2(VN,n))},cidrv4(n){return this.check(u2(IN,n))},cidrv6(n){return this.check(c2(PN,n))},e164(n){return this.check(h2(YN,n))},datetime(n){return this.check(p2(NN,n))},date(n){return this.check(g2(AN,n))},time(n){return this.check(v2(MN,n))},duration(n){return this.check(y2(jN,n))}});function ri(n){return KO(ON,n)}const Ht=F("ZodStringFormat",(n,i)=>{Ct.init(n,i),J1.init(n,i)}),NN=F("ZodISODateTime",(n,i)=>{YE.init(n,i),Ht.init(n,i)}),AN=F("ZodISODate",(n,i)=>{FE.init(n,i),Ht.init(n,i)}),MN=F("ZodISOTime",(n,i)=>{QE.init(n,i),Ht.init(n,i)}),jN=F("ZodISODuration",(n,i)=>{JE.init(n,i),Ht.init(n,i)}),kN=F("ZodEmail",(n,i)=>{CE.init(n,i),Ht.init(n,i)}),RN=F("ZodGUID",(n,i)=>{kE.init(n,i),Ht.init(n,i)}),vf=F("ZodUUID",(n,i)=>{RE.init(n,i),Ht.init(n,i)}),CN=F("ZodURL",(n,i)=>{HE.init(n,i),Ht.init(n,i)}),DN=F("ZodEmoji",(n,i)=>{BE.init(n,i),Ht.init(n,i)}),UN=F("ZodNanoID",(n,i)=>{qE.init(n,i),Ht.init(n,i)}),ZN=F("ZodCUID",(n,i)=>{VE.init(n,i),Ht.init(n,i)}),$N=F("ZodCUID2",(n,i)=>{IE.init(n,i),Ht.init(n,i)}),LN=F("ZodULID",(n,i)=>{PE.init(n,i),Ht.init(n,i)}),HN=F("ZodXID",(n,i)=>{KE.init(n,i),Ht.init(n,i)}),BN=F("ZodKSUID",(n,i)=>{GE.init(n,i),Ht.init(n,i)}),qN=F("ZodIPv4",(n,i)=>{XE.init(n,i),Ht.init(n,i)}),VN=F("ZodIPv6",(n,i)=>{eO.init(n,i),Ht.init(n,i)}),IN=F("ZodCIDRv4",(n,i)=>{tO.init(n,i),Ht.init(n,i)}),PN=F("ZodCIDRv6",(n,i)=>{iO.init(n,i),Ht.init(n,i)}),KN=F("ZodBase64",(n,i)=>{rO.init(n,i),Ht.init(n,i)}),GN=F("ZodBase64URL",(n,i)=>{aO.init(n,i),Ht.init(n,i)}),YN=F("ZodE164",(n,i)=>{lO.init(n,i),Ht.init(n,i)}),FN=F("ZodJWT",(n,i)=>{uO.init(n,i),Ht.init(n,i)}),X1=F("ZodNumber",(n,i)=>{M1.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>P2(n,a,l,u),n.isFinite=!0},v1({minValue:n=>{const{minimum:i,exclusiveMinimum:a}=Wi(n);return Math.max(i??Number.NEGATIVE_INFINITY,a??Number.NEGATIVE_INFINITY)},maxValue:n=>{const{maximum:i,exclusiveMaximum:a}=Wi(n);return Math.min(i??Number.POSITIVE_INFINITY,a??Number.POSITIVE_INFINITY)},isInt:n=>{const{isInt:i,multipleOf:a}=Wi(n);return!!i||!!a?.some(Number.isSafeInteger)},format:n=>Wi(n).format??null},{gt(n,i){return this.check(jb(n,i))},gte(n,i){return this.check($m(n,i))},min(n,i){return this.check($m(n,i))},lt(n,i){return this.check(Mb(n,i))},lte(n,i){return this.check(Zm(n,i))},max(n,i){return this.check(Zm(n,i))},int(n){return this.check(Bb(n))},safe(n){return this.check(Bb(n))},positive(n){return this.check(jb(0,n))},nonnegative(n){return this.check($m(0,n))},negative(n){return this.check(Mb(0,n))},nonpositive(n){return this.check(Zm(0,n))},multipleOf(n,i){return this.check(kb(n,i))},step(n,i){return this.check(kb(n,i))},finite(){return this}}));function mn(n){return b2(X1,n)}const QN=F("ZodNumberFormat",(n,i)=>{cO.init(n,i),X1.init(n,i)});function Bb(n){return _2(QN,n)}const JN=F("ZodBoolean",(n,i)=>{fO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>K2(n,a,l)});function dn(n){return S2(JN,n)}const XN=F("ZodUnknown",(n,i)=>{dO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>Y2()});function qb(){return x2(XN)}const WN=F("ZodNever",(n,i)=>{hO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>G2(n,a,l)});function eA(n){return w2(WN,n)}const tA=F("ZodArray",(n,i)=>{Lu(),gO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>W2(n,a,l,u),n.element=i.element},{min(n,i){return this.check(Uf(n,i))},nonempty(n){return this.check(Uf(1,n))},max(n,i){return this.check(Z1(n,i))},length(n,i){return this.check($1(n,i))},unwrap(){return this.element}});function Jf(n,i){return D2(tA,n,i)}const nA=F("ZodObject",(n,i)=>{Lu(),bO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>eN(n,a,l,u),vT(n,"shape",a=>a._zod.def.shape,!1)},{keyof(){return Cu(Object.keys(this._zod.def.shape))},catchall(n){return this.clone(Di(this._zod.def,{catchall:n}))},passthrough(){return this.clone(Di(this._zod.def,{catchall:qb()}))},loose(){return this.clone(Di(this._zod.def,{catchall:qb()}))},strict(){return this.clone(Di(this._zod.def,{catchall:eA()}))},strip(){return this.clone(Di(this._zod.def,{catchall:void 0}))},extend(n){return aT(this,n)},safeExtend(n){return lT(this,n)},merge(n){return oT(this,n)},pick(n){return rT(this,n)},omit(n){return sT(this,n)},partial(...n){return ub(Gp,this,n[0])},exactPartial(...n){return ub(W1,this,n[0],"exactPartial")},required(...n){return uT(eS,this,n[0])}});function vi(n,i){const a={type:"object",shape:n??{},...Te(i)};return new nA(a)}const iA=F("ZodUnion",(n,i)=>{_O.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>tN(n,a,l,u),n.options=i.options});function Xf(n,i){return new iA({type:"union",options:n,...Te(i)})}const rA=F("ZodIntersection",(n,i)=>{SO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>nN(n,a,l,u)});function sA(n,i){return new rA({type:"intersection",left:n,right:i})}const aA=F("ZodTuple",(n,i)=>{Lu(),xO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>iN(n,a,l,u)},{rest(n){return this.clone({...this._zod.def,rest:n})},partial(){const n=this._zod.def;if(n.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...n,items:n.items.map(i=>new Gp({type:"optional",innerType:i}))})}});function lA(n,i,a){const l=i instanceof Ot,u=l?a:i,f=l?i:null;return new aA({type:"tuple",items:n,rest:f,...Te(u)})}const Vb=F("ZodRecord",(n,i)=>{Lu(),wO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>sN(n,a,l,u),n.keyType=i.keyType,n.valueType=i.valueType});function oA(n,i,a){return!i||!i._zod?new Vb({type:"record",keyType:ri(),valueType:n,...Te(i)}):new Vb({type:"record",keyType:n,valueType:i,...Te(a)})}const ap=F("ZodEnum",(n,i)=>{zO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(l,u,f)=>F2(n,l,u),n.enum=i.entries,n.options=[...n._zod.values];const a=new Set(Object.keys(i.entries));n.extract=(l,u)=>{const f={};for(const d of l)if(a.has(d))f[d]=i.entries[d];else throw new Error(`Key ${d} not found in enum`);return new ap({...i,checks:)DELIM" -R"DELIM([],...Te(u),entries:f})},n.exclude=(l,u)=>{const f={...i.entries};for(const d of l)if(a.has(d))delete f[d];else throw new Error(`Key ${d} not found in enum`);return new ap({...i,checks:[],...Te(u),entries:f})}});function Cu(n,i){const a=Array.isArray(n)?Object.fromEntries(n.map(l=>[l,l])):n;return new ap({type:"enum",entries:a,...Te(i)})}const uA=F("ZodLiteral",(n,i)=>{TO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>Q2(n,a,l,u),n.values=new Set(i.values),Object.defineProperty(n,"value",{get(){if(i.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return i.values[0]}})});function Nu(n,i){return new uA({type:"literal",values:Array.isArray(n)?n:[n],...Te(i)})}const cA=F("ZodTransform",(n,i)=>{Lu(),EO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>X2(n,a,l,u),n._zod.parse=(a,l)=>{if(l.direction==="backward")throw new y1(n.constructor.name);a.addIssue=f=>{if(typeof f=="string")a.issues.push(ku(f,a.value,i));else{const d=f;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),"input"in d||(d.input=a.value),d.inst??(d.inst=n),a.issues.push(ku(d))}};const u=i.transform(a.value,a);return u instanceof Promise?u.then(f=>(a.value=f,a)):(a.value=u,a)}});function fA(n){return new cA({type:"transform",transform:n})}const Gp=F("ZodOptional",(n,i)=>{R1.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>Q1(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function Ib(n){return new Gp({type:"optional",innerType:n})}const W1=F("ZodExactOptional",(n,i)=>{OO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>Q1(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function dA(n){return new W1({type:"optional",innerType:n})}const hA=F("ZodNullable",(n,i)=>{NO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>aN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function Pb(n){return new hA({type:"nullable",innerType:n})}const mA=F("ZodDefault",(n,i)=>{AO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>oN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function pA(n,i){return new mA({type:"default",innerType:n,get defaultValue(){return typeof i=="function"?i():d1(i)}})}const gA=F("ZodPrefault",(n,i)=>{MO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>uN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function vA(n,i){return new gA({type:"prefault",innerType:n,get defaultValue(){return typeof i=="function"?i():d1(i)}})}const eS=F("ZodNonOptional",(n,i)=>{jO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>lN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function yA(n,i){return new eS({type:"nonoptional",innerType:n,...Te(i)})}const bA=F("ZodCatch",(n,i)=>{kO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>cN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function _A(n,i){return new bA({type:"catch",innerType:n,catchValue:typeof i=="function"?i:bT(i)})}const SA=F("ZodPipe",(n,i)=>{RO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>fN(n,a,l,u),n.in=i.in,n.out=i.out});function Kb(n,i){return new SA({type:"pipe",in:n,out:i})}const xA=F("ZodReadonly",(n,i)=>{CO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>dN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function wA(n){return new xA({type:"readonly",innerType:n})}const zA=F("ZodCustom",(n,i)=>{DO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>J2(n,a,l,u)});function TA(n,i={}){return U2(zA,n,i)}function EA(n,i){return Z2(n,i)}const Hu=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],$f=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],tS=mn().int().nonnegative().max(864e13),OA=vi({level:mn().int().nonnegative(),time:tS,message:ri()}),NA=vi({event:mn().int().nonnegative(),value:mn().nonnegative(),time:tS}),AA=vi({previous:mn().nonnegative()});Xf([OA,NA,AA]);const Yp=2**Hu.length-1,eo=Yp,MA=2**0+2**1+2**2+2**6+2**7;function jA(n,i){return Number.isInteger(i)&&i>=0&&i0?`${String(a)}d ${String(l)}h`:l>0?`${String(l)}h ${String(u)}m`:u>0?`${String(u)}m ${String(f)}s`:`${String(f)}s`}function iS(n,i){switch(ho(n).valueKind){case"height":return`height ${Tn(i)}`;case"seconds":return`${Ya(i)} s`;case"milliseconds":return`${Ya(i)} ms`;case"microseconds":return`${Ya(i)} µs`;case"count":return Tn(i);case"fee-rate":return`${Ya(i/1e3,3)} sat/vB`;default:return String(i)}}function $A(n){return n>=100?`${Ya(n,0)}/s`:n>=10?`${Ya(n,1)}/s`:`${Ya(n,2)}/s`}const Lf=32,LA=[{value:"all",label:"All categories"},{value:"headers",label:"Headers"},{value:"blocks",label:"Blocks"},{value:"transactions",label:"Transactions"},{value:"chain",label:"Confirmed chain"},{value:"mining",label:"Mining"},{value:"timing",label:"Timing"}],HA={headers:"bg-violet-500/15 text-violet-300",blocks:"bg-accent/15 text-accent",transactions:"bg-sky-500/15 text-sky-300",chain:"bg-emerald-500/15 text-emerald-300",mining:"bg-amber-500/15 text-amber-300",timing:"bg-cyan-500/15 text-cyan-300"};function BA({metrics:n,paused:i,onPausedChange:a,onClear:l}){const[u,f]=se.useState(""),[d,m]=se.useState("all"),[p,g]=se.useState({offset:0,search:u,category:d}),b=p.search===u&&p.category===d?p.offset:0,y=se.useRef(null),w=se.useSyncExternalStore(n.subscribeEvents,n.getEventWindow,n.getEventWindow);return se.useEffect(()=>{n.setEventQuery({search:u,category:d,offset:b})},[n,u,d,b]),se.useEffect(()=>{y.current&&(y.current.scrollTop=0)},[u,d]),x.jsxs("section",{className:"space-y-4",children:[x.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node lifecycle"}),x.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Live events"}),x.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"Heights are event payloads; timing values retain their source units."}),x.jsx("p",{className:"text-textMuted mt-1 text-xs",children:"Pause freezes this view; collection and charts continue."})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("button",{type:"button",onClick:()=>{i&&(y.current&&(y.current.scrollTop=0),g({offset:0,search:u,category:d})),a(!i)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:i?"Resume display":"Pause display"}),x.jsx("button",{type:"button",onClick:l,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[x.jsxs("label",{className:"min-w-56 flex-1",children:[x.jsx("span",{className:"sr-only",children:"Search events"}),x.jsx("input",{type:"search",value:u,onChange:O=>{f(O.target.value)},placeholder:"Search event names or values…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),x.jsxs("label",{children:[x.jsx("span",{className:"sr-only",children:"Filter event category"}),x.jsx("select",{value:d,onChange:O=>{m(O.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent rounded-md border px-3 py-2 text-sm focus:ring-0",children:LA.map(O=>x.jsx("option",{value:O.value,children:O.label},O.value))})]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[x.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[x.jsx("span",{children:i?"Display paused · collection continues":b>0?"Viewing older rows · collection continues":"Live stream · newest first"}),x.jsxs("span",{children:[String(w.matched)," matching · ",String(w.retained)," retained"]})]}),x.jsx("div",{ref:y,role:"region","aria-label":"Scrollable event history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:O=>{g({offset:Math.max(0,Math.floor(O.currentTarget.scrollTop/Lf)-8),search:u,category:d})},children:w.matched===0?x.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching events."}):x.jsx("ol",{"aria-label":"Received events",className:"relative min-w-[32rem]",style:{height:w.matched*Lf},children:w.events.map((O,T)=>x.jsx(qA,{event:O,index:w.offset+T,total:w.matched},O.id))})})]}),!i&&x.jsx("div",{className:"flex justify-end text-xs",children:x.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{y.current&&(y.current.scrollTop=0),g({offset:0,search:u,category:d})},children:"Jump to latest"})}),x.jsxs("details",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[x.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-4 py-3 text-sm",children:["Event contract (",String($f.length)," identifiers)"]}),x.jsx("div",{className:"border-accentSecondary/20 grid gap-2 border-t p-4 sm:grid-cols-2 lg:grid-cols-3",children:$f.map(O=>x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-textMuted font-mono",children:String(O.id).padStart(2,"0")}),x.jsx("span",{className:"text-textPrimary ml-2",children:O.name})]},O.id))})]})]})}const qA=se.memo(function({event:i,index:a,total:l}){const u=ho(i.event);return x.jsxs("li",{"aria-setsize":l,"aria-posinset":a+1,className:"border-accentSecondary/20 absolute inset-x-0 grid grid-cols-[8.5rem_10rem_minmax(0,1fr)] items-center gap-2 border-b px-4 text-xs",style:{top:a*Lf,height:Lf},children:[x.jsx("time",{dateTime:Fp(i.time),className:"text-textMuted font-mono tabular-nums",children:Du(i.time)}),x.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${HA[u.category]}`,children:u.name}),x.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:iS(i.event,i.value)})]})}),Hf=32,Gb={0:"bg-sky-500/15 text-sky-300",1:"bg-emerald-500/15 text-emerald-300",2:"bg-violet-500/15 text-violet-300",3:"bg-cyan-500/15 text-cyan-300",4:"bg-indigo-500/15 text-indigo-300",5:"bg-blue-500/15 text-blue-300",6:"bg-red-500/20 text-red-300",7:"bg-orange-500/20 text-orange-300",8:"bg-slate-500/20 text-slate-300",9:"bg-zinc-500/20 text-zinc-300"};function VA({metrics:n,delivery:i,status:a,logFilter:l,paused:u,onLogFilterChange:f,onPausedChange:d,onClear:m}){const[p,g]=se.useState(""),[b,y]=se.useState({offset:0,search:p,filter:l}),w=b.search===p&&b.filter===l?b.offset:0,[O,T]=se.useState(null),A=se.useRef(null),k=se.useSyncExternalStore(n.subscribeLogs,n.getLogWindow,n.getLogWindow);return se.useEffect(()=>{n.setLogQuery({search:p,filter:l,offset:w})},[n,p,l,w]),se.useEffect(()=>{A.current&&(A.current.scrollTop=0)},[p,l]),x.jsxs("section",{className:"space-y-4",children:[x.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Diagnostic stream"}),x.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Node logs"}),x.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"The newest 1,000 messages are retained in this browser session."})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("button",{type:"button",onClick:()=>{u&&(A.current&&(A.current.scrollTop=0),y({offset:0,search:p,filter:l})),d(!u)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:u?"Resume display":"Pause display"}),x.jsx("button",{type:"button",onClick:m,className:"border-accent/40 text-accent hover:border-accent hover:text)DELIM" -R"DELIM(-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),x.jsxs("fieldset",{className:"border-accent/30 bg-surface/80 space-y-3 rounded-2xl border p-4",children:[x.jsx("legend",{className:"text-textPrimary px-1 text-sm font-medium",children:"Requested log levels"}),x.jsx("p",{className:"text-textMuted text-xs",children:"Only checked levels are sent by the server. Pause freezes this view; collection and charts continue. Skipped log levels are not replayed."}),x.jsx("div",{className:"flex flex-wrap gap-x-5 gap-y-3",children:Hu.map(L=>x.jsxs("label",{className:"text-textPrimary flex items-center gap-2 text-sm",children:[x.jsx("input",{type:"checkbox",checked:jA(l,L.id),onChange:()=>{f(l^1<{f(MA)},className:"text-accent hover:underline",children:"Operational levels"}),x.jsx("button",{type:"button",onClick:()=>{f(Yp)},className:"text-accent hover:underline",children:"All levels"}),x.jsx("button",{type:"button",onClick:()=>{f(0)},className:"text-accent hover:underline",children:"No levels"}),x.jsx("span",{className:"text-textMuted",children:"Selection is saved in this browser."})]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 space-y-2 rounded-2xl border p-4 text-xs",children:[x.jsx("dl",{"aria-label":"Log delivery statistics",className:"flex flex-wrap gap-x-6 gap-y-2",children:[["Received logs",i.totalLogs],["Rolled out of history",i.evictedLogs],["Cleared from history",i.clearedLogs],["Invalid admin frames",i.invalidFrames],["Reconnects",a.reconnects]].map(([L,D])=>x.jsxs("div",{children:[x.jsx("dt",{className:"text-textMuted",children:L}),x.jsx("dd",{className:"text-textPrimary mt-1 font-mono tabular-nums",children:D.toLocaleString()})]},L))}),x.jsx("p",{className:"text-textMuted",children:"Live rows refresh every 100 ms and can skip intermediate messages on screen. Every valid log at a requested level is counted; older messages leave the 1,000-message history as new ones arrive. These counters continue while display is paused. Reconnects can leave gaps that the server does not replay."}),x.jsxs("p",{className:"text-textMuted",role:"status",children:["Admin connection: ",a.phase,a.error?` · ${a.error}`:""]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[x.jsxs("label",{className:"min-w-56 flex-1",children:[x.jsx("span",{className:"sr-only",children:"Search logs"}),x.jsx("input",{type:"search",value:p,onChange:L=>{g(L.target.value)},placeholder:"Search received messages…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),x.jsx("p",{className:"text-textMuted self-center text-xs",children:"Search filters received messages only."})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[x.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[x.jsx("span",{children:u?"Display paused · collection continues":l===0?"Log delivery disabled":w>0?"Viewing older rows · collection continues":"Live stream · newest first"}),x.jsxs("span",{children:[String(k.matched)," matching · ",String(k.retained)," retained"]})]}),x.jsx("div",{ref:A,role:"region","aria-label":"Scrollable log history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:L=>{y({offset:Math.max(0,Math.floor(L.currentTarget.scrollTop/Hf)-8),search:p,filter:l})},children:k.matched===0?x.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching log messages."}):x.jsx("ol",{"aria-label":"Received logs",className:"relative",style:{height:k.matched*Hf},children:k.logs.map((L,D)=>x.jsx(IA,{log:L,index:k.offset+D,total:k.matched,onSelect:T},L.id))})})]}),x.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[x.jsx("p",{className:"text-textMuted",children:"Select a row to read its full message."}),!u&&x.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{A.current&&(A.current.scrollTop=0),y({offset:0,search:p,filter:l})},children:"Jump to latest"})]}),O&&x.jsx(PA,{log:O,onClose:()=>{T(null)}})]})}const IA=se.memo(function({log:i,index:a,total:l,onSelect:u}){return x.jsx("li",{"aria-setsize":l,"aria-posinset":a+1,className:"border-accentSecondary/20 absolute inset-x-0 border-b",style:{top:a*Hf,height:Hf},children:x.jsxs("button",{type:"button",onClick:()=>{u(i)},className:"hover:bg-accentSecondary/10 focus-visible:bg-accentSecondary/20 grid h-full w-full grid-cols-[5.5rem_4.5rem_minmax(0,1fr)] items-center gap-2 px-4 text-left text-xs sm:grid-cols-[7.5rem_7.5rem_minmax(0,1fr)]",children:[x.jsx("time",{dateTime:Fp(i.time),className:"text-textMuted font-mono tabular-nums",children:Du(i.time,!1)}),x.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${Gb[i.level]??Gb[8]}`,children:nS(i.level).name}),x.jsx("span",{className:"text-textPrimary min-w-0 truncate font-mono",children:i.message.replaceAll(` -`," ↵ ")})]})})});function PA({log:n,onClose:i}){const a=se.useRef(null);return se.useEffect(()=>{const l=a.current;return l?.showModal(),()=>{l?.close()}},[]),x.jsxs("dialog",{ref:a,onClose:i,"aria-labelledby":"log-detail-title",className:"border-accent/30 bg-surface/95 text-textPrimary fixed inset-0 m-auto max-h-[80vh] w-[min(60rem,90vw)] rounded-2xl border p-5 shadow-xl backdrop:bg-black/60",children:[x.jsxs("header",{className:"mb-4 flex items-center justify-between gap-4",children:[x.jsxs("h3",{id:"log-detail-title",className:"text-accent text-lg font-semibold",children:[nS(n.level).label," · ",Fp(n.time)??"Invalid time"]}),x.jsx("button",{type:"button",onClick:i,className:"text-accent rounded px-3 py-2",children:"Close"})]}),x.jsx("pre",{className:"text-sm break-words whitespace-pre-wrap",children:n.message})]})}function lp(){return globalThis.window?.location.origin??"http://localhost"}function Bf(n){const i=n.trim();if(!i)throw new Error("Endpoint URL is required");const a=/^[a-z][a-z\d+\-.]*:\/\//iu.test(i)?i:`http://${i}`,l=new URL(a);if(l.protocol!=="http:"&&l.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return l.pathname=l.pathname.replace(/\/+$/u,"")||"/",l.search="",l.hash="",l.toString().replace(/\/$/u,"")}function KA(n){const i=new URL(Bf(n));return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.pathname="/",i.search="",i.hash="",i.toString()}function GA(n,i=lp()){return new URL(Bf(n)).origin===new URL(i).origin}function YA(){try{globalThis.localStorage.removeItem("libbitcoinAdminDashboardEndpoints")}catch{}return{adminUrl:Bf(lp()),nativeUrl:Bf(lp())}}const FA=vi({store:vi({address:dn(),filter:dn(),silent:mn().int().nonnegative().nullable(),turbo:dn(),witness:dn(),pruned:mn().int().nonnegative()}),node:vi({network:ri(),limited:dn().optional(),blocks:dn().optional(),witness:dn().optional(),filters:dn().optional(),privacy:dn().optional(),fees:dn().optional()}),wallet:vi({p2kh:mn().int(),p2sh:mn().int(),wif:mn().int(),witness:ri(),silent:ri(),hd_private:mn().int(),hd_public:mn().int()}).optional(),network:vi({relay:dn(),alert:dn(),reject:dn(),compact:dn(),address:dn(),witness_tx:dn(),memory_pool:dn(),not_found:dn(),protocol_maximum:mn().int(),protocol_minimum:mn().int()}).optional(),forks:oA(ri(),dn()).transform(n=>Object.keys(n).filter(i=>n[i]))}),QA=vi({height:mn().int().nonnegative(),timestamp:mn().int().positive().max(4294967295)}),yf=mn().int().nonnegative().max(Number.MAX_SAFE_INTEGER),JA=vi({count:yf,virtual:yf,fee:yf,histogram:Jf(lA([mn().nonnegative(),yf]))}),XA="/v1/fees?format=json",WA=5e3,Uu=15e3,e3=mn().int().non)DELIM" -R"DELIM(negative();function Of(n,i){return new URL(i,`${n.replace(/\/+$/u,"")}/`).toString()}async function Nf(n,i){const a=await fetch(n,{headers:{Accept:"application/json"},signal:i});if(!a.ok)throw new Error(`Native API request failed with status ${String(a.status)}`);return await a.json()}async function t3(n,i){const[a,l]=await Promise.all([Nf(Of(n,"/v1/configuration?format=json"),i),Nf(Of(n,"/v1/top?format=json"),i)]),u=FA.parse(a),f=e3.parse(l),d=Date.now();let m=null;try{const p=QA.parse(await Nf(Of(n,n3(f)),i));p.height===f&&(m=p)}catch{i?.throwIfAborted()}return{configuration:u,top:f,topHeader:m,receivedAt:d}}function n3(n){return`/v1/block/height/${String(n)}/header?format=json`}async function i3(n,i){return{data:JA.parse(await Nf(Of(n,XA),i)),receivedAt:Date.now()}}const Lm=["line","area","bar"],Yb=["line","step","area"],r3=["line","step","area"],rS={"occurrence-count":{id:"occurrence-count",label:"Occurrences per bucket",description:"Number of frames observed in each one-second bucket.",unit:"occurrences",chartTypes:Lm},"occurrence-rate":{id:"occurrence-rate",label:"Occurrence rate",description:"Frames observed per second.",unit:"occurrences-per-second",chartTypes:Lm},"cumulative-occurrences":{id:"cumulative-occurrences",label:"Cumulative occurrences",description:"Running number of frames observed during this browser session.",unit:"occurrences",chartTypes:Yb},"payload-latest":{id:"payload-latest",label:"Latest value",description:"Most recently observed payload value.",unit:"count",chartTypes:r3},"payload-average":{id:"payload-average",label:"Average value",description:"Average payload value within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-minimum":{id:"payload-minimum",label:"Minimum value",description:"Minimum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-maximum":{id:"payload-maximum",label:"Maximum value",description:"Maximum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-sum":{id:"payload-sum",label:"Value per bucket",description:"Sum of count payloads within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-cumulative":{id:"payload-cumulative",label:"Cumulative value",description:"Running sum of count payloads during this browser session.",unit:"count",chartTypes:Yb},"payload-change-rate":{id:"payload-change-rate",label:"Height change rate",description:"Change in the latest observed height per second.",unit:"height-per-second",chartTypes:Lm}},Wa=["occurrence-rate","occurrence-count","cumulative-occurrences"],s3=["payload-latest","payload-maximum","payload-change-rate",...Wa],a3=["payload-average","payload-latest","payload-minimum","payload-maximum",...Wa],l3=["payload-sum","payload-cumulative","payload-latest","payload-average",...Wa],sS=["payload-latest","payload-average","payload-minimum","payload-maximum"],aS=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function Ui(n){return`event:${String(n)}`}function Gs(n){return`log:${String(n)}`}const qf="native:top";function o3(n){switch(n){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function u3(n){switch(n){case"height":return s3;case"duration":return a3;case"count":return l3;case"fee-rate":return[...sS,...Wa];default:return Wa}}function c3(n){switch(n){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function lS(n){const i=ho(n),a=o3(i.valueKind);return{id:Ui(n),source:"event",sourceId:n,name:i.name,label:i.label,category:i.category,payloadKind:a,allowedMeasures:u3(a),defaultMeasure:c3(a),description:n===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":a==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${i.label} event with a ${a} payload.`}}const f3=[...aS.map(n=>({id:n.id,source:"pool",sourceId:n.field,name:n.field,label:n.label,category:"pool",payloadKind:n.payloadKind,allowedMeasures:sS,defaultMeasure:"payload-latest",description:n.description})),...$f.map(n=>lS(n.id)),...Hu.map(n=>({id:Gs(n.id),source:"log",sourceId:n.id,name:n.name,label:`${n.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:Wa,defaultMeasure:"occurrence-rate",description:`${n.label} log message volume. Message text is not interpreted as numeric data.`})),{id:qf,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}],Qp=f3,d3=new Map(Qp.map(n=>[n.id,n]));function cs(n){const i=d3.get(n);if(i)return i;const a=/^event:(\d+)$/u.exec(n);return a?lS(Number(a[1])):{id:n,source:"event",sourceId:-1,name:n,label:n,category:"unknown",payloadKind:"unknown",allowedMeasures:Wa,defaultMeasure:"occurrence-rate",description:"Unknown signal; only occurrence measurements are available."}}function Fs(n,i){const a=rS[i];if(i.startsWith("occurrence")||i==="cumulative-occurrences")return a;const l=i==="payload-change-rate"?"height-per-second":n.payloadKind==="height"?"height":n.payloadKind==="duration"?"milliseconds":n.payloadKind==="fee-rate"?"sat-per-vbyte":n.payloadKind==="transactions"||n.payloadKind==="vbytes"||n.payloadKind==="satoshis"?n.payloadKind:"count";return{...a,unit:l}}function h3(n,i){return n.allowedMeasures.includes(i)}function m3(n,i){return ho(n).valueKind==="fee-rate"?i/1e3:DA(n,i)??i}const p3=3600*1e3,g3=1e3,v3=1e3,y3=1e3;class Fb{constructor(i){this.capacity=i,this.#e=Array.from({length:i})}capacity;#e;#t=0;#n=0;#i=null;get size(){return this.#n}push(i){const a=this.#n===this.capacity;return this.#i=null,this.#e[this.#t]=i,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity),a}clear(){this.#i=null,this.#e.fill(void 0),this.#t=0,this.#n=0}newestFirst(){if(this.#i)return this.#i;const i=[];for(let a=0;athis.#k;getRecentLogs=()=>this.#i.newestFirst();getRecentEvents=()=>this.#s.newestFirst();subscribe=i=>(this.#n.add(i),()=>{this.#n.delete(i)});start(){this.#O||(this.tick(),this.#O=setInterval(()=>{this.tick()},1e3))}stop(){this.#O&&(clearInterval(this.#O),this.#O=null),this.#d&&(clearTimeout(this.#d),this.#d=null)}ingest(i,a=this.#e()){const l=this.#N(a);this.#_+=1,kA(i)?this.#U(i,l):RA(i)?this.#j(i,l):CA(i)&&(this.#v+=1),this.#C()}recordInvalidFrame(){this.#w+=1,this.#C()}recordNativeTop(i,a=this.#e()){const l=this.#N(a),u=this.#a[qf];u?.value===i&&l-u.time<15e3||(this.#R(qf,l,i),this.#D(l),this.#C())}recordNativeFees(i,a=this.#e()){if(!Number.isFinite(a)||a=Uu||this.#M!==null&&a<=this.#M.receivedAt)return;const l=this.#N(a);this.#M={data:i,receivedAt:a};for(const u of aS)this.#R(u.id,l,i[u.field]);this.#D(l),this.#C()}clearLogs(){this.#E+=this.#i.size,this.#i.clear(),this.flush()}clearEvents(){this.#s.clear(),this.flush()}reset(){this.#i.clear(),this.#s.clear(),this.#r.clear(),this.#l={},this.#f={},this.#u={},this.#o={},this.#b={},this.#a={},this.#g={},this.#c=this.#N(this.#e()),this.#_=0,this.#m=0,this.#S=0,this.#E=0,this.#x=0,this.#v=0,this.#w=0,this.#p=null,this.#A=null,this.#M=null,this.#T=0,this.#z(this.#c),this.flush()}tick(){const i=this.#N(this.#e());this.#z(i),this.#D(i),this.#C()}flush(){this.#d&&(clearTimeout(this.#d),this.#d=null),this.#k=this.#Z();for(const i of this.#n)i()}#U(i,a){this.#m+=1,this.#p=a,this.#T+=1,this.#i.push({...i,id:this.#T,receivedAt:a})&&(this.#S+=1),this.#R(Gs(i.level),a,null)}#j(i,a){this.#x+=1,this.#A=a,this.#T+=1,this.#s.push({...i,id:this.#T,receivedAt:a}),this.#R(Ui(i.event),a,m3(i.event,i.value))}#N(i){return Number.isFinite(i)?(this.#h=Math.max(this.#h,i),this.#h):this.#h}#R(i,a,l){const u=this.#z(a);u.snapshot=null;const f=u.signals.get(i)??b3();if(f.count+=1,bf(this.#o,i,1),l!==null){f.samples+=1,f.sum+=l,f.minimum=f.minimum===null?l:Math.min(f.minimum,l),f.maximum=f.maximum===null?l:Math.max(f.maximum,l),(f.firstAt===null||a=f.lastAt)&&(f.last=l,f.lastAt=a),bf(this.#b,i,l);const d=this.#a[i];(!d||a>=d.time)&&(this.#a[i]={value:l,time:a}),this.#g[i]=Math.max(this.#g[i]??l,l)}u.signals.set(i,f)}#z(i){const a=Math.floor(i/1e3)*1e3,l=this.#r.get(a);if(l)return l;const u={time:a,signals:new Map,snapshot:null};return this.#r.set(a,u),u}#D(i){const a=i-p3;for(const[l,u]of this.#r){if(l>=a)break;for(const[f,d]of u.signals)if(bf(this.#l,f,d.count),bf(this.#f,f,d.sum),d.last!==null&&d.lastAt!==null){const m=this.#u[f];(!m||d.lastAt>=m.time)&&(this.#u[f]={value:d.last,time:d.lastAt})}this.#r.delete(l)}}#C(){!this.#t||this.#d||(this.#d=setTimeout(()=>{this.#d=null,this.flush()},g3))}#Z(){const i=[...this.#r.values()].map(a=>(a.snapshot??={time:a.time,signals:Object.fromEntries([...a.signals].map(([l,u])=>[l,{...u}]))},a.snapshot));return{now:this.#N(this.#e()),sessionStartedAt:this.#c,totalFrames:this.#_,totalLogs:this.#m,evictedLogs:this.#S,clearedLogs:this.#E,totalEvents:this.#x,totalAcks:this.#v,invalidFrames:this.#w,buckets:i,priorSignalCounts:{...this.#l},priorSignalSums:{...this.#f},priorSignalLatest:Qb(this.#u),signalTotals:{...this.#o},signalSums:{...this.#b},signalLatest:Qb(this.#a),signalMaximums:{...this.#g},recentLogs:this.#i.newestFirst(),recentEvents:this.#s.newestFirst(),lastLogAt:this.#p,lastEventAt:this.#A,poolSnapshot:this.#M}}}function _3(n,i,a,l,u=n[0]?.time??a){const f=a-l*1e3,d=f<=u,m=d?Math.floor(u/1e3)*1e3:Math.ceil(f/1e3)*1e3,p=d?u:m,g=Math.floor(a/1e3)*1e3,y=n.filter(O=>O.time>=m&&O.time<=g).reduce((O,T)=>O+(T.signals[i]?.count??0),0),w=Math.max(0,(a-p)/1e3);return w>0?y/w:0}function S3(n,i){const a=d=>_3(n.buckets,Ui(d),n.now,i,n.sessionStartedAt),l=a(2)+a(14);if(l>0)return{label:"Reorganizing",rate:l};const f=[{label:"Confirming blocks",rate:a(6)},{label:"Validating blocks",rate:a(5)},{label:"Archiving blocks",rate:a(3)},{label:"Synchronizing headers",rate:Math.max(a(0),a(1))}].reduce((d,m)=>m.rate>d.rate?m:d);return f.rate>0?f:{label:"Idle",rate:0}}const Wf=18,x3=600*1e3;function w3(n,i,a){if(n===null||!Number.isSafeInteger(n)||n<0||i===null||!Number.isSafeInteger(i.height)||i.height<0||i.height>n||!Number.isFinite(i.timestamp)||i.timestamp<=0||!Number.isFinite(a)||a<0)return null;const l=Math.max(0,a-i.timestamp*1e3),u=Math.max(n,i.height+Math.ceil(l/x3));return{blocksRemaining:u-n,estimatedTop:u,progress:u===0?100:n/u*100}}function _f({label:n,value:i,detail:a,numeric:l=!0,emphasized:u=!1}){return x.jsxs("div",{className:"border-accent/30 bg-surface/80 min-w-0 space-y-2 rounded-2xl border p-5",children:[x.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),x.jsx("dd",{className:`text-2xl font-semibold break-words ${l?"tabular-nums":""} ${u?"text-accent":"text-textPrimary"}`,children:i}),x.jsx("dd",{className:"text-textMuted text-sm break-words",children:a})]})}function z3({confirmed:n,estimate:i}){if(n===null||i===null||i.blocksRemaining<=Wf)return null;const a=Math.min(99.99,Math.max(0,i.progress)),l=`${a.toFixed(2)}%`;return x.jsxs("section",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border","aria-labelledby":"node-sync-progress-title",children:[x.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3 px-5 pt-5",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node synchronization"}),x.jsx("h2",{id:"node-sync-progress-title",className:"text-accent mt-1 text-lg font-semibold",children:"Catching up to top candidate header"})]}),x.jsx("p",{className:"text-accent text-2xl font-semibold tabular-nums",children:l})]}),x.jsx("div",{className:"px-5 pt-4",children:x.jsx("div",{role:"progressbar","aria-label":"Node synchronization progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number(a.toFixed(2)),"aria-valuetext":`Approximately ${Tn(i.blocksRemaining)} blocks remaining`,className:"bg-background border-accentSecondary/20 h-3 overflow-hidden rounded-full border",children:x.jsx("div",{className:"bg-accent h-full rounded-full transition-[width] duration-700",style:{width:`${String(a)}%`}})})}),x.jsxs("dl",{className:"bg-accentSecondary/10 mt-5 grid gap-px text-sm sm:grid-cols-3",children:[x.jsx(Hm,{label:"Top confirmed block",value:Tn(n)}),x.jsx(Hm,{label:"Top candidate header",value:Tn(i.estimatedTop)}),x.jsx(Hm,{label:"Estimated blocks remaining",value:Tn(i.blocksRemaining)})]}),x.jsx("p",{className:"bg-surface text-textMuted border-accentSecondary/20 border-t px-5 py-2 text-[11px]",children:"Estimated from the confirmed block timestamp and your browser clock, assuming one block every 10 minutes. Actual block counts may differ."})]})}function Hm({label:n,value:i}){return x.jsxs("div",{className:"bg-surface px-5 py-3",children:[x.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),x.jsx("dd",{className:"text-textPrimary mt-1 text-lg font-semibold tabular-nums",children:i})]})}const Xl=16,op=8,ed=80,T3=[300,900,3600],up=["line","step","area","bar"],oS=["linear","compressed"],Rt=["#ffa022","#38bdf8","#34d399","#c084fc","#fb7185","#e879f9","#facc15","#60a5fa"],E3=Cu(["occurrence-count","occurrence-rate","cumulative-occurrences","payload-latest","payload-average","payload-minimum","payload-maximum","payload-sum","payload-cumulative","payload-change-rate"]),O3=vi({id:ri().min(1).max(100),signalId:ri().min(1).max(100),measure:E3,color:ri().regex(/^#[\da-f]{6}$/iu),label:ri().max(80).optional()}).strict(),N3=vi({id:ri().min(1).max(100),title:ri().trim().min(1).max(ed),visualization:Cu(up),scale:Cu(oS).default("linear"),range:Xf([Nu(300),Nu(900),Nu(3600)]),series:Jf(O3).min(1).max(op)}).strict(),A3=vi({id:ri().min(1).max(100),title:ri().trim().min(1).max(ed),visualization:Nu("histogram"),scale:Cu(oS).default("linear"),color:ri().regex(/^#[\da-f]{6}$/iu)}).strict(),uS=Xf([N3,A3]),M3=vi({version:Nu(1),charts:Jf(uS).max(Xl)}).strict();function ln(n){return n.visualization!=="histogram"}const Jp={id:"default-sync-pipeline",title:"Sync pipeline",visualization:"line",scale:"linear",range:900,series:[En("sync-header",Ui(0),"occurrence-rate",Rt[3]),En("sync-archive",Ui(3),"occurrence-rate",Rt[0]),En("sync-validate",Ui(5),"occurrence-rate",Rt[1]),En("sync-confirm",Ui(6),"occurrence-rate",Rt[2])]},cS={id:"default-chain-progress",title:"Chain progress",visualization:"step",scale:"linear",range:900,series:[En("progress-top",qf,"payload-latest",Rt[0]),En("progress-organized",Ui(13),"payload-latest",Rt[2]),En("progress-confirmed",Ui(6),"payload-latest",Rt[1])]},fS={id:"default-log-volume",title:"Lo)DELIM" -R"DELIM(g volume",visualization:"bar",scale:"linear",range:900,series:[En("logs-news",Gs(1),"occurrence-rate",Rt[2]),En("logs-session",Gs(2),"occurrence-rate",Rt[3]),En("logs-protocol",Gs(3),"occurrence-rate",Rt[1]),En("logs-remote",Gs(5),"occurrence-rate",Rt[7]),En("logs-fault",Gs(6),"occurrence-rate",Rt[4]),En("logs-quitting",Gs(7),"occurrence-rate",Rt[0])]},td={id:"default-pool-transactions",title:"Pool transactions",visualization:"step",scale:"linear",range:900,series:[En("pool-count","pool:count","payload-latest",Rt[0])]},dS={...td,id:"default-pool-fees",title:"Pool total fees",series:[En("pool-fees","pool:total_fee","payload-latest",Rt[3])]},hS={...td,id:"default-pool-virtual-size",title:"Pool virtual size",series:[En("pool-size","pool:vsize","payload-latest",Rt[1])]},Xb={id:"default-transaction-archive-rate",title:"Transactions archived / second",visualization:"line",scale:"linear",range:900,series:[En("tx-archived",Ui(10),"occurrence-rate",Rt[2])]},mS={id:"default-pool-fee-histogram",title:"Pool fee distribution",visualization:"histogram",scale:"linear",color:Rt[0]},pS=[{id:"pool-fee-histogram",label:"Pool fee distribution",description:"Current pool virtual size grouped by fee rate.",chart:mS},{id:"sync-pipeline",label:"Sync pipeline",description:"Header and block lifecycle throughput.",chart:Jp},{id:"chain-progress",label:"Chain progress",description:"Canonical, organized, and confirmed heights.",chart:cS},{id:"log-volume",label:"Log volume",description:"Message rates grouped by log level.",chart:fS},{id:"pool-transactions",label:"Pool transactions",description:"Current pool transaction count, sampled every five seconds.",chart:td},{id:"transaction-archive-rate",label:"Transaction archive rate",description:"Newly archived transactions per second, including compact-block recovery.",chart:Xb},{id:"pool-virtual-size",label:"Pool virtual size",description:"Current pool virtual size in vbytes.",chart:hS},{id:"pool-fees",label:"Pool total fees",description:"Total fees currently in the pool, in satoshis.",chart:dS},{id:"transaction-fee-rate",label:"Archived transaction fee rate",description:"Average fee rate of newly archived transactions, in sat/vB.",chart:{...Xb,id:"template-tx-fees",title:"Archived transaction fee rate",series:[En("tx-fee-rate",Ui(10),"payload-average",Rt[0])]}}],gS="libbitcoinAdminDashboardCharts";let Wb=0;function En(n,i,a,l){return{id:n,signalId:i,measure:a,color:l}}function Au(n){return Wb+=1,`${n}-${Date.now().toString(36)}-${String(Wb)}`}function Xp(n,i=!1){return ln(n)?{...n,id:i?Au("chart"):n.id,series:n.series.map(a=>({...a,id:i?Au("series"):a.id}))}:{...n,id:i?Au("chart"):n.id}}function Af(){return[Jp,cS,fS,td,dS,hS,mS].map(n=>Xp(n))}function j3(n){const i=pS.find(a=>a.id===n);return Xp(i?.chart??Jp,!0)}function vS(){return{id:Au("chart"),title:"Custom chart",visualization:"line",scale:"linear",range:900,series:[{id:Au("series"),signalId:Ui(3),measure:"occurrence-rate",color:Rt[0]}]}}function k3(n){const i=" copy",a=`${n.title.slice(0,ed-i.length).trimEnd()}${i}`;return{...Xp(n,!0),title:a}}function cp(n){if(!ln(n))return"vbytes";const i=new Set(n.series.map(a=>Fs(cs(a.signalId),a.measure).unit));return i.size===1?[...i][0]??null:null}function yS(n){const i=uS.safeParse(n);if(!i.success)return i.error.issues[0]?.message??"Invalid chart configuration";if(!ln(n))return null;for(const a of n.series){const l=cs(a.signalId);if(!h3(l,a.measure))return`${rS[a.measure].label} is not valid for ${l.label}.`;const u=Fs(l,a.measure);if(!u.chartTypes.includes(n.visualization))return`${u.label} cannot be displayed as a ${n.visualization} chart.`}return cp(n)===null?"All series on a chart must use compatible units.":null}function bS(n){const i=M3.safeParse(n);return!i.success||new Set(i.data.charts.map(a=>a.id)).size!==i.data.charts.length||i.data.charts.some(a=>ln(a)&&new Set(a.series.map(l=>l.id)).size!==a.series.length)?null:i.data.charts.every(a=>yS(a)===null)?i.data.charts:null}function _S(){try{return globalThis.window?.localStorage??null}catch{return null}}function R3(n=_S()){try{const i=n?.getItem(gS);return i?bS(JSON.parse(i))??Af():Af()}catch{return Af()}}function C3(n,i=_S()){try{const a={version:1,charts:n};if(!bS(a))return;i?.setItem(gS,JSON.stringify(a))}catch{}}function Wp(n,i){return n.signals[i]}function e_(n,i,a,l){let u=l==="count"?n.priorSignalCounts[i]??0:n.priorSignalSums[i]??0;for(const f of n.buckets){if(f.time>=a)break;const d=Wp(f,i);u+=l==="count"?d?.count??0:d?.sum??0}return u}function D3(n,i,a){let l=n.priorSignalLatest[i]??null;for(const u of n.buckets){if(u.time>=a)break;const f=Wp(u,i);f?.last!==null&&f?.last!==void 0&&f.lastAt!==null&&(l={value:f.last,time:f.lastAt})}return l}function U3(n,i){const a=i<=n.sessionStartedAt?Math.floor(n.sessionStartedAt/1e3)*1e3:Math.ceil(i/1e3)*1e3,l=Math.floor(n.now/1e3)*1e3,u=new Map(n.buckets.map(d=>[d.time,d])),f=[];for(let d=a;d<=l;d+=1e3)f.push(u.get(d)??{time:d,signals:{}});return f}function Z3(n,i,a){const l=Math.max(n.time,a),u=Math.min(i,n.time+1e3);return Math.max(0,(u-l)/1e3)}function $3(n,i,a,l){const u=cs(l.signalId);let f=l.measure==="cumulative-occurrences"?e_(n,l.signalId,a,"count"):l.measure==="payload-cumulative"?e_(n,l.signalId,a,"sum"):0,d=D3(n,l.signalId,a);return i.map(m=>{const p=Wp(m,l.signalId);switch(l.measure){case"occurrence-count":return p?.count??0;case"occurrence-rate":{const g=Z3(m,n.now,n.sessionStartedAt);return g>0?(p?.count??0)/g:0}case"cumulative-occurrences":return f+=p?.count??0,f;case"payload-sum":return p&&p.samples>0?p.sum:null;case"payload-cumulative":return f+=p?.sum??0,f;case"payload-average":return p&&p.samples>0?p.sum/p.samples:null;case"payload-minimum":return p?.minimum??null;case"payload-maximum":return p?.maximum??null;case"payload-latest":{if(p?.last!==null&&p?.last!==void 0&&p.lastAt!==null)return d={value:p.last,time:p.lastAt},p.last;if(u.source==="pool"){const g=Math.min(m.time+1e3,n.now);return d&&g-d.time0?(p.last-g.value)/b:null}}})}function L3(n,i){const a=n.now-i.range*1e3,l=U3(n,a),u=l[0]?.time??Math.floor(n.now/1e3)*1e3,f=i.series[0],d=Fs(cs(f.signalId),f.measure).unit,m=i.series.filter(p=>(n.signalTotals[p.signalId]??0)===0).map(p=>p.label??cs(p.signalId).label);return{data:[l.map(p=>p.time/1e3),...i.series.map(p=>$3(n,l,u,p))],unit:d,hasObservedData:m.length{const a=()=>{i(Date.now())},l=setInterval(a,1e3);return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{clearInterval(l),window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[]),n}const q3={300:"5 minutes",900:"15 minutes",3600:"1 hour"},V3={line:"Line",step:"Step",area:"Area",bar:"Bar"};function I3(n){return ln(n)?{...n,series:n.series.map(i=>({...i}))}:{...n}}function P3(){const n=new Map;for(const i of Qp){const a=n.get(i.category)??[];a.push(i),n.set(i.categ)DELIM" -R"DELIM(ory,a)}return[...n]}const K3=P3();function G3({chart:n,mode:i,onCancel:a,onSave:l}){const[u,f]=se.useState(()=>I3(n)),d=yS(u),m=cp(u);se.useEffect(()=>{function T(A){A.key==="Escape"&&a()}return globalThis.addEventListener("keydown",T),()=>{globalThis.removeEventListener("keydown",T)}},[a]);const p=se.useMemo(()=>new Set(up.filter(T=>ln(u)&&u.series.every(A=>Fs(cs(A.signalId),A.measure).chartTypes.includes(T)))),[u]);function g(T){f(A=>ln(A)?T(A):A)}function b(T,A){g(k=>({...k,series:k.series.map((L,D)=>D===T?A:L)}))}function y(T,A){if(!ln(u))return;const k=u.series[T],L=cs(A);b(T,{...k,signalId:A,measure:L.defaultMeasure})}function w(){if(!ln(u)||u.series.length>=op)return;const T=cp(u),A=Qp.find(D=>D.allowedMeasures.some(W=>T===null||Fs(D,W).unit===T));if(!A)return;const k=A.allowedMeasures.find(D=>T===null||Fs(A,D).unit===T)??A.defaultMeasure,L={id:`series-${Date.now().toString(36)}-${String(u.series.length+1)}`,signalId:A.id,measure:k,color:Rt[u.series.length%Rt.length]??Rt[0]};g(D=>({...D,series:[...D.series,L]}))}function O(T){T.preventDefault(),!d&&l({...u,title:u.title.trim()})}return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:T=>{T.target===T.currentTarget&&a()},children:x.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"chart-editor-title",className:"border-accent/30 bg-surface/95 max-h-[92vh] w-full max-w-4xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/60",children:[x.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Dashboard builder"}),x.jsx("h2",{id:"chart-editor-title",className:"text-accent mt-1 text-xl font-semibold",children:i==="add"?"Add chart":"Edit chart"})]}),x.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close chart editor",children:"×"})]}),i==="add"&&x.jsxs("div",{className:"border-accentSecondary/20 border-b p-5",children:[x.jsx("p",{className:"text-accentSecondary mb-3 text-xs tracking-wide uppercase",children:"Start from a template"}),x.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-5",children:[pS.map(T=>x.jsxs("button",{type:"button",onClick:()=>{f(j3(T.id))},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[x.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:T.label}),x.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:T.description})]},T.id)),x.jsxs("button",{type:"button",onClick:()=>{f(vS())},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[x.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:"Custom"}),x.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:"Begin with one editable series."})]})]})]}),x.jsxs("form",{onSubmit:O,className:"space-y-6 p-5",children:[x.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_11rem_11rem]",children:[x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Chart title"}),x.jsx("input",{value:u.title,maxLength:ed,onChange:T=>{f(A=>({...A,title:T.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),ln(u)?x.jsxs(x.Fragment,{children:[x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Chart type"}),x.jsx("select",{value:u.visualization,onChange:T=>{g(A=>({...A,visualization:T.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:up.map(T=>x.jsx("option",{value:T,disabled:!p.has(T),children:V3[T]},T))})]}),x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Time range"}),x.jsx("select",{value:u.range,onChange:T=>{g(A=>({...A,range:Number(T.target.value)}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:T3.map(T=>x.jsx("option",{value:T,children:q3[T]},T))})]})]}):x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Bar color"}),x.jsx("input",{type:"color",value:u.color,onChange:T=>{const A=T.target.value;f(k=>ln(k)?k:{...k,color:A})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]})]}),ln(u)?x.jsxs("section",{className:"space-y-3",children:[x.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[x.jsxs("div",{children:[x.jsx("h3",{className:"text-accent text-lg font-semibold",children:"Series"}),x.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:["One chart uses one axis unit",m===null?".":`: ${SS(m)}.`]})]}),x.jsx("button",{type:"button",onClick:w,disabled:u.series.length>=op,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary disabled:text-textMuted rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",children:"Add series"})]}),x.jsx("div",{className:"space-y-3",children:u.series.map((T,A)=>{const k=cs(T.signalId),L=Fs(k,T.measure);return x.jsxs("article",{className:"border-accentSecondary/20 bg-accent/5 grid gap-3 rounded-xl border p-4 lg:grid-cols-[minmax(12rem,1.2fr)_minmax(11rem,1fr)_minmax(9rem,0.8fr)_3.5rem_auto]",children:[x.jsxs("label",{className:"space-y-1.5",children:[x.jsxs("span",{className:"text-textMuted text-xs",children:["Signal ",String(A+1)]}),x.jsx("select",{"aria-label":`Signal ${String(A+1)}`,value:T.signalId,onChange:D=>{y(A,D.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0",children:K3.map(([D,W])=>x.jsx("optgroup",{label:D,children:W.map(K=>x.jsx("option",{value:K.id,children:K.label},K.id))},D))})]}),x.jsxs("label",{className:"space-y-1.5",children:[x.jsx("span",{className:"text-textMuted text-xs",children:"Measurement"}),x.jsx("select",{"aria-label":`Measurement ${String(A+1)}`,value:T.measure,onChange:D=>{b(A,{...T,measure:D.target.value})},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0",title:L.description,children:k.allowedMeasures.map(D=>x.jsx("option",{value:D,children:Fs(k,D).label},D))})]}),x.jsxs("label",{className:"space-y-1.5",children:[x.jsx("span",{className:"text-textMuted text-xs",children:"Display label"}),x.jsx("input",{"aria-label":`Display label ${String(A+1)}`,value:T.label??"",onChange:D=>{b(A,{...T,label:D.target.value||void 0})},placeholder:k.label,className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/50 focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0"})]}),x.jsxs("label",{className:"space-y-1.5",children:[x.jsx("span",{className:"text-textMuted text-xs",children:"Color"}),x.jsx("input",{"aria-label":`Series color ${String(A+1)}`,type:"color",value:T.color,onChange:D=>{b(A,{...T,color:D.target.value})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]}),x.jsx("button",{type:"button",onClick:()=>{g(D=>({...D,series:D.series.filter((W,K)=>K!==A)}))},disabled:u.series.length===1,"aria-label":`Remove series ${String(A+1)}`,className:"text-textMuted self-end rounded-md px-3 py-2 text-sm hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-30",children:"Remove"})]},T.id)})})]}):x.jsx("p",{className:"text-textMuted text-sm",children:"Shows the latest transaction-pool fee distribution, refreshed every five )DELIM" -R"DELIM(seconds. Each bar shows the virtual size of one fee-rate group, labeled by its minimum fee rate in sat/vB."}),d&&x.jsx("p",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:d}),x.jsxs("div",{className:"border-accentSecondary/20 flex justify-end gap-2 border-t pt-4",children:[x.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded-md px-4 py-2 text-sm",children:"Cancel"}),x.jsx("button",{type:"submit",disabled:d!==null,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:i==="add"?"Add chart":"Save changes"})]})]})]})})}const Y3=!0,gn="u-",F3="uplot",Q3=gn+"hz",J3=gn+"vt",X3=gn+"title",W3=gn+"wrap",eM=gn+"under",tM=gn+"over",nM=gn+"axis",Ga=gn+"off",iM=gn+"select",rM=gn+"cursor-x",sM=gn+"cursor-y",aM=gn+"cursor-pt",lM=gn+"legend",oM=gn+"live",uM=gn+"inline",cM=gn+"series",fM=gn+"marker",t_=gn+"label",dM=gn+"value",wu="width",zu="height",vu="top",n_="bottom",Jl="left",Bm="right",eg="#000",i_=eg+"0",qm="mousemove",r_="mousedown",Vm="mouseup",s_="mouseenter",a_="mouseleave",l_="dblclick",hM="resize",mM="scroll",o_="change",Vf="dppxchange",tg="--",mo=typeof window<"u",fp=mo?document:null,to=mo?window:null,pM=mo?navigator:null;let rt,Sf;function dp(){let n=devicePixelRatio;rt!=n&&(rt=n,Sf&&mp(o_,Sf,dp),Sf=matchMedia(`(min-resolution: ${rt-.001}dppx) and (max-resolution: ${rt+.001}dppx)`),Ja(o_,Sf,dp),to.dispatchEvent(new CustomEvent(Vf)))}function Ci(n,i){if(i!=null){let a=n.classList;!a.contains(i)&&a.add(i)}}function hp(n,i){let a=n.classList;a.contains(i)&&a.remove(i)}function Et(n,i,a){n.style[i]=a+"px"}function vr(n,i,a,l){let u=fp.createElement(n);return i!=null&&Ci(u,i),a?.insertBefore(u,l),u}function Ji(n,i){return vr("div",n,i)}const u_=new WeakMap;function Lr(n,i,a,l,u){let f="translate("+i+"px,"+a+"px)",d=u_.get(n);f!=d&&(n.style.transform=f,u_.set(n,f),i<0||a<0||i>l||a>u?Ci(n,Ga):hp(n,Ga))}const c_=new WeakMap;function f_(n,i,a){let l=i+a,u=c_.get(n);l!=u&&(c_.set(n,l),n.style.background=i,n.style.borderColor=a)}const d_=new WeakMap;function h_(n,i,a,l){let u=i+""+a,f=d_.get(n);u!=f&&(d_.set(n,u),n.style.height=a+"px",n.style.width=i+"px",n.style.marginLeft=l?-i/2+"px":0,n.style.marginTop=l?-a/2+"px":0)}const ng={passive:!0},gM={...ng,capture:!0};function Ja(n,i,a,l){i.addEventListener(n,a,l?gM:ng)}function mp(n,i,a,l){i.removeEventListener(n,a,ng)}mo&&dp();function yr(n,i,a,l){let u;a=a||0,l=l||i.length-1;let f=l<=2147483647;for(;l-a>1;)u=f?a+l>>1:Zi((a+l)/2),i[u]{let f=-1,d=-1;for(let m=l;m<=u;m++)if(n(a[m])){f=m;break}for(let m=u;m>=l;m--)if(n(a[m])){d=m;break}return[f,d]}}const zS=n=>n!=null,TS=n=>n!=null&&n>0,nd=wS(zS),vM=wS(TS);function yM(n,i,a,l=0,u=!1){let f=u?vM:nd,d=u?TS:zS;[i,a]=f(n,i,a);let m=n[i],p=n[i];if(i>-1)if(l==1)m=n[i],p=n[a];else if(l==-1)m=n[a],p=n[i];else for(let g=i;g<=a;g++){let b=n[g];d(b)&&(bp&&(p=b))}return[m??_t,p??-_t]}function id(n,i,a,l){let u=g_(n),f=g_(i);n==i&&(u==-1?(n*=a,i/=a):(n/=a,i*=a));let d=a==10?fs:ES,m=u==1?Zi:Xi,p=f==1?Xi:Zi,g=m(d(pn(n))),b=p(d(pn(i))),y=ao(a,g),w=ao(a,b);return a==10&&(g<0&&(y=St(y,-g)),b<0&&(w=St(w,-b))),l||a==2?(n=y*u,i=w*f):(n=MS(n,y),i=rd(i,w)),[n,i]}function ig(n,i,a,l){let u=id(n,i,a,l);return n==0&&(u[0]=0),i==0&&(u[1]=0),u}const rg=.1,m_={mode:3,pad:rg},Mu={pad:0,soft:null,mode:0},bM={min:Mu,max:Mu};function If(n,i,a,l){return sd(a)?p_(n,i,a):(Mu.pad=a,Mu.soft=l?0:null,Mu.mode=l?3:0,p_(n,i,bM))}function et(n,i){return n??i}function _M(n,i,a){for(i=et(i,0),a=et(a,n.length-1);i<=a;){if(n[i]!=null)return!0;i++}return!1}function p_(n,i,a){let l=a.min,u=a.max,f=et(l.pad,0),d=et(u.pad,0),m=et(l.hard,-_t),p=et(u.hard,_t),g=et(l.soft,_t),b=et(u.soft,-_t),y=et(l.mode,0),w=et(u.mode,0),O=i-n,T=fs(O),A=si(pn(n),pn(i)),k=fs(A),L=pn(k-T);(O<1e-24||L>10)&&(O=0,(n==0||i==0)&&(O=1e-24,y==2&&g!=_t&&(f=0),w==2&&b!=-_t&&(d=0)));let D=O||A||1e3,W=fs(D),K=ao(10,Zi(W)),Y=D*(O==0?n==0?.1:1:f),G=St(MS(n-Y,K/10),24),ne=n>=g&&(y==1||y==3&&G<=g||y==2&&G>=g)?g:_t,ae=si(m,G=ne?ne:br(ne,G)),ye=D*(O==0?i==0?.1:1:d),ue=St(rd(i+ye,K/10),24),X=i<=b&&(w==1||w==3&&ue>=b||w==2&&ue<=b)?b:-_t,we=br(p,ue>X&&i<=X?X:si(X,ue));return ae==we&&ae==0&&(we=100),[ae,we]}const SM=new Intl.NumberFormat(mo?pM.language:"en-US"),sg=n=>SM.format(n),$i=Math,Mf=$i.PI,pn=$i.abs,Zi=$i.floor,hn=$i.round,Xi=$i.ceil,br=$i.min,si=$i.max,ao=$i.pow,g_=$i.sign,fs=$i.log10,ES=$i.log2,xM=(n,i=1)=>$i.sinh(n)*i,Im=(n,i=1)=>$i.asinh(n/i),_t=1/0;function v_(n){return(fs((n^n>>31)-(n>>31))|0)+1}function pp(n,i,a){return br(si(n,i),a)}function OS(n){return typeof n=="function"}function Qe(n){return OS(n)?n:()=>n}const wM=()=>{},NS=n=>n,AS=(n,i)=>i,zM=n=>null,y_=n=>!0,b_=(n,i)=>n==i,TM=/\.\d*?(?=9{6,}|0{6,})/gm,el=n=>{if(kS(n)||ea.has(n))return n;const i=`${n}`,a=i.match(TM);if(a==null)return n;let l=a[0].length-1;if(i.indexOf("e-")!=-1){let[u,f]=i.split("e");return+`${el(u)}e${f}`}return St(n,l)};function Pa(n,i){return el(St(el(n/i))*i)}function rd(n,i){return el(Xi(el(n/i))*i)}function MS(n,i){return el(Zi(el(n/i))*i)}function St(n,i=0){if(kS(n))return n;let a=10**i,l=n*a*(1+Number.EPSILON);return hn(l)/a}const ea=new Map;function jS(n){return((""+n).split(".")[1]||"").length}function Zu(n,i,a,l){let u=[],f=l.map(jS);for(let d=i;d=0?0:m)+(d>=f[g]?0:f[g]),w=n==10?b:St(b,y);u.push(w),ea.set(w,y)}}return u}const ju={},ag=[],lo=[null,null],Ys=Array.isArray,kS=Number.isInteger,EM=n=>n===void 0;function __(n){return typeof n=="string"}function sd(n){let i=!1;if(n!=null){let a=n.constructor;i=a==null||a==Object}return i}function OM(n){return n!=null&&typeof n=="object"}const NM=Object.getPrototypeOf(Uint8Array),RS="__proto__";function oo(n,i=sd){let a;if(Ys(n)){let l=n.find(u=>u!=null);if(Ys(l)||i(l)){a=Array(n.length);for(let u=0;uf){for(u=d-1;u>=0&&n[u]==null;)n[u--]=null;for(u=d+1;ud-m)],u=l[0].length,f=new Map;for(let d=0;d"u"?n=>Promise.resolve().then(n):queueMicrotask;function DM(n){let i=n[0],a=i.length,l=Array(a);for(let f=0;fi[f]-i[d]);let u=[];for(let f=0;f=l&&n[u]==null;)u--;if(u<=l)return!0;const f=si(1,Zi((u-l+1)/i));for(let d=n[l],m=l+f;m<=u;m+=f){const p=n[m];if(p!=null){if(p<=d)return!1;d=p}}return!0}const CS=["January","February","March","April","May","June","July","August","September","October","November","December"],DS=["Sunday","Monday","Tuesday)DELIM" -R"DELIM(","Wednesday","Thursday","Friday","Saturday"];function US(n){return n.slice(0,3)}const $M=DS.map(US),LM=CS.map(US),HM={MMMM:CS,MMM:LM,WWWW:DS,WWW:$M};function yu(n){return(n<10?"0":"")+n}function BM(n){return(n<10?"00":n<100?"0":"")+n}const qM={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,i)=>i.MMMM[n.getMonth()],MMM:(n,i)=>i.MMM[n.getMonth()],MM:n=>yu(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>yu(n.getDate()),D:n=>n.getDate(),WWWW:(n,i)=>i.WWWW[n.getDay()],WWW:(n,i)=>i.WWW[n.getDay()],HH:n=>yu(n.getHours()),H:n=>n.getHours(),h:n=>{let i=n.getHours();return i==0?12:i>12?i-12:i},AA:n=>n.getHours()>=12?"PM":"AM",aa:n=>n.getHours()>=12?"pm":"am",a:n=>n.getHours()>=12?"p":"a",mm:n=>yu(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>yu(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>BM(n.getMilliseconds())};function lg(n,i){i=i||HM;let a=[],l=/\{([a-z]+)\}|[^{]+/gi,u;for(;u=l.exec(n);)a.push(u[0][0]=="{"?qM[u[1]]:u[0]);return f=>{let d="";for(let m=0;mn%1==0,Pf=[1,2,2.5,5],PM=Zu(10,-32,0,Pf),$S=Zu(10,0,32,Pf),KM=$S.filter(ZS),Ka=PM.concat($S),og=` -`,LS="{YYYY}",S_=og+LS,HS="{M}/{D}",Tu=og+HS,xf=Tu+"/{YY}",BS="{aa}",GM="{h}:{mm}",Wl=GM+BS,x_=og+Wl,w_=":{ss}",lt=null;function qS(n){let i=n*1e3,a=i*60,l=a*60,u=l*24,f=u*30,d=u*365,p=(n==1?Zu(10,0,3,Pf).filter(ZS):Zu(10,-3,0,Pf)).concat([i,i*5,i*10,i*15,i*30,a,a*5,a*10,a*15,a*30,l,l*2,l*3,l*4,l*6,l*8,l*12,u,u*2,u*3,u*4,u*5,u*6,u*7,u*8,u*9,u*10,u*15,f,f*2,f*3,f*4,f*6,d,d*2,d*5,d*10,d*25,d*50,d*100]);const g=[[d,LS,lt,lt,lt,lt,lt,lt,1],[u*28,"{MMM}",S_,lt,lt,lt,lt,lt,1],[u,HS,S_,lt,lt,lt,lt,lt,1],[l,"{h}"+BS,xf,lt,Tu,lt,lt,lt,1],[a,Wl,xf,lt,Tu,lt,lt,lt,1],[i,w_,xf+" "+Wl,lt,Tu+" "+Wl,lt,x_,lt,1],[n,w_+".{fff}",xf+" "+Wl,lt,Tu+" "+Wl,lt,x_,lt,1]];function b(y){return(w,O,T,A,k,L)=>{let D=[],W=k>=d,K=k>=f&&k=u?u:k,ue=Zi(T)-Zi(G),X=ae+ue+rd(G-ae,ye);D.push(X);let we=y(X),he=we.getHours()+we.getMinutes()/a+we.getSeconds()/l,Oe=k/l,fe=w.axes[O]._space,J=L/fe;for(;X=St(X+k,n==1?0:3),!(X>A);)if(Oe>1){let ee=Zi(St(he+Oe,6))%24,Se=y(X).getHours()-ee;Se>1&&(Se=-1),X-=Se*l,he=(he+Oe)%24;let Be=D[D.length-1];St((X-Be)/k,3)*J>=.7&&D.push(X)}else D.push(X)}return D}}return[p,g,b]}const[YM,FM,QM]=qS(1),[JM,XM,WM]=qS(.001);Zu(2,-53,53,[1]);function z_(n,i){return n.map(a=>a.map((l,u)=>u==0||u==8||l==null?l:i(u==1||a[8]==0?l:a[1]+l)))}function T_(n,i){return(a,l,u,f,d)=>{let m=i.find(T=>d>=T[0])||i[i.length-1],p,g,b,y,w,O;return l.map(T=>{let A=n(T),k=A.getFullYear(),L=A.getMonth(),D=A.getDate(),W=A.getHours(),K=A.getMinutes(),Y=A.getSeconds(),G=k!=p&&m[2]||L!=g&&m[3]||D!=b&&m[4]||W!=y&&m[5]||K!=w&&m[6]||Y!=O&&m[7]||m[1];return p=k,g=L,b=D,y=W,w=K,O=Y,G(A)})}}function e4(n,i){let a=lg(i);return(l,u,f,d,m)=>u.map(p=>a(n(p)))}function Pm(n,i,a){return new Date(n,i,a)}function E_(n,i){return i(n)}const t4="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function O_(n,i){return(a,l,u,f)=>f==null?tg:i(n(l))}function n4(n,i){let a=n.series[i];return a.width?a.stroke(n,i):a.points.width?a.points.stroke(n,i):null}function i4(n,i){return n.series[i].fill(n,i)}const r4={show:!0,live:!0,isolate:!1,mount:wM,markers:{show:!0,width:2,stroke:n4,fill:i4,dash:"solid"},idx:null,idxs:null,values:[]};function s4(n,i){let a=n.cursor.points,l=Ji(),u=a.size(n,i);Et(l,wu,u),Et(l,zu,u);let f=u/-2;Et(l,"marginLeft",f),Et(l,"marginTop",f);let d=a.width(n,i,u);return d&&Et(l,"borderWidth",d),l}function a4(n,i){let a=n.series[i].points;return a._fill||a._stroke}function l4(n,i){let a=n.series[i].points;return a._stroke||a._fill}function o4(n,i){return n.series[i].points.size}const Km=[0,0];function u4(n,i,a){return Km[0]=i,Km[1]=a,Km}function wf(n,i,a,l=!0){return u=>{u.button==0&&(!l||u.target==i)&&a(u)}}function Gm(n,i,a,l=!0){return u=>{(!l||u.target==i)&&a(u)}}const c4={show:!0,x:!0,y:!0,lock:!1,move:u4,points:{one:!1,show:s4,size:o4,width:0,stroke:l4,fill:a4},bind:{mousedown:wf,mouseup:wf,click:wf,dblclick:wf,mousemove:Gm,mouseleave:Gm,mouseenter:Gm},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(n,i)=>{i.stopPropagation(),i.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(n,i,a,l,u)=>l-u,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},VS={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},ug=an({},VS,{filter:AS}),IS=an({},ug,{size:10}),PS=an({},VS,{show:!1}),cg='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',KS="bold "+cg,GS=1.5,N_={show:!0,scale:"x",stroke:eg,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:KS,side:2,grid:ug,ticks:IS,border:PS,font:cg,lineGap:GS,rotate:0},f4="Value",d4="Time",A_={show:!0,scale:"x",auto:!1,sorted:1,min:_t,max:-_t,idxs:[]};function h4(n,i,a,l,u){return i.map(f=>f==null?"":sg(f))}function m4(n,i,a,l,u,f,d){let m=[],p=ea.get(u)||0;a=d?a:St(rd(a,u),p);for(let g=a;g<=l;g=St(g+u,p))m.push(Object.is(g,-0)?0:g);return m}function gp(n,i,a,l,u,f,d){const m=[],p=n.scales[n.axes[i].scale].log,g=p==10?fs:ES,b=Zi(g(a));u=ao(p,b),p==10&&(u=Ka[yr(u,Ka)]);let y=a,w=u*p;p==10&&(w=Ka[yr(w,Ka)]);do m.push(y),y=y+u,p==10&&!ea.has(y)&&(y=St(y,ea.get(u))),y>=w&&(u=y,w=u*p,p==10&&(w=Ka[yr(w,Ka)]));while(y<=l);return m}function p4(n,i,a,l,u,f,d){let p=n.scales[n.axes[i].scale].asinh,g=l>p?gp(n,i,si(p,a),l,u):[p],b=l>=0&&a<=0?[0]:[];return(a<-p?gp(n,i,si(p,-l),-a,u):[p]).reverse().map(w=>-w).concat(b,g)}const YS=/./,g4=/[12357]/,v4=/[125]/,M_=/1/,vp=(n,i,a,l)=>n.map((u,f)=>i==4&&u==0||f%l==0&&a.test(u.toExponential()[u<0?1:0])?u:null);function y4(n,i,a,l,u){let f=n.axes[a],d=f.scale,m=n.scales[d],p=n.valToPos,g=f._space,b=p(10,d),y=p(9,d)-b>=g?YS:p(7,d)-b>=g?g4:p(5,d)-b>=g?v4:M_;if(y==M_){let w=pn(p(1,d)-b);if(wu,R_={show:!0,auto:!0,sorted:0,gaps:FS,alpha:1,facets:[an({},k_,{scale:"x"}),an({},k_,{scale:"y"})]},C_={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:FS,alpha:1,points:{show:x4,filter:null},values:null,min:_t,max:-_t,idxs:[],path:null,clip:null};function w4(n,i,a,l,u){return a/10}const QS={time:Y3,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},z4=an({},QS,{time:!1,ori:1}),D_={};function JS(n,i){let a=D_[n];return a||(a={key:n,plots:[],sub(l){a.plots.push(l)},unsub(l){a.plots=a.plots.filter(u=>u!=l)},pub(l,u,f,d,m,p,g){for(let b=0;b{let L=d.pxRound;const D=g.dir*(g.ori==0?1:-1),W=g.ori==0?po:go;let K,Y;D==1?(K=a,Y=l):(K=l,Y=a);let G=L(y(m[K],g,A,O)),ne=L(w(p[K],b,k,T)),ae=L(y(m[Y],g,A,O)),ye=L(w(f==1?b.max:b.min,b,k,T)),ue=new Path2D(u);return W(ue,ae,ye),W(ue,G,ye),W(ue,G,ne),ue})}function ad(n,i,a,l,u,f){let d=null;if(n.length>0){d=new Path2D;const m=i==0?ud:hg;let p=a;for(let y=0;yw[0]){let O=w[0]-p;O>0&&m(d,p,l,O,l+f),p=w[1]}}let g=a+u-p,b=10;g>0&&m(d,p,l-b/2,g,l+f+b)}return d}function E4(n,i,a){let l=n[n.length-1];l&&l[0]==i?l[1]=a:n.push([i,a])}function dg(n,i,a,l,u,f,d){let m=[],p=n.length;for(let g=u==1?a:l;g>=a&&g<=l;g+=u)if(i[g]===null){let y=g,w=g;if(u==1)for(;++g<=l&&i[g]===null;)w=g;else for(;--g>=a&&i[g]===null;)w=g;let O=f(n[y]),T=w==y?O:f(n[w]),A=y-u;O=d<=0&&A>=0&&A=0&&L>=0&&L=O&&m.push([O,T])}return m}function U_(n){return n==0?NS:n==1?hn:i=>Pa(i,n)}function XS(n){let i=n==0?ld:od,a=n==0?(u,f,d,m,p,g)=>{u.arcTo(f,d,m,p,g)}:(u,f,d,m,p,g)=>{u.arcTo(d,f,p,m,g)},l=n==0?(u,f,d,m,p)=>{u.rect(f,d,m,p)}:(u,f,d,m,p)=>{u.rect(d,f,p,m)};return(u,f,d,m,p,g=0,b=0)=>{g==0&&b==0?l(u,f,d,m,p):(g=br(g,m/2,p/2),b=br(b,m/2,p/2),i(u,f+g,d),a(u,f+m,d,f+m,d+p,g),a(u,f+m,d+p,f,d+p,b),a(u,f,d+p,f,d,b),a(u,f,d,f+m,d,g),u.closePath())}}const ld=(n,i,a)=>{n.moveTo(i,a)},od=(n,i,a)=>{n.moveTo(a,i)},po=(n,i,a)=>{n.lineTo(i,a)},go=(n,i,a)=>{n.lineTo(a,i)},ud=XS(0),hg=XS(1),WS=(n,i,a,l,u,f)=>{n.arc(i,a,l,u,f)},ex=(n,i,a,l,u,f)=>{n.arc(a,i,l,u,f)},tx=(n,i,a,l,u,f,d)=>{n.bezierCurveTo(i,a,l,u,f,d)},nx=(n,i,a,l,u,f,d)=>{n.bezierCurveTo(a,i,u,l,d,f)};function ix(n){return(i,a,l,u,f)=>tl(i,a,(d,m,p,g,b,y,w,O,T,A,k)=>{let{pxRound:L,points:D}=d,W,K;g.ori==0?(W=ld,K=WS):(W=od,K=ex);const Y=St(D.width*rt,3);let G=(D.size-D.width)/2*rt,ne=St(G*2,3),ae=new Path2D,ye=new Path2D,{left:ue,top:X,width:we,height:he}=i.bbox;ud(ye,ue-ne,X-ne,we+ne*2,he+ne*2);const Oe=fe=>{if(p[fe]!=null){let J=L(y(m[fe],g,A,O)),ee=L(w(p[fe],b,k,T));W(ae,J+G,ee),K(ae,J,ee,G,0,Mf*2)}};if(f)f.forEach(Oe);else for(let fe=l;fe<=u;fe++)Oe(fe);return{stroke:Y>0?ae:null,fill:ae,clip:ye,flags:uo|yp}})}function rx(n){return(i,a,l,u,f,d)=>{l!=u&&(f!=l&&d!=l&&n(i,a,l),f!=u&&d!=u&&n(i,a,u),n(i,a,d))}}const O4=rx(po),N4=rx(go);function sx(n){const i=et(n?.alignGaps,0);return(a,l,u,f)=>tl(a,l,(d,m,p,g,b,y,w,O,T,A,k)=>{[u,f]=nd(p,u,f);let L=d.pxRound,D=he=>L(y(he,g,A,O)),W=he=>L(w(he,b,k,T)),K,Y;g.ori==0?(K=po,Y=O4):(K=go,Y=N4);const G=g.dir*(g.ori==0?1:-1),ne={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:uo},ae=ne.stroke;let ye=!1;if(f-u>=A*4){let he=be=>a.posToVal(be,g.key,!0),Oe=null,fe=null,J,ee,xe,Me=D(m[G==1?u:f]),Se=D(m[u]),Be=D(m[f]),Re=he(G==1?Se+1:Be-1);for(let be=G==1?u:f;be>=u&&be<=f;be+=G){let M=m[be],le=(G==1?MRe)?Me:D(M),re=p[be];le==Me?re!=null?(ee=re,Oe==null?(K(ae,le,W(ee)),J=Oe=fe=ee):eefe&&(fe=ee)):re===null&&(ye=!0):(Oe!=null&&Y(ae,Me,W(Oe),W(fe),W(J),W(ee)),re!=null?(ee=re,K(ae,le,W(ee)),Oe=fe=J=ee):(Oe=fe=null,re===null&&(ye=!0)),Me=le,Re=he(Me+G))}Oe!=null&&Oe!=fe&&xe!=Me&&Y(ae,Me,W(Oe),W(fe),W(J),W(ee))}else for(let he=G==1?u:f;he>=u&&he<=f;he+=G){let Oe=p[he];Oe===null?ye=!0:Oe!=null&&K(ae,D(m[he]),W(Oe))}let[X,we]=fg(a,l);if(d.fill!=null||X!=0){let he=ne.fill=new Path2D(ae),Oe=d.fillTo(a,l,d.min,d.max,X),fe=W(Oe),J=D(m[u]),ee=D(m[f]);G==-1&&([ee,J]=[J,ee]),K(he,ee,fe),K(he,J,fe)}if(!d.spanGaps){let he=[];ye&&he.push(...dg(m,p,u,f,G,D,i)),ne.gaps=he=d.gaps(a,l,u,f,he),ne.clip=ad(he,g.ori,O,T,A,k)}return we!=0&&(ne.band=we==2?[ds(a,l,u,f,ae,-1),ds(a,l,u,f,ae,1)]:ds(a,l,u,f,ae,we)),ne})}function A4(n){const i=et(n.align,1),a=et(n.ascDesc,!1),l=et(n.alignGaps,0),u=et(n.extend,!1);return(f,d,m,p)=>tl(f,d,(g,b,y,w,O,T,A,k,L,D,W)=>{[m,p]=nd(y,m,p);let K=g.pxRound,{left:Y,width:G}=f.bbox,ne=Se=>K(T(Se,w,D,k)),ae=Se=>K(A(Se,O,W,L)),ye=w.ori==0?po:go;const ue={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:uo},X=ue.stroke,we=w.dir*(w.ori==0?1:-1);let he=ae(y[we==1?m:p]),Oe=ne(b[we==1?m:p]),fe=Oe,J=Oe;u&&i==-1&&(J=Y,ye(X,J,he)),ye(X,Oe,he);for(let Se=we==1?m:p;Se>=m&&Se<=p;Se+=we){let Be=y[Se];if(Be==null)continue;let Re=ne(b[Se]),be=ae(Be);i==1?ye(X,Re,he):ye(X,fe,be),ye(X,Re,be),he=be,fe=Re}let ee=fe;u&&i==1&&(ee=Y+G,ye(X,ee,he));let[xe,Me]=fg(f,d);if(g.fill!=null||xe!=0){let Se=ue.fill=new Path2D(X),Be=g.fillTo(f,d,g.min,g.max,xe),Re=ae(Be);ye(Se,ee,Re),ye(Se,J,Re)}if(!g.spanGaps){let Se=[];Se.push(...dg(b,y,m,p,we,ne,l));let Be=g.width*rt/2,Re=a||i==1?Be:-Be,be=a||i==-1?-Be:Be;Se.forEach(M=>{M[0]+=Re,M[1]+=be}),ue.gaps=Se=g.gaps(f,d,m,p,Se),ue.clip=ad(Se,w.ori,k,L,D,W)}return Me!=0&&(ue.band=Me==2?[ds(f,d,m,p,X,-1),ds(f,d,m,p,X,1)]:ds(f,d,m,p,X,Me)),ue})}function Z_(n,i,a,l,u,f,d=_t){if(n.length>1){let m=null;for(let p=0,g=1/0;p{}),{fill:y,stroke:w}=g;return(O,T,A,k)=>tl(O,T,(L,D,W,K,Y,G,ne,ae,ye,ue,X)=>{let we=L.pxRound,he=a,Oe=l*rt,fe=m*rt,J=p*rt,ee,xe;K.ori==0?[ee,xe]=f(O,T):[xe,ee]=f(O,T);const Me=K.dir*(K.ori==0?1:-1);let Se=K.ori==0?ud:hg,Be=K.ori==0?b:(me,nt,Zt,qr,Zn,li,nr)=>{b(me,nt,Zt,Zn,qr,nr,li)},Re=et(O.bands,ag).find(me=>me.series[0]==T),be=Re!=null?Re.dir:0,M=L.fillTo(O,T,L.min,L.max,be),Q=we(ne(M,Y,X,ye)),le,re,$e,Ue=ue,Ae=we(L.width*rt),pe=!1,Ne=null,Bt=null,Li=null,bi=null;y!=null&&(Ae==0||w!=null)&&(pe=!0,Ne=y.values(O,T,A,k),Bt=new Map,new Set(Ne).forEach(me=>{me!=null&&Bt.set(me,new Path2D)}),Ae>0&&(Li=w.values(O,T,A,k),bi=new Map,new Set(Li).forEach(me=>{me!=null&&bi.set(me,new Path2D)})));let{x0:On,size:Ut}=g;if(On!=null&&Ut!=null){he=1,D=On.values(O,T,A,k),On.unit==2&&(D=D.map(Zt=>O.posToVal(ae+Zt*ue,K.key,!0)));let me=Ut.values(O,T,A,k);Ut.unit==2?re=me[0]*ue:re=G(me[0],K,ue,ae)-G(0,K,ue,ae),Ue=Z_(D,W,G,K,ue,ae,Ue),$e=Ue-re+Oe}else Ue=Z_(D,W,G,K,ue,ae,Ue),$e=Ue*d+Oe,re=Ue-$e;$e<1&&($e=0),Ae>=re/2&&(Ae=0),$e<5&&(we=NS);let tt=$e>0,vn=Ue-$e-(tt?Ae:0);re=we(pp(vn,J,fe)),le=(he==0?re/2:he==Me?0:re)-he*Me*((he==0?Oe/2:0)+(tt?Ae/2:0));const Gt={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},In=pe?null:new Path2D;let ai=null;if(Re!=null)ai=O.data[Re.series[1]];else{let{y0:me,y1:nt}=g;me!=null&&nt!=null&&(W=nt.values(O,T,A,k),ai=me.values(O,T,A,k))}let Hi=ee*re,Ce=xe*re;for(let me=Me==1?A:k;me>=A&&me<=k;me+=Me){let nt=W[me];if(nt==null)continue;if(ai!=null){let yn=ai[me]??0;if(nt-yn==0)continue;Q=ne(yn,Y,X,ye)}let Zt=K.distr!=2||g!=null?D[me]:me,qr=G(Zt,K,ue,ae),Zn=ne(et(nt,M),Y,X,ye),li=we(qr-le),nr=we(si(Zn,Q)),Pn=we(br(Zn,Q)),Kn=nr-Pn;if(nt!=null){let yn=nt<0?Ce:Hi,Gn=nt<0?Hi:Ce;pe?(Ae>0&&Li[me]!=null&&Se(bi.get(Li[me]),li,Pn+Zi(Ae/2),re,si(0,Kn-Ae),yn,Gn),Ne[me]!=null&&Se(Bt.get(Ne[me]),li,Pn+Zi(Ae/2),re,si(0,Kn-Ae),yn,Gn)):Se(In,li,Pn+Zi(Ae/2),re,si(0,Kn-Ae),yn,Gn),Be(O,T,me,li-Ae/2,Pn,re+Ae,Kn)}}return Ae>0?Gt.stroke=pe?bi:In:pe||(Gt._fill=L.width==0?L._fill:L._stroke??L._fill,Gt.width=0),Gt.fill=pe?Bt:In,Gt})}function j4(n,i){const a=et(i?.alignGaps,0);return(l,u,f,d)=>tl(l,u,(m,p,g,b,y,w,O,T,A,k,L)=>{[f,d]=nd(g,f,d);let D=m.pxRound,W=ee=>D(w(ee,b,k,T)),K=ee=>D(O(ee,y,L,A)),Y,G,ne;b.)DELIM" -R"DELIM(ori==0?(Y=ld,ne=po,G=tx):(Y=od,ne=go,G=nx);const ae=b.dir*(b.ori==0?1:-1);let ye=W(p[ae==1?f:d]),ue=ye,X=[],we=[];for(let ee=ae==1?f:d;ee>=f&&ee<=d;ee+=ae)if(g[ee]!=null){let Me=p[ee],Se=W(Me);X.push(ue=Se),we.push(K(g[ee]))}const he={stroke:n(X,we,Y,ne,G,D),fill:null,clip:null,band:null,gaps:null,flags:uo},Oe=he.stroke;let[fe,J]=fg(l,u);if(m.fill!=null||fe!=0){let ee=he.fill=new Path2D(Oe),xe=m.fillTo(l,u,m.min,m.max,fe),Me=K(xe);ne(ee,ue,Me),ne(ee,ye,Me)}if(!m.spanGaps){let ee=[];ee.push(...dg(p,g,f,d,ae,W,a)),he.gaps=ee=m.gaps(l,u,f,d,ee),he.clip=ad(ee,b.ori,T,A,k,L)}return J!=0&&(he.band=J==2?[ds(l,u,f,d,Oe,-1),ds(l,u,f,d,Oe,1)]:ds(l,u,f,d,Oe,J)),he})}function k4(n){return j4(R4,n)}function R4(n,i,a,l,u,f){const d=n.length;if(d<2)return null;const m=new Path2D;if(a(m,n[0],i[0]),d==2)l(m,n[1],i[1]);else{let p=Array(d),g=Array(d-1),b=Array(d-1),y=Array(d-1);for(let w=0;w0!=g[w]>0?p[w]=0:(p[w]=3*(y[w-1]+y[w])/((2*y[w]+y[w-1])/g[w-1]+(y[w]+2*y[w-1])/g[w]),isFinite(p[w])||(p[w]=0));p[d-1]=g[d-2];for(let w=0;w{on.pxRatio=rt}));const C4=sx(),D4=ix();function L_(n,i,a,l){return(l?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((f,d)=>_p(f,d,i,a))}function U4(n,i){return n.map((a,l)=>l==0?{}:an({},i,a))}function _p(n,i,a,l){return an({},i==0?a:l,n)}function ax(n,i,a){return i==null?lo:[i,a]}const Z4=ax;function $4(n,i,a){return i==null?lo:If(i,a,rg,!0)}function lx(n,i,a,l){return i==null?lo:id(i,a,n.scales[l].log,!1)}const L4=lx;function ox(n,i,a,l){return i==null?lo:ig(i,a,n.scales[l].log,!1)}const H4=ox;function B4(n,i,a,l,u){let f=si(v_(n),v_(i)),d=i-n,m=yr(u/l*d,a);do{let p=a[m],g=l*p/d;if(g>=u&&f+(p<5?ea.get(p):0)<=17)return[p,g]}while(++m(i=hn((a=+u)*rt))+"px"),[n,i,a]}function q4(n){n.show&&[n.font,n.labelFont].forEach(i=>{let a=St(i[2]*rt,1);i[0]=i[0].replace(/[0-9.]+px/,a+"px"),i[1]=a})}function on(n,i,a){const l={mode:et(n.mode,1)},u=l.mode;function f(v,S,z,E){let R=S.valToPct(v);return E+z*(S.dir==-1?1-R:R)}function d(v,S,z,E){let R=S.valToPct(v);return E+z*(S.dir==-1?R:1-R)}function m(v,S,z,E){return S.ori==0?f(v,S,z,E):d(v,S,z,E)}l.valToPosH=f,l.valToPosV=d;let p=!1;l.status=0;const g=l.root=Ji(F3);if(n.id!=null&&(g.id=n.id),Ci(g,n.class),n.title){let v=Ji(X3,g);v.textContent=n.title}const b=vr("canvas"),y=l.ctx=b.getContext("2d"),w=Ji(W3,g);Ja("click",w,v=>{v.target===T&&(vt!=_s||xt!=Qr)&&ht.click(l,v)},!0);const O=l.under=Ji(eM,w);w.appendChild(b);const T=l.over=Ji(tM,w);n=oo(n);const A=+et(n.pxAlign,1),k=U_(A);(n.plugins||[]).forEach(v=>{v.opts&&(n=v.opts(l,n)||n)});const L=n.ms||.001,D=l.series=u==1?L_(n.series||[],A_,C_,!1):U4(n.series||[null],R_),W=l.axes=L_(n.axes||[],N_,j_,!0),K=l.scales={},Y=l.bands=n.bands||[];Y.forEach(v=>{v.fill=Qe(v.fill||null),v.dir=et(v.dir,-1)});const G=u==2?D[1].facets[0].scale:D[0].scale,ne={axes:fl,series:Vu},ae=(n.drawOrder||["axes","series"]).map(v=>ne[v]);function ye(v){const S=v.distr==3?z=>fs(z>0?z:v.clamp(l,z,v.min,v.max,v.key)):v.distr==4?z=>Im(z,v.asinh):v.distr==100?z=>v.fwd(z):z=>z;return z=>{let E=S(z),{_min:R,_max:H}=v,I=H-R;return(E-R)/I}}function ue(v){let S=K[v];if(S==null){let z=(n.scales||ju)[v]||ju;if(z.from!=null){ue(z.from);let E=an({},K[z.from],z,{key:v});E.valToPct=ye(E),K[v]=E}else{S=K[v]=an({},v==G?QS:z4,z),S.key=v;let E=S.time,R=S.range,H=Ys(R);if((v!=G||u==2&&!E)&&(H&&(R[0]==null||R[1]==null)&&(R={min:R[0]==null?m_:{mode:1,hard:R[0],soft:R[0]},max:R[1]==null?m_:{mode:1,hard:R[1],soft:R[1]}},H=!1),!H&&sd(R))){let I=R;R=(te,ie,ce)=>ie==null?lo:If(ie,ce,I)}S.range=Qe(R||(E?Z4:v==G?S.distr==3?L4:S.distr==4?H4:ax:S.distr==3?lx:S.distr==4?ox:$4)),S.auto=Qe(H?!1:S.auto),S.clamp=Qe(S.clamp||w4),S._min=S._max=null,S.valToPct=ye(S)}}}ue("x"),ue("y"),u==1&&D.forEach(v=>{ue(v.scale)}),W.forEach(v=>{ue(v.scale)});for(let v in n.scales)ue(v);const X=K[G],we=X.distr;let he,Oe;X.ori==0?(Ci(g,Q3),he=f,Oe=d):(Ci(g,J3),he=d,Oe=f);const fe={};for(let v in K){let S=K[v];(S.min!=null||S.max!=null)&&(fe[v]={min:S.min,max:S.max},S.min=S.max=null)}const J=n.tzDate||(v=>new Date(hn(v/L))),ee=n.fmtDate||lg,xe=L==1?QM(J):WM(J),Me=T_(J,z_(L==1?FM:XM,ee)),Se=O_(J,E_(t4,ee)),Be=[],Re=l.legend=an({},r4,n.legend),be=l.cursor=an({},c4,{drag:{y:u==2}},n.cursor),M=Re.show,Q=be.show,le=Re.markers;Re.idxs=Be,le.width=Qe(le.width),le.dash=Qe(le.dash),le.stroke=Qe(le.stroke),le.fill=Qe(le.fill);let re,$e,Ue,Ae=[],pe=[],Ne,Bt=!1,Li={};if(Re.live){const v=D[1]?D[1].values:null;Bt=v!=null,Ne=Bt?v(l,1,0):{_:0};for(let S in Ne)Li[S]=tg}if(M)if(re=vr("table",lM,g),Ue=vr("tbody",null,re),Re.mount(l,re),Bt){$e=vr("thead",null,re,Ue);let v=vr("tr",null,$e);vr("th",null,v);for(var bi in Ne)vr("th",t_,v).textContent=bi}else Ci(re,uM),Re.live&&Ci(re,oM);const On={show:!0},Ut={show:!1};function tt(v,S){if(S==0&&(Bt||!Re.live||u==2))return lo;let z=[],E=vr("tr",cM,Ue,Ue.childNodes[S]);Ci(E,v.class),v.show||Ci(E,Ga);let R=vr("th",null,E);if(le.show){let te=Ji(fM,R);if(S>0){let ie=le.width(l,S);ie&&(te.style.border=ie+"px "+le.dash(l,S)+" "+le.stroke(l,S)),te.style.background=le.fill(l,S)}}let H=Ji(t_,R);v.label instanceof HTMLElement?H.appendChild(v.label):H.textContent=v.label,S>0&&(le.show||(H.style.color=v.width>0?le.stroke(l,S):le.fill(l,S)),Gt("click",R,te=>{if(be._lock)return;Ft(te);let ie=D.indexOf(v);if((te.ctrlKey||te.metaKey)!=Re.isolate){let ce=D.some((de,ge)=>ge>0&&ge!=ie&&de.show);D.forEach((de,ge)=>{ge>0&&Ln(ge,ce?ge==ie?On:Ut:On,!0,$t.setSeries)})}else Ln(ie,{show:!v.show},!0,$t.setSeries)},!1),ps&&Gt(s_,R,te=>{be._lock||(Ft(te),Ln(D.indexOf(v),lr,!0,$t.setSeries))},!1));for(var I in Ne){let te=vr("td",dM,E);te.textContent="--",z.push(te)}return[E,z]}const vn=new Map;function Gt(v,S,z,E=!0){const R=vn.get(S)||{},H=be.bind[v](l,S,z,E);H&&(Ja(v,S,R[v]=H),vn.set(S,R))}function In(v,S,z){const E=vn.get(S)||{};for(let R in E)(v==null||R==v)&&(mp(R,S,E[R]),delete E[R]);v==null&&vn.delete(S)}let ai=0,Hi=0,Ce=0,me=0,nt=0,Zt=0,qr=nt,Zn=Zt,li=Ce,nr=me,Pn=0,Kn=0,yn=0,Gn=0;l.bbox={};let ia=!1,nl=!1,ms=!1,Yt=!1,il=!1,Yn=!1;function rl(v,S,z){(z||v!=l.width||S!=l.height)&&ra(v,S),$n(!1),ms=!0,nl=!0,Gr()}function ra(v,S){l.width=ai=Ce=v,l.height=Hi=me=S,nt=Zt=0,dd(),sa();let z=l.bbox;Pn=z.left=Pa(nt*rt,.5),Kn=z.top=Pa(Zt*rt,.5),yn=z.width=Pa(Ce*rt,.5),Gn=z.height=Pa(me*rt,.5)}const cd=3;function qu(){let v=!1,S=0;for(;!v;){S++;let z=Iu(S),E=cl(S);v=S==cd||z&&E,v||(ra(l.width,l.height),nl=!0)}}function fd({width:v,height:S}){rl(v,S)}l.setSize=fd;function dd(){let v=!1,S=!1,z=!1,E=!1;W.forEach((R,H)=>{if(R.show&&R._show){let{side:I,_size:te}=R,ie=I%2,ce=R.label!=null?R.labelSize:0,de=te+ce;de>0&&(ie?(Ce-=de,I==3?(nt+=de,E=!0):z=!0):(me-=de,I==0?(Zt+=de,v=!0):S=!0))}}),xr[0]=v,xr[1]=z,xr[2]=S,xr[3]=E,Ce-=ui[1]+ui[3],nt+=ui[3],me-=ui[2]+ui[0],Zt+=ui[0]}function sa(){let v=nt+Ce,S=Zt+me,z=nt,E=Zt;function R(H,I){switch(H){case 1:return v+=I,v-I;case 2:return S+=I,S-I;case 3:return z-=I,z+I;case 0:return E-=I,E+I}}W.forEach((H,I)=>{if(H.show&&H._show){let te=H.side;H._pos=R(te,H._size),H.label!=null&&(H._lpos=R(te,H.labelSize))}})}if(be.dataIdx==null){let v=be.hover,S=v.skip=new Set(v.skip??[]);S.add(void 0);let z=v.prox=Qe(v.prox),E=v.bias??=0;be.dataIdx=(R,H,I,te)=>{if(H==0)return I;let ie=I,ce=z(R,H,I,te)??_t,de=ce>=0&&ce<_t,ge=X.ori==0?Ce:me,De=be.left,Ie=i[0],Je=i[H];if(S.has(Je[I])){ie=null;let qe=null,je=null,ze;if(E==0||E==-1)for(ze=I;qe==null&&ze-- >0;)S.has(Je[ze])||(qe=ze);if(E==0||E==1)for(ze=I;je==null&&ze++ce&&(ie=null);return ie}}const Ft=v=>{be.event=v};be.idxs=Be,be._lock=!1;let Tt=be.points;Tt.show=Qe(Tt.show),Tt.size=Qe(Tt.size),Tt.stroke=Qe(Tt.stroke),Tt.width=Qe(Tt.width),Tt.fill=Qe(Tt.fill);const Nt=l.focus=an({},n.focus||{alpha:.3},be.focus),ps=Nt.prox>=0,gs=ps&&Tt.one;let oi=[],ir=[],rr=[];function aa(v,S){let z=Tt.show(l,S);if(z instanceof HTMLElement)return Ci(z,aM),Ci(z,v.class),Lr(z,-10,-10,Ce,me),T.insertBefore(z,oi[S]),z}function Sr(v,S){if(u==1||S>0){let z=u==1&&K[v.scale].time,E=v.value;v.value=z?__(E)?O_(J,E_(E,ee)):E||Se:E||_4,v.label=v.label||(z?d4:f4)}if(gs||S>0){v.width=v.width==null?1:v.width,v.paths=v.paths||C4||zM,v.fillTo=Qe(v.fillTo||T4),v.pxAlign=+et(v.pxAlign,A),v.pxRound=U_(v.pxAlign),v.stroke=Qe(v.stroke||null),v.fill=Qe(v.fill||null),v._stroke=v._fill=v._paths=v._focus=null;let z=S4(si(1,v.width),1),E=v.points=an({},{size:z,width:si(1,z*.2),stroke:v.stroke,space:z*2,paths:D4,_stroke:null,_fill:null},v.points);E.show=Qe(E.show),E.filter=Qe(E.filter),E.fill=Qe(E.fill),E.stroke=Qe(E.stroke),E.paths=Qe(E.paths),E.pxAlign=v.pxAlign}if(M){let z=tt(v,S);Ae.splice(S,0,z[0]),pe.splice(S,0,z[1]),Re.values.push(null)}if(Q){Be.splice(S,0,null);let z=null;gs?S==0&&(z=aa(v,S)):S>0&&(z=aa(v,S)),oi.splice(S,0,z),ir.splice(S,0,0),rr.splice(S,0,0)}en("addSeries",S)}function sl(v,S){S=S??D.length,v=u==1?_p(v,S,A_,C_):_p(v,S,{},R_),D.splice(S,0,v),Sr(D[S],S)}l.addSeries=sl;function la(v){if(D.splice(v,1),M){Re.values.splice(v,1),pe.splice(v,1);let S=Ae.splice(v,1)[0];In(null,S.firstChild),S.remove()}Q&&(Be.splice(v,1),oi.splice(v,1)[0].remove(),ir.splice(v,1),rr.splice(v,1)),en("delSeries",v)}l.delSeries=la;const xr=[!1,!1,!1,!1];function hd(v,S){if(v._show=v.show,v.show){let z=v.side%2,E=K[v.scale];E==null&&(v.scale=z?D[1].scale:G,E=K[v.scale]);let R=E.time;v.size=Qe(v.size),v.space=Qe(v.space),v.rotate=Qe(v.rotate),Ys(v.incrs)&&v.incrs.forEach(I=>{!ea.has(I)&&ea.set(I,jS(I))}),v.incrs=Qe(v.incrs||(E.distr==2?KM:R?L==1?YM:JM:Ka)),v.splits=Qe(v.splits||(R&&E.distr==1?xe:E.distr==3?gp:E.distr==4?p4:m4)),v.stroke=Qe(v.stroke),v.grid.stroke=Qe(v.grid.stroke),v.ticks.stroke=Qe(v.ticks.stroke),v.border.stroke=Qe(v.border.stroke);let H=v.values;v.values=Ys(H)&&!Ys(H[0])?Qe(H):R?Ys(H)?T_(J,z_(H,ee)):__(H)?e4(J,H):H||Me:H||h4,v.filter=Qe(v.filter||(E.distr>=3&&E.log==10?y4:E.distr==3&&E.log==2?b4:AS)),v.font=H_(v.font),v.labelFont=H_(v.labelFont),v._size=v.size(l,null,S,0),v._space=v._rotate=v._incrs=v._found=v._splits=v._values=null,v._size>0&&(xr[S]=!0,v._el=Ji(nM,w))}}function vs(v,S,z,E){let[R,H,I,te]=z,ie=S%2,ce=0;return ie==0&&(te||H)&&(ce=S==0&&!R||S==2&&!I?hn(N_.size/3):0),ie==1&&(R||I)&&(ce=S==1&&!H||S==3&&!te?hn(j_.size/2):0),ce}const al=l.padding=(n.padding||[vs,vs,vs,vs]).map(v=>Qe(et(v,vs))),ui=l._padding=al.map((v,S)=>v(l,S,xr,0));let un,Qt=null,Jt=null;const oa=u==1?D[0].idxs:null;let Fn=null,Vr=!1;function vo(v,S){if(i=v??[],l.data=l._data=i,u==2){un=0;for(let z=1;z=0,Yn=!0,Gr()}}l.setData=vo;function ll(){Vr=!0;let v,S;u==1&&(un>0?(Qt=oa[0]=0,Jt=oa[1]=un-1,v=i[0][Qt],S=i[0][Jt],we==2?(v=Qt,S=Jt):v==S&&(we==3?[v,S]=id(v,v,X.log,!1):we==4?[v,S]=ig(v,v,X.log,!1):X.time?S=v+hn(86400/L):[v,S]=If(v,S,rg,!0))):(Qt=oa[0]=v=null,Jt=oa[1]=S=null)),sr(G,v,S)}let ci,At,bn,wr,ol,yo,bo,ul,Ir,cn;function ua(v,S,z,E,R,H){v??=i_,z??=ag,E??="butt",R??=i_,H??="round",v!=ci&&(y.strokeStyle=ci=v),R!=At&&(y.fillStyle=At=R),S!=bn&&(y.lineWidth=bn=S),H!=ol&&(y.lineJoin=ol=H),E!=yo&&(y.lineCap=yo=E),z!=wr&&y.setLineDash(wr=z)}function zr(v,S,z,E){S!=At&&(y.fillStyle=At=S),v!=bo&&(y.font=bo=v),z!=ul&&(y.textAlign=ul=z),E!=Ir&&(y.textBaseline=Ir=E)}function Tr(v,S,z,E,R=0){if(E.length>0&&v.auto(l,Vr)&&(S==null||S.min==null)){let H=et(Qt,0),I=et(Jt,E.length-1),te=z.min==null?yM(E,H,I,R,v.distr==3):[z.min,z.max];v.min=br(v.min,z.min=te[0]),v.max=si(v.max,z.max=te[1])}}const ys={min:null,max:null};function bs(){for(let E in K){let R=K[E];fe[E]==null&&(R.min==null||fe[G]!=null&&R.auto(l,Vr))&&(fe[E]=ys)}for(let E in K){let R=K[E];fe[E]==null&&R.from!=null&&fe[R.from]!=null&&(fe[E]=ys)}fe[G]!=null&&$n(!0);let v={};for(let E in fe){let R=fe[E];if(R!=null){let H=v[E]=oo(K[E],OM);if(R.min!=null)an(H,R);else if(E!=G||u==2)if(un==0&&H.from==null){let I=H.range(l,null,null,E);H.min=I[0],H.max=I[1]}else H.min=_t,H.max=-_t}}if(un>0){D.forEach((E,R)=>{if(u==1){let H=E.scale,I=fe[H];if(I==null)return;let te=v[H];if(R==0){let ie=te.range(l,te.min,te.max,H);te.min=ie[0],te.max=ie[1],Qt=yr(te.min,i[0]),Jt=yr(te.max,i[0]),Jt-Qt>1&&(i[0][Qt]te.max&&Jt--),E.min=Fn[Qt],E.max=Fn[Jt]}else E.show&&E.auto&&Tr(te,I,E,i[R],E.sorted);E.idxs[0]=Qt,E.idxs[1]=Jt}else if(R>0&&E.show&&E.auto){let[H,I]=E.facets,te=H.scale,ie=I.scale,[ce,de]=i[R],ge=v[te],De=v[ie];ge!=null&&Tr(ge,fe[te],H,ce,H.sorted),De!=null&&Tr(De,fe[ie],I,de,I.sorted),E.min=I.min,E.max=I.max}});for(let E in v){let R=v[E],H=fe[E];if(R.from==null&&(H==null||H.min==null)){let I=R.range(l,R.min==_t?null:R.min,R.max==-_t?null:R.max,E);R.min=I[0],R.max=I[1]}}}for(let E in v){let R=v[E];if(R.from!=null){let H=v[R.from];if(H.min==null)R.min=R.max=null;else{let I=R.range(l,H.min,H.max,E);R.min=I[0],R.max=I[1]}}}let S={},z=!1;for(let E in v){let R=v[E],H=K[E];if(H.min!=R.min||H.max!=R.max){H.min=R.min,H.max=R.max;let I=H.distr;H._min=I==3?fs(H.min):I==4?Im(H.min,H.asinh):I==100?H.fwd(H.min):H.min,H._max=I==3?fs(H.max):I==4?Im(H.max,H.asinh):I==100?H.fwd(H.max):H.max,S[E]=z=!0}}if(z){D.forEach((E,R)=>{u==2?R>0&&S.y&&(E._paths=null):S[E.scale]&&(E._paths=null)});for(let E in S)ms=!0,en("setScale",E);Q&&be.left>=0&&(Yt=Yn=!0)}for(let E in fe)fe[E]=null}function Wt(v){let S=pp(Qt-1,0,un-1),z=pp(Jt+1,0,un-1);for(;v[S]==null&&S>0;)S--;for(;v[z]==null&&z0){let v=D.some(S=>S._focus)&&cn!=Nt.alpha;v&&(y.globalAlpha=cn=Nt.alpha),D.forEach((S,z)=>{if(z>0&&S.show&&(_o(z,!1),_o(z,!0),S._paths==null)){let E=cn;cn!=S.alpha&&(y.globalAlpha=cn=S.alpha);let R=u==2?[0,i[z][0].length-1]:Wt(i[z]);S._paths=S.paths(l,z,R[0],R[1]),cn!=E&&(y.globalAlpha=cn=E)}}),D.forEach((S,z)=>{if(z>0&&S.show){let E=cn;cn!=S.alpha&&(y.globalAlpha=cn=S.alpha),S._paths!=null&&So(z,!1);{let R=S._paths!=null?S._paths.gaps:null,H=S.points.show(l,z,Qt,Jt,R),I=S.points.filter(l,z,H,R);(H||I)&&(S.points._paths=S.points.paths(l,z,Qt,Jt,I),So(z,!0))}cn!=E&&(y.globalAlpha=cn=E),en("drawSeries",z)}}),v&&(y.globalAlpha=cn=1)}}function _o(v,S){let z=S?D[v].points:D[v];z._stroke=z.stroke(l,v),z._fill=z.fill(l,v)}function So(v,S){let z=S?D[v].points:D[v],{stroke:E,fill:R,clip:H,flags:I,_stroke:te=z._stroke,_fill:ie=z._fill,_width:ce=z.width}=z._paths;ce=St(ce*rt,3);let de=null,ge=ce%2/2;S&&ie==null&&(ie=ce>0?"#fff":te);let De=z.pxAlign==1&&ge>0;if(De&&y.translate(ge,ge),!S){let Ie=Pn-ce/2,Je=Kn-ce/2,qe=yn+ce,je=Gn+ce;de=new Path2D,de.rect(Ie,Je,qe,je)}S?xo(te,ce,z.dash,z.cap,ie,E,R,I,H):Pr(v,te,ce,z.dash,z.cap,ie,E,R,I,de,H),De&&y.translate(-ge,-ge)}function Pr(v,S,z,E,R,H,I,te,ie,ce,de){let ge=!1;ie!=0&&Y.forEach((De,Ie)=>{if(De.series[0]==v){let Je=D[De.series[1]],qe=i[De.series[1]],je=(Je._paths||ju).band;Ys(je)&&(je=De.dir==1?je[0]:je[1]);let ze,mt=null;Je.show&&je&&_M(qe,Qt,Jt)?(mt=De.fill(l,Ie)||H,ze=Je._paths.clip):je=null,xo(S,z,E,R,mt,I,te,ie,ce,de,ze,je),ge=!0}}),ge||xo(S,z,E,R,H,I,te,ie,ce,de)}const Kr=uo|yp;function xo(v,S,z,E,R,H,I,te,ie,ce,de,ge){ua(v,S,z,E,R),(ie||ce||ge)&&(y.save(),ie&&y.clip(ie),ce&&y.clip(ce)),ge?(te&Kr)==Kr?(y.clip(ge),de&&y.clip(de),fa(R,I),ca(v,H,S)):te&yp?(fa(R,I),y.clip(ge),ca(v,H,S)):te&uo&&(y.save(),y.clip(ge),de&&y.clip(de),fa(R,I),y.restore(),ca(v,H,S)):(fa(R,I),ca(v,H,S)),(ie||ce||ge)&&y.restore()}function ca(v,S,z){z>0)DELIM" -R"DELIM(&&(S instanceof Map?S.forEach((E,R)=>{y.strokeStyle=ci=R,y.stroke(E)}):S!=null&&v&&y.stroke(S))}function fa(v,S){S instanceof Map?S.forEach((z,E)=>{y.fillStyle=At=E,y.fill(z)}):S!=null&&v&&y.fill(S)}function md(v,S,z,E){let R=W[v],H;if(E<=0)H=[0,0];else{let I=R._space=R.space(l,v,S,z,E),te=R._incrs=R.incrs(l,v,S,z,E,I);H=B4(S,z,te,E,I)}return R._found=H}function Ge(v,S,z,E,R,H,I,te,ie,ce){let de=I%2/2;A==1&&y.translate(de,de),ua(te,I,ie,ce,te),y.beginPath();let ge,De,Ie,Je,qe=R+(E==0||E==3?-H:H);z==0?(De=R,Je=qe):(ge=R,Ie=qe);for(let je=0;je{if(!z.show)return;let R=K[z.scale];if(R.min==null){z._show&&(S=!1,z._show=!1,$n(!1));return}else z._show||(S=!1,z._show=!0,$n(!1));let H=z.side,I=H%2,{min:te,max:ie}=R,[ce,de]=md(E,te,ie,I==0?Ce:me);if(de==0)return;let ge=R.distr==2,De=z._splits=z.splits(l,E,te,ie,ce,de,ge),Ie=R.distr==2?De.map(ze=>Fn[ze]):De,Je=R.distr==2?Fn[De[1]]-Fn[De[0]]:ce,qe=z._values=z.values(l,z.filter(l,Ie,E,de,Je),E,de,Je);z._rotate=H==2?z.rotate(l,qe,E,de):0;let je=z._size;z._size=Xi(z.size(l,qe,E,v)),je!=null&&z._size!=je&&(S=!1)}),S}function cl(v){let S=!0;return al.forEach((z,E)=>{let R=z(l,E,xr,v);R!=ui[E]&&(S=!1),ui[E]=R}),S}function fl(){for(let v=0;vFn[An]):Ie,qe=de.distr==2?Fn[Ie[1]]-Fn[Ie[0]]:ie,je=S.ticks,ze=S.border,mt=je.show?je.size:0,pt=hn(mt*rt),Mt=hn((S.alignTo==2?S._size-mt-S.gap:S.gap)*rt),st=S._rotate*-Mf/180,yt=k(S._pos*rt),Hn=(pt+Mt)*te,Sn=yt+Hn;H=E==0?Sn:0,R=E==1?Sn:0;let Bn=S.font[0],Jn=S.align==1?Jl:S.align==2?Bm:st>0?Jl:st<0?Bm:E==0?"center":z==3?Bm:Jl,Ei=st||E==1?"middle":z==2?vu:n_;zr(Bn,I,Jn,Ei);let qn=S.font[1]*S.lineGap,Xn=Ie.map(An=>k(m(An,de,ge,De))),Oi=S._values;for(let An=0;An{z>0&&(S._paths=null,v&&(u==1?(S.min=null,S.max=null):S.facets.forEach(E=>{E.min=null,E.max=null})))})}let _n=!1,dl=!1,da=[];function wo(){dl=!1;for(let v=0;v0&&queueMicrotask(wo)}l.batch=pd;function Qn(){if(ia&&(bs(),ia=!1),ms&&(qu(),ms=!1),nl){if(Et(O,Jl,nt),Et(O,vu,Zt),Et(O,wu,Ce),Et(O,zu,me),Et(T,Jl,nt),Et(T,vu,Zt),Et(T,wu,Ce),Et(T,zu,me),Et(w,wu,ai),Et(w,zu,Hi),b.width=hn(ai*rt),b.height=hn(Hi*rt),W.forEach(({_el:v,_show:S,_size:z,_pos:E,side:R})=>{if(v!=null)if(S){let H=R===3||R===0?z:0,I=R%2==1;Et(v,I?"left":"top",E-H),Et(v,I?"width":"height",z),Et(v,I?"top":"left",I?Zt:nt),Et(v,I?"height":"width",I?me:Ce),hp(v,Ga)}else Ci(v,Ga)}),ci=At=bn=ol=yo=bo=ul=Ir=wr=null,cn=1,Sa(!0),nt!=qr||Zt!=Zn||Ce!=li||me!=nr){$n(!1);let v=Ce/li,S=me/nr;if(Q&&!Yt&&be.left>=0){be.left*=v,be.top*=S,_i&&Lr(_i,hn(be.left),0,Ce,me),Yr&&Lr(Yr,0,hn(be.top),Ce,me);for(let z=0;z=0&&We.width>0){We.left*=v,We.width*=v,We.top*=S,We.height*=S;for(let z in xa)Et(xi,z,We[z])}qr=nt,Zn=Zt,li=Ce,nr=me}en("setSize"),nl=!1}ai>0&&Hi>0&&(y.clearRect(0,0,b.width,b.height),en("drawClear"),ae.forEach(v=>v()),en("draw")),We.show&&il&&(pa(We),il=!1),Q&&Yt&&(Bi(null,!0,!1),Yt=!1),Re.show&&Re.live&&Yn&&(ba(),Yn=!1),p||(p=!0,l.status=1,en("ready")),Vr=!1,_n=!1}l.redraw=(v,S)=>{ms=S||!1,v!==!1?sr(G,X.min,X.max):Gr()};function ha(v,S){let z=K[v];if(z.from==null){if(un==0){let E=z.range(l,S.min,S.max,v);S.min=E[0],S.max=E[1]}if(S.min>S.max){let E=S.min;S.min=S.max,S.max=E}if(un>1&&S.min!=null&&S.max!=null&&S.max-S.min<1e-16)return;v==G&&z.distr==2&&un>0&&(S.min=yr(S.min,i[0]),S.max=yr(S.max,i[0]),S.min==S.max&&S.max++),fe[v]=S,ia=!0,Gr()}}l.setScale=ha;let hl,ma,_i,Yr,zo,Fr,_s,Qr,To,ml,vt,xt,Si=!1;const ht=be.drag;let qt=ht.x,Vt=ht.y;Q&&(be.x&&(hl=Ji(rM,T)),be.y&&(ma=Ji(sM,T)),X.ori==0?(_i=hl,Yr=ma):(_i=ma,Yr=hl),vt=be.left,xt=be.top);const We=l.select=an({show:!0,over:!0,left:0,width:0,top:0,height:0},n.select),xi=We.show?Ji(iM,We.over?T:O):null;function pa(v,S){if(We.show){for(let z in v)We[z]=v[z],z in xa&&Et(xi,z,v[z]);S!==!1&&en("setSelect")}}l.setSelect=pa;function Eo(v){if(D[v].show)M&&hp(Ae[v],Ga);else if(M&&Ci(Ae[v],Ga),Q){let z=gs?oi[0]:oi[v];z!=null&&Lr(z,-10,-10,Ce,me)}}function sr(v,S,z){ha(v,{min:S,max:z})}function Ln(v,S,z,E){S.focus!=null&&pl(v),S.show!=null&&D.forEach((R,H)=>{H>0&&(v==H||v==null)&&(R.show=S.show,Eo(H),u==2?(sr(R.facets[0].scale,null,null),sr(R.facets[1].scale,null,null)):sr(R.scale,null,null),Gr())}),z!==!1&&en("setSeries",v,S),E&&wa("setSeries",l,v,S)}l.setSeries=Ln;function ar(v,S){an(Y[v],S)}function Oo(v,S){v.fill=Qe(v.fill||null),v.dir=et(v.dir,-1),S=S??Y.length,Y.splice(S,0,v)}function ga(v){v==null?Y.length=0:Y.splice(v,1)}l.addBand=Oo,l.setBand=ar,l.delBand=ga;function Er(v,S){D[v].alpha=S,Q&&oi[v]!=null&&(oi[v].style.opacity=S),M&&Ae[v]&&(Ae[v].style.opacity=S)}let wi,zi,Or;const lr={focus:!0};function pl(v){if(v!=Or){let S=v==null,z=Nt.alpha!=1;D.forEach((E,R)=>{if(u==1||R>0){let H=S||R==0||R==v;E._focus=S?null:H,z&&Er(R,H?1:Nt.alpha)}}),Or=v,z&&Gr()}}M&&ps&&Gt(a_,re,v=>{be._lock||(Ft(v),Or!=null&&Ln(null,lr,!0,$t.setSeries))});function Ti(v,S,z){let E=K[S];z&&(v=v/rt-(E.ori==1?Zt:nt));let R=Ce;E.ori==1&&(R=me,v=R-v),E.dir==-1&&(v=R-v);let H=E._min,I=E._max,te=v/R,ie=H+(I-H)*te,ce=E.distr;return ce==3?ao(10,ie):ce==4?xM(ie,E.asinh):ce==100?E.bwd(ie):ie}function Nn(v,S){let z=Ti(v,G,S);return yr(z,i[0],Qt,Jt)}l.valToIdx=v=>yr(v,i[0]),l.posToIdx=Nn,l.posToVal=Ti,l.valToPos=(v,S,z)=>K[S].ori==0?f(v,K[S],z?yn:Ce,z?Pn:0):d(v,K[S],z?Gn:me,z?Kn:0),l.setCursor=(v,S,z)=>{vt=v.left,xt=v.top,Bi(null,S,z)};function or(v,S){Et(xi,Jl,We.left=v),Et(xi,wu,We.width=S)}function va(v,S){Et(xi,vu,We.top=v),Et(xi,zu,We.height=S)}let ur=X.ori==0?or:va,ya=X.ori==1?or:va;function No(){if(M&&Re.live)for(let v=u==2?1:0;v{Be[E]=z}):EM(v.idx)||Be.fill(v.idx),Re.idx=Be[0]),M&&Re.live){for(let z=0;z0||u==1&&!Bt)&&_a(z,Be[z]);No()}Yn=!1,S!==!1&&en("setLegend")}l.setLegend=ba;function _a(v,S){let z=D[v],E=v==0&&we==2?Fn:i[v],R;Bt?R=z.values(l,v,S)??Li:(R=z.value(l,S==null?null:E[S],v,S),R=R==null?Li:{_:R}),Re.values[v]=R}function Bi(v,S,z){To=vt,ml=xt,[vt,xt]=be.move(l,vt,xt),be.left=vt,be.top=xt,Q&&(_i&&Lr(_i,hn(vt),0,Ce,me),Yr&&Lr(Yr,0,hn(xt),Ce,me));let E,R=Qt>Jt;wi=_t,zi=null;let H=X.ori==0?Ce:me,I=X.ori==1?Ce:me;if(vt<0||un==0||R){E=be.idx=null;for(let te=0;te0&&mt.show){let Hn=st==null?-10:st==E?ce:he(u==1?i[0][st]:i[ze][0][st],X,H,0),Sn=yt==null?-10:Oe(yt,u==1?K[mt.scale]:K[mt.facets[1].scale],I,0);if(ps&&yt!=null){let Bn=X.ori==1?vt:xt,Jn=pn(Nt.dist(l,ze,st,Sn,Bn));if(Jn=0?1:-1,Oi=qn>=0?1:-1;Oi==Xn&&(Oi==1?Ei==1?yt>=qn:yt<=qn:Ei==1?yt<=qn:yt>=qn)&&(wi=Jn,zi=ze)}else wi=Jn,zi=ze}}if(Yn||gs){let Bn,Jn;X.ori==0?(Bn=Hn,Jn=Sn):(Bn=Sn,Jn=Hn);let Ei,qn,Xn,Oi,qi,An,Wn=!0,Jr=Tt.bbox;if(Jr!=null){Wn=!1;let ut=Jr(l,ze);Xn=ut.left,Oi=ut.top,Ei=ut.width,qn=ut.height}else Xn=Bn,Oi=Jn,Ei=qn=Tt.size(l,ze);if(An=Tt.fill(l,ze),qi=Tt.stroke(l,ze),gs)ze==zi&&wi<=Nt.prox&&(de=Xn,ge=Oi,De=Ei,Ie=qn,Je=Wn,qe=An,je=qi);else{let ut=oi[ze];ut!=null&&(ir[ze]=Xn,rr[ze]=Oi,h_(ut,Ei,qn,Wn),f_(ut,An,qi),Lr(ut,Xi(Xn),Xi(Oi),Ce,me))}}}}if(gs){let ze=Nt.prox,mt=Or==null?wi<=ze:wi>ze||zi!=Or;if(Yn||mt){let pt=oi[0];pt!=null&&(ir[0]=de,rr[0]=ge,h_(pt,De,Ie,Je),f_(pt,qe,je),Lr(pt,Xi(de),Xi(ge),Ce,me))}}}if(We.show&&Si)if(v!=null){let[te,ie]=$t.scales,[ce,de]=$t.match,[ge,De]=v.cursor.sync.scales,Ie=v.cursor.drag;if(qt=Ie._x,Vt=Ie._y,qt||Vt){let{left:Je,top:qe,width:je,height:ze}=v.select,mt=v.scales[ge].ori,pt=v.posToVal,Mt,st,yt,Hn,Sn,Bn=te!=null&&ce(te,ge),Jn=ie!=null&&de(ie,De);Bn&&qt?(mt==0?(Mt=Je,st=je):(Mt=qe,st=ze),yt=K[te],Hn=he(pt(Mt,ge),yt,H,0),Sn=he(pt(Mt+st,ge),yt,H,0),ur(br(Hn,Sn),pn(Sn-Hn))):ur(0,H),Jn&&Vt?(mt==1?(Mt=Je,st=je):(Mt=qe,st=ze),yt=K[ie],Hn=Oe(pt(Mt,De),yt,I,0),Sn=Oe(pt(Mt+st,De),yt,I,0),ya(br(Hn,Sn),pn(Sn-Hn))):ya(0,I)}else Mo()}else{let te=pn(To-zo),ie=pn(ml-Fr);if(X.ori==1){let De=te;te=ie,ie=De}qt=ht.x&&te>=ht.dist,Vt=ht.y&&ie>=ht.dist;let ce=ht.uni;ce!=null?qt&&Vt&&(qt=te>=ce,Vt=ie>=ce,!qt&&!Vt&&(ie>te?Vt=!0:qt=!0)):ht.x&&ht.y&&(qt||Vt)&&(qt=Vt=!0);let de,ge;qt&&(X.ori==0?(de=_s,ge=vt):(de=Qr,ge=xt),ur(br(de,ge),pn(ge-de)),Vt||ya(0,I)),Vt&&(X.ori==1?(de=_s,ge=vt):(de=Qr,ge=xt),ya(br(de,ge),pn(ge-de)),qt||ur(0,H)),!qt&&!Vt&&(ur(0,0),ya(0,0))}if(ht._x=qt,ht._y=Vt,v==null){if(z){if(ec!=null){let[te,ie]=$t.scales;$t.values[0]=te!=null?Ti(X.ori==0?vt:xt,te):null,$t.values[1]=ie!=null?Ti(X.ori==1?vt:xt,ie):null}wa(qm,l,vt,xt,Ce,me,E)}if(ps){let te=z&&$t.setSeries,ie=Nt.prox;Or==null?wi<=ie&&Ln(zi,lr,!0,te):wi>ie?Ln(null,lr,!0,te):zi!=Or&&Ln(zi,lr,!0,te)}}Yn&&(Re.idx=E,ba()),S!==!1&&en("setCursor")}let cr=null;Object.defineProperty(l,"rect",{get(){return cr==null&&Sa(!1),cr}});function Sa(v=!1){v?cr=null:(cr=T.getBoundingClientRect(),en("syncRect",cr))}function Pu(v,S,z,E,R,H,I){be._lock||Si&&v!=null&&v.movementX==0&&v.movementY==0||(Ao(v,S,z,E,R,H,I,!1,v!=null),v!=null?Bi(null,!0,!0):Bi(S,!0,!1))}function Ao(v,S,z,E,R,H,I,te,ie){if(cr==null&&Sa(!1),Ft(v),v!=null)z=v.clientX-cr.left,E=v.clientY-cr.top;else{if(z<0||E<0){vt=-10,xt=-10;return}let[ce,de]=$t.scales,ge=S.cursor.sync,[De,Ie]=ge.values,[Je,qe]=ge.scales,[je,ze]=$t.match,mt=S.axes[0].side%2==1,pt=X.ori==0?Ce:me,Mt=X.ori==1?Ce:me,st=mt?H:R,yt=mt?R:H,Hn=mt?E:z,Sn=mt?z:E;if(Je!=null?z=je(ce,Je)?m(De,K[ce],pt,0):-10:z=pt*(Hn/st),qe!=null?E=ze(de,qe)?m(Ie,K[de],Mt,0):-10:E=Mt*(Sn/yt),X.ori==1){let Bn=z;z=E,E=Bn}}ie&&(S==null||S.cursor.event.type==qm)&&((z<=1||z>=Ce-1)&&(z=Pa(z,Ce)),(E<=1||E>=me-1)&&(E=Pa(E,me))),te?(zo=z,Fr=E,[_s,Qr]=be.move(l,z,E)):(vt=z,xt=E)}const xa={width:0,height:0,left:0,top:0};function Mo(){pa(xa,!1)}let Ku,Gu,Yu,Fu;function jo(v,S,z,E,R,H,I){Si=!0,qt=Vt=ht._x=ht._y=!1,Ao(v,S,z,E,R,H,I,!0,!1),v!=null&&(Gt(Vm,fp,Qu,!1),wa(r_,l,_s,Qr,Ce,me,null));let{left:te,top:ie,width:ce,height:de}=We;Ku=te,Gu=ie,Yu=ce,Fu=de}function Qu(v,S,z,E,R,H,I){Si=ht._x=ht._y=!1,Ao(v,S,z,E,R,H,I,!1,!0);let{left:te,top:ie,width:ce,height:de}=We,ge=ce>0||de>0,De=Ku!=te||Gu!=ie||Yu!=ce||Fu!=de;if(ge&&De&&pa(We),ht.setScale&&ge&&De){let Ie=te,Je=ce,qe=ie,je=de;if(X.ori==1&&(Ie=ie,Je=de,qe=te,je=ce),qt&&sr(G,Ti(Ie,G),Ti(Ie+Je,G)),Vt)for(let ze in K){let mt=K[ze];ze!=G&&mt.from==null&&mt.min!=_t&&sr(ze,Ti(qe+je,ze),Ti(qe,ze))}Mo()}else be.lock&&(be._lock=!be._lock,Bi(S,!0,v!=null));v!=null&&(In(Vm,fp),wa(Vm,l,vt,xt,Ce,me,null))}function gd(v,S,z,E,R,H,I){if(be._lock)return;Ft(v);let te=Si;if(Si){let ie=!0,ce=!0,de=10,ge,De;X.ori==0?(ge=qt,De=Vt):(ge=Vt,De=qt),ge&&De&&(ie=vt<=de||vt>=Ce-de,ce=xt<=de||xt>=me-de),ge&&ie&&(vt=vt<_s?0:Ce),De&&ce&&(xt=xt{let R=$t.match[2];z=R(l,S,z),z!=-1&&Ln(z,E,!0,!1)},Q&&(Gt(r_,T,jo),Gt(qm,T,Pu),Gt(s_,T,v=>{Ft(v),Sa(!1)}),Gt(a_,T,gd),Gt(l_,T,Ju),bp.add(l),l.syncRect=Sa);const gl=l.hooks=n.hooks||{};function en(v,S,z){dl?da.push([v,S,z]):v in gl&&gl[v].forEach(E=>{E.call(null,l,S,z)})}(n.plugins||[]).forEach(v=>{for(let S in v.hooks)gl[S]=(gl[S]||[]).concat(v.hooks[S])});const Wu=(v,S,z)=>z,$t=an({key:null,setSeries:!1,filters:{pub:y_,sub:y_},scales:[G,D[1]?D[1].scale:null],match:[b_,b_,Wu],values:[null,null]},be.sync);$t.match.length==2&&$t.match.push(Wu),be.sync=$t;const ec=$t.key,ko=JS(ec);function wa(v,S,z,E,R,H,I){$t.filters.pub(v,S,z,E,R,H,I)&&ko.pub(v,S,z,E,R,H,I)}ko.sub(l);function vd(v,S,z,E,R,H,I){$t.filters.sub(v,S,z,E,R,H,I)&&Nr[v](null,S,z,E,R,H,I)}l.pub=vd;function yd(){ko.unsub(l),bp.delete(l),vn.clear(),mp(Vf,to,Xu),g.remove(),re?.remove(),en("destroy")}l.destroy=yd;function Ro(){en("init",n,i),vo(i||n.data,!1),fe[G]?ha(G,fe[G]):ll(),il=We.show&&(We.width>0||We.height>0),Yt=Yn=!0,rl(n.width,n.height)}return D.forEach(Sr),W.forEach(hd),a?a instanceof HTMLElement?(a.appendChild(g),Ro()):a(l,Ro):Ro(),l}on.assign=an;on.fmtNum=sg;on.rangeNum=If;on.rangeLog=id;on.rangeAsinh=ig;on.orient=tl;on.pxRatio=rt;on.join=RM;on.fmtDate=lg,on.tzDate=IM;on.sync=JS;{on.addGap=E4,on.clipGaps=ad;let n=on.paths={points:ix};n.linear=sx,n.stepped=A4,n.bars=M4,n.spline=k4}const ux=(n,i,a,l,u)=>{if(!Number.isFinite(a)||!Number.isFinite(l)||l<=a)return[];const f=[];if(Math.asinh(l)-Math.asinh(a)<1.5){const p=Number.isFinite(u)&&u>0?u:(l-a)/4,g=Math.ceil(a/p)*p;for(let b=0;b<100;b++){const y=Number((g+b*p).toPrecision(14));if(y>l)break;f.push({value:y,priority:y===0?0:1})}}else{const p=Math.ceil(Math.log10(Math.max(Math.abs(a),Math.abs(l))));for(let g=Math.min(-1,p-1);g<=p;g++)for(const b of[1,2,5]){const y=b*10**g;for(const w of[-y,y])Number.isFinite(w)&&w>=a&&w<=l&&f.push({value:w,priority:b===1?1:2})}a<=0&&l>=0&&f.push({value:0,priority:0})}f.sort((p,g)=>p.priority-g.priority||p.value-g.value);const d=[],m=[];for(const{value:p}of f){const g=n.valToPos(p,"y");Number.isFinite(g)&&m.every(b=>Math.abs(g-b)>=36)&&(d.push(p),m.push(g))}return d.sort((p,g)=>p-g),d};function cx(n,i){const a=Rt.indexOf(n.toLowerCase());return a===-1?n:i.getPropertyValue(`--chart-color-${String(a)}`).trim()||n}function V4(n){const i=n.filter(([,a])=>a>0).map(([a,l])=>({minimumRate:a,virtualSize:l}));return i.sort((a,l)=>a.minimumRate-l.minimumRate),i}const I4=new Intl.NumberFormat(void 0,{maximumSignificantDigits:8}),P4=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function Sp(n){return I4.format(n)}function fx(n){return`${P4.format(n)} vB`}function K4({snapshot:n,now:i,color:a,scale:l}){const u=se.useMemo(()=>V4(n?.data.histogram??[]),[n]),f=n!==null&&i-n.receivedAt>=Uu,d=n===null?"Waiting for transaction-pool fee data…":f?"Fee distribution is stale. Waiting for a fresh pool snapshot…":n.data.count===0?"The transaction pool is empty.":u.length===0?"No fee distribution is available for this pool snapshot.":null;return x.jsxs("div",{className:"space-y-3",children:[d?x.jsx("p",{role:"status",className:"text-textMuted flex min-h-72 item)DELIM" -R"DELIM(s-center justify-center px-4 text-center text-sm",children:d}):x.jsxs(x.Fragment,{children:[x.jsx(G4,{bins:u,color:a,scale:l}),x.jsx("p",{className:"text-textMuted text-xs",children:"Each bar is a fee-rate group, labeled by its minimum rate. Bar height is virtual size, not transaction count. Groups are spaced evenly."}),x.jsxs("details",{className:"border-accentSecondary/20 rounded-md border text-xs",children:[x.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-3 py-2",children:["View ",Tn(u.length)," fee-rate ",u.length===1?"group":"groups"]}),x.jsx("div",{className:"border-accentSecondary/20 max-h-56 overflow-auto border-t",children:x.jsxs("table",{className:"w-full text-left tabular-nums",children:[x.jsx("caption",{className:"sr-only",children:"Transaction-pool fee-rate groups"}),x.jsx("thead",{className:"bg-surface text-textMuted sticky top-0",children:x.jsxs("tr",{children:[x.jsx("th",{scope:"col",className:"px-3 py-2",children:"Minimum rate (sat/vB)"}),x.jsx("th",{scope:"col",className:"px-3 py-2 text-right",children:"Virtual size (vB)"})]})}),x.jsx("tbody",{className:"divide-accentSecondary/20 divide-y",children:u.map((m,p)=>x.jsxs("tr",{children:[x.jsx("td",{className:"px-3 py-2",children:Sp(m.minimumRate)}),x.jsx("td",{className:"px-3 py-2 text-right",children:Tn(m.virtualSize)})]},p))})]})})]})]}),n&&x.jsxs("p",{className:"text-textMuted text-xs",children:[f?"Last snapshot":"Snapshot"," ",Du(n.receivedAt),!f&&` · ${Tn(n.data.count)} transactions · ${fx(n.data.virtual)}`]})]})}function G4({bins:n,color:i,scale:a}){const l=kp(),u=se.useRef(null),f=se.useRef(null),d=se.useRef(n);return se.useLayoutEffect(()=>{d.current=n;const m=f.current;m&&(m.setData([n.map((p,g)=>g),n.map(p=>p.virtualSize)]),m.redraw(!1,!0))},[n]),se.useLayoutEffect(()=>{const m=u.current;if(!m)return;const p=getComputedStyle(m),g=cx(i,p),b=`12px ${p.fontFamily}`,y=[d.current.map((A,k)=>k),d.current.map(A=>A.virtualSize)],w={width:Math.max(240,m.clientWidth),height:280,padding:[12,12,0,0],cursor:{drag:{x:!1,y:!1}},legend:{show:!0,live:!0},scales:{x:{time:!1,range:()=>[-.5,d.current.length-.5]},y:{distr:a==="compressed"?4:1,asinh:1,range:(A,k,L)=>[0,Math.max(1,L*1.08)]}},axes:[{stroke:p.color,font:b,grid:{show:!1},ticks:{stroke:p.getPropertyValue("--chart-ticks").trim(),width:1},splits:A=>{const k=d.current,L=Math.max(1,Math.ceil(k.length/Math.max(1,Math.floor(A.width/80))));return k.map((D,W)=>W).filter(D=>D%L===0)},values:(A,k)=>k.map(L=>Sp(d.current[L].minimumRate))},{size:76,stroke:p.color,font:b,grid:{stroke:p.getPropertyValue("--chart-grid").trim(),width:1},ticks:{stroke:p.getPropertyValue("--chart-ticks").trim(),width:1},values:(A,k)=>k.map(L=>Tn(L)),...a==="compressed"?{splits:ux,filter:(A,k)=>k}:{}}],series:[{label:"Min rate",value:(A,k)=>{const L=k===null?void 0:d.current[k];return L?`${Sp(L.minimumRate)} sat/vB`:"—"}},{label:"Virtual size",stroke:g,fill:`${g}90`,width:1,points:{show:!1},paths:on.paths.bars?.({size:[.85,48]}),value:(A,k)=>k===null?"—":fx(k)}]},O=new on(w,y,m);f.current=O;const T=new ResizeObserver(A=>{const k=A[0]?.contentRect.width;k&&k>0&&O.setSize({width:Math.round(k),height:280})});return T.observe(m),()=>{T.disconnect(),O.destroy(),f.current=null}},[i,a,l]),x.jsxs("div",{role:"img","aria-label":"Transaction-pool fee distribution: virtual size in vbytes by minimum fee rate in satoshis per vbyte",children:[x.jsx("p",{className:"text-textMuted mb-2 text-xs",children:"Virtual size (vB)"}),x.jsx("div",{ref:u,className:"text-textMuted min-w-0 overflow-hidden"}),x.jsx("p",{className:"text-textMuted text-center text-xs",children:"Minimum fee rate per group (sat/vB)"})]})}function Y4({data:n,series:i,height:a=280,emptyMessage:l="Waiting for live data…",valueSuffix:u="",zeroBased:f=!0,valueFormatter:d=X4,visualization:m="line",scale:p="linear",forceEmpty:g=!1}){const b=kp(),y=se.useRef(null),w=se.useRef(null),O=se.useRef(!1),T=se.useRef(null),A=se.useMemo(()=>J4(n),[n]),k=se.useRef(A),L=!g&&n[0]?.length>0;return se.useLayoutEffect(()=>{k.current=A},[A]),se.useLayoutEffect(()=>{const D=y.current;if(!D)return;const W=getComputedStyle(D),K=`12px ${W.fontFamily}`,Y={width:Math.max(240,D.clientWidth),height:a,padding:[12,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},focus:{prox:24}},hooks:{setSelect:[ye=>{ye.select.width>0&&(O.current=!0)}]},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,distr:p==="compressed"?4:1,asinh:1,...f?{range:(ye,ue,X)=>[Math.min(0,ue),X===0?1:X*1.08]}:{range:(ye,ue,X)=>{const we=X-ue,he=we===0?Math.max(1,Math.abs(X)*5e-4):we*.08;return[ue-he,X+he]}}}},axes:[{stroke:W.color,grid:{stroke:W.getPropertyValue("--chart-grid").trim(),width:1},ticks:{stroke:W.getPropertyValue("--chart-ticks").trim(),width:1},font:K},{size:72,stroke:W.color,grid:{stroke:W.getPropertyValue("--chart-grid").trim(),width:1},ticks:{stroke:W.getPropertyValue("--chart-ticks").trim(),width:1},font:K,values:(ye,ue)=>ue.map(X=>X===null?null:`${d(X)}${u}`),...p==="compressed"?{splits:ux,filter:(ye,ue)=>ue}:{}}],series:[{},...i.map((ye,ue)=>{const X=cx(ye.color,W),we=m==="step"?on.paths.stepped?.({align:1}):m==="bar"?F4(ue,i.length):void 0;return{label:ye.label,stroke:X,fill:m==="area"||m==="bar"?ye.fill??`${X}24`:ye.fill,width:ye.width??2,paths:we,points:{show:m==="line"?ye.points??!1:!1},value:(he,Oe)=>Oe===null?"—":`${d(Oe)}${u}`}})]},G=new on(Y,k.current,D),ne=T.current;ne&&G.setScale("x",ne),w.current=G;const ae=new ResizeObserver(ye=>{const ue=ye[0]?.contentRect.width;ue&&ue>0&&G.setSize({width:Math.round(ue),height:a})});return ae.observe(D),()=>{T.current=O.current&&G.scales.x.min!=null&&G.scales.x.max!=null?{min:G.scales.x.min,max:G.scales.x.max}:null,ae.disconnect(),G.destroy(),w.current=null}},[a,i,d,u,m,f,p,b]),se.useEffect(()=>{const D=w.current;if(!D)return;const W=!O.current;D.setData(A,W),W||D.redraw()},[A]),x.jsxs("div",{className:"relative min-w-0",children:[x.jsx("div",{ref:y,className:"text-textMuted min-w-0 overflow-hidden"}),!L&&x.jsx("div",{className:"bg-surface text-textMuted pointer-events-none absolute inset-0 z-10 flex items-center justify-center text-sm",children:l})]})}function F4(n,i){const a=Math.max(1,i);return on.paths.bars?.({size:[1,48/a,0],disp:{x0:{unit:1,values:l=>{const u=B_(l,a),f=-u.groupWidth/2+u.barWidth*n;return Array.from(l.data[0],d=>d+f)}},size:{unit:1,values:l=>[B_(l,a).barWidth]}}})}function B_(n,i){const a=Q4(n.data[0]),l=Math.abs(n.posToVal(48,"x")-n.posToVal(0,"x")),u=Math.min(a*.72,l);return{groupWidth:u,barWidth:u/i}}function Q4(n){let i=Number.POSITIVE_INFINITY,a;for(const l of n)if(Number.isFinite(l)){if(a!==void 0){const u=Math.abs(l-a);u>0&&u=2)return n;const a=Date.now()/1e3,l=i[0]??a,u=[l-1,l],f=n.slice(1).map(d=>{const m=d[0]??null;return[m,m]});return[u,...f]}function X4(n){return Math.abs(n)>=1e6?`${(n/1e6).toFixed(1)}m`:Math.abs(n)>=1e3?`${(n/1e3).toFixed(1)}k`:Math.abs(n)>=10?n.toFixed(0):Math.abs(n)>=1?n.toFixed(1):n.toFixed(2)}const W4={300:"5m",900:"15m",3600:"1h"},ej=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),tj=new Intl.NumberFormat(void 0,{maximumFractionDigits:2});function nj(n){return ej.format(n)}function ij(n){return tj.format(n)}function rj(n){return n==="height"||n==="occurrences"?nj:ij}function sj({metrics:n}){const i=xS(),[a,l]=se.useState(R3),[u,f]=se.useState(null),[d,m]=se.useState(!1);se.useEffect(()=>{C3(a)},[a]);function p(y){l(w=>u?.mode==="add"?w.length>=Xl?w:[...w,y]:w.map(O=>O.id===y.id?y:O)),f(null)}function g(y,w){l(O=>{const T=y+w;if(T<0||T>=O.length)return O;const A=[...O],k=A[y],L=A[T];return A[y]=L,A[T]=k,A})}function b(){if(!d){m(!0);return}l(Af()),m(!1)}return x.jsxs("section",{className:"space-y-4",children:[x.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Live telemetry"}),x.jsx("h2",{class)DELIM" -R"DELIM(Name:"text-accent mt-1 text-2xl font-semibold",children:"Custom charts"}),x.jsxs("p",{className:"text-textMuted mt-1 text-sm",children:["Session data only · ",String(a.length)," of ",String(Xl)," charts"]})]}),x.jsxs("div",{className:"flex flex-wrap gap-2",children:[x.jsx("button",{type:"button",onClick:()=>{m(!1),f({mode:"add",chart:vS()})},disabled:a.length>=Xl,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:"Add chart"}),x.jsx("button",{type:"button",onClick:b,onBlur:()=>{m(!1)},className:`rounded-md border px-3 py-2 text-sm font-medium ${d?"border-amber-400/60 text-amber-200":"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary"}`,children:d?"Confirm reset":"Reset defaults"})]})]}),a.length===0?x.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border border-dashed px-6 py-16 text-center",children:[x.jsx("p",{className:"text-textPrimary font-medium",children:"No charts in this dashboard."}),x.jsx("p",{className:"text-textMuted mt-2 text-sm",children:"Add a custom chart or start from a template."})]}):x.jsx("div",{className:"grid gap-6 xl:grid-cols-2",children:a.map((y,w)=>x.jsx(aj,{chart:y,metrics:n,now:i,canMoveEarlier:w>0,canMoveLater:w{l(O=>O.map(T=>T.id===y.id?{...T,scale:T.scale==="compressed"?"linear":"compressed"}:T))},onDelete:()=>{l(O=>O.filter(T=>T.id!==y.id))},onDuplicate:()=>{l(O=>O.length>=Xl?O:[...O,k3(y)])},onEdit:()=>{f({mode:"edit",chart:y})},onMoveEarlier:()=>{g(w,-1)},onMoveLater:()=>{g(w,1)}},y.id))}),u&&x.jsx(G3,{chart:u.chart,mode:u.mode,onCancel:()=>{f(null)},onSave:p},`${u.mode}-${u.chart.id}`)]})}function aj({chart:n,metrics:i,now:a,canMoveEarlier:l,canMoveLater:u,canDuplicate:f,onDelete:d,onDuplicate:m,onEdit:p,onMoveEarlier:g,onMoveLater:b,onToggleScale:y}){const[w,O]=se.useState(null),[T,A]=se.useState(0),k=w??i,L=se.useMemo(()=>ln(n)?L3(k,n):null,[n,k]),D=se.useMemo(()=>ln(n)?n.series.map(Y=>({label:Y.label??cs(Y.signalId).label,color:Y.color})):[],[n]),W=rj(L?.unit??"vbytes"),K=`Waiting for ${D.length===1?D[0]?.label?.toLowerCase():"the selected signals"}…`;return x.jsxs("article",{className:"border-accent/30 bg-surface/80 min-w-0 overflow-hidden rounded-2xl border",children:[x.jsx("header",{className:"border-accentSecondary/20 space-y-3 border-b px-4 py-4 sm:px-5",children:x.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsx("h3",{className:"text-accent truncate text-lg font-semibold",title:n.title,children:n.title}),x.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:[ln(n)&&L?`${SS(L.unit)} · ${W4[n.range]} · ${n.visualization}`:"Virtual size by fee-rate group · latest snapshot",n.scale==="compressed"?" · compressed scale":"",w?" · paused":""]})]}),x.jsxs("div",{className:"flex flex-wrap justify-end gap-1 text-xs",children:[x.jsx("button",{type:"button","aria-label":`Compress peaks for ${n.title}`,"aria-pressed":n.scale==="compressed",title:"Use a log-like Y axis to compress large peaks. Zero, negative values, and original measurements are preserved.",onClick:y,className:`rounded-md border px-2 py-1.5 ${n.scale==="compressed"?"border-accent/40 bg-accentSecondary/20 text-accent":"border-accent/30 text-textMuted hover:text-accent hover:bg-accentSecondary/10"}`,children:"Compress peaks"}),x.jsx(Ia,{label:w?"Resume chart":"Pause chart",onClick:()=>{O(Y=>Y?null:ln(n)?i:{...i,now:a})},children:w?"Resume":"Pause"}),ln(n)&&x.jsx(Ia,{label:"Reset chart zoom",onClick:()=>{A(Y=>Y+1)},children:"Reset zoom"}),x.jsx(Ia,{label:"Edit chart",onClick:p,children:"Edit"}),x.jsx(Ia,{label:"Duplicate chart",onClick:m,disabled:!f,children:"Duplicate"}),x.jsx(Ia,{label:`Move ${n.title} earlier`,onClick:g,disabled:!l,children:"←"}),x.jsx(Ia,{label:`Move ${n.title} later`,onClick:b,disabled:!u,children:"→"}),x.jsx(Ia,{label:"Delete chart",onClick:d,danger:!0,children:"Delete"})]})]})}),x.jsx("div",{className:"min-w-0 p-3 sm:p-5",children:ln(n)&&L?x.jsx(Y4,{data:L.data,series:D,visualization:n.visualization,scale:n.scale,zeroBased:B3(L.unit),valueFormatter:W,valueSuffix:H3(L.unit),forceEmpty:!L.hasObservedData,emptyMessage:K},T):!ln(n)&&x.jsx(K4,{snapshot:k.poolSnapshot,now:w?.now??a,color:n.color,scale:n.scale})}),n.scale==="compressed"&&x.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Log-like Y axis · peaks compressed · labels and hover values show original measurements."}),ln(n)&&n.series.some(Y=>Y.signalId==="event:10")&&x.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Archival includes compact-block recovery; rejected and duplicate submissions are excluded."}),L&&L.unobservedLabels.length>0&&L.hasObservedData&&x.jsxs("footer",{className:"border-accent/10 text-textMuted border-t px-5 py-2 text-[11px]",children:["Not observed this session: ",L.unobservedLabels.join(", ")]})]})}function Ia({label:n,children:i,onClick:a,disabled:l=!1,danger:u=!1}){return x.jsx("button",{type:"button","aria-label":n,onClick:a,disabled:l,className:`rounded-md px-2 py-1.5 disabled:cursor-not-allowed disabled:opacity-30 ${u?"text-textMuted hover:bg-red-500/10 hover:text-red-300":"text-textMuted hover:text-accent hover:bg-accentSecondary/10"}`,children:i})}const lj=[{event:0,label:"Header archived"},{event:3,label:"Block archived"},{event:5,label:"Block validated"},{event:6,label:"Block confirmed"},{event:13,label:"Block organized"},{event:14,label:"Block reorganized"}];function oj({adminStatus:n,endpoints:i,metrics:a,native:l,syncEstimate:u}){const f=S3(a,10),d=l.configuration,m=uj(n,l.status),p=[n.error?`Admin: ${n.error}`:null,l.status.error?`Native: ${l.status.error}`:null,l.transport==="none"&&l.restError?`Native REST: ${l.restError}`:null,a.invalidFrames>0?`${String(a.invalidFrames)} malformed admin frame${a.invalidFrames===1?"":"s"} ignored`:null,l.live.invalidFrames>0?`${String(l.live.invalidFrames)} malformed native frame${l.live.invalidFrames===1?"":"s"} ignored`:null,l.status.phase==="connected"&&l.transport==="none"?"Native: Connected, but no fresh valid state has been received":null].filter(g=>g!==null);return x.jsxs("div",{className:"space-y-6",children:[p.length>0&&x.jsxs("section",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3",children:[x.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Transport notice"}),x.jsx("ul",{className:"text-textMuted mt-1 space-y-1 text-xs",children:p.map(g=>x.jsx("li",{children:g},g))})]}),x.jsx(z3,{confirmed:l.top,estimate:u}),x.jsxs("dl",{"aria-label":"Node summary",className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[x.jsx(_f,{label:"Canonical top",value:l.top===null?"—":Tn(l.top),detail:l.transport==="none"?"Waiting for native API":`${fj(u)} · via ${l.transport==="websocket"?"native WebSocket":"REST fallback"}`,emphasized:!0}),x.jsx(_f,{label:"Current activity",value:f.label,detail:f.rate>0?`${$A(f.rate)} over the last 10 seconds`:"No lifecycle events in the last 10 seconds",numeric:!1}),x.jsx(_f,{label:"Collection uptime",value:ZA(a.now-a.sessionStartedAt),detail:`${Tn(a.totalEvents)} events · ${Tn(a.totalLogs)} logs`}),x.jsx(_f,{label:"Connection",value:m.phase==="connected"?KA(i.adminUrl).replace(/\/$/u,""):"[disconnected]",detail:`${m.lastMessageAt?`Last frame ${Du(m.lastMessageAt)}`:"Waiting for the first frame"} · ${String(m.reconnects)} reconnect${m.reconnects===1?"":"s"}`,numeric:!1})]}),x.jsx(sj,{metrics:a}),x.jsxs("section",{className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[x.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border",children:[x.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Lifecycle)DELIM" -R"DELIM( heights"}),x.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Highest observed event values"})]}),x.jsx("div",{className:"bg-accentSecondary/10 grid gap-px sm:grid-cols-2 lg:grid-cols-3",children:lj.map(({event:g,label:b})=>{const y=a.signalMaximums[Ui(g)];return x.jsxs("div",{className:"bg-surface px-5 py-4",children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:b}),x.jsx("p",{className:"text-textPrimary mt-2 text-xl font-semibold tabular-nums",children:y===void 0?"—":Tn(y)})]},g)})})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[x.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Capabilities"}),x.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Native configuration"})]}),d?x.jsxs("div",{className:"space-y-4 p-5 text-sm",children:[x.jsxs(bu,{title:"Store",children:[x.jsx(Ym,{items:[["Address index",d.store.address],["Client filters",d.store.filter],["Turbo",d.store.turbo],["Witness",d.store.witness]]}),x.jsx(Fm,{items:[["Silent payments from",d.store.silent===null?"Disabled":Tn(d.store.silent)],["Pruned below",d.store.pruned>0?Tn(d.store.pruned):"Not pruned"]]})]}),x.jsx(bu,{title:"Node services",children:x.jsx(Ym,{items:[["Blocks",d.node.blocks],["Limited",d.node.limited],["Witness",d.node.witness],["Filters",d.node.filters],["Privacy",d.node.privacy],["Fees",d.node.fees]]})}),d.network&&x.jsxs(bu,{title:"Peer protocol",children:[x.jsx(Ym,{items:[["Relay",d.network.relay],["Compact",d.network.compact],["Address",d.network.address],["Witness tx",d.network.witness_tx],["Memory pool",d.network.memory_pool],["Not found",d.network.not_found],["Reject",d.network.reject],["Alert",d.network.alert]]}),x.jsx(Fm,{items:[["Protocol minimum",String(d.network.protocol_minimum)],["Protocol maximum",String(d.network.protocol_maximum)]]})]}),d.wallet&&x.jsx(bu,{title:"Wallet",children:x.jsx(Fm,{items:[["P2PKH version",String(d.wallet.p2kh)],["P2SH version",String(d.wallet.p2sh)],["WIF version",String(d.wallet.wif)],["Witness prefix",d.wallet.witness],["Silent prefix",d.wallet.silent],["HD private",V_(d.wallet.hd_private)],["HD public",V_(d.wallet.hd_public)]]})}),x.jsx(bu,{title:"Configured forks",children:x.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.forks.map(g=>x.jsx("span",{className:"text-textPrimary bg-accentSecondary/15 rounded-full px-2 py-0.5 font-mono text-xs",children:g},g))})})]}):x.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Waiting for native configuration."})]})]}),x.jsx("section",{children:x.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[x.jsx("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Recent events"})}),a.recentEvents.length===0?x.jsx(cj,{text:"No events observed yet."}):x.jsx("ul",{className:"divide-accentSecondary/20 divide-y",children:a.recentEvents.slice(0,6).map(g=>x.jsxs("li",{className:"flex items-center gap-3 px-5 py-3 text-xs",children:[x.jsx("time",{className:"text-textMuted w-24 shrink-0 font-mono",children:Du(g.time)}),x.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:ho(g.event).name}),x.jsx("span",{className:"text-accent tabular-nums",children:iS(g.event,g.value)})]},g.id))})]})})]})}const q_={connected:0,connecting:1,reconnecting:2,idle:3};function uj(n,i){const a=q_[i.phase]>q_[n.phase]?i:n,l=Math.max(n.lastMessageAt??0,i.lastMessageAt??0);return{...a,reconnects:n.reconnects+i.reconnects,lastMessageAt:l>0?l:null}}function bu({title:n,children:i}){return x.jsxs("section",{className:"border-accentSecondary/20 space-y-2 border-t pt-3 first:border-t-0 first:pt-0",children:[x.jsx("h3",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),i]})}function Ym({items:n}){const i=n.filter(([,a])=>a!==void 0);return x.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(([a,l])=>x.jsx("span",{className:`rounded-full border px-2 py-0.5 text-xs ${l?"border-emerald-500/50 bg-emerald-500/15 text-emerald-300":"text-textMuted border-slate-500/40"}`,children:a},a))})}function Fm({items:n}){return x.jsx("dl",{className:"grid gap-x-6 gap-y-1 sm:grid-cols-2",children:n.map(([i,a])=>x.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[x.jsx("dt",{className:"text-textMuted",children:i}),x.jsx("dd",{className:"text-textPrimary font-mono",children:a})]},i))})}function V_(n){return`0x${n.toString(16).padStart(8,"0")}`}function cj({text:n}){return x.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}function fj(n){return n?n.blocksRemaining<=Wf?"Near current (estimated)":`${Tn(n.blocksRemaining)} blocks remaining (estimated)`:"Waiting for confirmed block timestamp"}const dj=8e3;function hj({estimate:n,browserNotificationsEnabled:i}){const a=se.useRef(null),[l,u]=se.useState(null),f=n?.blocksRemaining??null;if(se.useEffect(()=>{const m=pj(f);if(!m)return;const p=a.current;if(a.current=m.state,!(p===null||p===m.state)&&(u(m),i)){const g=mj(m);Iz(g.title,{body:g.body,tag:"libbitcoin-sync-status"})}},[i,f]),se.useEffect(()=>{if(!l)return;const m=setTimeout(()=>{u(p=>p===l?null:p)},dj);return()=>{clearTimeout(m)}},[l]),!l)return null;const d=l.state==="near-current";return x.jsx("aside",{role:"status","aria-live":"polite","aria-atomic":"true",className:`fixed right-4 bottom-4 left-4 z-[60] rounded-xl border p-4 shadow-2xl shadow-black/50 sm:left-auto sm:w-96 ${d?"bg-noticeSuccess/95 border-emerald-400/35":"bg-noticeWarning/95 border-amber-400/35"}`,children:x.jsxs("div",{className:"flex items-start gap-4",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("p",{className:d?"font-semibold text-emerald-200":"font-semibold text-amber-200",children:d?"Node near current (estimated)":"Node fell behind (estimated)"}),x.jsx("p",{className:"text-noticeText/75 mt-1 text-sm",children:xp(l)})]}),x.jsx("button",{type:"button","aria-label":"Dismiss synchronization notification",onClick:()=>{u(null)},className:"text-noticeText/60 hover:text-noticeText text-lg leading-none",children:"×"})]})})}function mj(n){return n.state==="near-current"?{title:"Libbitcoin node near current (estimated)",body:xp(n)}:{title:"Libbitcoin node fell behind (estimated)",body:xp(n)}}function pj(n){return n===null?null:{state:n<=Wf?"near-current":"behind",blocksBehind:n}}function xp(n){return n.state==="near-current"?`Confirmed top is approximately ${String(Wf)} blocks from the top candidate header, based on block time.`:`Confirmed top is approximately ${Tn(n.blocksBehind)} blocks from the top candidate header, based on block time.`}const dx='(function(){"use strict";function je(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function gt(e,t="|"){return e.map(n=>kt(n)).join(t)}function Me(e,t){return typeof t=="bigint"?t.toString():t}class gr{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Le(e){return new gr(e)}function _r(e){return e==null}function Fe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function vr(e,t){const n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r){const c=t._zod.def.shape[s];return r?r(c,s):c}):bt(e,s,r?r(o.value,s):o.value))}}function br(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?vt(e,n,()=>t[n]):bt(e,n,r.value))}}function N(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function yr(e){return JSON.stringify(e)}function wr(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,"").replace(/[\\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const yt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function de(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const kr=Le(()=>{if(R.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function G(e){if(de(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(de(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wt(e){return G(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const zr=new Set(["string","number","symbol"]);function pe(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function K(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function kt(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Sr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const zt={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]},$r={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Or(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return q(s,e,me(e,t)),K(e,N(n,{shape:s,checks:[]}))}function me(e,t){const n=x(e),r=[];for(const i of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,i)?.enumerable)throw new Error(`Unrecognized key: "${String(i)}"`);t[i]&&r.push(i)}return r}function Er(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(me(e,t)),o={};return q(o,e,Reflect.ownKeys(x(e)).filter(c=>!s.has(c))),K(e,N(n,{shape:o,checks:[]}))}function Ir(e,t){if(!G(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=x(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return K(e,N(e._zod.def,{shape:St(e,t)}))}function St(e,t){const n={};return q(n,e,Reflect.ownKeys(x(e))),br(n,t),n}function Tr(e,t){if(!G(t))throw new Error("Invalid input to safeExtend: expected a plain object");return K(e,N(e._zod.def,{shape:St(e,t)}))}function Pr(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};q(n,e,Reflect.ownKeys(x(e))),q(n,t,Reflect.ownKeys(x(t)));const r=N(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return K(e,r)}function $t(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const c=n?new Set(me(t,n)):void 0,a={};return q(a,t,Reflect.ownKeys(x(t)),e&&((u,l)=>c&&!c.has(l)?u:new e({type:"optional",innerType:u}))),K(t,N(t._zod.def,{shape:a,checks:[]}))}function Zr(e,t,n){const r=n?new Set(me(t,n)):void 0,i={};return q(i,t,Reflect.ownKeys(x(t)),(s,o)=>r&&!r.has(o)?s:new e({type:"nonoptional",innerType:s})),K(t,N(t._zod.def,{shape:i}))}function L(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function re(e){return typeof e=="string"?e:e?.message}function Ot(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const i=r.maximum??r.length??r.size;i>=0&&t.push([i,n])}return t}function Ce(e,t,n){var r;for(let i=t;ie;return t[Dr]=!0,t}var Tt;const Ke={value:void 0,enumerable:!1};let Pt="captureStackTrace"in Error?Error:null;function Ur(e){const t=Pt;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return Pt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function f(e,t,n,r){const i={};function s(p){this.def=p,this.constr=h,this.traits=new Set}s.prototype=i;const o=n,c=o&&new WeakSet;function a(p,d){if(p._zod){if(p._zod.traits.has(e))return}else{Ke.value=new s(d);try{Object.defineProperty(p,"_zod",Ke)}finally{Ke.value=void 0}}if(p._zod.traits.add(e),t(p,d),c){const g=Object.getPrototypeOf(p),v=p._zod.constr.prototype;let b=g;for(;b&&b!==v;)b=Object.getPrototypeOf(b);const A=b??g;c.has(A)||(c.add(A),jr(A,o))}const m=h.prototype;for(const g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}const u=r?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function h(p){const d=r?.Parent?Ur(l):this;a(d,p);const m=d._zod.deferred;if(m){for(const v of m)v();d._zod.deferred=void 0}const g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(d),d}return Object.defineProperty(h,"init",{value:a}),Object.defineProperty(h,Symbol.hasInstance,{value:p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(h,"name",{value:e}),h}class H extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Zt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Tt=globalThis).__zod_globalConfig??(Tt.__zod_globalConfig={});const R=globalThis.__zod_globalConfig;function F(e){return e&&Object.assign(R,e),R}function Kr(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Me,2)),e.message}function Jr(e){this._zod.message=e}const Br={get:Kr,set:Jr,enumerable:!0,configurable:!0},Je={value:void 0,enumerable:!1},At=new WeakSet([Object.prototype,Error.prototype]),Vr=f("$ZodError",(e,t)=>{e.name="$ZodError",Je.value=t,Object.defineProperty(e,"issues",Je),Je.value=void 0,Object.defineProperty(e,"message",Br);const n=Object.getPrototypeOf(e);At.has(n)||(At.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))});function Wr(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function qr(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?Wr(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Hr(e,t=n=>n.message){const n={_errors:[]},r=(i,s=[])=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>r({issues:c},[...s,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...s,...o.path]);else{const c=[...s,...o.path];if(c.length===0)n._errors.push(t(o));else{let a=n,u=0;for(;u{const t=(n,r,i,s)=>{const o=i?{...i,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise)throw new H;if(c.issues.length){const a=new(s?.Err??e)(c.issues.map(u=>B(u,o,F())));throw yt(a,s?.callee??t),a}return c.value};return t},Ve=e=>{const t=async(n,r,i,s)=>{const o=i?{...i,async:!0}:{async:!0};let c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const a=new(s?.Err??e)(c.issues.map(u=>B(u,o,F())));throw yt(a,s?.callee??t),a}return c.value};return t},We=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new H;return s.issues.length?Nt(e,s.issues,i):{success:!0,data:s.value}};function Nt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(i=>B(i,n,F()))),t=void 0,n=void 0),r},set error(i){r=i,t=void 0,n=void 0}}}const qe=e=>async(t,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?Nt(e,s.issues,i):{success:!0,data:s.value}},Gr=Symbol.for("zod.compile.invalid"),Yr=Symbol.for("zod.compile.fallback"),Xr=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Gr)return!0;if(r.definite===!0&&n===void 0)return!1}return Qr(e,t,n)});function Qr(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun;let s;if(i?(r[Yr]=!0,s=i({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new H;return s.issues.length===0}const ei=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ti=e=>{const t=Be(e),n=(r,i,s,o)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,i,c,ge(n,o))};return n},ni=e=>{const t=Be(e),n=(r,i,s,o)=>t(r,i,s,ge(n,o));return n},ri=e=>{const t=Ve(e),n=async(r,i,s,o)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,i,c,ge(n,o))};return n},ii=e=>{const t=Ve(e),n=async(r,i,s,o)=>await t(r,i,s,ge(n,o));return n},si=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return We(e)(t,n,i)},oi=e=>(t,n,r)=>We(e)(t,n,r),ci=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return qe(e)(t,n,i)},ai=e=>async(t,n,r)=>qe(e)(t,n,r),ui=/^[cC][0-9a-z]{6,}$/,li=/^[0-9a-z]+$/,fi=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,hi=/^[0-9a-vA-V]{20}$/,di=/^[A-Za-z0-9]{27}$/,pi=/^[a-zA-Z0-9_-]{21}$/;function mi(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const gi=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,_i=/^([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})$/,Rt=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)$/,vi=/^(?:[A-Za-z0-9_\'+\\-]+\\.)*[A-Za-z0-9_\'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,bi="^(?=[\\\\s\\\\S]*[\\\\p{Extended_Pictographic}\\\\p{Regional_Indicator}\\\\u20E3])[\\\\p{Extended_Pictographic}\\\\p{Emoji_Component}]+$";function yi(){return new RegExp(bi,"u")}const wi=/^(?:(?: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])$/,ki=/^(([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}|:))$/,zi=/^((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])$/,Si=/^(([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)DELIM" -R"DELIM(}){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}|:))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$i=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Oi=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ei=/^https?$/,Ii=/^\\+[1-9]\\d{6,14}$/,jt="(?:(?:\\\\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])))";function Ti(e){return new RegExp(`^${e}$`)}const Pi=Ti(jt);function He(e){const t="(?:[01]\\\\d|2[0-3]):[0-5]\\\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\\\d`:`${t}:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\\\d(?:\\\\.\\\\d+)?`:`${t}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`}function Zi(e){return new RegExp(`^${He(e)}$`)}function Ai(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)");const n=`${He({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${He({precision:e.precision})}`:n;return new RegExp(`^${jt}T(?:${r})$`)}const Ni=/^[\\s\\S]{0,}$/,Ri=/^-?\\d+$/,Ge=/^-?\\d+(?:\\.\\d+)?$/,ji=/^(?:true|false)$/i,Mi=/^[^A-Z]*$/,Li=/^[^a-z]*$/,Z=f("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ye=e=>{const t=e.value;return!_r(t)&&t.length!==void 0},_e={number:"number",bigint:"bigint",object:"date"},Mt=f("$ZodCheckLessThan",(e,t)=>{Z.init(e,t);const n=_e[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{Z.init(e,t);const n=_e[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:_e[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fi=f("$ZodCheckMultipleOf",(e,t)=>{Z.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):vr(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ci=f("$ZodCheckNumberFormat",(e,t)=>{Z.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=zt[t.format];e._zod.check=o=>{const c=o.value;if(n){if(!Number.isInteger(c)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}cs&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Di=f("$ZodCheckMaxLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Ye),e._zod.check=r=>{const i=r.value,s=i.length;if((typeof i=="string"&&s>t.maximum?De(i):s)<=t.maximum)return;const c=xe(i);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),xi=f("$ZodCheckMinLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Ye),e._zod.check=r=>{const i=r.value,s=i.length;if((typeof i=="string"&&s>=t.minimum&&s=t.minimum)return;const c=xe(i);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ui=f("$ZodCheckLengthEquals",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Ye),e._zod.check=r=>{const i=r.value,s=i.length,o=typeof i=="string"&&s>=t.length&&s<=t.length*2?De(i):s;if(o===t.length)return;const c=xe(i),a=o>t.length;r.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ve=f("$ZodCheckStringFormat",(e,t)=>{var n,r;Z.init(e,t),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ki=f("$ZodCheckRegex",(e,t)=>{ve.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ji=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Mi),ve.init(e,t)}),Bi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Li),ve.init(e,t)}),Vi=f("$ZodCheckIncludes",(e,t)=>{Z.init(e,t);const n=pe(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Wi=f("$ZodCheckStartsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`^${pe(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),qi=f("$ZodCheckEndsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`.*${pe(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Hi=f("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Gi{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`\n`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {\n${n.join(`\n`)}\n};`)(...Object.values(this.closed))}}const Yi={major:4,minor:6,patch:7},k=f("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Yi;const r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(const s of i)for(const o of s._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,a,u)=>{if(c.memo)return c;let l=L(c),h;for(const p of a){if(p._zod.def.when){if(Ar(c)||!p._zod.def.when(c))continue}else if(l)continue;const d=c.issues.length,m=p._zod.check(c);if(m instanceof Promise&&u?.async===!1)throw new H;if(h||m instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await m,c.issues.length!==d&&(Ce(c.issues,d,e),l||(l=L(c,d)))});else{if(c.issues.length===d)continue;Ce(c.issues,d,e),l||(l=L(c,d))}}return h?h.then(()=>c):c},o=(c,a,u)=>{if(L(c))return c.aborted=!0,c;const l=s(a,i,u);if(l instanceof Promise){if(u.async===!1)throw new H;return l.then(h=>e._zod.parse(h,u))}return e._zod.parse(l,u)};e)DELIM" -R"DELIM(._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){const l=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(h=>o(h,c,a)):o(l,c,a)}const u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new H;return u.then(l=>s(l,i,a))}return s(u,i,a)}}},{get"~standard"(){return Et(this,"~standard",Ct(this))},set"~standard"(e){V(this,"~standard",e)}}),Ft=(e,t)=>e.issues.length?{issues:e.issues.map(n=>B(n,t,F()))}:{value:e.value};async function Xi(e,t){const n={async:!0};return Ft(await e._zod.run({value:t,issues:[]},n),n)}function Ct(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Ft(r,n)}catch{}return Xi(e,t)},vendor:"zod",version:1}}const Xe=f("$ZodString",(e,t)=>{k.init(e,t),e._zod.pattern=t.pattern??Ni,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),z=f("$ZodStringFormat",(e,t)=>{ve.init(e,t),Xe.init(e,t)}),Qi=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_i),z.init(e,t)}),es=f("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Rt(r))}else t.pattern??(t.pattern=Rt());z.init(e,t)}),ts=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=vi),z.init(e,t)}),Dt=1,be=2;function xt(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ns(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?xt(e)||be:rs(e,t)}function rs(e,t){if(!t.normalize&&t.protocol?.source===Ei.source&&!/^https?:\\/\\//i.test(e))return Dt;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(e)??be}return new URL(e)}catch{return be}}const is=/[\\t\\n\\r]/g;function Ut(e){return e.replace(is,"")}function ss(e,t){return t.lastIndex=0,t.test(e.hostname)}function os(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const cs=f("$ZodURL",(e,t)=>{z.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=ns(r,t);if(i===Dt){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(i===be){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Ut(r);return}t.hostname&&!ss(i,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!os(i,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Ut(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),as=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=yi()),z.init(e,t)}),us=f("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?pi:mi(t.length)),z.init(e,t)}),ls=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ui),z.init(e,t)}),fs=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=li),z.init(e,t)}),hs=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=fi),z.init(e,t)}),ds=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=hi),z.init(e,t)}),ps=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=di),z.init(e,t)}),ms=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ai(t)),z.init(e,t)}),gs=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Pi),z.init(e,t)}),_s=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Zi(t)),z.init(e,t)}),vs=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gi),z.init(e,t)}),bs=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wi),z.init(e,t)}),ys=/^[0-9a-fA-F:.]+$/;function Kt(e){return ys.test(e)?xt(`http://[${e}]`):!1}const ws=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ki),z.init(e,t),e._zod.check=n=>{Kt(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),ks=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zi),z.init(e,t)});function zs(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const i=Number(r);return`${i}`!==r||i<0||i>128?!1:Kt(n)}const Ss=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Si),z.init(e,t),e._zod.check=n=>{zs(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Jt(e){if(e==="")return!0;if(/\\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Bt=/^[0-9a-zA-Z+/]*={0,2}$/,$s=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bt),z.init(e,t),e._zod.check=n=>{Jt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Qe=/^[A-Za-z0-9_-]*$/;function Os(e){if(!Qe.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Jt(n)}const Es=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qe),z.init(e,t),e._zod.check=n=>{Os(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Is=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ii),z.init(e,t)});function Ts(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const Ps=f("$ZodJWT",(e,t)=>{z.init(e,t),e._zod.check=n=>{Ts(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Vt=f("$ZodNumber",(e,t)=>{k.init(e,t),e._zod.pattern=Ge,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),Zs=f("$ZodNumberFormat",(e,t)=>{Ci.init(e,t),Vt.init(e,t)}),As=f("$ZodBoolean",(e,t)=>{k.init(e,t),e._zod.pattern=ji,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Ns=f("$ZodUnknown",(e,t)=>{k.init(e,t),e._zod.parse=n=>n}),Rs=f("$ZodNever",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function js(e,t){const n=Ot(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(s=>s[0])),i=e._zod.parse;e._zod.parse=(s,o)=>{const c=t(s.value);if(c>r&&!o?.skipChecks&&o?.direction!=="backward"){for(const[a,u]of Ot(e._zod.def.checks))if(c>a&&u._zod.def.when(s)){const l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Ce(s.issues,l,e),s}}return i(s,o)}}const Ms=e=>Array.isArray(e)?e.length:-1;function Wt(e,t,n){e.issues.length&&t.issues.push(...J(n,e.issues)),t.value[n]=e.value}const Ls=f("$ZodArray",(e,t)=>{k.init(e,t);const n=R.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),i):Array(s.length);const o=[],c=i?.abortEarly;for(let a=0;aWt(h,r,a)));else if(Wt(l,r,a),c&&l.issues.length!==0&&L(l))break}return o.length?Promise.all(o).then(()=>r):r},js(e,Ms)});function ye(e,t,n,r,i,s){const o=n in r,c=s==="optional";if(!(!o&&c&&i==="optional")){if(e.issues.length){if(i!==void 0&&c&&!o)return;t.issues.push(...J(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:"invalid_type",expec)DELIM" -R"DELIM(ted:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(o||i==="defaulted"&&!c)&&(t.value[n]=void 0):t.value[n]=e.value}}const Fs=[];function qt(e){const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Fs,i=r.length?[...t,...r]:t;for(const o of i)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(o)}": expected a Zod schema`);const s=Sr(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Ht(e,t,n,r,i,s,o){const c=[],a=i.keySet,u=i.catchall._zod,l=u.def.type,h=u.optin,p=u.optout;let d=0;for(const m in t){if(o&&n.issues.length!==d){if(L(n,d))break;d=n.issues.length}if(a.has(m))continue;if(m==="__proto__"){l==="never"&&c.push(m);continue}if(l==="never"){c.push(m);continue}const g=u.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(v=>ye(v,n,m,t,h,p))):ye(g,n,m,t,h,p)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Cs=f("$ZodObject",(e,t)=>{k.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){const u=()=>{const l={...r};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=r,Object.defineProperty(t,"shape",{get:u})}const i=Le(()=>qt(t));y(e,"propValues",u=>{const l=u.def.shape,h={};for(const p in l){const d=l[p]._zod;if(d.values){Object.prototype.hasOwnProperty.call(h,p)||U(h,p,new Set);for(const m of d.values)h[p].add(m);d.optin!==void 0&&h[p].add(void 0)}}return h});const s=de,o=t.catchall;let c;const a=R.memoizer;a?.attach(e),e._zod.parse=(u,l)=>{c??(c=i.value);const h=u.value;if(!s(h))return u.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),u;u.value=a?a.alloc(e,u,{},l):{};const p=[],d=c.shape,m=l?.abortEarly;let g=u.issues.length;for(const v of c.allKeys){if(m&&u.issues.length!==g){if(L(u,g))break;g=u.issues.length}if(v==="__proto__")continue;const b=d[v],A=b._zod.optin,fe=b._zod.optout,he=b._zod.run({value:h[v],issues:[]},l);he instanceof Promise?p.push(he.then(T=>ye(T,u,v,h,A,fe))):ye(he,u,v,h,A,fe)}return o?Ht(p,h,u,l,i.value,e,m===!0):p.length?Promise.all(p).then(()=>u):u}}),Ds=f("$ZodObjectJIT",(e,t)=>{Cs.init(e,t);const n=e._zod.parse,r=Le(()=>qt(t)),i=R.memoizer,s=d=>{const m=r.value,g=m.symbolKeys,v=new Gi(["payload","ctx"],{shape:d,inst:e,memo:i,syms:g}),b=T=>`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`,A=(T,w)=>`\n let ${T}_ab = false;\n for (let i = 0; i < ${T}.issues.length; i++) {\n const iss = ${T}.issues[i];\n iss.path = iss.path ? [${w}, ...iss.path] : [${w}];\n payload.issues.push(iss);\n if (iss.continue !== true) ${T}_ab = true;\n }\n if (${T}_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }`;v.write("const input = payload.value;");const fe=Object.create(null);let he=0;for(const T of m.allKeys)fe[T]=`key_${he++}`;v.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const T of m.allKeys){if(T==="__proto__")continue;const w=fe[T],D=typeof T=="symbol"?`syms[${g.indexOf(T)}]`:yr(T),pt=`${D} in input`,pr=d[T],mt=pr?._zod?.optin,mr=mt!==void 0,Ru=pr?._zod?.optout==="optional";if(v.write(`const ${w} = ${b(D)};`),mr&&Ru){const ju=mt==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;v.write(`\n const ${w}_present = ${pt};\n if (!${w}.issues.length || ${w}_present) {\n if (${w}.issues.length) {${A(w,D)}\n }\n\n if (${ju}) {\n newResult[${D}] = ${w}.value;\n }\n }\n\n `)}else mr?(v.write(`\n if (${w}.issues.length) {${A(w,D)}\n }\n `),mt==="defaulted"?v.write(`newResult[${D}] = ${w}.value;`):v.write(`\n if (${w}.value !== undefined || ${pt}) {\n newResult[${D}] = ${w}.value;\n }\n `)):v.write(`\n const ${w}_present = ${pt};\n if (${w}.issues.length) {${A(w,D)}\n }\n if (!${w}_present && !${w}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${D}]\n });\n if (ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (${w}_present) {\n newResult[${D}] = ${w}.value;\n }\n\n `)}return v.write("payload.value = newResult;"),v.write("return payload;"),v.compile()};let o;const c=de,a=!R.jitless,l=a&&kr.value,h=t.catchall;let p;e._zod.parse=(d,m)=>{p??(p=r.value);const g=d.value;return c(g)?a&&l&&m?.async===!1&&m.jitless!==!0?(o||(o=s(t.shape)),d=o(d,m),h?Ht([],g,d,m,p,e,m?.abortEarly===!0):d):n(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),d)}});function Gt(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!L(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(o=>B(o,r,F())))}),t)}const xs=f("$ZodUnion",(e,t)=>{k.init(e,t),y(e,"optin",r=>r.def.options.some(i=>i._zod.optin==="defaulted")?"defaulted":r.def.options.some(i=>i._zod.optin!==void 0)?"optional":void 0),y(e,"optout",r=>r.def.options.some(i=>i._zod.optout==="optional")?"optional":void 0),y(e,"values",r=>{if(r.def.options.every(i=>i._zod.values))return new Set(r.def.options.flatMap(i=>Array.from(i._zod.values)))}),y(e,"pattern",r=>{if(r.def.options.every(i=>i._zod.pattern)){const i=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Fe(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1;const o=[];for(const c of t.options){const a=c._zod.run({value:r.value,issues:[]},i);if(a instanceof Promise)o.push(a),s=!0;else{if(a.issues.length===0)return a;o.push(a)}}return s?Promise.all(o).then(c=>Gt(c,r,e,i)):Gt(o,r,e,i)}}),Us=f("$ZodIntersection",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([a,u])=>Yt(n,a,u)):Yt(n,s,o)}});function et(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(G(e)&&G(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(const s of r){if(s==="__proto__")continue;const o=et(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r{let h;if(u.code==="unrecognized_keys"&&!u.path?.length)i??(i=u),h=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){const p=String(u.path[0]);s.has(p)||s.set(p,u),h=[p]}else return!1;for(const p of h)r.has(p)||r.set(p,{}),r.get(p)[l]=!0;return!0};for(const u of t.issues)o(u,"l")||e.issues.push(u);for(const u of n.issues)o(u,"r")||e.issues.push(u);const c=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){const u=i?c.filter(l=>i.keys.includes(l)):[];u.length&&e.issues.push({...i,keys:u});for(const l of c)!u.includes(l)&&s.has(l)&&e.issues.push(s.get(l))}const a=et(t.value,n.value);if(!a.valid){if(L(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify)DELIM" -R"DELIM((a.mergeErrorPath)}`)}return e.value=a.data,e}const Ks=f("$ZodTuple",(e,t)=>{k.init(e,t);const n=t.items,r=R.memoizer;r?.attach(e),e._zod.parse=(i,s)=>{const o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],s):[];const c=[],a=Xt(n,"optin"),u=Xt(n,"optout");if(!t.rest){if(o.lengthn.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:e,origin:"array"})}const l=new Array(n.length),h=t.rest?s?.abortEarly:void 0;let p=!1;for(let d=0;d{l[d]=g})):(l[d]=m,h&&!p&&m.issues.length&&(p=L(m)))}if(t.rest&&!p){let d=n.length-1;const m=o.slice(n.length);let g=i.issues.length;for(const v of m){if(h&&i.issues.length!==g){if(L(i,g))break;g=i.issues.length}d++;const b=t.rest._zod.run({value:v,issues:[]},s);b instanceof Promise?c.push(b.then(A=>Qt(A,i,d))):Qt(b,i,d)}}return c.length?Promise.all(c).then(()=>en(l,i,n,o,u)):en(l,i,n,o,u)}});function Xt(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Qt(e,t,n){e.issues.length&&t.issues.push(...J(n,e.issues)),t.value[n]=e.value}function en(e,t,n,r,i){for(let s=0;s=i&&n[s]._zod.optin==="optional"){t.value.length=s;break}if(o.issues.length){if(!c&&s>=i){t.value.length=s;break}t.issues.push(...J(s,o.issues))}t.value[s]=o.value}for(let s=t.value.length-1;s>=r.length&&(n[s]._zod.optout==="optional"&&t.value[s]===void 0);s--)t.value.length=s;return t}const Js=f("$ZodRecord",(e,t)=>{k.init(e,t);const n=R.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{const s=r.value;if(!G(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const o=[],c=t.keyType._zod.values;if(c&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};const a=new Set;for(const l of c)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(a.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;const h=t.keyType._zod.run({value:l,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(m=>B(m,i,F())),input:l,path:[l],inst:e});continue}const p=h.value;if(p==="__proto__")continue;const d=t.valueType._zod.run({value:s[l],issues:[]},i);d instanceof Promise?o.push(d.then(m=>{m.issues.length&&r.issues.push(...J(l,m.issues)),r.value[p]=m.value})):(d.issues.length&&r.issues.push(...J(l,d.issues)),r.value[p]=d.value)}let u;for(const l in s)if(!a.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;r.value[l]=s[l]}else u=u??[],u.push(l);u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let a;for(const u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ge.test(u)&&l.issues.length){const m=t.keyType._zod.run({value:Number(u),issues:[]},i);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(l=m)}if(l.issues.length){t.mode==="loose"?r.value[u]=s[u]:c?(a=a??[],a.push(u)):r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>B(m,i,F())),input:u,path:[u],inst:e});continue}const p=l.value;if(p==="__proto__")continue;const d=t.valueType._zod.run({value:s[u],issues:[]},i);d instanceof Promise?o.push(d.then(m=>{m.issues.length&&r.issues.push(...J(u,m.issues)),r.value[p]=m.value})):(d.issues.length&&r.issues.push(...J(u,d.issues)),r.value[p]=d.value)}a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Bs=f("$ZodEnum",(e,t)=>{k.init(e,t);const n=je(t.entries),r=new Set(n);e._zod.values=r,y(e,"pattern",i=>{const s=je(i.def.entries).filter(o=>zr.has(typeof o));return new RegExp(s.length?`^(${s.map(o=>pe(o.toString())).join("|")})$`:"^[^\\\\s\\\\S]$")}),e._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),Vs=f("$ZodTransform",(e,t)=>{k.init(e,t),e._zod.optin="optional",R.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Zt(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new H;return n.value=i,n}});function tn(e,t){return e.value=t.issues.length?void 0:t.value,e}const nn=f("$ZodOptional",(e,t)=>{k.init(e,t),y(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),y(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Fe(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(s=>tn(n,s)):tn(n,i)}return t.innerType._zod.run(n,r)}}),Ws=f("$ZodExactOptional",(e,t)=>{nn.init(e,t),y(e,"values",n=>n.def.innerType._zod.values),y(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),qs=f("$ZodNullable",(e,t)=>{k.init(e,t),y(e,"optin",n=>n.def.innerType._zod.optin),y(e,"optout",n=>n.def.innerType._zod.optout),y(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Fe(r.source)}|null)$`):void 0}),y(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Hs=f("$ZodDefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>rn(s,t)):rn(i,t)}});function rn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Gs=f("$ZodPrefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Ys=f("$ZodNonOptional",(e,t)=>{k.init(e,t),y(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>sn(s,e)):sn(i,e)}});function sn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function on(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(i=>B(i,r,F()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Xs=f("$ZodCatch",(e,t)=>{k.init(e,t),y(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",n=>n.def.innerType._zod.optout),y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(s=>on(n,s,t,r)):on(n,i,t,r)}}),Qs=f("$ZodPipe",(e,t)=>{k.init(e,t),y(e,"values",n=>n.def.in._zod.values),y(e,"optin",n=>n.def.in._zod.optin),y(e,"optout",n=>n.def.out._zod.optout),y(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.ou)DELIM" -R"DELIM(t._zod.run(n,r);return s instanceof Promise?s.then(o=>we(o,t.in,r)):we(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>we(s,t.out,r)):we(i,t.out,r)}});function we(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const eo=f("$ZodReadonly",(e,t)=>{k.init(e,t),y(e,"propValues",n=>n.def.innerType._zod.propValues),y(e,"values",n=>n.def.innerType._zod.values),y(e,"optin",n=>n.def.innerType?._zod?.optin),y(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(cn):cn(i)}});function cn(e){return e.memo||(e.value=Object.freeze(e.value)),e}const to=f("$ZodCustom",(e,t)=>{Z.init(e,t),k.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>an(s,n,r,e));an(i,n,r,e)}});function an(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(ie(i))}}class no extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const tt="~memo",un=[];function ln(e){return e!==null&&typeof e=="object"}function nt(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const fn=new WeakMap,se=0,ke=1,oe=2;function ze(e,t,n){const r=fn.get(e);if(r!==void 0)return r?oe:se;if(t.has(e))return oe;t.add(e);let i=se;const s=l=>{if(i!==oe&&l?._zod){const h=ze(l,t);h>i&&(i=h)}},o=(l,h)=>{let p=se;for(const d of Reflect.ownKeys(l)){const m=Object.getOwnPropertyDescriptor(l,d);if(!m.enumerable)continue;const g=m.get?ke:m.value?._zod?ze(m.value,t):se;g>p&&(p=g)}return p},c=l=>{l>i&&(i=l)},a=e._zod.def;switch(a.type){case"object":{const l=_t(a);c(l?o(l):ke),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(const l of a.items)s(l);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(const l of a.options)s(l);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{const l=a._cachedInner??void 0;c(l?ze(l,t):ke);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const l in a){const h=Object.getOwnPropertyDescriptor(a,l);if(!h||h.get)continue;const p=h.value;if(!(!p||typeof p!="object")){if(p._zod)s(p);else if(Array.isArray(p))for(const d of p)s(d)}}}return t.delete(e),ro(e,i)}function ro(e,t){return t!==ke&&fn.set(e,t===oe),t}function io(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let Se;const $e=[],so={alloc(e,t,n){const r=Se;if(!r)return n;Se=void 0;const i={value:n,issues:null};return r.set(t.value,i),$e.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(i,s)=>{if(s.direction!=="backward"&&co(s,i.value))throw new no;return n(i,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,i,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const o=e._zod.parse,c=(a,u)=>{if(n===void 0){const b=ze(e,new Set);if(b===se)return e._zod.parse=o,e._zod.run===c&&(e._zod.run=o),o(a,u);b===oe||r?n=!0:r=!0}const l=a.value;if(!ln(l))return o(a,u);let h=u[tt];h||(h={buckets:new WeakMap,backEdges:void 0},u[tt]=h);let p;i===u?p=s:(p=io(h,e),i=u,s=p);const d=p.get(l);if(d)return a.value=d.value,d.issues?d.issues.length&&a.issues.push(...nt(d.issues)):(a.memo=!0,h.backEdges??(h.backEdges=new WeakSet),h.backEdges.add(d.value)),a;Se=p;const m=$e.length,g=o(a,u);Se=void 0;const v=$e.length>m?$e.pop():void 0;return g instanceof Promise?g.then(b=>(v&&(v.issues=b.issues.length?nt(b.issues):un),b)):(v&&(v.issues=g.issues.length?nt(g.issues):un),g)};e._zod.parse=c,e._zod.run===o&&(e._zod.run=c)})}};function oo(){return so}function co(e,t){const n=e[tt]?.backEdges;return n!==void 0&&ln(t)&&n.has(t)}const ao=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function i(s,o){return s==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const o=i(s.expected),c=Rr(s.input),a=i(c,s.input);return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${kt(s.values[0])}`:`Invalid option: expected one of ${gt(s.values,"|")}`;case"too_big":{const o=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);return c?`Too big: expected ${s.origin??"value"} to have ${o}${s.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${o}${s.maximum.toString()}`}case"too_small":{const o=s.exact?"exactly ":s.inclusive?">=":">",c=t(s.origin);return c?`Too small: expected ${s.origin} to have ${o}${s.minimum.toString()} ${c.unit}`:`Too small: expected ${s.origin} to be ${o}${s.minimum.toString()}`}case"invalid_format":{const o=s;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${gt(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(c=>`\'${c}\'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function uo(){return{localeError:ao()}}var hn;class lo{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fo(){return new lo}(hn=globalThis).__zod_globalRegistry??(hn.__zod_globalRegistry=fo());const ce=globalThis.__zod_globalRegistry;function dn(e){return e.checks&&(e.checks=[...e.checks]),e}function ho(e,t){return new e(dn({type:"string",..._(t)}))}fu)DELIM" -R"DELIM(nction po(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._(t)})}function mo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._(t)})}function go(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._(t)})}function _o(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._(t)})}function vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._(t)})}function bo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._(t)})}function yo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._(t)})}function wo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._(t)})}function ko(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._(t)})}function zo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._(t)})}function So(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._(t)})}function $o(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._(t)})}function Oo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._(t)})}function Eo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._(t)})}function Io(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._(t)})}function To(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._(t)})}function Po(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._(t)})}function Zo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._(t)})}function Ao(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._(t)})}function No(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._(t)})}function Ro(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._(t)})}function jo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._(t)})}function Mo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._(t)})}function Lo(e,t){return new e({type:"string",format:"date",check:"string_format",..._(t)})}function Fo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._(t)})}function Co(e,t){return new e({type:"string",format:"duration",check:"string_format",..._(t)})}function Do(e,t){return new e(dn({type:"number",checks:[],..._(t)}))}function xo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._(t)})}function Uo(e,t){return new e({type:"boolean",..._(t)})}function Ko(e){return new e({type:"unknown"})}function Jo(e,t){return new e({type:"never",..._(t)})}function pn(e,t){return new Mt({check:"less_than",..._(t),value:e,inclusive:!1})}function rt(e,t){return new Mt({check:"less_than",..._(t),value:e,inclusive:!0})}function mn(e,t){return new Lt({check:"greater_than",..._(t),value:e,inclusive:!1})}function it(e,t){return new Lt({check:"greater_than",..._(t),value:e,inclusive:!0})}function gn(e,t){return new Fi({check:"multiple_of",..._(t),value:e})}function _n(e,t){return new Di({check:"max_length",..._(t),maximum:e})}function Oe(e,t){return new xi({check:"min_length",..._(t),minimum:e})}function vn(e,t){return new Ui({check:"length_equals",..._(t),length:e})}function Bo(e,t){return new Ki({check:"string_format",format:"regex",..._(t),pattern:e})}function Vo(e){return new Ji({check:"string_format",format:"lowercase",..._(e)})}function Wo(e){return new Bi({check:"string_format",format:"uppercase",..._(e)})}function qo(e,t){return new Vi({check:"string_format",format:"includes",..._(t),includes:e})}function Ho(e,t){return new Wi({check:"string_format",format:"starts_with",..._(t),prefix:e})}function Go(e,t){return new qi({check:"string_format",format:"ends_with",..._(t),suffix:e})}function Y(e){return new Hi({check:"overwrite",tx:e})}function Yo(e){return Y(t=>t.normalize(e))}function Xo(){return Y(e=>e.trim())}function Qo(){return Y(e=>e.toLowerCase())}function ec(){return Y(e=>e.toUpperCase())}function tc(){return Y(e=>wr(e))}function nc(e,t,n){return new e({type:"array",element:t,..._(n)})}function rc(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._(n)})}function ic(e,t){const n=sc(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(ie(i,r.value,n._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(ie(s))}},e(r.value,r)),t);return n}function sc(e,t){const n=new Z({check:"custom",..._(t)});return n._zod.check=e,n}function ae(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&U(e,r,n[r]);return e}function bn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ce,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function X(e,t,n,r,i){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(i);return Object.assign(n,s),!0}function O(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,l);else{const p=o.schema,d=t.processors[i.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);d(e,t,p,l)}const h=e._zod.parent;h&&(o.ref||(o.ref=h),O(h,t,l),t.seen.get(h).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&ae(o.schema,a),t.io==="input"&&P(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function yn(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function wn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const o of e.seen.entries()){const c=e.metadataRegistry.get(o[0])?.id;if(c){const a=r.get(c);if(a&&a!==o[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,o[0])}}const i=o=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(o[0])?.id,p=e.external.uri??(m=>m);if(h)return{ref:p(h)};const d=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=d,{defId:d,ref:`${p("__shared")}#/${c}/${yn(d)}`}}const a="#",u=`${a}/${c}/`;if(o[1]===n&&!o[1].schema.id)return{ref:a};const l=o[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+yn(l)}},s=o=>{if(o[1].schema.$ref)return;const c=o[1],{ref:a,defId:u}=i(o);c.def={...c.schema},u&&(c.defId=u);const l=c.schema;for(const h in l)delete l[h];l.$ref=a};if(e.cycles==="throw")for(const o of e.seen.entries()){const c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cy)DELIM" -R"DELIM(cle?.join("/")}/\n\nSet the \\`cycles\\` parameter to \\`"ref"\\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const c=o[1];if(t===o[0]){s(o);continue}if(e.external){const u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(c.cycle){s(o);continue}c.count>1&&e.reused==="ref"&&s(o)}e.external&&(e.sharedDefsExtractedFor=e.external)}function kn(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;kn(r);const i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;const s=r.type;for(const o of Array.isArray(s)?s:[s]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const zn=new Set(["type","properties","required","additionalProperties"]),Sn=["oneOf","anyOf"];function $n(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function st(e){const t=[];for(const s of e){if(typeof s!="object"||s.type!=="object")return null;for(const o in s)if(!zn.has(o))return null;t.push(s)}const n={},r=new Set;for(const s of t){for(const o in s.properties){if(Object.prototype.hasOwnProperty.call(n,o))continue;const c=[];for(const u of t){const l=u.properties?.[o]??$n(u);l!=null&&(c.some(h=>JSON.stringify(h)===JSON.stringify(l))||c.push(l))}const a=c.length===1?c[0]:st(c)??{allOf:c};U(n,o,a)}for(const o of s.required??[])r.add(o)}const i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(s=>s.additionalProperties===!1))i.additionalProperties=!1;else{const s=[];for(const o of t){const c=$n(o);c&&!s.some(a=>JSON.stringify(a)===JSON.stringify(c))&&s.push(c)}s.length===1?i.additionalProperties=s[0]:s.length>1&&(i.additionalProperties={allOf:s})}return i}function oc(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const i of zn)if(i in e)return;const n=t.filter(i=>Sn.some(s=>Array.isArray(i[s])));let r=null;if(!n.length)r=st(t);else{const i=n[0],s=Sn.find(a=>Array.isArray(i[a]));if(Object.keys(i).length!==1)return;const o=t.filter(a=>a!==i),c=i[s].map(a=>st([...o,a]));if(c.some(a=>!a))return;r={[s]:c}}r&&(delete e.allOf,ae(e,r))}function On(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=c=>{const a=e.seen.get(c);if(a.ref===null)return;const u=a.def??a.schema,l={...u},h=a.ref;if(a.ref=null,h){r(h);const d=e.seen.get(h),m=d.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):ae(u,m),ae(u,l),c._zod.parent===h)for(const v in u)v==="$ref"||v==="allOf"||v in l||delete u[v];if(m.$ref&&d.def)for(const v in u)v==="$ref"||v==="allOf"||v in d.def&&JSON.stringify(u[v])===JSON.stringify(d.def[v])&&delete u[v]}const p=c._zod.parent;if(p&&p!==h){r(p);const d=e.seen.get(p);if(d?.schema.$ref&&(u.$ref=d.schema.$ref,d.def))for(const m in u)m==="$ref"||m==="allOf"||m in d.def&&JSON.stringify(u[m])===JSON.stringify(d.def[m])&&delete u[m]}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const c of[...e.seen.entries()].reverse())r(c[0]);if(e.target!=="openapi-3.0")for(const c of e.seen.entries())kn(c[1].def??c[1].schema);for(const c of e.deferred)c();if(e.intersections.length){const c=new Map;for(const a of e.seen.values())for(const u of[a.schema,a.def]){const l=u?.allOf;if(!Array.isArray(l))continue;const h=c.get(l);h?h.push(u):c.set(l,[u])}for(const a of e.intersections)for(const u of c.get(a)??[])oc(u)}}const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(c)}ae(i,n.defId?n.schema:n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&i.id===s&&delete i.id;const o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const c of e.seen.entries()){const a=c[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,U(o,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const c=JSON.parse(JSON.stringify(i));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ee(t,"input",e.processors),output:Ee(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function P(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return P(r.element,n);if(r.type==="set")return P(r.valueType,n);if(r.type==="lazy")return P(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return P(r.innerType,n);if(r.type==="intersection")return P(r.left,n)||P(r.right,n);if(r.type==="record"||r.type==="map")return P(r.keyType,n)||P(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:P(r.in,n)||P(r.out,n);if(r.type==="object"){for(const i in r.shape)if(P(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(P(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(P(i,n))return!0;return!!(r.rest&&P(r.rest,n))}return!1}const cc=(e,t={})=>n=>{const r=bn({...n,processors:t});return O(e,r),wn(r,e),On(r,e)},Ee=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=bn({...i??{},target:s,io:t,processors:n});return O(e,o),wn(o,e),On(o,e)},Q=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ee=(e,t,n)=>{(e[t]===void 0||n{Q(e,"minimum",t),ee(e,"maximum",t)},In=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Tn=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Pn=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},Zn=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},An=(e,t)=>Q(e,"minimum",t.minimum),Nn=(e,t)=>ee(e,"maximum",t.maximum),Rn=e=>(t,n)=>{Zn(t,n.format);const[r,i]=e[n.format];Q(t,"minimum",r),ee(t,"maximum",i)},ac={greater_than:(e,t)=>Q(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ee(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>In(e,t.value),number_format:Rn(zt),bigint_format:Rn($r),min_length:An,max_length:Nn,length_equals:(e,t)=>En(e,t.length),min_size:An,max_size:Nn,size_equals:(e,t)=>En(e,t.size),string_format:(e,t)=>{Zn(e,t.format),t.pattern&&Tn(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Pn(e,t.mime)};function j(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const s of r)ac[s._zod.def.check]?.(t,s._zod.def);const i=e._zod.bag;i.minimum!==void 0&&Q(t,"minimum",i.minimum),i.exclusiveMinimum!==void 0&&Q(t,"exclusiveMinimum",i.exclusiveMinimum),i.maximum!==void 0&&ee(t,"maximum",i.maximum),i.exclusiveMaximum!==void 0&&ee(t,"exclusiveMaximum",i.exclusiveMaximum),i.multipleOf!==void 0&&In(t,i.multipleOf),i.format!==void 0&&(t.format??(t.format=i.format),i.format.includes("int")&&(t.isInt=!0)),i.mime&&Pn(t,i.mime);for(const s of i.patterns??[])Tn(t,s);return t}const uc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lc=new Map([[Bt,$i],[Qe,Oi]]),jn=e=>lc.get(e)??e,fc=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:c,patterns:a,contentEncoding:u,laxFormat:l}=j(e);if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),c)DELIM" -R"DELIM(&&(i.format=uc[c]??c,i.format===""&&delete i.format,(c==="time"||l)&&delete i.format),u&&(i.contentEncoding=u),a&&a.size>0){const h=[...a].map(jn);h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},hc=(e,t,n,r)=>{const i=n,{minimum:s,maximum:o,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:l}=j(e);i.type=l?"integer":"number";const h=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),p=typeof a=="number"&&a<=(o??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";if(h?d?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),p?d?(i.maximum=a,i.exclusiveMaximum=!0):i.exclusiveMaximum=a:typeof o=="number"&&(i.maximum=o),c){const m=new Set;for(const b of c)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):X(e,t,i,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,...v]=m;g!==void 0&&(i.multipleOf=g),v.length&&(i.allOf=[...i.allOf??[],...v.map(b=>({multipleOf:b}))])}},dc=(e,t,n,r)=>{n.type="boolean"},pc=(e,t,n,r)=>{n.not={}},mc=(e,t,n,r)=>{},gc=(e,t,n,r)=>{const i=e._zod.def,s=je(i.entries);if(s.length===0){n.not={};return}s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},_c=(e,t,n,r)=>{X(e,t,n,r,"Custom types cannot be represented in JSON Schema")},vc=(e,t,n,r)=>{X(e,t,n,r,"Transforms cannot be represented in JSON Schema")},bc=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:o,maximum:c}=j(e);typeof o=="number"&&(i.minItems=o),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=O(s.element,t,{...r,path:[...r.path,"items"]})};function ue(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?ue(t.out):t.type==="catch"?ue(t.innerType):e._zod.optin}const yc=(e,t,n,r)=>{const i=n,s=e._zod.def,o=s.shape;if(Object.getOwnPropertySymbols(o).length&&X(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(const u in o)U(i.properties,u,O(o[u],t,{...r,path:[...r.path,"properties",u]}));const a=[];for(const u of Object.keys(o)){const l=s.shape[u];(t.io==="input"?ue(l)===void 0:l._zod.optout===void 0)&&a.push(u)}a.length>0&&(i.required=a),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=O(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},wc=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,o=i.options.map((c,a)=>O(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=o:n.anyOf=o},kc=(e,t,n,r)=>{const i=e._zod.def,s=O(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=O(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(o)?o.allOf:[o]];n.allOf=a,t.intersections.push(a)},zc=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="array";const o=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((g,v)=>O(g,t,{...r,path:[...r.path,o,v]})),u=s.rest?O(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;let l=s.items.length;for(;l>0;){const g=s.items[l-1];if(!(t.io==="input"?ue(g)!==void 0:g._zod.optout==="optional"))break;l--}const h=s.items.length,p=!s.rest;t.target==="draft-2020-12"?(i.prefixItems=a,p?i.items=!1:u&&(i.items=u),l>0&&(i.minItems=l),p&&(i.maxItems=h)):t.target==="openapi-3.0"?(i.items={anyOf:a},u&&i.items.anyOf.push(u),l>0&&(i.minItems=l),p&&(i.maxItems=h)):(i.items=a,p?i.additionalItems=!1:u&&(i.additionalItems=u),l>0&&(i.minItems=l),p&&(i.maxItems=h));const{minimum:d,maximum:m}=j(e);typeof d=="number"&&(i.minItems=d),typeof m=="number"&&(i.maxItems=m)};function ot(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const m=e.get(t)?.def;if(!m)return t;const g=ot(e,m,n);return g===m?t:g}for(const m of["anyOf","oneOf"]){const g=t[m];if(!Array.isArray(g))continue;const v=g.map(b=>ot(e,b,n));v.some((b,A)=>b!==g[A])&&(t={...t,[m]:v})}const r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!i&&!s?.some(m=>typeof m=="number"))return t;const{minimum:o,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:l,format:h,id:p,...d}=t;return d.enum?d.enum=d.enum.map(m=>typeof m=="number"?String(m):m):typeof d.const=="number"&&(d.const=String(d.const)),i&&(d.type="string",s||(d.pattern=(r.includes("number")?Ge:Ri).source)),d}const ct=new WeakMap;function Sc(e){const t=new Map;for(const r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);const n=new Map;for(const r of ct.get(e)??[]){const i=e.seen.get(r),s=(i?.def??i?.schema)?.propertyNames;if(!s||s===!0||n.has(s))continue;const o=ot(t,s,new Set);o!==s&&n.set(s,o)}if(n.size)for(const r of e.seen.values())for(const i of[r.schema,r.def]){const s=i&&n.get(i.propertyNames);s&&(i.propertyNames=s)}}const $c=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const o=s.keyType,c=j(o).patterns;if(s.mode==="loose"&&c&&c.size>0){const l=O(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const h of c)U(i.patternProperties,jn(h).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){i.propertyNames=O(s.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=ct.get(t);l||(l=[],ct.set(t,l),t.deferred.push(()=>Sc(t))),l.push(e)}i.additionalProperties=O(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const a=o._zod.values,u=t.io==="input"&&ue(s.valueType)!==void 0;if(a&&!s.partial&&!u){const l=[...a].filter(h=>typeof h=="string"||typeof h=="number");l.length>0&&(i.required=l.map(String))}},Oc=(e,t,n,r)=>{const i=e._zod.def,s=O(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},Ec=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},at=Symbol();function Mn(e,t,n,r,i){let s=!1;const o=JSON.stringify(e,(c,a)=>typeof a!="bigint"?a:(s=!0,null));return s?(X(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),at):JSON.parse(o)}const Ic=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;const o=Mn(i.defaultValue,e,t,n,r);o!==at&&(n.default=o)},Tc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);if(s.ref=i.innerType,t.io!=="input")return;const o=Mn(i.defaultValue,e,t,n,r);o!==at&&(n._prefault=o)},Pc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{X(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},Zc=(e,t,n,r)=>{const i=e._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?s?i.out:i.in:i.out;O(o,t,r);const c=t.seen.get(e);c.ref=o},Ac=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},Ln=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},Fn=new WeakSet([Object.prototype,Error.prototype]);function Ie(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const M=f("ZodError",(e,t)=>{Vr.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Fn.has(n)||(Fn.add(n),Ie(n,"format",r=>i=>Hr(r,i)),Ie(n,"flatten",r=>i=>qr(r,i)),Ie(n,"addIssue",r=>i=>{r.issues.push(i),r.message=JSON.stringify(r.issues,Me,2)}),Ie(n,"addIssues",r=>i=>{r.issues.push(...i),r.message=JSON.stringify(r.issues,Me,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Nc=Be(M),Rc=)DELIM" -R"DELIM(Ve(M),jc=We(M),Mc=qe(M),Lc=ti(M),Fc=ni(M),Cc=ri(M),Dc=ii(M),xc=si(M),Uc=oi(M),Kc=ci(M),Jc=ai(M);function Bc(){R.localeError||F(uo())}function le(){R.memoizer||F({memoizer:oo()})}const S=f("ZodType",(e,t)=>(Bc(),k.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(N(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return K(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ja(e,t))},superRefine(e,t){return this.check(Ba(e,t))},overwrite(e){return this.check(Y(e))},optional(){return Vn(this)},exactOptional(){return Za(this)},nullable(){return qn(this)},nullish(){return Vn(qn(this))},nonoptional(e){return La(this,e)},array(){return Kn(this)},or(e){return Jn([this,e])},and(e){return Sa(this,e)},transform(e){return Gn(this,Pa(e))},default(e){return Ra(this,e)},prefault(e){return Ma(this,e)},catch(e){return Ca(this,e)},pipe(e){return Gn(this,e)},readonly(){return Ua(this)},describe(e){const t=this.clone();return ce.add(t,{description:e}),t},meta(...e){if(e.length===0)return ce.get(this);const t=this.clone();return ce.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Et(this,"~standard",{...Ct(this),jsonSchema:{input:Ee(this,"input"),output:Ee(this,"output")}})},set"~standard"(e){V(this,"~standard",e)},parse:function e(t,n){return Nc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Rc(this,t,n,{callee:e})},safeParse(e,t){return jc(this,e,t)},async safeParseAsync(e,t){return Mc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){V(this,"spa",e)},validate(e,t){return Xr(this,e,t)},validateAsync(e,t){return ei(this,e,t)},encode:function e(t,n){return Lc(this,t,n,{callee:e})},decode:function e(t,n){return Fc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Cc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Dc(this,t,n,{callee:e})},safeEncode(e,t){return xc(this,e,t)},safeDecode(e,t){return Uc(this,e,t)},async safeEncodeAsync(e,t){return Kc(this,e,t)},async safeDecodeAsync(e,t){return Jc(this,e,t)},toJSONSchema(e){return cc(this,{})(e)},get description(){return ce.get(this)?.description},get _def(){return this._zod.def}}),Cn=f("_ZodString",(e,t)=>{Xe.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fc(e,n,r)},It({format:e=>j(e).format??null,minLength:e=>j(e).minimum??null,maxLength:e=>j(e).maximum??null},{regex(...e){return this.check(Bo(...e))},includes(...e){return this.check(qo(...e))},startsWith(...e){return this.check(Ho(...e))},endsWith(...e){return this.check(Go(...e))},min(...e){return this.check(Oe(...e))},max(...e){return this.check(_n(...e))},length(...e){return this.check(vn(...e))},nonempty(...e){return this.check(Oe(1,...e))},lowercase(e){return this.check(Vo(e))},uppercase(e){return this.check(Wo(e))},trim(){return this.check(Xo())},normalize(...e){return this.check(Yo(...e))},toLowerCase(){return this.check(Qo())},toUpperCase(){return this.check(ec())},slugify(){return this.check(tc())}})),Vc=f("ZodString",(e,t)=>{Xe.init(e,t),Cn.init(e,t)},{email(e){return this.check(po(Yc,e))},url(e){return this.check(yo(Qc,e))},jwt(e){return this.check(jo(pa,e))},emoji(e){return this.check(wo(ea,e))},guid(e){return this.check(mo(Xc,e))},uuid(e){return this.check(go(Te,e))},uuidv4(e){return this.check(_o(Te,e))},uuidv6(e){return this.check(vo(Te,e))},uuidv7(e){return this.check(bo(Te,e))},nanoid(e){return this.check(ko(ta,e))},cuid(e){return this.check(zo(na,e))},cuid2(e){return this.check(So(ra,e))},ulid(e){return this.check($o(ia,e))},base64(e){return this.check(Ao(fa,e))},base64url(e){return this.check(No(ha,e))},xid(e){return this.check(Oo(sa,e))},ksuid(e){return this.check(Eo(oa,e))},ipv4(e){return this.check(Io(ca,e))},ipv6(e){return this.check(To(aa,e))},cidrv4(e){return this.check(Po(ua,e))},cidrv6(e){return this.check(Zo(la,e))},e164(e){return this.check(Ro(da,e))},datetime(e){return this.check(Mo(Wc,e))},date(e){return this.check(Lo(qc,e))},time(e){return this.check(Fo(Hc,e))},duration(e){return this.check(Co(Gc,e))}});function te(e){return ho(Vc,e)}const $=f("ZodStringFormat",(e,t)=>{z.init(e,t),Cn.init(e,t)}),Wc=f("ZodISODateTime",(e,t)=>{ms.init(e,t),$.init(e,t)}),qc=f("ZodISODate",(e,t)=>{gs.init(e,t),$.init(e,t)}),Hc=f("ZodISOTime",(e,t)=>{_s.init(e,t),$.init(e,t)}),Gc=f("ZodISODuration",(e,t)=>{vs.init(e,t),$.init(e,t)}),Yc=f("ZodEmail",(e,t)=>{ts.init(e,t),$.init(e,t)}),Xc=f("ZodGUID",(e,t)=>{Qi.init(e,t),$.init(e,t)}),Te=f("ZodUUID",(e,t)=>{es.init(e,t),$.init(e,t)}),Qc=f("ZodURL",(e,t)=>{cs.init(e,t),$.init(e,t)}),ea=f("ZodEmoji",(e,t)=>{as.init(e,t),$.init(e,t)}),ta=f("ZodNanoID",(e,t)=>{us.init(e,t),$.init(e,t)}),na=f("ZodCUID",(e,t)=>{ls.init(e,t),$.init(e,t)}),ra=f("ZodCUID2",(e,t)=>{fs.init(e,t),$.init(e,t)}),ia=f("ZodULID",(e,t)=>{hs.init(e,t),$.init(e,t)}),sa=f("ZodXID",(e,t)=>{ds.init(e,t),$.init(e,t)}),oa=f("ZodKSUID",(e,t)=>{ps.init(e,t),$.init(e,t)}),ca=f("ZodIPv4",(e,t)=>{bs.init(e,t),$.init(e,t)}),aa=f("ZodIPv6",(e,t)=>{ws.init(e,t),$.init(e,t)}),ua=f("ZodCIDRv4",(e,t)=>{ks.init(e,t),$.init(e,t)}),la=f("ZodCIDRv6",(e,t)=>{Ss.init(e,t),$.init(e,t)}),fa=f("ZodBase64",(e,t)=>{$s.init(e,t),$.init(e,t)}),ha=f("ZodBase64URL",(e,t)=>{Es.init(e,t),$.init(e,t)}),da=f("ZodE164",(e,t)=>{Is.init(e,t),$.init(e,t)}),pa=f("ZodJWT",(e,t)=>{Ps.init(e,t),$.init(e,t)}),Dn=f("ZodNumber",(e,t)=>{Vt.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hc(e,n,r,i),e.isFinite=!0},It({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=j(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=j(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=j(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>j(e).format??null},{gt(e,t){return this.check(mn(e,t))},gte(e,t){return this.check(it(e,t))},min(e,t){return this.check(it(e,t))},lt(e,t){return this.check(pn(e,t))},lte(e,t){return this.check(rt(e,t))},max(e,t){return this.check(rt(e,t))},int(e){return this.check(xn(e))},safe(e){return this.check(xn(e))},positive(e){return this.check(mn(0,e))},nonnegative(e){return this.check(it(0,e))},negative(e){return this.check(pn(0,e))},nonpositive(e){return this.check(rt(0,e))},multipleOf(e,t){return this.check(gn(e,t))},step(e,t){return this.check(gn(e,t))},finite(){return this}}));function E(e){return Do(Dn,e)}const ma=f("ZodNumberFormat",(e,t)=>{Zs.init(e,t),Dn.init(e,t)});function xn(e){return xo(ma,e)}const ga=f("ZodBoolean",(e,t)=>{As.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dc(e,n,r)});function I(e){return Uo(ga,e)}const _a=f("ZodUnknown",(e,t)=>{Ns.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mc()});function Un(){return Ko(_a)}const va=f("ZodNever",(e,t)=>{Rs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pc(e,n,r)});function ba(e){return Jo(va,e)}const ya=f("ZodArray",(e,t)=>{le(),Ls.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bc(e,n,r,i),e.element=t.element},{min(e,t){return this.check(Oe(e,t))},nonempty(e){return this.check(Oe(1,e))},max(e,t){return this.check(_n(e,t))},length(e,t){return this.check(vn(e,t))},unwrap(){return this.element}});function Kn(e,t){return nc(ya,e,t)}const wa=f("ZodObject",(e,t)=>{le(),Ds.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yc(e,n,r,i),Cr(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Ia(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(N(this._zod.def,{catchall:e}))},passthrough(){return this.clone(N(this._zod.def,{catchall:Un()}))},loose(){return this.clone(N(this._zod.def,{catchall:Un()}))},strict(){return this.clone(N(this._zod.def,{catchall:ba()}))},strip(){return this.clone(N(this)DELIM" -R"DELIM(._zod.def,{catchall:void 0}))},extend(e){return Ir(this,e)},safeExtend(e){return Tr(this,e)},merge(e){return Pr(this,e)},pick(e){return Or(this,e)},omit(e){return Er(this,e)},partial(...e){return $t(lt,this,e[0])},exactPartial(...e){return $t(Wn,this,e[0],"exactPartial")},required(...e){return Zr(Hn,this,e[0])}});function C(e,t){const n={type:"object",shape:e??{},..._(t)};return new wa(n)}const ka=f("ZodUnion",(e,t)=>{xs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wc(e,n,r,i),e.options=t.options});function Jn(e,t){return new ka({type:"union",options:e,..._(t)})}const za=f("ZodIntersection",(e,t)=>{Us.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kc(e,n,r,i)});function Sa(e,t){return new za({type:"intersection",left:e,right:t})}const $a=f("ZodTuple",(e,t)=>{le(),Ks.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zc(e,n,r,i)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){const e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new lt({type:"optional",innerType:t}))})}});function Oa(e,t,n){const r=t instanceof k,i=r?n:t,s=r?t:null;return new $a({type:"tuple",items:e,rest:s,..._(i)})}const Bn=f("ZodRecord",(e,t)=>{le(),Js.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$c(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Ea(e,t,n){return!t||!t._zod?new Bn({type:"record",keyType:te(),valueType:e,..._(t)}):new Bn({type:"record",keyType:e,valueType:t,..._(n)})}const ut=f("ZodEnum",(e,t)=>{Bs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(r,i,s)=>gc(e,r,i),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ut({...t,checks:[],..._(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new ut({...t,checks:[],..._(i),entries:s})}});function Ia(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ut({type:"enum",entries:n,..._(t)})}const Ta=f("ZodTransform",(e,t)=>{le(),Vs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vc(e,n,r,i),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Zt(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(ie(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=e),n.issues.push(ie(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function Pa(e){return new Ta({type:"transform",transform:e})}const lt=f("ZodOptional",(e,t)=>{nn.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ln(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Vn(e){return new lt({type:"optional",innerType:e})}const Wn=f("ZodExactOptional",(e,t)=>{Ws.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ln(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Wn({type:"optional",innerType:e})}const Aa=f("ZodNullable",(e,t)=>{qs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Oc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function qn(e){return new Aa({type:"nullable",innerType:e})}const Na=f("ZodDefault",(e,t)=>{Hs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ic(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ra(e,t){return new Na({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wt(t)}})}const ja=f("ZodPrefault",(e,t)=>{Gs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Tc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ma(e,t){return new ja({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wt(t)}})}const Hn=f("ZodNonOptional",(e,t)=>{Ys.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ec(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function La(e,t){return new Hn({type:"nonoptional",innerType:e,..._(t)})}const Fa=f("ZodCatch",(e,t)=>{Xs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Pc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ca(e,t){return new Fa({type:"catch",innerType:e,catchValue:typeof t=="function"?t:xr(t)})}const Da=f("ZodPipe",(e,t)=>{Qs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Zc(e,n,r,i),e.in=t.in,e.out=t.out});function Gn(e,t){return new Da({type:"pipe",in:e,out:t})}const xa=f("ZodReadonly",(e,t)=>{eo.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ac(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ua(e){return new xa({type:"readonly",innerType:e})}const Ka=f("ZodCustom",(e,t)=>{to.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_c(e,n,r,i)});function Ja(e,t={}){return rc(Ka,e,t)}function Ba(e,t){return ic(e,t)}const Pe=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],ft=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category)DELIM" -R"DELIM(:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],Yn=E().int().nonnegative().max(864e13),Xn=C({level:E().int().nonnegative(),time:Yn,message:te()}),Qn=C({event:E().int().nonnegative(),value:E().nonnegative(),time:Yn}),er=C({previous:E().nonnegative()});Jn([Xn,Qn,er]);const Va=2**Pe.length-1,tr=2**ft.length-1;function nr(e,t){return Number.isInteger(t)&&t>=0&&t{this.#u(r)},onHeartbeat:r=>{this.#u(r)},onBeforeStop:r=>{r.send("/v1/log/subscribe?filter=0"),r.send("/v1/event/subscribe?filter=0")},onMessage:r=>{const i=Ha(r);if(!i)return!1;if(rr(i)&&!nr(this.#e,i.level))return!0;for(const s of this.#t)s(i);return!0},onUnclaimed:r=>{for(const i of this.#i)i(r)}}}getStatus=()=>this.#c.getStatus();subscribeStatus=t=>this.#c.subscribeStatus(t);start(){this.#r??=this.#c.attach(this.#a)}stop(){this.#r?.(),this.#r=null}subscribeFrames(t){return this.#t.add(t),()=>{this.#t.delete(t)}}subscribeInvalidFrames(t){return this.#i.add(t),()=>{this.#i.delete(t)}}setFilters(t,n){this.#e!==t&&(this.#e=t,this.#c.send(`/v1/log/subscribe?filter=${String(t)}`)),this.#n!==n&&(this.#n=n,this.#c.send(`/v1/event/subscribe?filter=${String(n)}`))}#u(t){t.send(`/v1/log/subscribe?filter=${String(this.#e)}`),t.send(`/v1/event/subscribe?filter=${String(this.#n)}`)}}function Qa(e){const t=e.trim();if(!t)throw new Error("Endpoint URL is required");const n=/^[a-z][a-z\\d+\\-.]*:\\/\\//iu.test(t)?t:`http://${t}`,r=new URL(n);if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return r.pathname=r.pathname.replace(/\\/+$/u,"")||"/",r.search="",r.hash="",r.toString().replace(/\\/$/u,"")}function eu(e){const t=new URL(Qa(e));return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.pathname="/",t.search="",t.hash="",t.toString()}const tu=C({store:C({address:I(),filter:I(),silent:E().int().nonnegative().nullable(),turbo:I(),witness:I(),pruned:E().int().nonnegative()}),node:C({network:te(),limited:I().optional(),blocks:I().optional(),witness:I().optional(),filters:I().optional(),privacy:I().optional(),fees:I().optional()}),wallet:C({p2kh:E().int(),p2sh:E().int(),wif:E().int(),witness:te(),silent:te(),hd_private:E().int(),hd_public:E().int()}).optional(),network:C({relay:I(),alert:I(),reject:I(),compact:I(),address:I(),witness_tx:I(),memory_pool:I(),not_found:I(),protocol_maximum:E().int(),protocol_minimum:E().int()}).optional(),forks:Ea(te(),I()).transform(e=>Object.keys(e).filter(t=>e[t]))}),nu=C({height:E().int().nonnegative(),timestamp:E().int().positive().max(4294967295)}),Ae=E().int().nonnegative().max(Number.MAX_SAFE_INTEGER),ru=C({count:Ae,virtual:Ae,fee:Ae,histogram:Kn(Oa([E().nonnegative(),Ae]))}),iu="/v1/fees?format=json",su=5e3,ou=15e3,cu=E().int().nonnegative();function au(e){try{const t=JSON.parse(e),n=tu.safeParse(t);if(n.success)return{type:"configuration",payload:n.data};const r=nu.safeParse(t);if(r.success)return{type:"header",payload:r.data};const i=ru.safeParse(t);if(i.success)return{type:"fees",payload:i.data};const s=cu.safeParse(t);return s.success?{type:"top",payload:s.data}:null}catch{return null}}function uu(e){return`/v1/block/height/${String(e)}/header?format=json`}const ir=15e3,sr=3*ir,or={configuration:null,configurationReceivedAt:null,top:null,topReceivedAt:null,topHeader:null,headerReceivedAt:null,fees:null,invalidFrames:0};class lu{#e=or;#n=new Set;#t;#i;#c=null;#a=null;#r;#u=null;#s=null;#o=null;#p;#f=null;#h=null;constructor(t,n={}){this.#r=n.now??Date.now,this.#p=n.pollIntervalMs??ir,this.#t=t,this.#i={heartbeatMs:this.#p,onOpen:r=>{this.#u=this.#r(),r.send("/v1/configuration?format=json"),r.send("/v1/top/subscribe?format=json"),this.#h=null,this.#g()},onHeartbeat:r=>{const i=this.#e.topReceivedAt??this.#u;if(i!==null&&this.#r()-i>=sr){try{r.close(4e3,"Native top response timed out")}catch{}return}r.send("/v1/top?format=json")},onBeforeStop:r=>{r.send("/v1/top/subscribe?format=json&stop=true")},onMessage:r=>{const i=au(r);return i?(this.#d(i),!0):!1},onUnclaimed:()=>{this.#l({...this.#e,invalidFrames:this.#e.invalidFrames+1})}}}getStatus=()=>this.#t.getStatus();subscribeStatus=t=>this.#t.subscribeStatus(t);getState=()=>this.#e;subscribeState=t=>(this.#n.add(t),()=>{this.#n.delete(t)});start(){this.#f??=setInterval(()=>{this.#g()},su),this.#a??=this.#t.subscribeStatus(()=>{this.#t.getStatus().phase!=="connected"&&(this.#u=null,this.#h=null,this.#s=null,this.#o=null,this.#v())}),this.#c??=this.#t.attach(this.#i)}stop(){this.#f!==null&&clearInterval(this.#f),this.#f=null,this.#h=null,this.#a?.(),this.#a=null,this.#c?.(),this.#c=null}#d(t){const n=this.#r();if(t.type==="fees"){this.#h=null,this.#l({...this.#e,fees:{data:t.payload,receivedAt:n}});return}if(t.type==="top"){const r=this.#e.top!==null&&t.payloadnew WebSocket(n))},this.#s=this.#e.retryMinimumMs}getStatus=()=>this.#n;subscribeStatus=t=>(this.#i.add(t),()=>{this.#i.delete(t)});attach(t){this.#r.push(t);const n=this.#t;return n?.readyState===1&&this.#n.phase==="connected"&&(t.onOpen?.(n),this.#h(n,t)),()=>{const r=this.#r.indexOf(t);if(r<0)return;this.#r.splice(r,1),this.#m(t);const i=this.#t;if(i?.readyState===1)try{t.onBeforeStop?.(i)}catch{}}}start(){this.#o||(this.#o=!0,this.#s=this.#e.retryMinimumMs,this.#p())}stop(){this.#o=!1,this.#v();const t=this.#t;if(this.#t=null,t)try{if(t.readyState===1)for(const n of[...this.#r])n.onBeforeStop?.(t);t.close()}catch{}this.#l(cr)}send(t){if(this.#t?.readyState!==1)return!1;try{return this.#t.send(t),!0}catch{return!1}}#p(){if(!this.#o||this.#t)return;const t=this.#n.reconnects>0;this.#l({...this.#n,phase:t?"reconnecting":"connecting",attempt:this.#n.attempt+1,error:null});let n;try{n=this.#e.webSo)DELIM" -R"DELIM(cketFactory(this.#e.url),this.#t=n}catch(r){this.#l({...this.#n,error:du(r)}),this.#f();return}this.#c=setTimeout(()=>{if(this.#t===n){this.#l({...this.#n,error:"Connection timed out"});try{n.close()}catch{this.#t=null,this.#f()}}},this.#e.connectTimeoutMs),n.addEventListener("open",()=>{if(!(this.#t!==n||!this.#o)){this.#d(),this.#s=this.#e.retryMinimumMs,this.#l({...this.#n,phase:"connected",connectedAt:this.#e.now(),error:null});for(const r of[...this.#r]){if(this.#t!==n)return;r.onOpen?.(n),this.#h(n,r)}}}),n.addEventListener("message",r=>{if(this.#t!==n||!this.#o)return;const i=hu(r.data);if(i===null)return;const s=this.#e.now();(this.#n.lastMessageAt===null||s-this.#n.lastMessageAt>=1e3)&&this.#l({...this.#n,lastMessageAt:s});const o=[...this.#r];if(!o.some(c=>c.onMessage(i)))for(const c of o)c.onUnclaimed?.(i)}),n.addEventListener("error",()=>{if(!(this.#t!==n||!this.#o)){this.#l({...this.#n,error:"WebSocket connection failed"});try{n.close()}catch{this.#t=null,this.#f()}}}),n.addEventListener("close",()=>{this.#t===n&&(this.#t=null,this.#d(),this.#g(),this.#o&&this.#f())})}#f(){if(!this.#o||this.#a)return;const t=1+(this.#e.random()*2-1)*this.#e.jitterRatio,n=Math.max(0,Math.round(this.#s*t));this.#s=Math.min(this.#s*2,this.#e.retryMaximumMs),this.#l({...this.#n,phase:"reconnecting",reconnects:this.#n.reconnects+1,connectedAt:null}),this.#a=setTimeout(()=>{this.#a=null,this.#p()},n)}#h(t,n){this.#m(n);const r=n.heartbeatMs??24e4;if(!n.onHeartbeat||r<=0)return;const i=setInterval(()=>{this.#t===t&&t.readyState===1&&n.onHeartbeat?.(t)},r);this.#u.set(n,i)}#d(){this.#c&&(clearTimeout(this.#c),this.#c=null)}#m(t){const n=this.#u.get(t);n!==void 0&&(clearInterval(n),this.#u.delete(t))}#g(){for(const t of this.#u.values())clearInterval(t);this.#u.clear()}#v(){this.#d(),this.#g(),this.#a&&(clearTimeout(this.#a),this.#a=null)}#l(t){this.#n=t;for(const n of this.#i)n()}}function hu(e){return typeof e=="string"?e:e instanceof ArrayBuffer?new TextDecoder().decode(e):null}function du(e){return e instanceof Error?e.message:"Unable to create WebSocket"}const ne=["occurrence-rate","occurrence-count","cumulative-occurrences"],pu=["payload-latest","payload-maximum","payload-change-rate",...ne],mu=["payload-average","payload-latest","payload-minimum","payload-maximum",...ne],gu=["payload-sum","payload-cumulative","payload-latest","payload-average",...ne],ar=["payload-latest","payload-average","payload-minimum","payload-maximum"],ur=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function lr(e){return`event:${String(e)}`}function fr(e){return`log:${String(e)}`}const ht="native:top";function _u(e){switch(e){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function vu(e){switch(e){case"height":return pu;case"duration":return mu;case"count":return gu;case"fee-rate":return[...ar,...ne];default:return ne}}function bu(e){switch(e){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function yu(e){const t=Ze(e),n=_u(t.valueKind);return{id:lr(e),source:"event",sourceId:e,name:t.name,label:t.label,category:t.category,payloadKind:n,allowedMeasures:vu(n),defaultMeasure:bu(n),description:e===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":n==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${t.label} event with a ${n} payload.`}}const wu=[...ur.map(e=>({id:e.id,source:"pool",sourceId:e.field,name:e.field,label:e.label,category:"pool",payloadKind:e.payloadKind,allowedMeasures:ar,defaultMeasure:"payload-latest",description:e.description})),...ft.map(e=>yu(e.id)),...Pe.map(e=>({id:fr(e.id),source:"log",sourceId:e.id,name:e.name,label:`${e.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:ne,defaultMeasure:"occurrence-rate",description:`${e.label} log message volume. Message text is not interpreted as numeric data.`})),{id:ht,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}];new Map(wu.map(e=>[e.id,e]));function ku(e,t){return Ze(e).valueKind==="fee-rate"?t/1e3:Ya(e,t)??t}const zu=3600*1e3,Su=1e3,$u=1e3,Ou=1e3;class hr{constructor(t){this.capacity=t,this.#e=Array.from({length:t})}capacity;#e;#n=0;#t=0;#i=null;get size(){return this.#t}push(t){const n=this.#t===this.capacity;return this.#i=null,this.#e[this.#n]=t,this.#n=(this.#n+1)%this.capacity,this.#t=Math.min(this.#t+1,this.capacity),n}clear(){this.#i=null,this.#e.fill(void 0),this.#n=0,this.#t=0}newestFirst(){if(this.#i)return this.#i;const t=[];for(let n=0;nthis.#A;getRecentLogs=()=>this.#i.newestFirst();getRecentEvents=()=>this.#c.newestFirst();subscribe=t=>(this.#t.add(t),()=>{this.#t.delete(t)});start(){this.#k||(this.tick(),this.#k=setInterval(()=>{this.tick()},1e3))}stop(){this.#k&&(clearInterval(this.#k),this.#k=null),this.#_&&(clearTimeout(this.#_),this.#_=null)}ingest(t,n=this.#e()){const r=this.#b(n);this.#g+=1,rr(t)?this.#j(t,r):Wa(t)?this.#M(t,r):qa(t)&&(this.#I+=1),this.#z()}recordInvalidFrame(){this.#T+=1,this.#z()}recordNativeTop(t,n=this.#e()){const r=this.#b(n),i=this.#f[ht];i?.value===t&&r-i.time<15e3||(this.#S(ht,r,t),this.#N(r),this.#z())}recordNativeFees(t,n=this.#e()){if(!Number.isFinite(n)||n=ou||this.#y!==null&&n<=this.#y.receivedAt)return;const r=this.#b(n);this.#y={data:t,receivedAt:n};for(const i of ur)this.#S(i.id,r,t[i.field]);this.#N(r),this.#z()}clearLogs(){this.#O+=this.#i.size,this.#i.clear(),this.flush()}clearEvents(){this.#c.clear(),this.flush()}reset(){this.#i.clear(),this.#c.clear(),this.#a.clear(),this.#r={},this.#u={},this.#s={},this.#o={},this.#p={},this.#f={},this.#h={},this.#d=this.#b(this.#e()),this.#g=0,this.#v=0,this.#l=0,this.#O=0,this.#E=0,this.#I=0,this.#T=0,this.#P=null,this.#Z=null,this.#y=null,this.#w=0,this.#$(this.#d),this.flush()}tick(){const t=this.#b(this.#e());this.#$(t),this.#N(t),this.#z()}flush(){this.#_&&(clearTimeout(this.#_),this.#_=null),this.#A=this.#R();for(const t of this.#t)t()}#j(t,n){this.#v+=1,this.#P=n,this.#w+=1,this.#i.push({...t,id:this.#w,receivedAt:n})&&(this.#l+=1),this.#S(fr(t.level),n,null)}#M(t,n){this.#E+=1,this.#Z=n,this.#w+=1,this.#c.push({...t,id:this.#w,receivedAt:n}),this.#S(lr(t.event),n,ku(t.event,t.value))}#b(t){return Number.isFinite(t)?(this.#m=Math.max(this.#m,t),this.#m):this.#m}#S(t,n,r){const i=this.#$(n);i.snapshot=null;const s=i.signals.get(t)??Eu();if(s.count+=1,Ne(this.#o,t,1),r!==null){s.samples+=1,s.sum+=r,s.minimum=s.minimum===null?r:M)DELIM" -R"DELIM(ath.min(s.minimum,r),s.maximum=s.maximum===null?r:Math.max(s.maximum,r),(s.firstAt===null||n=s.lastAt)&&(s.last=r,s.lastAt=n),Ne(this.#p,t,r);const o=this.#f[t];(!o||n>=o.time)&&(this.#f[t]={value:r,time:n}),this.#h[t]=Math.max(this.#h[t]??r,r)}i.signals.set(t,s)}#$(t){const n=Math.floor(t/1e3)*1e3,r=this.#a.get(n);if(r)return r;const i={time:n,signals:new Map,snapshot:null};return this.#a.set(n,i),i}#N(t){const n=t-zu;for(const[r,i]of this.#a){if(r>=n)break;for(const[s,o]of i.signals)if(Ne(this.#r,s,o.count),Ne(this.#u,s,o.sum),o.last!==null&&o.lastAt!==null){const c=this.#s[s];(!c||o.lastAt>=c.time)&&(this.#s[s]={value:o.last,time:o.lastAt})}this.#a.delete(r)}}#z(){!this.#n||this.#_||(this.#_=setTimeout(()=>{this.#_=null,this.flush()},Su))}#R(){const t=[...this.#a.values()].map(n=>(n.snapshot??={time:n.time,signals:Object.fromEntries([...n.signals].map(([r,i])=>[r,{...i}]))},n.snapshot));return{now:this.#b(this.#e()),sessionStartedAt:this.#d,totalFrames:this.#g,totalLogs:this.#v,evictedLogs:this.#l,clearedLogs:this.#O,totalEvents:this.#E,totalAcks:this.#I,invalidFrames:this.#T,buckets:t,priorSignalCounts:{...this.#r},priorSignalSums:{...this.#u},priorSignalLatest:dr(this.#s),signalTotals:{...this.#o},signalSums:{...this.#p},signalLatest:dr(this.#f),signalMaximums:{...this.#h},recentLogs:this.#i.newestFirst(),recentEvents:this.#c.newestFirst(),lastLogAt:this.#P,lastEventAt:this.#Z,poolSnapshot:this.#y}}}const Re=40;function Tu(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>nr(t.filter,o.level)&&(!n||o.message.toLowerCase().includes(n)||Ga(o.level).name.includes(n))),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-Re));return{logs:r.slice(s,s+Re),retained:e.length,matched:r.length,offset:s}}function Pu(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>{const c=Ze(o.event);return(t.category==="all"||c.category===t.category)&&(!n||c.name.includes(n)||c.label.toLowerCase().includes(n)||String(o.value).includes(n))}),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-Re));return{events:r.slice(s,s+Re),retained:e.length,matched:r.length,offset:s}}function Zu(e,t){const{buckets:n,recentLogs:r,recentEvents:i,...s}=e,o=new Map(t?.buckets.map(c=>[c.time,c]));return{summary:s,reset:t===null,firstBucketTime:n[0]?.time??e.now,buckets:n.filter(c=>o.get(c.time)!==c),recentLogs:r===t?.recentLogs?null:r,recentEvents:i===t?.recentEvents?null:i}}class Au{constructor(t,n=i=>new fu({url:eu(i)}),r=Date.now){this.send=t,this.createSocket=n,this.#e=new Iu(r,!1)}send;createSocket;#e;#n=null;#t=null;#i=[];#c=null;#a=null;#r=0;#u=null;#s=null;#o=null;#p=[];handle(t){if(t.type==="stop"){this.#d(),this.#e.stop(),this.send({type:"stopped"});return}if(t.type==="configure"){if(t.generation=this.#r&&this.#f(t.generation);return}if(t.generation===this.#r)switch(t.type){case"pause-display":{t.stream==="logs"?this.#s=t.paused?this.#s??this.#e.getRecentLogs():null:this.#o=t.paused?this.#o??this.#e.getRecentEvents():null;break}case"poll-events":{this.send({type:"events",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:Pu(this.#o??this.#e.getRecentEvents(),t.query)});break}case"poll-logs":{this.send({type:"logs",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:Tu(this.#s??this.#e.getRecentLogs(),t.query)});break}case"native-top":{this.#e.recordNativeTop(t.height,t.receivedAt);break}case"native-fees":{this.#e.recordNativeFees(t.fees,t.receivedAt);break}case"clear-logs":{this.#e.clearLogs(),this.#s!==null&&(this.#s=[]);break}case"clear-events":{this.#e.clearEvents(),this.#o!==null&&(this.#o=[]);break}case"poll":{if(!this.#n)return;this.#e.flush();const n=this.#e.getSnapshot();this.send({type:"snapshot",generation:this.#r,requestId:t.requestId,status:this.#n.getStatus(),update:Zu(n,this.#u)}),this.#u=n;break}}}#f(t){this.#r=t,this.#u=null,this.#s!==null&&(this.#s=[]),this.#o!==null&&(this.#o=[]),this.#e.reset()}#h(t,n,r){this.#d(),this.#c=t,this.#a=n;const i=this.createSocket(t),s=n===t?i:this.createSocket(n);this.#i=i===s?[i]:[i,s];const o=new Xa(i,{logFilter:r}),c=new lu(s),a=()=>{this.send({type:"native",status:c.getStatus(),live:c.getState()})};this.#n=o,this.#t=c,this.#p=[o.subscribeFrames(u=>{this.#e.ingest(u)}),o.subscribeInvalidFrames(()=>{this.#e.recordInvalidFrame()}),c.subscribeStatus(a),c.subscribeState(a)],o.start(),c.start();for(const u of this.#i)u.start()}#d(){for(const t of this.#p)t();this.#p=[];for(const t of this.#i)t.stop();this.#n?.stop(),this.#t?.stop(),this.#i=[],this.#n=null,this.#t=null}}const dt=globalThis,Nu=new Au(e=>{dt.postMessage(e)});dt.addEventListener("message",e=>{Nu.handle(e.data),e.data.type==="stop"&&dt.close()})})();\n',I_=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",dx],{type:"text/javascript;charset=utf-8"});function gj(n){let i;try{if(i=I_&&(self.URL||self.webkitURL).createObjectURL(I_),!i)throw"";const a=new Worker(i,{name:n?.name});return a.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(i)}),a}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(dx),{name:n?.name})}}const P_=100,hx=15e3,vj=3*hx,_u={configuration:null,configurationReceivedAt:null,top:null,topReceivedAt:null,topHeader:null,headerReceivedAt:null,fees:null,invalidFrames:0};function yj(n,i){const a=new Map((i.reset?[]:n.buckets).filter(l=>l.time>=i.firstBucketTime).map(l=>[l.time,l]));for(const l of i.buckets)a.set(l.time,l);return{...i.summary,buckets:[...a.values()],recentLogs:Kf(i.reset?[]:n.recentLogs,i.recentLogs),recentEvents:Kf(i.reset?[]:n.recentEvents,i.recentEvents)}}function Kf(n,i){if(i===null)return n;const a=new Map(n.map(l=>[l.id,l]));return i.map(l=>a.get(l.id)??l)}const Hr={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class bj{constructor(i=()=>new gj){this.createWorker=i}createWorker;#e=null;#t=new Jb().getSnapshot();#n=Hr;#i=new Set;#s=new Set;#r=Hr;#l=_u;#f=new Set;#u=null;#o=null;#b=eo;#a=0;#g=0;#c=null;#h=null;#_=null;#m=new Set;#S={logs:[],retained:0,matched:0,offset:0};#E={search:"",filter:eo,offset:0};#x=0;#v=null;#w=null;#p=new Set;#A={events:[],retained:0,matched:0,offset:0};#M={search:"",category:"all",offset:0};#T=0;#d=null;#O=!1;#k=!1;getSnapshot=()=>this.#t;getStatus=()=>this.#n;getNativeStatus=()=>this.#r;getNativeLive=()=>this.#l;subscribeNative=i=>(this.#f.add(i),()=>{this.#f.delete(i)});getLogWindow=()=>this.#S;getEventWindow=()=>this.#A;subscribeEvents=i=>(this.#p.add(i),this.#j(),this.#U(),()=>{this.#p.delete(i),this.#p.size===0&&this.#N()});subscribeLogs=i=>(this.#m.add(i),this.#z(),this.#R(),()=>{this.#m.delete(i),this.#m.size===0&&this.#D()});subscribe=i=>(this.#i.add(i),()=>{this.#i.delete(i)});subscribeStatus=i=>(this.#s.add(i),()=>{this.#s.delete(i)});configure(i,a,l){i===this.#u&&a===this.#o&&l===this.#b||(this.#u!==null&&i!==this.#u&&(this.reset(),this.#L({...Hr,phase:"connecting"})),this.#o!==null&&a!==this.#o&&this.#$({...Hr,phase:"connecting"},_u),this.#u=i,this.#o=a,this.#b=l,this.#C())}start(){if(!(this.#e||this.#u===null||this.#o===null))try{const i=this.createWorker();this.#e=i,this.#S={logs:[],retained:0,matched:0,offset:0},this.#A={events:[],retained:0,matched:0,offset:0};for(const a of this.#m)a();for(const a of this.#p)a();this.#L({...Hr,phase:"connecting"}),this.#$({...Hr,phase:"connecting"},_u),i.onmessage=a=>{if(this.#e!==i)return;const l=a.data;if(l.type==="events"){if(l.requestId!==this.#d||(this.#d=null,l.generation!==this.#a))return;if(l.queryVersion!==this.#T){thi)DELIM" -R"DELIM(s.#j();return}this.#A={...l.window,events:Kf(this.#A.events,l.window.events)};for(const u of this.#p)u();return}if(l.type==="logs"){if(l.requestId!==this.#v||(this.#v=null,l.generation!==this.#a))return;if(l.queryVersion!==this.#x){this.#z();return}this.#S={...l.window,logs:Kf(this.#S.logs,l.window.logs)};for(const u of this.#m)u();return}if(l.type==="native"){this.#$(l.status,l.live);return}if(l.type==="snapshot"&&l.requestId===this.#c&&(this.#c=null,l.generation===this.#a)){this.#t=yj(this.#t,l.update),this.#L(l.status);for(const u of this.#i)u()}},i.onerror=()=>{this.#H("Telemetry worker failed. Reload the dashboard to reconnect.")},i.onmessageerror=()=>{this.#H("Unable to read telemetry worker data. Reload the dashboard to reconnect.")},this.#C(),this.#O&&this.#y({type:"pause-display",generation:this.#a,stream:"logs",paused:!0}),this.#k&&this.#y({type:"pause-display",generation:this.#a,stream:"events",paused:!0}),this.#Z(),this.getStatus().error===null&&(this.#h=setInterval(()=>{this.#Z()},1e3)),this.#R(),this.#U()}catch(i){this.#H(`Unable to start telemetry worker: ${i instanceof Error?i.message:String(i)}`)}}stop(){this.#B();const i=this.#e;if(this.#e=null,i){const a=setTimeout(()=>{i.terminate()},500),l=()=>{clearTimeout(a),i.terminate()};i.onmessage=u=>{u.data.type==="stopped"&&l()},i.onerror=l,i.onmessageerror=l;try{i.postMessage({type:"stop"})}catch{l()}}this.#L(Hr),this.#$(Hr,_u)}recordNativeTop(i,a=Date.now()){this.#y({type:"native-top",generation:this.#a,height:i,receivedAt:a})}recordNativeFees(i,a=Date.now()){this.#y({type:"native-fees",generation:this.#a,fees:i,receivedAt:a})}clearLogs(){this.#y({type:"clear-logs",generation:this.#a}),this.#x+=1,this.#z()}clearEvents(){this.#y({type:"clear-events",generation:this.#a}),this.#T+=1,this.#j()}setLogsPaused(i){i!==this.#O&&(this.#O=i,this.#D(),this.#y({type:"pause-display",generation:this.#a,stream:"logs",paused:i}),this.#x+=1,this.#z(),this.#R())}setEventsPaused(i){i!==this.#k&&(this.#k=i,this.#N(),this.#y({type:"pause-display",generation:this.#a,stream:"events",paused:i}),this.#T+=1,this.#j(),this.#U())}reset(){this.#a+=1,this.#c=null,this.#v=null,this.#d=null,this.#S={logs:[],retained:0,matched:0,offset:0},this.#A={events:[],retained:0,matched:0,offset:0},this.#t=new Jb().getSnapshot(),this.#y({type:"reset",generation:this.#a});for(const i of this.#i)i();for(const i of this.#m)i();for(const i of this.#p)i()}setLogQuery(i){JSON.stringify(i)!==JSON.stringify(this.#E)&&(this.#E=i,this.#x+=1,this.#z())}setEventQuery(i){JSON.stringify(i)!==JSON.stringify(this.#M)&&(this.#M=i,this.#T+=1,this.#j())}#U(){!this.#e||this.#p.size===0||this.#w||this.#k||(this.#w=setInterval(()=>{this.#j()},P_),this.#j())}#j(){this.#d!==null||!this.#e||this.#p.size===0||(this.#d=++this.#g,this.#y({type:"poll-events",generation:this.#a,requestId:this.#d,queryVersion:this.#T,query:this.#M}))}#N(){this.#w&&clearInterval(this.#w),this.#w=null,this.#d=null}#R(){!this.#e||this.#m.size===0||this.#_||this.#O||(this.#_=setInterval(()=>{this.#z()},P_),this.#z())}#z(){this.#v!==null||!this.#e||this.#m.size===0||(this.#v=++this.#g,this.#y({type:"poll-logs",generation:this.#a,requestId:this.#v,queryVersion:this.#x,query:this.#E}))}#D(){this.#_&&clearInterval(this.#_),this.#_=null,this.#v=null}#C(){this.#u!==null&&this.#o!==null&&this.#y({type:"configure",generation:this.#a,endpoint:this.#u,nativeEndpoint:this.#o,logFilter:this.#b})}#Z(){this.#c!==null||!this.#e||(this.#c=++this.#g,this.#y({type:"poll",generation:this.#a,requestId:this.#c}))}#y(i){try{this.#e?.postMessage(i)}catch{this.#H("Unable to communicate with telemetry worker. Reload the dashboard to reconnect.")}}#B(){this.#D(),this.#N(),this.#h&&clearInterval(this.#h),this.#h=null,this.#c=null}#H(i){this.#B(),this.#e?.terminate(),this.#e=null,this.#L({...Hr,error:i}),this.#$({...Hr,error:i},_u)}#$(i,a){this.#r=i,this.#l=a;for(const l of this.#f)l()}#L(i){if(JSON.stringify(i)!==JSON.stringify(this.#n)){this.#n=i;for(const a of this.#s)a()}}}const mx="libbitcoinAdminDashboardLogFilter";function px(){try{return globalThis.localStorage}catch{return null}}function _j(n=px()){try{const i=n?.getItem(mx);if(!i)return eo;const a=JSON.parse(i);return typeof a=="number"&&Number.isInteger(a)&&a>=0&&a<=Yp?a:eo}catch{return eo}}function Sj(n,i=px()){try{i?.setItem(mx,String(n))}catch{}}const gx=se.createContext(void 0),xj=n=>{const i=se.useContext(gx);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},wj=({client:n,children:i})=>(se.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),x.jsx(gx.Provider,{value:n,children:i})),zj={setTimeout:(n,i)=>setTimeout(n,i),clearTimeout:n=>clearTimeout(n),setInterval:(n,i)=>setInterval(n,i),clearInterval:n=>clearInterval(n)};var Tj=class{#e=zj;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,i){return this.#e.setTimeout(n,i)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,i){return this.#e.setInterval(n,i)}clearInterval(n){this.#e.clearInterval(n)}};const Fa=new Tj;function Ej(n){setTimeout(n,0)}const Oj=typeof window>"u"||"Deno"in globalThis;function gi(){}function Nj(n,i){return typeof n=="function"?n(i):n}function vx(n){return typeof n=="number"&&n>=0&&n!==1/0}function yx(n,i){return Math.max(n+(i||0)-Date.now(),0)}function kt(n,i){return typeof n=="function"?n(i):n}function K_(n,i){const{type:a="all",exact:l,fetchStatus:u,predicate:f,queryKey:d,stale:m}=n;if(d){if(l){if(i.queryHash!==mg(d,i.options))return!1}else if(!co(i.queryKey,d))return!1}if(a!=="all"){const p=i.isActive();if(a==="active"&&!p||a==="inactive"&&p)return!1}return!(typeof m=="boolean"&&i.isStale()!==m||u&&u!==i.state.fetchStatus||f&&!f(i))}function G_(n,i){const{exact:a,status:l,predicate:u,mutationKey:f}=n;if(f){if(!i.options.mutationKey)return!1;if(a){if($u(i.options.mutationKey)!==$u(f))return!1}else if(!co(i.options.mutationKey,f))return!1}return!(l&&i.state.status!==l||u&&!u(i))}function mg(n,i){return(i?.queryKeyHashFn||$u)(n)}function $u(n){return JSON.stringify(n,(i,a)=>wp(a)?Object.keys(a).sort().reduce((l,u)=>(l[u]=a[u],l),{}):a)}function co(n,i){if(n===i)return!0;if(typeof n!=typeof i)return!1;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(Array.isArray(n)&&Array.isArray(i)){if(i.length>n.length)return!1;for(let l=0;l500)return i;const l=Y_(n)&&Y_(i);if(!l&&!(wp(n)&&wp(i)))return i;const u=(l?n:Object.keys(n)).length,f=l?i:Object.keys(i),d=f.length,m=l?new Array(d):{};let p=0;for(let g=0;g{Fa.setTimeout(i,n)})}function zp(n,i,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,i):a.structuralSharing!==!1?_x(n,i):i}function Mj(n,i,a=0){const l=[...n,i];return a&&l.length>a?l.slice(-a):l}function jj(n,i,a=0){const l=[i,...n];return a&&l.length>a?l.slice(0,a):l}const pg=Symbol();function Sx(n,i){return!n.queryFn&&i?.initialPromise?()=>i.initialPromise:!n.queryFn||n.queryFn===pg?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function xx(n,i){return typeof n=="func)DELIM" -R"DELIM(tion"?n(...i):!!n}const gg=Symbol();function kj(n,i,a,l){let u=!1,f;return Object.defineProperties(n,{[gg]:{value:l},signal:{enumerable:!0,get:()=>(f??=i(),u||(u=!0,f.aborted?a():f.addEventListener("abort",a,{once:!0})),f)}}),n}let Rj=()=>Oj;const vg=()=>Rj();var Bu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Cj=class extends Bu{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(i=>{i(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const yg=new Cj,Dj=Ej;function Uj(){let n=[],i=0,a=m=>{m()},l=m=>{m()},u=Dj;const f=m=>{i?n.push(m):u(()=>{a(m)})},d=()=>{const m=n;n=[],m.length&&u(()=>{l(()=>{m.forEach(p=>{a(p)})})})};return{batch:m=>{let p;i++;try{p=m()}finally{i--,i||d()}return p},batchCalls:m=>(...p)=>{f(()=>{m(...p)})},schedule:f,setNotifyFunction:m=>{a=m},setBatchNotifyFunction:m=>{l=m},setScheduler:m=>{u=m}}}const Un=Uj();var Zj=class extends Bu{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(i=>{i(n)}))}isOnline(){return this.#e}};const Gf=new Zj;function $j(n){return Math.min(1e3*2**n,3e4)}function wx(n){return(n??"online")==="online"?Gf.isOnline():!0}var Tp=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function zx(n){let i=!1,a=0,l,u="pending",f,d;const m=new Promise((D,W)=>{f=D,d=W});m.catch(gi);const p=()=>u!=="pending",g=D=>{if(!p()){const W=new Tp(D);A(W),n.onCancel?.(W)}},b=()=>{i=!0},y=()=>{i=!1},w=()=>yg.isFocused()&&(n.networkMode==="always"||Gf.isOnline())&&n.canRun(),O=()=>wx(n.networkMode)&&n.canRun(),T=D=>{p()||(l?.(),u="resolved",f(D))},A=D=>{p()||(l?.(),u="rejected",d(D))},k=D=>new Promise(W=>{l=K=>{(p()||D())&&W(K)},n.onPause?.()}).then(()=>{l=void 0,p()||n.onContinue?.()}),L=()=>{if(p())return;let D;const W=a===0?n.initialPromise:void 0;try{D=W??n.fn()}catch(K){D=Promise.reject(K)}Promise.resolve(D).then(T).catch(K=>{if(p())return;const Y=n.retry??(vg()?0:3),G=n.retryDelay??$j,ne=typeof G=="function"?G(a,K):G,ae=Y===!0||typeof Y=="number"&&ap()||w()?void 0:k(w)).then(()=>{i?A(K):L()})})};return{promise:m,status:()=>u,cancel:g,continue:()=>(l?.(),m),cancelRetry:b,continueRetry:y,canStart:O,start:()=>(O()?L():k(O).then(L),m)}}var Tx=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vx(this.gcTime)&&(this.#e=Fa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(vg()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Fa.clearTimeout(this.#e),this.#e=void 0)}};function Lj(n){return{onFetch:(i,a)=>{const l=i.options,u=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],d=i.state.data?.pageParams||[];let m={pages:[],pageParams:[]},p=0;const g=async()=>{let b=!1;const y=i,w=A=>{kj(A,()=>i.signal,()=>b=!0,y[gg])},O=Sx(i.options,i.fetchOptions),T=async(A,k,L)=>{if(b)return Promise.reject(i.signal.reason);if(k==null&&A.pages.length)return Promise.resolve(A);const W=(()=>{const ne={client:i.client,queryKey:i.queryKey,pageParam:k,direction:L?"backward":"forward",meta:i.options.meta};return w(ne),ne})(),K=await O(W),{maxPages:Y}=i.options,G=L?jj:Mj;return{pages:G(A.pages,K,Y),pageParams:G(A.pageParams,k,Y)}};if(u&&f.length){const A=u==="backward",k=A?Hj:Q_,L={pages:f,pageParams:d};m=await T(L,k(l,L),A)}else{const A=n??f.length;do{const k=p===0?d[0]===void 0?l.initialPageParam:d[0]:Q_(l,m);if(p>0&&k==null)break;m=await T(m,k),p++}while(pi.options.persister?.(g,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},a):i.fetchFn=g}}}function Q_(n,{pages:i,pageParams:a}){const l=i.length-1;return i.length>0?n.getNextPageParam(i[l],i,a[l],a):void 0}function Hj(n,{pages:i,pageParams:a}){return i.length>0?n.getPreviousPageParam?.(i[0],i,a[0],a):void 0}var Bj=class extends Tx{#e;#t;#n;#i;#s;#r;#l;#f;#u;constructor(n){super(),this.#u=!1,this.#f=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#s=n.client,this.#i=this.#s.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=X_(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(n){if(this.options={...this.#f,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=X_(this.options);i.data!==void 0&&(this.setState(J_(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(n,i){const a=zp(this.state.data,n,this.options);return this.#o({data:a,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),a}setState(n){this.#o({type:"setState",state:n})}cancel(n){const i=this.#r?.promise;return this.#r?.cancel(n),i?i.then(gi).catch(gi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>kt(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(n=>kt(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!yx(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const i=this.observers.indexOf(n);i!==-1&&(this.observers.splice(i,1),this.observers.length||(this.#r&&(this.#u||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(n,i){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});)DELIM" -R"DELIM(else if(this.#r&&this.#l)return this.#r.continueRetry(),this.#l}if(n&&this.setOptions(n),!this.options.queryFn){const g=this.observers.find(b=>b.options.queryFn);g&&this.setOptions(g.options)}const a=new AbortController,l=g=>{Object.defineProperties(g,{[gg]:{value:a.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#u=!0,a.signal)}})},u=()=>{const g=Sx(this.options,i),y=(()=>{const w={client:this.#s,queryKey:this.queryKey,meta:this.meta};return l(w),w})();return this.#u=!1,this.options.persister?this.options.persister(g,y,this):g(y)},d=(()=>{const g={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:u};return l(g),g})();(this.#e==="infinite"?Lj(this.options.pages):this.options.behavior)?.onFetch(d,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#o({type:"fetch",meta:d.fetchOptions?.meta});const m=this.#r=zx({initialPromise:i?.initialPromise,fn:d.fetchFn,onCancel:g=>{g instanceof Tp&&g.revert&&this.setState({...this.#n,fetchStatus:"idle"}),a.abort()},onFail:(g,b)=>{this.#o({type:"failed",failureCount:g,error:b})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}),p=(async()=>{try{const g=await m.promise;if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#i.config.onSuccess?.(g,this),this.#i.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof Tp){if(g.silent){if(this.#r!==m&&this.#l)return this.#l;throw g}else if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#o({type:"error",error:g}),this.#i.config.onError?.(g,this),this.#i.config.onSettled?.(this.state.data,g,this),g}finally{this.#r===m&&(this.#r=void 0,this.#l=void 0),this.scheduleGc()}})();return this.#l=p,m.start(),p}#o(n){const i=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Ex(a.data,this.options),fetchMeta:n.meta??null};case"success":const l={...a,...J_(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?l:void 0,l;case"error":const u=n.error;return{...a,error:u,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=i(this.state),Un.batch(()=>{this.observers.slice().forEach(a=>{a.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:n})})}};function Ex(n,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wx(i.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function J_(n,i){return{data:n,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function X_(n){const i=typeof n.initialData=="function"?n.initialData():n.initialData,a=i!==void 0,l=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:a?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var qj=class extends Bu{#e;#t=void 0;#n=void 0;#i=void 0;#s;#r;#l;#f;#u;#o;#b;#a;#g;#c=new Set;constructor(n,i){super(),this.options=i,this.#e=n,this.#l=null,this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),W_(this.#t,this.options)?this.#h():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ep(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ep(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#w(),this.#t.removeObserver(this)}setOptions(n){const i=this.options,a=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#p(),this.#t.setOptions(this.options),i._defaulted&&!Qm(this.options,i)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&e1(this.#t,a,this.options,i)&&this.#h(),this.updateResult(),l&&(this.#t!==a||kt(this.options.enabled,this.#t)!==kt(i.enabled,this.#t)||kt(this.options.staleTime,this.#t)!==kt(i.staleTime,this.#t))&&this.#m();const u=this.#S();l&&(this.#t!==a||kt(this.options.enabled,this.#t)!==kt(i.enabled,this.#t)||u!==this.#g)&&this.#E(u)}getOptimisticResult(n){const i=this.#e.getQueryCache().build(this.#e,n),a=this.createResult(i,n);return Qm(this.getCurrentResult(),a)||(this.#i=a,this.#r=this.options,this.#s=this.#t.state),a}getCurrentResult(){return this.#i}trackResult(n,i){return new Proxy(n,{get:(a,l)=>(this.trackProp(l),i?.(l),Reflect.get(a,l))})}trackProp(n){this.#c.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const i=this.#e.defaultQueryOptions(n),a=this.#e.getQueryCache().build(this.#e,i);let l=()=>{},u;const f=new Promise(d=>{u=d,l=this.#e.getQueryCache().subscribe(m=>{m.type==="updated"&&m.query.queryHash===a.queryHash&&a.state.data!==void 0&&(l(),d(this.createResult(a,i)))})});return Promise.race([a.fetch(i).then(()=>{const d=this.createResult(a,i);return u?.(d),d}).finally(()=>{l()}),f])}fetch(n){return this.#h({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(n){this.#p();let i=this.#t.fetch(this.options,n);return n?.throwOnError||(i=i.catch(gi)),i}#_(n){return!vg()&&kt(this.options.enabled,this.#t)!==!1&&vx(n)}#m(){this.#v();const n=kt(this.options.staleTime,this.#t);if(this.#i.isStale||!this.#_(n))return;const i=yx(this.#i.dataUpdatedAt,n)+1;this.#b=Fa.setTimeout(()=>{this.#i.isStale||this.updateResult()},i)}#S(){return kt(this.options.refetchInterval,this.#t)??!1}#E(n){this.#w(),this.#g=n,!(this.#g===0||!this.#_(this.#g))&&(this.#a=Fa.setInterval(()=>{(this.options.refetchIntervalInBackground||yg.isFocused())&&this.#h()},this.#g))}#x(){this.#m(),this.#E(this.#S())}#v(){this.#b!==void 0&&(Fa.clearTimeout(this.#b),this.#b=void 0)}#w(){this.#a!==void 0&&(Fa.clearInterval(this.#a),this.#a=void 0)}createResult(n,i){const a=this.#t,l=this.options,u=this.#i,f=this.#s,d=this.#r,m=n!==a?n.state:this.#n,{state:p}=n;let g={...p},b=!1,y;if(i._optimisticResults){const Y=this.hasListeners(),G=!Y&&W_(n,i),ne=Y&&e1(n,a,i,l);(G||ne)&&(g={...g,...Ex(p.data,n.options)}),i._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:w,errorUpdatedAt:O,status:T}=g;y=g.data;let A=!1;if(i.placeholderData!==void 0&&y===void 0&&T==="pending"){let Y;u?.isPlaceholderData&&i.placeholderData===d?.placeholderData?(Y=u.data,A=!0):Y=typeof i.placeholderData=="function"?i.placeholderData(this.#o?.state.data,this.#o):i.placeholderData,Y!==void 0&&(T="success",y=zp(u?.data,Y,i),b=!0)}if(i.select&&y!==void 0&&!A)if(u&&y===f?.data&&i.select===this.#f)y=this.#u;else try{this.#f=i.select,y=i.select(y),y=zp(u?.data,y,i),this.#u=y,this.#l=null}catch(Y){this.#l=Y}else y===void 0&&(this.#l=null);this.#l&&(w=this.#l,y=this.#u,O=u?.error===w?u.errorUpdatedAt:Date.now(),T="error",b=!1);const k=g.fetchStatus==="fetching",L=T==="pending",D=T==="error",W=L&&k,K=y!==void 0;return{status:T,fetchStatus:g.fetchStatus,isPending:L,isSuccess)DELIM" -R"DELIM(:T==="success",isError:D,isInitialLoading:W,isLoading:W,data:y,dataUpdatedAt:g.dataUpdatedAt,error:w,errorUpdatedAt:O,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:g.dataUpdateCount>m.dataUpdateCount||g.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!L,isLoadingError:D&&!K,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:D&&K,isStale:bg(n,i),refetch:this.refetch,isEnabled:kt(i.enabled,n)!==!1}}updateResult(){const n=this.#i,i=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#r=this.options,this.#s.data!==void 0&&(this.#o=this.#t),Qm(i,n))return;this.#i=i;const l=(()=>{if(!n)return!0;const{notifyOnChangeProps:u}=this.options,f=typeof u=="function"?u():u;if(f==="all"||!f&&!this.#c.size||this.options.throwOnError&&this.#i.error!==n.error)return!0;for(const d of f??this.#c)if(this.#i[d]!==n[d])return!0;return!1})();Un.batch(()=>{l&&this.listeners.forEach(u=>{u(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#p(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const i=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(i?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}};function Vj(n,i){return kt(i.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&kt(i.retryOnMount,n)===!1)}function W_(n,i){return Vj(n,i)||n.state.data!==void 0&&Ep(n,i,i.refetchOnMount)}function Ep(n,i,a){if(kt(i.enabled,n)!==!1&&kt(i.staleTime,n)!=="static"){const l=kt(a,n);return l==="always"||l!==!1&&bg(n,i)}return!1}function e1(n,i,a,l){return(n!==i||kt(l.enabled,n)===!1)&&(!a.suspense||n.state.status!=="error")&&bg(n,a)}function bg(n,i){return kt(i.enabled,n)!==!1&&n.isStaleByTime(kt(i.staleTime,n))}var Ij=class extends Tx{#e;#t;#n;#i;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||Pj(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(i=>i!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){const i=()=>{this.#s({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},l=this.#i=zx({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(d,m)=>{this.#s({type:"failed",failureCount:d,error:m})},onPause:()=>{this.#s({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),u=this.state.status==="pending",f=!l.canStart();try{if(u)i();else{this.#s({type:"pending",variables:n,isPaused:f}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,a);const m=await this.options.onMutate?.(n,a);m!==this.state.context&&this.#s({type:"pending",context:m,variables:n,isPaused:f})}this.state.isPaused&&l.canStart()&&i();const d=await l.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,a),await this.options.onSuccess?.(d,n,this.state.context,a),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(d,null,n,this.state.context,a),this.#s({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,a)}catch(m){Promise.reject(m)}try{await this.options.onError?.(d,n,this.state.context,a)}catch(m){Promise.reject(m)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,a)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,a)}catch(m){Promise.reject(m)}throw this.#s({type:"error",error:d}),d}finally{this.#i===l&&(this.#i=void 0),this.#n.runNext(this)}}#s(n){const i=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Un.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function Pj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Kj=class extends Bu{#e;#t;#n;constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}build(n,i,a){const l=new Ij({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(i),state:a});return this.add(l),l}add(n){this.#e.add(n);const i=zf(n);if(typeof i=="string"){const a=this.#t.get(i);a?a.push(n):this.#t.set(i,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const i=zf(n);if(typeof i=="string"){const a=this.#t.get(i);if(a)if(a.length>1){const l=a.indexOf(n);l!==-1&&a.splice(l,1)}else a[0]===n&&this.#t.delete(i)}}this.notify({type:"removed",mutation:n})}canRun(n){const i=zf(n);if(typeof i=="string"){const a=this.#t.get(i)?.find(l=>l.state.status==="pending");return!a||a===n}else return!0}runNext(n){const i=zf(n);return typeof i=="string"?this.#t.get(i)?.find(a=>a!==n&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Un.batch(()=>{const n=this.getAll();this.#e.clear(),this.#t.clear(),n.forEach(i=>{this.notify({type:"removed",mutation:i})})})}getAll(){return Array.from(this.#e)}find(n){const i={exact:!0,...n};return this.getAll().find(a=>G_(i,a))}findAll(n={}){return this.getAll().filter(i=>G_(n,i))}notify(n){Un.batch(()=>{this.listeners.forEach(i=>{i(n)})})}resumePausedMutations(){const n=this.getAll().filter(i=>i.state.isPaused);return Un.batch(()=>Promise.all(n.map(i=>i.continue().catch(gi))))}};function zf(n){return n.options.scope?.id}var Gj=class extends Bu{#e;constructor(n={}){super(),this.config=n,this.#e=new Map}build(n,i,a){const l=i.queryKey,u=i.queryHash??mg(l,i);let f=this.get(u);return f||(f=new Bj({client:n,queryKey:l,queryHash:u,options:n.defaultQueryOptions(i),state:a,defaultOptions:n.getQueryDefaults(l)}),this.add(f)),f}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){this.#e.get(n.queryHash)===n&&(n.destroy(),this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Un.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const i={exact:!0,...n};return this.getAll().find(a=>K_(i,a))}findAll(n={}){const i=this.getAll();return Object.keys(n).length>0?i.filter(a=>K_(n,a)):i}notify(n){Un.batch(()=>{this.listeners.forEach(i=>{i(n)})})}onFocus(){Un.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Un.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Yj=class{#e;#t;#n;#i;#s;#r;#l;#f;constructor(n={}){this.#e=n.queryCache||new Gj,this.#t=n.mutationCache||new Kj,this.#n=n.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}m)DELIM" -R"DELIM(ount(){this.#r++,this.#r===1&&(this.#l=yg.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#f=Gf.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#f?.(),this.#f=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state.data}ensureQueryData(n){const i=this.defaultQueryOptions(n),a=this.#e.build(this,i),l=a.state.data;return l===void 0?this.fetchQuery(n):(n.revalidateIfStale&&a.isStaleByTime(kt(i.staleTime,a))&&this.prefetchQuery(i),Promise.resolve(l))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:i,state:a})=>[i,a.data])}setQueryData(n,i,a){const l=this.defaultQueryOptions({queryKey:n}),u=this.#e.get(l.queryHash)?.state.data,f=Nj(i,u);if(f!==void 0)return this.#e.build(this,l).setData(f,{...a,manual:!0})}setQueriesData(n,i,a){return Un.batch(()=>this.#e.findAll(n).map(({queryKey:l})=>[l,this.setQueryData(l,i,a)]))}getQueryState(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state}removeQueries(n){const i=this.#e;Un.batch(()=>{i.findAll(n).forEach(a=>{i.remove(a)})})}resetQueries(n,i){const a=this.#e;return Un.batch(()=>{const l=a.findAll(n),u=new Set(l);return l.forEach(f=>{f.reset()}),this.refetchQueries({type:"active",predicate:f=>u.has(f)},i)})}cancelQueries(n,i={}){const a={revert:!0,...i},l=Un.batch(()=>this.#e.findAll(n).map(u=>u.cancel(a)));return Promise.all(l).then(gi).catch(gi)}invalidateQueries(n,i={}){return Un.batch(()=>(this.#e.findAll(n).forEach(a=>{a.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},i)))}refetchQueries(n,i={}){const a={...i,cancelRefetch:i.cancelRefetch??!0},l=Un.batch(()=>this.#e.findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,a);const d=u.state.fetchStatus==="paused";return(!a.throwOnError||d)&&(f=f.catch(gi)),d?Promise.resolve():f}));return Promise.all(l).then(gi)}async query(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const a=this.#e.build(this,i),l=a.isStaleByTime(kt(i.staleTime,a))?await a.fetch(i):a.state.data,u=i.select;return u?u(l):l}fetchQuery(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const a=this.#e.build(this,i);return a.isStaleByTime(kt(i.staleTime,a))?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(gi).catch(gi)}infiniteQuery(n){return n._type="infinite",this.query(n)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(gi).catch(gi)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Gf.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,i){this.#i.set($u(n),{queryKey:n,defaultOptions:i})}getQueryDefaults(n){const i=[...this.#i.values()],a={};return i.forEach(l=>{co(n,l.queryKey)&&Object.assign(a,l.defaultOptions)}),a}setMutationDefaults(n,i){this.#s.set($u(n),{mutationKey:n,defaultOptions:i})}getMutationDefaults(n){const i=[...this.#s.values()],a={};return i.forEach(l=>{co(n,l.mutationKey)&&Object.assign(a,l.defaultOptions)}),a}defaultQueryOptions(n){if(n._defaulted)return n;const i={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return i.queryHash||(i.queryHash=mg(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===pg&&(i.enabled=!1),i}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const Ox=se.createContext(!1),Fj=()=>se.useContext(Ox);Ox.Provider;function Qj(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const Jj=se.createContext(Qj()),Xj=()=>se.useContext(Jj),Wj=(n,i,a)=>{const l=a?.state.status==="error"&&typeof n.throwOnError=="function"?xx(n.throwOnError,[a.state.error,a]):n.throwOnError;(n.suspense||l)&&(i.isReset()||(n.retryOnMount=!1))},ek=n=>{se.useEffect(()=>{n.clearReset()},[n])},tk=({result:n,errorResetBoundary:i,throwOnError:a,query:l,suspense:u})=>n.isError&&!i.isReset()&&!n.isFetching&&l&&(u&&n.data===void 0||xx(a,[n.error,l])),nk=n=>{if(n.suspense){const a=u=>u==="static"?u:Math.max(u??1e3,1e3),l=n.staleTime;n.staleTime=typeof l=="function"?(...u)=>a(l(...u)):a(l),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},ik=(n,i)=>n?.suspense&&i.isPending,rk=(n,i,a)=>i.fetchOptimistic(n).catch(()=>{a.clearReset()});function sk(n,i,a){const l=Fj(),u=Xj(),f=xj(),d=f.defaultQueryOptions(n),m=f.getQueryCache().get(d.queryHash),p=n.subscribed!==!1;d._optimisticResults=l?"isRestoring":p?"optimistic":void 0,nk(d),Wj(d,u,m),ek(u);const[g]=se.useState(()=>new i(f,d)),b=g.getOptimisticResult(d);se.useEffect(()=>{g.setOptions(d)},[d,g]);const y=!l&&p;if(se.useSyncExternalStore(se.useCallback(w=>{const O=y?g.subscribe(Un.batchCalls(w)):gi;return g.updateResult(),O},[g,y]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),ik(d,b))throw rk(d,g,u);if(tk({result:b,errorResetBoundary:u,throwOnError:d.throwOnError,query:m,suspense:d.suspense}))throw b.error;return d.notifyOnChangeProps?b:g.trackResult(b)}function t1(n,i){return sk(n,qj)}function ak(n,i,a,l=eo){const u=se.useSyncExternalStore(a.subscribeStatus,a.getStatus,a.getStatus);return se.useEffect(()=>{a.configure(n,i,l)},[n,i,a,l]),se.useEffect(()=>(a.start(),()=>{a.stop()}),[a]),u}function lk(n,i,a){const l=se.useMemo(()=>GA(n),[n]),u=se.useSyncExternalStore(i.subscribeNative,i.getNativeStatus,i.getNativeStatus),f=se.useSyncExternalStore(i.subscribeNative,i.getNativeLive,i.getNativeLive),d=Nx(u,f,a),m=t1({queryKey:["native-snapshot",n],queryFn:({signal:w})=>t3(n,w),enabled:l&&!d,refetchInterval:hx,retry:!1}),p=ok(u,f,m.data??null,a),g=n1(u,f,null,a),b=t1({queryKey:["native-fees",n],queryFn:({signal:w})=>i3(n,w),enabled:l&&g===null,refetchInterval:WA,retry:!1}),y=n1(u,f,b.data??null,a);return se.useEffect(()=>{y!==null&&i.recordNativeFees(y.data,y.receivedAt)},[y,i]),se.useEffect(()=>{p.top!==null&&i.recordNativeTop(p.top,p.receivedAt??Date.now())},[i,p.receivedAt,p.top]),{status:u,live:f,...p,restError:m.error instanceof Error?m.error.message:null}}function Nx(n,i,a){return n.phase==="connected"&&i.top!==null&&i.topReceivedAt!==null&&i.configuration!==null&&i.configurationReceivedAt!==null&&Op(i.topReceivedAt,a)}function ok(n,i,a,l){return Nx(n,i,l)?{top:i.top,topHeader:i.headerReceivedAt!==null&&Op(i.headerReceivedAt,l)?i.topHeader:null,configuration:i.configuration,receivedAt:i.topReceivedAt,transport:"websocket"}:a&&Op(a.receivedAt,l)?{top:a.top,topHeader:a.topHeader,configuration:a.configuration,receivedAt:a.receivedAt,transport:"rest"}:{top:null,topHeader:null,configuration:null,receivedAt:null,transport:"none"}}function n1(n,i,a,l){return n.phase==="connected"&&i.fees!==null&&l-i.fees.receivedAtnew bj,[]),i=xS(),[a]=se.useState(YA),[l,u]=se.useState("overview"),[f,d]=se.useState(!1),[m,p]=se.useState(_j),[g,b]=se.useState(!1),[y,w]=se.useState(!1),[O,T]=se.useState(qz),A=se.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),k=ak(a.adminUrl,a.nativeUrl,n,m),L=lk(a.nativeUrl,n,i),D=w3(L.top,L.to)DELIM" -R"DELIM(pHeader,i);function W(Y){Vz(Y),T(Y)}function K(Y){Sj(Y),p(Y)}return x.jsxs("div",{className:"bg-background text-textPrimary min-h-screen",children:[x.jsx("header",{className:"border-accent/30 bg-surface/90 border-b backdrop-blur",children:x.jsx("div",{className:"mx-auto max-w-7xl px-4 py-4",children:x.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[x.jsxs("div",{className:"order-1 flex flex-col",children:[x.jsx("button",{type:"button",onClick:()=>{u("overview")},className:"text-accent text-left text-lg font-semibold tracking-tight",children:"Libbitcoin Server"}),x.jsx("span",{className:"text-textMuted text-sm",children:L.configuration?.node.network??" "})]}),x.jsx("nav",{className:"text-textMuted order-3 flex w-full items-center gap-3 text-sm md:order-2 md:w-auto",children:uk.map(Y=>x.jsxs("button",{type:"button",onClick:()=>{u(Y.id)},className:`text-textMuted hover:text-accent rounded-md px-3 py-1 text-sm transition ${l===Y.id?"bg-accentSecondary/20 text-accent":""}`,children:[Y.label,Y.id==="logs"&&A.totalLogs>0&&x.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:A.totalLogs>999?"999+":String(A.totalLogs)}),Y.id==="events"&&A.totalEvents>0&&x.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:A.totalEvents>999?"999+":String(A.totalEvents)})]},Y.id))}),x.jsx("div",{className:"order-2 ml-auto flex items-center gap-3 md:order-3",children:x.jsx("button",{type:"button",onClick:()=>{d(!0)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Settings"})})]})})}),x.jsxs("main",{className:"mx-auto min-h-[calc(100vh-4rem)] max-w-7xl min-w-0 space-y-6 px-4 py-8",children:[x.jsxs("header",{children:[x.jsx("p",{className:"text-accentSecondary text-sm tracking-wide uppercase",children:"Administration"}),x.jsx("h1",{className:"text-accent text-3xl font-semibold",children:"Admin Dashboard"})]}),l==="overview"&&x.jsx(oj,{adminStatus:k,endpoints:a,metrics:A,native:L,syncEstimate:D}),l==="logs"&&x.jsx(VA,{metrics:n,delivery:A,status:k,logFilter:m,paused:g,onLogFilterChange:K,onPausedChange:Y=>{n.setLogsPaused(Y),b(Y)},onClear:()=>{n.clearLogs()}}),l==="events"&&x.jsx(BA,{metrics:n,paused:y,onPausedChange:Y=>{n.setEventsPaused(Y),w(Y)},onClear:()=>{n.clearEvents()}})]}),x.jsx(hj,{estimate:D,browserNotificationsEnabled:O}),f&&x.jsx(Pz,{browserNotificationsEnabled:O,onClose:()=>{d(!1)},onBrowserNotificationsEnabledChange:W})]})}function fk({children:n}){const[i]=se.useState(()=>new Yj({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return x.jsx(wj,{client:i,children:n})}Dz();const Ax=document.querySelector("#root");if(!Ax)throw new Error("Root element not found");Rz.createRoot(Ax).render(x.jsx(Tz.StrictMode,{children:x.jsx(fk,{children:x.jsx(ck,{})})})); +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of n.seen.entries()){const m=d[1];if(i===d[0]){f(d);continue}if(n.external){const g=n.external.registry.get(d[0])?.id;if(i!==d[0]&&g){f(d);continue}}if(n.metadataRegistry.get(d[0])?.id){f(d);continue}if(m.cycle){f(d);continue}m.count>1&&n.reused==="ref"&&f(d)}n.external&&(n.sharedDefsExtractedFor=n.external)}function q1(n){const i=n.anyOf;if(!Array.isArray(i)||i.length===0||n.type!==void 0)return;const a=[];for(const l of i){if(!l||typeof l!="object")return;q1(l);const u=Object.keys(l);if(u.length!==1||u[0]!=="type")return;const f=l.type;for(const d of Array.isArray(f)?f:[f]){if(typeof d!="string")return;a.includes(d)||a.push(d)}}delete n.anyOf,n.type=a.length===1?a[0]:a}const V1=new Set(["type","properties","required","additionalProperties"]),Db=["oneOf","anyOf"];function Ub(n){const i=n.additionalProperties;return i===void 0||i===!1||typeof i!="object"||i===null?null:Object.keys(i).length?i:null}function rp(n){const i=[];for(const f of n){if(typeof f!="object"||f.type!=="object")return null;for(const d in f)if(!V1.has(d))return null;i.push(f)}const a={},l=new Set;for(const f of i){for(const d in f.properties){if(Object.prototype.hasOwnProperty.call(a,d))continue;const m=[];for(const g of i){const b=g.properties?.[d]??Ub(g);b!=null&&(m.some(y=>JSON.stringify(y)===JSON.stringify(b))||m.push(b))}const p=m.length===1?m[0]:rp(m)??{allOf:m};ta(a,d,p)}for(const d of f.required??[])l.add(d)}const u={type:"object",properties:a};if(l.size&&(u.required=[...l]),i.every(f=>f.additionalProperties===!1))u.additionalProperties=!1;else{const f=[];for(const d of i){const m=Ub(d);m&&!f.some(p=>JSON.stringify(p)===JSON.stringify(m))&&f.push(m)}f.length===1?u.additionalProperties=f[0]:f.length>1&&(u.additionalProperties={allOf:f})}return u}function B2(n){const i=n.allOf;if(!Array.isArray(i)||i.length<2)return;for(const u of V1)if(u in n)return;const a=i.filter(u=>Db.some(f=>Array.isArray(u[f])));let l=null;if(!a.length)l=rp(i);else{const u=a[0],f=Db.find(p=>Array.isArray(u[p]));if(Object.keys(u).length!==1)return;const d=i.filter(p=>p!==u),m=u[f].map(p=>rp([...d,p]));if(m.some(p=>!p))return;l={[f]:m}}l&&(delete n.allOf,Nu(n,l))}function I1(n,i){const a=n.seen.get(i);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=m=>{const p=n.seen.get(m);if(p.ref===null)return;const g=p.def??p.schema,b={...g},y=p.ref;if(p.ref=null,y){l(y);const O=n.seen.get(y),T=O.schema;if(T.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(T)):Nu(g,T),Nu(g,b),m._zod.parent===y)for(const k in g)k==="$ref"||k==="allOf"||k in b||delete g[k];if(T.$ref&&)DELIM" +R"DELIM(O.def)for(const k in g)k==="$ref"||k==="allOf"||k in O.def&&JSON.stringify(g[k])===JSON.stringify(O.def[k])&&delete g[k]}const w=m._zod.parent;if(w&&w!==y){l(w);const O=n.seen.get(w);if(O?.schema.$ref&&(g.$ref=O.schema.$ref,O.def))for(const T in g)T==="$ref"||T==="allOf"||T in O.def&&JSON.stringify(g[T])===JSON.stringify(O.def[T])&&delete g[T]}n.override({zodSchema:m,jsonSchema:g,path:p.path??[]})};if(!n.external||n.sharedEmitDoneFor!==n.external){for(const m of[...n.seen.entries()].reverse())l(m[0]);if(n.target!=="openapi-3.0")for(const m of n.seen.entries())q1(m[1].def??m[1].schema);for(const m of n.deferred)m();if(n.intersections.length){const m=new Map;for(const p of n.seen.values())for(const g of[p.schema,p.def]){const b=g?.allOf;if(!Array.isArray(b))continue;const y=m.get(b);y?y.push(g):m.set(b,[g])}for(const p of n.intersections)for(const g of m.get(p)??[])B2(g)}}const u={};if(n.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const m=n.external.registry.get(i)?.id;if(!m)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(m)}Nu(u,a.defId?a.schema:a.def??a.schema);const f=n.metadataRegistry.get(i)?.id;f!==void 0&&u.id===f&&delete u.id;const d=n.external?.defs??{};if(!n.external||n.sharedEmitDoneFor!==n.external)for(const m of n.seen.entries()){const p=m[1];p.def&&p.defId&&(p.def.id===p.defId&&delete p.def.id,ta(d,p.defId,p.def))}n.external&&(n.sharedEmitDoneFor=n.external),n.external||Object.keys(d).length>0&&(n.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{const m=JSON.parse(JSON.stringify(u));return Object.defineProperty(m,"~standard",{value:{...i["~standard"],jsonSchema:{input:Lf(i,"input",n.processors),output:Lf(i,"output",n.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function ii(n,i){const a=i??{seen:new Set};if(a.seen.has(n))return!1;a.seen.add(n);const l=n._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return ii(l.element,a);if(l.type==="set")return ii(l.valueType,a);if(l.type==="lazy")return ii(l.getter(),a);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault"||l.type==="catch")return ii(l.innerType,a);if(l.type==="intersection")return ii(l.left,a)||ii(l.right,a);if(l.type==="record"||l.type==="map")return ii(l.keyType,a)||ii(l.valueType,a);if(l.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:ii(l.in,a)||ii(l.out,a);if(l.type==="object"){for(const u in l.shape)if(ii(l.shape[u],a))return!0;return!1}if(l.type==="union"){for(const u of l.options)if(ii(u,a))return!0;return!1}if(l.type==="tuple"){for(const u of l.items)if(ii(u,a))return!0;return!!(l.rest&&ii(l.rest,a))}return!1}const q2=(n,i={})=>a=>{const l=H1({...a,processors:i});return Kt(n,l),B1(l,n),I1(l,n)},Lf=(n,i,a={})=>l=>{const{libraryOptions:u,target:f}=l??{},d=H1({...u??{},target:f,io:i,processors:a});return Kt(n,d),B1(d,n),I1(d,n)},so=(n,i,a)=>{(n[i]===void 0||a>n[i])&&(n[i]=a)},ao=(n,i,a)=>{(n[i]===void 0||a{so(n,"minimum",i),ao(n,"maximum",i)},P1=(n,i)=>{n.multipleOf??(n.multipleOf=[]),n.multipleOf.includes(i)||n.multipleOf.push(i)},K1=(n,i)=>{n.patterns??(n.patterns=new Set),n.patterns.add(i)},G1=(n,i)=>{n.mime=n.mime?n.mime.filter(a=>i.includes(a)):[...i]},Y1=(n,i)=>{n.format=i,i.includes("int")&&(n.isInt=!0)},$b=(n,i)=>so(n,"minimum",i.minimum),Lb=(n,i)=>ao(n,"maximum",i.maximum),Hb=n=>(i,a)=>{Y1(i,a.format);const[l,u]=n[a.format];so(i,"minimum",l),ao(i,"maximum",u)},V2={greater_than:(n,i)=>so(n,i.inclusive?"minimum":"exclusiveMinimum",i.value),less_than:(n,i)=>ao(n,i.inclusive?"maximum":"exclusiveMaximum",i.value),multiple_of:(n,i)=>P1(n,i.value),number_format:Hb(p1),bigint_format:Hb(sT),min_length:$b,max_length:Lb,length_equals:(n,i)=>Zb(n,i.length),min_size:$b,max_size:Lb,size_equals:(n,i)=>Zb(n,i.size),string_format:(n,i)=>{Y1(n,i.format),i.pattern&&K1(n,i.pattern),(i.format==="base64"||i.format==="base64url")&&(n.contentEncoding=i.format),(i.local||i.precision===-1)&&(n.laxFormat=!0)},mime_type:(n,i)=>G1(n,i.mime)};function Wi(n){const i={},a=n._zod.def,l=n._zod.traits.has("$ZodCheck")?[n,...a.checks??[]]:a.checks??[];for(const f of l)V2[f._zod.def.check]?.(i,f._zod.def);const u=n._zod.bag;u.minimum!==void 0&&so(i,"minimum",u.minimum),u.exclusiveMinimum!==void 0&&so(i,"exclusiveMinimum",u.exclusiveMinimum),u.maximum!==void 0&&ao(i,"maximum",u.maximum),u.exclusiveMaximum!==void 0&&ao(i,"exclusiveMaximum",u.exclusiveMaximum),u.multipleOf!==void 0&&P1(i,u.multipleOf),u.format!==void 0&&(i.format??(i.format=u.format),u.format.includes("int")&&(i.isInt=!0)),u.mime&&G1(i,u.mime);for(const f of u.patterns??[])K1(i,f);return i}const I2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},P2=new Map([[M1,aE],[Kp,lE]]),F1=n=>P2.get(n)??n,K2=(n,i,a,l)=>{const u=a;u.type="string";const{minimum:f,maximum:d,format:m,patterns:p,contentEncoding:g,laxFormat:b}=Wi(n);if(typeof f=="number"&&(u.minLength=f),typeof d=="number"&&(u.maxLength=d),m&&(u.format=I2[m]??m,u.format===""&&delete u.format,(m==="time"||b)&&delete u.format),g&&(u.contentEncoding=g),p&&p.size>0){const y=[...p].map(F1);y.length===1?u.pattern=y[0].source:y.length>1&&(u.allOf=[...y.map(w=>({...i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},G2=(n,i,a,l)=>{const u=a,{minimum:f,maximum:d,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:g,isInt:b}=Wi(n);u.type=b?"integer":"number";const y=typeof g=="number"&&g>=(f??Number.NEGATIVE_INFINITY),w=typeof p=="number"&&p<=(d??Number.POSITIVE_INFINITY),O=i.target==="draft-04"||i.target==="openapi-3.0";if(y?O?(u.minimum=g,u.exclusiveMinimum=!0):u.exclusiveMinimum=g:typeof f=="number"&&(u.minimum=f),w?O?(u.maximum=p,u.exclusiveMaximum=!0):u.exclusiveMaximum=p:typeof d=="number"&&(u.maximum=d),m){const T=new Set;for(const L of m)Number.isFinite(L)&&L!==0?T.add(Math.abs(L)):Ws(n,i,u,l,`A multipleOf divisor of ${L} cannot be represented in JSON Schema`);const[A,...k]=T;A!==void 0&&(u.multipleOf=A),k.length&&(u.allOf=[...u.allOf??[],...k.map(L=>({multipleOf:L}))])}},Y2=(n,i,a,l)=>{a.type="boolean"},F2=(n,i,a,l)=>{a.not={}},Q2=(n,i,a,l)=>{},J2=(n,i,a,l)=>{const u=n._zod.def,f=Xm(u.entries);if(f.length===0){a.not={};return}f.every(d=>typeof d=="number")&&(a.type="number"),f.every(d=>typeof d=="string")&&(a.type="string"),a.enum=f},X2=(n,i,a,l)=>{const u=n._zod.def;if(u.values.length===0){a.not={};return}const f=[];for(const d of u.values)if(d===void 0){if(Ws(n,i,a,l,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof d=="bigint"){if(Ws(n,i,a,l,"BigInt literals cannot be represented in JSON Schema"))return;f.push(Number(d))}else f.push(d);if(f.length!==0)if(f.length===1){const d=f[0];a.type=d===null?"null":typeof d,i.target==="draft-04"||i.target==="openapi-3.0"?a.enum=[d]:a.const=d}else f.every(d=>typeof d=="number")&&(a.type="number"),f.every(d=>typeof d=="string")&&(a.type="string"),f.every(d=>typeof d=="boolean")&&(a.type="boolean"),f.every(d=>d===null)&&(a.type="null"),a.enum=f},W2=(n,i,a,l)=>{Ws(n,i,a,l,"Custom types cannot be represented in JSON Schema")},eN=(n,i,a,l)=>{Ws(n,i,a,l,"Transforms cannot be represented in JSON Schema")},tN=(n,i,a,l)=>{const u=a,f=n._zod.def,{minimum:d,maximum:m}=Wi(n);typeof d=="number"&&(u.minItems=d),typeof m=="number"&&(u.maxItems=m),u.type="array",u.items=Kt(f.element,i,{...l,path:[...l.path,"items"]})};function Cu(n){const i=n._zod.def;return i.type==="pipe"&&i.in._zod.traits.has("$ZodTransform")?Cu(i.out):i.type==="catch"?Cu(i.innerType):n._zod.optin}const nN=(n,i,a,l)=>{const u=a,f=n._zod.def,d=f.shape;if(Object.getOwnPropertySymbols(d).length&&Ws(n,i,u,l,"Symbol keys cannot be represented)DELIM" +R"DELIM( in JSON Schema"))return;u.type="object",u.properties={};for(const g in d)ta(u.properties,g,Kt(d[g],i,{...l,path:[...l.path,"properties",g]}));const p=[];for(const g of Object.keys(d)){const b=f.shape[g];(i.io==="input"?Cu(b)===void 0:b._zod.optout===void 0)&&p.push(g)}p.length>0&&(u.required=p),f.catchall?._zod.def.type==="never"?u.additionalProperties=!1:f.catchall?f.catchall&&(u.additionalProperties=Kt(f.catchall,i,{...l,path:[...l.path,"additionalProperties"]})):i.io==="output"&&(u.additionalProperties=!1)},iN=(n,i,a,l)=>{const u=n._zod.def,f=u.inclusive===!1,d=u.options.map((m,p)=>Kt(m,i,{...l,path:[...l.path,f?"oneOf":"anyOf",p]}));f?a.oneOf=d:a.anyOf=d},rN=(n,i,a,l)=>{const u=n._zod.def,f=Kt(u.left,i,{...l,path:[...l.path,"allOf",0]}),d=Kt(u.right,i,{...l,path:[...l.path,"allOf",1]}),m=g=>"allOf"in g&&Object.keys(g).length===1,p=[...m(f)?f.allOf:[f],...m(d)?d.allOf:[d]];a.allOf=p,i.intersections.push(p)},sN=(n,i,a,l)=>{const u=a,f=n._zod.def;u.type="array";const d=i.target==="draft-2020-12"?"prefixItems":"items",m=i.target==="draft-2020-12"||i.target==="openapi-3.0"?"items":"additionalItems",p=f.items.map((A,k)=>Kt(A,i,{...l,path:[...l.path,d,k]})),g=f.rest?Kt(f.rest,i,{...l,path:[...l.path,m,...i.target==="openapi-3.0"?[f.items.length]:[]]}):null;let b=f.items.length;for(;b>0;){const A=f.items[b-1];if(!(i.io==="input"?Cu(A)!==void 0:A._zod.optout==="optional"))break;b--}const y=f.items.length,w=!f.rest;i.target==="draft-2020-12"?(u.prefixItems=p,w?u.items=!1:g&&(u.items=g),b>0&&(u.minItems=b),w&&(u.maxItems=y)):i.target==="openapi-3.0"?(u.items={anyOf:p},g&&u.items.anyOf.push(g),b>0&&(u.minItems=b),w&&(u.maxItems=y)):(u.items=p,w?u.additionalItems=!1:g&&(u.additionalItems=g),b>0&&(u.minItems=b),w&&(u.maxItems=y));const{minimum:O,maximum:T}=Wi(n);typeof O=="number"&&(u.minItems=O),typeof T=="number"&&(u.maxItems=T)};function sp(n,i,a){if(i.$ref){if(a.has(i))return i;a.add(i);const T=n.get(i)?.def;if(!T)return i;const A=sp(n,T,a);return A===T?i:A}for(const T of["anyOf","oneOf"]){const A=i[T];if(!Array.isArray(A))continue;const k=A.map(L=>sp(n,L,a));k.some((L,D)=>L!==A[D])&&(i={...i,[T]:k})}const l=Array.isArray(i.type)?i.type:[i.type],u=!l.includes("string")&&l.some(T=>T==="number"||T==="integer"),f=i.enum??(i.const!==void 0?[i.const]:void 0);if(!u&&!f?.some(T=>typeof T=="number"))return i;const{minimum:d,maximum:m,exclusiveMinimum:p,exclusiveMaximum:g,multipleOf:b,format:y,id:w,...O}=i;return O.enum?O.enum=O.enum.map(T=>typeof T=="number"?String(T):T):typeof O.const=="number"&&(O.const=String(O.const)),u&&(O.type="string",f||(O.pattern=(l.includes("number")?Vp:pE).source)),O}const ap=new WeakMap;function aN(n){const i=new Map;for(const l of n.seen.values())l.def&&!i.has(l.schema)&&i.set(l.schema,l);const a=new Map;for(const l of ap.get(n)??[]){const u=n.seen.get(l),f=(u?.def??u?.schema)?.propertyNames;if(!f||f===!0||a.has(f))continue;const d=sp(i,f,new Set);d!==f&&a.set(f,d)}if(a.size)for(const l of n.seen.values())for(const u of[l.schema,l.def]){const f=u&&a.get(u.propertyNames);f&&(u.propertyNames=f)}}const lN=(n,i,a,l)=>{const u=a,f=n._zod.def;u.type="object";const d=f.keyType,m=Wi(d).patterns;if(f.mode==="loose"&&m&&m.size>0){const b=Kt(f.valueType,i,{...l,path:[...l.path,"patternProperties","*"]});u.patternProperties={};for(const y of m)ta(u.patternProperties,F1(y).source,b)}else{if(i.target==="draft-07"||i.target==="draft-2020-12"){u.propertyNames=Kt(f.keyType,i,{...l,path:[...l.path,"propertyNames"]});let b=ap.get(i);b||(b=[],ap.set(i,b),i.deferred.push(()=>aN(i))),b.push(n)}u.additionalProperties=Kt(f.valueType,i,{...l,path:[...l.path,"additionalProperties"]})}const p=d._zod.values,g=i.io==="input"&&Cu(f.valueType)!==void 0;if(p&&!f.partial&&!g){const b=[...p].filter(y=>typeof y=="string"||typeof y=="number");b.length>0&&(u.required=b.map(String))}},oN=(n,i,a,l)=>{const u=n._zod.def,f=Kt(u.innerType,i,l),d=i.seen.get(n);i.target==="openapi-3.0"?(d.ref=u.innerType,a.nullable=!0):a.anyOf=[f,{type:"null"}]},uN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType},Gp=Symbol();function Q1(n,i,a,l,u){let f=!1;const d=JSON.stringify(n,(m,p)=>typeof p!="bigint"?p:(f=!0,null));return f?(Ws(i,a,l,u,"BigInt defaults cannot be represented in JSON Schema"),Gp):JSON.parse(d)}const cN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType;const d=Q1(u.defaultValue,n,i,a,l);d!==Gp&&(a.default=d)},fN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);if(f.ref=u.innerType,i.io!=="input")return;const d=Q1(u.defaultValue,n,i,a,l);d!==Gp&&(a._prefault=d)},dN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType;let d;try{d=u.catchValue(void 0)}catch{Ws(n,i,a,l,"Dynamic catch values are not supported in JSON Schema");return}a.default=d},hN=(n,i,a,l)=>{const u=n._zod.def,f=u.in._zod.traits.has("$ZodTransform"),d=i.io==="input"?f?u.out:u.in:u.out;Kt(d,i,l);const m=i.seen.get(n);m.ref=d},mN=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType,a.readOnly=!0},J1=(n,i,a,l)=>{const u=n._zod.def;Kt(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType},Bb=new WeakSet([Object.prototype,Error.prototype]);function vf(n,i,a){Object.defineProperty(n,i,{configurable:!0,enumerable:!1,get(){const l=a(this);return Object.defineProperty(this,i,{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,i,{value:l,configurable:!0,writable:!0})}})}const pN=(n,i)=>{OT.init(n,i),n.name="ZodError";const a=Object.getPrototypeOf(n);Bb.has(a)||(Bb.add(a),vf(a,"format",l=>u=>MT(l,u)),vf(a,"flatten",l=>u=>AT(l,u)),vf(a,"addIssue",l=>u=>{l.issues.push(u),l.message=JSON.stringify(l.issues,Wm,2)}),vf(a,"addIssues",l=>u=>{l.issues.push(...u),l.message=JSON.stringify(l.issues,Wm,2)}),Object.defineProperty(a,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},tr=Y("ZodError",pN,void 0,{Parent:Error}),gN=Lp(tr),vN=Hp(tr),yN=Bp(tr),bN=qp(tr),_N=UT(tr),SN=ZT(tr),xN=$T(tr),wN=LT(tr),zN=HT(tr),TN=BT(tr),EN=qT(tr),ON=VT(tr);function NN(){er.localeError||Br(PO())}function Hu(){er.memoizer||Br({memoizer:qO()})}const Dt=Y("ZodType",(n,i)=>(NN(),Ot.init(n,i),n.def=i,n.type=i.type,n),{check(...n){const i=this.def;return this.clone(Di(i,{checks:[...i.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return na(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(OA(n,i))},superRefine(n,i){return this.check(NA(n,i))},overwrite(n){return this.check(ho(n))},optional(){return Pb(this)},exactOptional(){return mA(this)},nullable(){return Kb(this)},nullish(){return Pb(Kb(this))},nonoptional(n){return _A(this,n)},array(){return Wf(this)},or(n){return ed([this,n])},and(n){return lA(this,n)},transform(n){return Gb(this,hA(n))},default(n){return vA(this,n)},prefault(n){return bA(this,n)},catch(n){return xA(this,n)},pipe(n){return Gb(this,n)},readonly(){return TA(this)},describe(n){const i=this.clone();return wu.add(i,{description:n}),i},meta(...n){if(n.length===0)return wu.get(this);const i=this.clone();return wu.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n,...i){return i.length===0?n(this):n(this,...i)},get"~standard"(){return v1(this,"~standard",{...T1(this),jsonSchema:{input:Lf(this,"input"),output:Lf(this,"output")}})},set"~standard"(n){Xs(this,"~standard",n)},parse:function n(i,a){return gN(this,i,a,{callee:n})},parseAsync:async function n(i,a){return await vN(this,i,a,{callee:n})},safeParse(n,i){return yN(this,n,i)},async safeParseAsync(n,i){return bN(this,n,i)},get spa(){return this?.safeParseAsync},set spa(n){Xs(this,"spa",n)},validate(n,i){return RT(this,n,i)},validateAsync(n,i){return DT(this,n,i)},encode:function n(i,a){return _N(this,i,a,{callee:n})DELIM" +R"DELIM()},decode:function n(i,a){return SN(this,i,a,{callee:n})},encodeAsync:async function n(i,a){return await xN(this,i,a,{callee:n})},decodeAsync:async function n(i,a){return await wN(this,i,a,{callee:n})},safeEncode(n,i){return zN(this,n,i)},safeDecode(n,i){return TN(this,n,i)},async safeEncodeAsync(n,i){return EN(this,n,i)},async safeDecodeAsync(n,i){return ON(this,n,i)},toJSONSchema(n){return q2(this,{})(n)},get description(){return wu.get(this)?.description},get _def(){return this._zod.def}}),X1=Y("_ZodString",(n,i)=>{Pp.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>K2(n,a,l)},y1({format:n=>Wi(n).format??null,minLength:n=>Wi(n).minimum??null,maxLength:n=>Wi(n).maximum??null},{regex(...n){return this.check(E2(...n))},includes(...n){return this.check(A2(...n))},startsWith(...n){return this.check(M2(...n))},endsWith(...n){return this.check(j2(...n))},min(...n){return this.check($f(...n))},max(...n){return this.check($1(...n))},length(...n){return this.check(L1(...n))},nonempty(...n){return this.check($f(1,...n))},lowercase(n){return this.check(O2(n))},uppercase(n){return this.check(N2(n))},trim(){return this.check(R2())},normalize(...n){return this.check(k2(...n))},toLowerCase(){return this.check(C2())},toUpperCase(){return this.check(D2())},slugify(){return this.check(U2())}})),AN=Y("ZodString",(n,i)=>{Pp.init(n,i),X1.init(n,i)},{email(n){return this.check(FO(CN,n))},url(n){return this.check(t2(UN,n))},jwt(n){return this.check(g2(JN,n))},emoji(n){return this.check(n2(ZN,n))},guid(n){return this.check(QO(DN,n))},uuid(n){return this.check(JO(yf,n))},uuidv4(n){return this.check(XO(yf,n))},uuidv6(n){return this.check(WO(yf,n))},uuidv7(n){return this.check(e2(yf,n))},nanoid(n){return this.check(i2($N,n))},cuid(n){return this.check(r2(LN,n))},cuid2(n){return this.check(s2(HN,n))},ulid(n){return this.check(a2(BN,n))},base64(n){return this.check(h2(YN,n))},base64url(n){return this.check(m2(FN,n))},xid(n){return this.check(l2(qN,n))},ksuid(n){return this.check(o2(VN,n))},ipv4(n){return this.check(u2(IN,n))},ipv6(n){return this.check(c2(PN,n))},cidrv4(n){return this.check(f2(KN,n))},cidrv6(n){return this.check(d2(GN,n))},e164(n){return this.check(p2(QN,n))},datetime(n){return this.check(v2(MN,n))},date(n){return this.check(y2(jN,n))},time(n){return this.check(b2(kN,n))},duration(n){return this.check(_2(RN,n))}});function ri(n){return YO(AN,n)}const Ht=Y("ZodStringFormat",(n,i)=>{Ct.init(n,i),X1.init(n,i)}),MN=Y("ZodISODateTime",(n,i)=>{QE.init(n,i),Ht.init(n,i)}),jN=Y("ZodISODate",(n,i)=>{JE.init(n,i),Ht.init(n,i)}),kN=Y("ZodISOTime",(n,i)=>{XE.init(n,i),Ht.init(n,i)}),RN=Y("ZodISODuration",(n,i)=>{WE.init(n,i),Ht.init(n,i)}),CN=Y("ZodEmail",(n,i)=>{UE.init(n,i),Ht.init(n,i)}),DN=Y("ZodGUID",(n,i)=>{CE.init(n,i),Ht.init(n,i)}),yf=Y("ZodUUID",(n,i)=>{DE.init(n,i),Ht.init(n,i)}),UN=Y("ZodURL",(n,i)=>{qE.init(n,i),Ht.init(n,i)}),ZN=Y("ZodEmoji",(n,i)=>{VE.init(n,i),Ht.init(n,i)}),$N=Y("ZodNanoID",(n,i)=>{IE.init(n,i),Ht.init(n,i)}),LN=Y("ZodCUID",(n,i)=>{PE.init(n,i),Ht.init(n,i)}),HN=Y("ZodCUID2",(n,i)=>{KE.init(n,i),Ht.init(n,i)}),BN=Y("ZodULID",(n,i)=>{GE.init(n,i),Ht.init(n,i)}),qN=Y("ZodXID",(n,i)=>{YE.init(n,i),Ht.init(n,i)}),VN=Y("ZodKSUID",(n,i)=>{FE.init(n,i),Ht.init(n,i)}),IN=Y("ZodIPv4",(n,i)=>{eO.init(n,i),Ht.init(n,i)}),PN=Y("ZodIPv6",(n,i)=>{nO.init(n,i),Ht.init(n,i)}),KN=Y("ZodCIDRv4",(n,i)=>{iO.init(n,i),Ht.init(n,i)}),GN=Y("ZodCIDRv6",(n,i)=>{sO.init(n,i),Ht.init(n,i)}),YN=Y("ZodBase64",(n,i)=>{aO.init(n,i),Ht.init(n,i)}),FN=Y("ZodBase64URL",(n,i)=>{oO.init(n,i),Ht.init(n,i)}),QN=Y("ZodE164",(n,i)=>{uO.init(n,i),Ht.init(n,i)}),JN=Y("ZodJWT",(n,i)=>{fO.init(n,i),Ht.init(n,i)}),W1=Y("ZodNumber",(n,i)=>{j1.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>G2(n,a,l,u),n.isFinite=!0},y1({minValue:n=>{const{minimum:i,exclusiveMinimum:a}=Wi(n);return Math.max(i??Number.NEGATIVE_INFINITY,a??Number.NEGATIVE_INFINITY)},maxValue:n=>{const{maximum:i,exclusiveMaximum:a}=Wi(n);return Math.min(i??Number.POSITIVE_INFINITY,a??Number.POSITIVE_INFINITY)},isInt:n=>{const{isInt:i,multipleOf:a}=Wi(n);return!!i||!!a?.some(Number.isSafeInteger)},format:n=>Wi(n).format??null},{gt(n,i){return this.check(kb(n,i))},gte(n,i){return this.check(Hm(n,i))},min(n,i){return this.check(Hm(n,i))},lt(n,i){return this.check(jb(n,i))},lte(n,i){return this.check(Lm(n,i))},max(n,i){return this.check(Lm(n,i))},int(n){return this.check(qb(n))},safe(n){return this.check(qb(n))},positive(n){return this.check(kb(0,n))},nonnegative(n){return this.check(Hm(0,n))},negative(n){return this.check(jb(0,n))},nonpositive(n){return this.check(Lm(0,n))},multipleOf(n,i){return this.check(Rb(n,i))},step(n,i){return this.check(Rb(n,i))},finite(){return this}}));function hn(n){return S2(W1,n)}const XN=Y("ZodNumberFormat",(n,i)=>{dO.init(n,i),W1.init(n,i)});function qb(n){return x2(XN,n)}const WN=Y("ZodBoolean",(n,i)=>{hO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>Y2(n,a,l)});function Dn(n){return w2(WN,n)}const eA=Y("ZodUnknown",(n,i)=>{mO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>Q2()});function Vb(){return z2(eA)}const tA=Y("ZodNever",(n,i)=>{pO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>F2(n,a,l)});function nA(n){return T2(tA,n)}const iA=Y("ZodArray",(n,i)=>{Hu(),yO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>tN(n,a,l,u),n.element=i.element},{min(n,i){return this.check($f(n,i))},nonempty(n){return this.check($f(1,n))},max(n,i){return this.check($1(n,i))},length(n,i){return this.check(L1(n,i))},unwrap(){return this.element}});function Wf(n,i){return Z2(iA,n,i)}const rA=Y("ZodObject",(n,i)=>{Hu(),SO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>nN(n,a,l,u),bT(n,"shape",a=>a._zod.def.shape,!1)},{keyof(){return Du(Object.keys(this._zod.def.shape))},catchall(n){return this.clone(Di(this._zod.def,{catchall:n}))},passthrough(){return this.clone(Di(this._zod.def,{catchall:Vb()}))},loose(){return this.clone(Di(this._zod.def,{catchall:Vb()}))},strict(){return this.clone(Di(this._zod.def,{catchall:nA()}))},strip(){return this.clone(Di(this._zod.def,{catchall:void 0}))},extend(n){return oT(this,n)},safeExtend(n){return uT(this,n)},merge(n){return cT(this,n)},pick(n){return aT(this,n)},omit(n){return lT(this,n)},partial(...n){return cb(Yp,this,n[0])},exactPartial(...n){return cb(eS,this,n[0],"exactPartial")},required(...n){return fT(tS,this,n[0])}});function vi(n,i){const a={type:"object",shape:n??{},...Te(i)};return new rA(a)}const sA=Y("ZodUnion",(n,i)=>{xO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>iN(n,a,l,u),n.options=i.options});function ed(n,i){return new sA({type:"union",options:n,...Te(i)})}const aA=Y("ZodIntersection",(n,i)=>{wO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>rN(n,a,l,u)});function lA(n,i){return new aA({type:"intersection",left:n,right:i})}const oA=Y("ZodTuple",(n,i)=>{Hu(),zO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>sN(n,a,l,u)},{rest(n){return this.clone({...this._zod.def,rest:n})},partial(){const n=this._zod.def;if(n.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...n,items:n.items.map(i=>new Yp({type:"optional",innerType:i}))})}});function uA(n,i,a){const l=i instanceof Ot,u=l?a:i,f=l?i:null;return new oA({type:"tuple",items:n,rest:f,...Te(u)})}const Ib=Y("ZodRecord",(n,i)=>{Hu(),TO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>lN(n,a,l,u),n.keyType=i.keyType,n.valueType=i.valueType});function cA(n,i,a){return!i||!i._zod?new Ib({type:"record",keyType:ri(),valueType:n,...Te(i)}):new Ib({type:"record",keyType:n,valueType:i,...Te(a)})}const lp=Y("ZodEnum",(n,i)=>{EO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(l,u,f)=>J2(n,l,u),n.enum=i.entries,n.options=[...n._zod.values];const a=new Set(Object.keys(i.entries));n.extract=(l,u)=>{const f={};for(const d of l)if(a.has(d))f[d]=i.entries[d];else throw new Error(`Key ${d} not found in enum`);return new lp({...i,checks:[],...Te(u),entrie)DELIM" +R"DELIM(s:f})},n.exclude=(l,u)=>{const f={...i.entries};for(const d of l)if(a.has(d))delete f[d];else throw new Error(`Key ${d} not found in enum`);return new lp({...i,checks:[],...Te(u),entries:f})}});function Du(n,i){const a=Array.isArray(n)?Object.fromEntries(n.map(l=>[l,l])):n;return new lp({type:"enum",entries:a,...Te(i)})}const fA=Y("ZodLiteral",(n,i)=>{OO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>X2(n,a,l,u),n.values=new Set(i.values),Object.defineProperty(n,"value",{get(){if(i.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return i.values[0]}})});function Au(n,i){return new fA({type:"literal",values:Array.isArray(n)?n:[n],...Te(i)})}const dA=Y("ZodTransform",(n,i)=>{Hu(),NO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>eN(n,a,l,u),n._zod.parse=(a,l)=>{if(l.direction==="backward")throw new b1(n.constructor.name);a.addIssue=f=>{if(typeof f=="string")a.issues.push(Ru(f,a.value,i));else{const d=f;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),"input"in d||(d.input=a.value),d.inst??(d.inst=n),a.issues.push(Ru(d))}};const u=i.transform(a.value,a);return u instanceof Promise?u.then(f=>(a.value=f,a)):(a.value=u,a)}});function hA(n){return new dA({type:"transform",transform:n})}const Yp=Y("ZodOptional",(n,i)=>{C1.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>J1(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function Pb(n){return new Yp({type:"optional",innerType:n})}const eS=Y("ZodExactOptional",(n,i)=>{AO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>J1(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function mA(n){return new eS({type:"optional",innerType:n})}const pA=Y("ZodNullable",(n,i)=>{MO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>oN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function Kb(n){return new pA({type:"nullable",innerType:n})}const gA=Y("ZodDefault",(n,i)=>{jO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>cN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function vA(n,i){return new gA({type:"default",innerType:n,get defaultValue(){return typeof i=="function"?i():h1(i)}})}const yA=Y("ZodPrefault",(n,i)=>{kO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>fN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function bA(n,i){return new yA({type:"prefault",innerType:n,get defaultValue(){return typeof i=="function"?i():h1(i)}})}const tS=Y("ZodNonOptional",(n,i)=>{RO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>uN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function _A(n,i){return new tS({type:"nonoptional",innerType:n,...Te(i)})}const SA=Y("ZodCatch",(n,i)=>{CO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>dN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function xA(n,i){return new SA({type:"catch",innerType:n,catchValue:typeof i=="function"?i:ST(i)})}const wA=Y("ZodPipe",(n,i)=>{DO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>hN(n,a,l,u),n.in=i.in,n.out=i.out});function Gb(n,i){return new wA({type:"pipe",in:n,out:i})}const zA=Y("ZodReadonly",(n,i)=>{UO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>mN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function TA(n){return new zA({type:"readonly",innerType:n})}const EA=Y("ZodCustom",(n,i)=>{ZO.init(n,i),Dt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>W2(n,a,l,u)});function OA(n,i={}){return $2(EA,n,i)}function NA(n,i){return L2(n,i)}const Bu=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],Hf=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],nS=hn().int().nonnegative().max(864e13),AA=vi({level:hn().int().nonnegative(),time:nS,message:ri()}),MA=vi({event:hn().int().nonnegative(),value:hn().nonnegative(),time:nS}),jA=vi({previous:hn().nonnegative()});ed([AA,MA,jA]);const Fp=2**Bu.length-1,to=Fp,kA=2**0+2**1+2**2+2**6+2**7;function RA(n,i){return Number.isInteger(i)&&i>=0&&i0?`${String(a)}d ${String(l)}h`:l>0?`${String(l)}h ${String(u)}m`:u>0?`${String(u)}m ${String(f)}s`:`${String(f)}s`}function rS(n,i){switch(mo(n).valueKind){case"height":return`height ${zn(i)}`;case"seconds":return`${Fa(i)} s`;case"milliseconds":return`${Fa(i)} ms`;case"microseconds":return`${Fa(i)} µs`;case"count":return zn(i);case"fee-rate":return`${Fa(i/1e3,3)} sat/vB`;default:return String(i)}}function HA(n){return n>=100?`${Fa(n,0)}/s`:n>=10?`${Fa(n,1)}/s`:`${Fa(n,2)}/s`}const Bf=32,BA=[{value:"all",label:"All categories"},{value:"headers",label:"Headers"},{value:"blocks",label:"Blocks"},{value:"transactions",label:"Transactions"},{value:"chain",label:"Confirmed chain"},{value:"mining",label:"Mining"},{value:"timing",label:"Timing"}],qA={headers:"bg-violet-500/15 text-violet-300",blocks:"bg-accent/15 text-accent",transactions:"bg-sky-500/15 text-sky-300",chain:"bg-emerald-500/15 text-emerald-300",mining:"bg-amber-500/15 text-amber-300",timing:"bg-cyan-500/15 text-cyan-300"};function VA({metrics:n,paused:i,onPausedChange:a,onClear:l}){const[u,f]=se.useState(""),[d,m]=se.useState("all"),[p,g]=se.useState({offset:0,search:u,category:d}),b=p.search===u&&p.category===d?p.offset:0,y=se.useRef(null),w=se.useSyncExternalStore(n.subscribeEvents,n.getEventWindow,n.getEventWindow);return se.useEffect(()=>{n.setEventQuery({search:u,category:d,offset:b})},[n,u,d,b]),se.useEffect(()=>{y.current&&(y.current.scrollTop=0)},[u,d]),x.jsxs("section",{className:"space-y-4",children:[x.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node lifecycle"}),x.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Live events"}),x.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"Heights are event payloads; timing values retain their source units."}),x.jsx("p",{className:"text-textMuted mt-1 text-xs",children:"Pause freezes this view; collection and charts continue."})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("button",{type:"button",onClick:()=>{i&&(y.current&&(y.current.scrollTop=0),g({offset:0,search:u,category:d})),a(!i)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:i?"Resume display":"Pause display"}),x.jsx("button",{type:"button",onClick:l,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[x.jsxs("label",{className:"min-w-56 flex-1",children:[x.jsx("span",{className:"sr-only",children:"Search events"}),x.jsx("input",{type:"search",value:u,onChange:O=>{f(O.target.value)},placeholder:"Search event names or values…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),x.jsxs("label",{children:[x.jsx("span",{className:"sr-only",children:"Filter event category"}),x.jsx("select",{value:d,onChange:O=>{m(O.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent rounded-md border px-3 py-2 text-sm focus:ring-0",children:BA.map(O=>x.jsx("option",{value:O.value,children:O.label},O.value))})]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[x.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[x.jsx("span",{children:i?"Display paused · collection continues":b>0?"Viewing older rows · collection continues":"Live stream · newest first"}),x.jsxs("span",{children:[String(w.matched)," matching · ",String(w.retained)," retained"]})]}),x.jsx("div",{ref:y,role:"region","aria-label":"Scrollable event history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:O=>{g({offset:Math.max(0,Math.floor(O.currentTarget.scrollTop/Bf)-8),search:u,category:d})},children:w.matched===0?x.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching events."}):x.jsx("ol",{"aria-label":"Received events",className:"relative min-w-[32rem]",style:{height:w.matched*Bf},children:w.events.map((O,T)=>x.jsx(IA,{event:O,index:w.offset+T,total:w.matched},O.id))})})]}),!i&&x.jsx("div",{className:"flex justify-end text-xs",children:x.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{y.current&&(y.current.scrollTop=0),g({offset:0,search:u,category:d})},children:"Jump to latest"})}),x.jsxs("details",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[x.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-4 py-3 text-sm",children:["Event contract (",String(Hf.length)," identifiers)"]}),x.jsx("div",{className:"border-accentSecondary/20 grid gap-2 border-t p-4 sm:grid-cols-2 lg:grid-cols-3",children:Hf.map(O=>x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-textMuted font-mono",children:String(O.id).padStart(2,"0")}),x.jsx("span",{className:"text-textPrimary ml-2",children:O.name})]},O.id))})]})]})}const IA=se.memo(function({event:i,index:a,total:l}){const u=mo(i.event);return x.jsxs("li",{"aria-setsize":l,"aria-posinset":a+1,className:"border-accentSecondary/20 absolute inset-x-0 grid grid-cols-[8.5rem_10rem_minmax(0,1fr)] items-center gap-2 border-b px-4 text-xs",style:{top:a*Bf,height:Bf},children:[x.jsx("time",{dateTime:Qp(i.time),className:"text-textMuted font-mono tabular-nums",children:Uu(i.time)}),x.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${qA[u.category]}`,children:u.name}),x.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:rS(i.event,i.value)})]})}),qf=32,Yb={0:"bg-sky-500/15 text-sky-300",1:"bg-emerald-500/15 text-emerald-300",2:"bg-violet-500/15 text-violet-300",3:"bg-cyan-500/15 text-cyan-300",4:"bg-indigo-500/15 text-indigo-300",5:"bg-blue-500/15 text-blue-300",6:"bg-red-500/20 text-red-300",7:"bg-orange-500/20 text-orange-300",8:"bg-slate-500/20 text-slate-300",9:"bg-zinc-500/20 text-zinc-300"};function PA({metrics:n,delivery:i,status:a,logFilter:l,paused:u,onLogFilterChange:f,onPausedChange:d,onClear:m}){const[p,g]=se.useState(""),[b,y]=se.useState({offset:0,search:p,filter:l}),w=b.search===p&&b.filter===l?b.offset:0,[O,T]=se.useState(null),A=se.useRef(null),k=se.useSyncExternalStore(n.subscribeLogs,n.getLogWindow,n.getLogWindow);return se.useEffect(()=>{n.setLogQuery({search:p,filter:l,offset:w})},[n,p,l,w]),se.useEffect(()=>{A.current&&(A.current.scrollTop=0)},[p,l]),x.jsxs("section",{className:"space-y-4",children:[x.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Diagnostic stream"}),x.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Node logs"}),x.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"The newest 1,000 messages are retained in this browser session."})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("button",{type:"button",onClick:()=>{u&&(A.current&&(A.current.scrollTop=0),y({offset:0,search:p,filter:l})),d(!u)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:u?"Resume display":"Pause display"}),x.jsx("button",{type:"button",onClick:m,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary r)DELIM" +R"DELIM(ounded-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),x.jsxs("fieldset",{className:"border-accent/30 bg-surface/80 space-y-3 rounded-2xl border p-4",children:[x.jsx("legend",{className:"text-textPrimary px-1 text-sm font-medium",children:"Requested log levels"}),x.jsx("p",{className:"text-textMuted text-xs",children:"Only checked levels are sent by the server. Pause freezes this view; collection and charts continue. Skipped log levels are not replayed."}),x.jsx("div",{className:"flex flex-wrap gap-x-5 gap-y-3",children:Bu.map(L=>x.jsxs("label",{className:"text-textPrimary flex items-center gap-2 text-sm",children:[x.jsx("input",{type:"checkbox",checked:RA(l,L.id),onChange:()=>{f(l^1<{f(kA)},className:"text-accent hover:underline",children:"Operational levels"}),x.jsx("button",{type:"button",onClick:()=>{f(Fp)},className:"text-accent hover:underline",children:"All levels"}),x.jsx("button",{type:"button",onClick:()=>{f(0)},className:"text-accent hover:underline",children:"No levels"}),x.jsx("span",{className:"text-textMuted",children:"Selection is saved in this browser."})]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 space-y-2 rounded-2xl border p-4 text-xs",children:[x.jsx("dl",{"aria-label":"Log delivery statistics",className:"flex flex-wrap gap-x-6 gap-y-2",children:[["Received logs",i.totalLogs],["Rolled out of history",i.evictedLogs],["Cleared from history",i.clearedLogs],["Invalid admin frames",i.invalidFrames],["Reconnects",a.reconnects]].map(([L,D])=>x.jsxs("div",{children:[x.jsx("dt",{className:"text-textMuted",children:L}),x.jsx("dd",{className:"text-textPrimary mt-1 font-mono tabular-nums",children:D.toLocaleString()})]},L))}),x.jsx("p",{className:"text-textMuted",children:"Live rows refresh every 100 ms and can skip intermediate messages on screen. Every valid log at a requested level is counted; older messages leave the 1,000-message history as new ones arrive. These counters continue while display is paused. Reconnects can leave gaps that the server does not replay."}),x.jsxs("p",{className:"text-textMuted",role:"status",children:["Admin connection: ",a.phase,a.error?` · ${a.error}`:""]})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[x.jsxs("label",{className:"min-w-56 flex-1",children:[x.jsx("span",{className:"sr-only",children:"Search logs"}),x.jsx("input",{type:"search",value:p,onChange:L=>{g(L.target.value)},placeholder:"Search received messages…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),x.jsx("p",{className:"text-textMuted self-center text-xs",children:"Search filters received messages only."})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[x.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[x.jsx("span",{children:u?"Display paused · collection continues":l===0?"Log delivery disabled":w>0?"Viewing older rows · collection continues":"Live stream · newest first"}),x.jsxs("span",{children:[String(k.matched)," matching · ",String(k.retained)," retained"]})]}),x.jsx("div",{ref:A,role:"region","aria-label":"Scrollable log history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:L=>{y({offset:Math.max(0,Math.floor(L.currentTarget.scrollTop/qf)-8),search:p,filter:l})},children:k.matched===0?x.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching log messages."}):x.jsx("ol",{"aria-label":"Received logs",className:"relative",style:{height:k.matched*qf},children:k.logs.map((L,D)=>x.jsx(KA,{log:L,index:k.offset+D,total:k.matched,onSelect:T},L.id))})})]}),x.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[x.jsx("p",{className:"text-textMuted",children:"Select a row to read its full message."}),!u&&x.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{A.current&&(A.current.scrollTop=0),y({offset:0,search:p,filter:l})},children:"Jump to latest"})]}),O&&x.jsx(GA,{log:O,onClose:()=>{T(null)}})]})}const KA=se.memo(function({log:i,index:a,total:l,onSelect:u}){return x.jsx("li",{"aria-setsize":l,"aria-posinset":a+1,className:"border-accentSecondary/20 absolute inset-x-0 border-b",style:{top:a*qf,height:qf},children:x.jsxs("button",{type:"button",onClick:()=>{u(i)},className:"hover:bg-accentSecondary/10 focus-visible:bg-accentSecondary/20 grid h-full w-full grid-cols-[5.5rem_4.5rem_minmax(0,1fr)] items-center gap-2 px-4 text-left text-xs sm:grid-cols-[7.5rem_7.5rem_minmax(0,1fr)]",children:[x.jsx("time",{dateTime:Qp(i.time),className:"text-textMuted font-mono tabular-nums",children:Uu(i.time,!1)}),x.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${Yb[i.level]??Yb[8]}`,children:iS(i.level).name}),x.jsx("span",{className:"text-textPrimary min-w-0 truncate font-mono",children:i.message.replaceAll(` +`," ↵ ")})]})})});function GA({log:n,onClose:i}){const a=se.useRef(null);return se.useEffect(()=>{const l=a.current;return l?.showModal(),()=>{l?.close()}},[]),x.jsxs("dialog",{ref:a,onClose:i,"aria-labelledby":"log-detail-title",className:"border-accent/30 bg-surface/95 text-textPrimary fixed inset-0 m-auto max-h-[80vh] w-[min(60rem,90vw)] rounded-2xl border p-5 shadow-xl backdrop:bg-black/60",children:[x.jsxs("header",{className:"mb-4 flex items-center justify-between gap-4",children:[x.jsxs("h3",{id:"log-detail-title",className:"text-accent text-lg font-semibold",children:[iS(n.level).label," · ",Qp(n.time)??"Invalid time"]}),x.jsx("button",{type:"button",onClick:i,className:"text-accent rounded px-3 py-2",children:"Close"})]}),x.jsx("pre",{className:"text-sm break-words whitespace-pre-wrap",children:n.message})]})}const YA="Unknown",FA={bitcoin:{p2kh:{0:"mainnet (1)",111:"test networks (m, n)"},p2sh:{5:"mainnet (3)",196:"test networks (2)"},wif:{128:"mainnet (5, K, L)",239:"test networks (9, c)"},witness:{bc:"mainnet",tb:"testnet and signet",bcrt:"regtest"},silent:{sp:"mainnet",tsp:"testnet and signet",sprt:"regtest"},hdPrivate:{76066276:"mainnet (xprv)",77428856:"mainnet BIP49 (yprv)",78791436:"mainnet BIP84 (zprv)",70615956:"test networks (tprv)",71978536:"test networks BIP49 (uprv)",73341116:"test networks BIP84 (vprv)"},hdPublic:{76067358:"mainnet (xpub)",77429938:"mainnet BIP49 (ypub)",78792518:"mainnet BIP84 (zpub)",70617039:"test networks (tpub)",71979618:"test networks BIP49 (upub)",73342198:"test networks BIP84 (vpub)"}},litecoin:{p2kh:{48:"mainnet (L)",111:"test networks (m, n)"},p2sh:{5:"mainnet deprecated (3)",50:"mainnet (M)",58:"test networks (Q)",196:"test networks deprecated (2)"},wif:{176:"mainnet (6, T)",239:"test networks (9, c)"},witness:{ltc:"mainnet",tltc:"testnet",rltc:"regtest"},silent:{},hdPrivate:{76066276:"mainnet (xprv)",27106558:"mainnet (Ltpv)",28469138:"mainnet BIP49 (Mtpv)",70615956:"test networks (tprv)",70709117:"test networks (ttpv)"},hdPublic:{76067358:"mainnet (xpub)",27108450:"mainnet (Ltub)",28471030:"mainnet BIP49 (Mtub)",70617039:"test networks (tpub)",70711009:"test networks (ttub)"}}};function sS(n){return n.includes("ltc_scrypt_proof_of_work")?"litecoin":"bitcoin"}function Ia(n,i,a){return FA[n][i][String(a)]??YA}function op(){return globalThis.window?.location.origin??"http://localhost"}function Vf(n){const i=n.trim();if(!i)throw new Error("Endpoint URL is required");const a=/^[a-z][a-z\d+\-.]*:\/\//iu.test(i)?i:`http://${i}`,l=new URL(a);if(l.protocol!=="http:"&&l.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS"))DELIM" +R"DELIM(;return l.pathname=l.pathname.replace(/\/+$/u,"")||"/",l.search="",l.hash="",l.toString().replace(/\/$/u,"")}function QA(n){const i=new URL(Vf(n));return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.pathname="/",i.search="",i.hash="",i.toString()}function JA(n,i=op()){return new URL(Vf(n)).origin===new URL(i).origin}function XA(){try{globalThis.localStorage.removeItem("libbitcoinAdminDashboardEndpoints")}catch{}return{adminUrl:Vf(op()),nativeUrl:Vf(op())}}const WA=vi({store:vi({address:Dn(),filter:Dn(),silent:hn().int().nonnegative().nullable(),turbo:Dn(),pruned:hn().int().nonnegative()}),node:vi({network:ri(),limited:Dn().optional(),blocks:Dn().optional(),witness:Dn().optional(),filters:Dn().optional(),privacy:Dn().optional()}),wallet:vi({p2kh:hn().int(),p2sh:hn().int(),wif:hn().int(),witness:ri(),silent:ri(),hd_private:hn().int(),hd_public:hn().int()}).optional(),network:vi({relay:Dn(),alert:Dn(),reject:Dn(),compact:Dn(),address:Dn(),witness_tx:Dn(),memory_pool:Dn(),not_found:Dn(),protocol_maximum:hn().int(),protocol_minimum:hn().int()}).optional(),forks:cA(ri(),Dn()).transform(n=>Object.keys(n).filter(i=>n[i]))}),e3=vi({height:hn().int().nonnegative(),timestamp:hn().int().positive().max(4294967295)}),bf=hn().int().nonnegative().max(Number.MAX_SAFE_INTEGER),t3=vi({count:bf,virtual:bf,fee:bf,histogram:Wf(uA([hn().nonnegative(),bf]))}),n3="/v1/fees?format=json",i3=5e3,Zu=15e3,r3=hn().int().nonnegative();function Af(n,i){return new URL(i,`${n.replace(/\/+$/u,"")}/`).toString()}async function Mf(n,i){const a=await fetch(n,{headers:{Accept:"application/json"},signal:i});if(!a.ok)throw new Error(`Native API request failed with status ${String(a.status)}`);return await a.json()}async function s3(n,i){const[a,l]=await Promise.all([Mf(Af(n,"/v1/configuration?format=json"),i),Mf(Af(n,"/v1/top?format=json"),i)]),u=WA.parse(a),f=r3.parse(l),d=Date.now();let m=null;try{const p=e3.parse(await Mf(Af(n,a3(f)),i));p.height===f&&(m=p)}catch{i?.throwIfAborted()}return{configuration:u,top:f,topHeader:m,receivedAt:d}}function a3(n){return`/v1/block/height/${String(n)}/header?format=json`}async function l3(n,i){return{data:t3.parse(await Mf(Af(n,n3),i)),receivedAt:Date.now()}}const Bm=["line","area","bar"],Fb=["line","step","area"],o3=["line","step","area"],aS={"occurrence-count":{id:"occurrence-count",label:"Occurrences per bucket",description:"Number of frames observed in each one-second bucket.",unit:"occurrences",chartTypes:Bm},"occurrence-rate":{id:"occurrence-rate",label:"Occurrence rate",description:"Frames observed per second.",unit:"occurrences-per-second",chartTypes:Bm},"cumulative-occurrences":{id:"cumulative-occurrences",label:"Cumulative occurrences",description:"Running number of frames observed during this browser session.",unit:"occurrences",chartTypes:Fb},"payload-latest":{id:"payload-latest",label:"Latest value",description:"Most recently observed payload value.",unit:"count",chartTypes:o3},"payload-average":{id:"payload-average",label:"Average value",description:"Average payload value within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-minimum":{id:"payload-minimum",label:"Minimum value",description:"Minimum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-maximum":{id:"payload-maximum",label:"Maximum value",description:"Maximum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-sum":{id:"payload-sum",label:"Value per bucket",description:"Sum of count payloads within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-cumulative":{id:"payload-cumulative",label:"Cumulative value",description:"Running sum of count payloads during this browser session.",unit:"count",chartTypes:Fb},"payload-change-rate":{id:"payload-change-rate",label:"Height change rate",description:"Change in the latest observed height per second.",unit:"height-per-second",chartTypes:Bm}},el=["occurrence-rate","occurrence-count","cumulative-occurrences"],u3=["payload-latest","payload-maximum","payload-change-rate",...el],c3=["payload-average","payload-latest","payload-minimum","payload-maximum",...el],f3=["payload-sum","payload-cumulative","payload-latest","payload-average",...el],lS=["payload-latest","payload-average","payload-minimum","payload-maximum"],oS=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function Ui(n){return`event:${String(n)}`}function Gs(n){return`log:${String(n)}`}const If="native:top";function d3(n){switch(n){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function h3(n){switch(n){case"height":return u3;case"duration":return c3;case"count":return f3;case"fee-rate":return[...lS,...el];default:return el}}function m3(n){switch(n){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function uS(n){const i=mo(n),a=d3(i.valueKind);return{id:Ui(n),source:"event",sourceId:n,name:i.name,label:i.label,category:i.category,payloadKind:a,allowedMeasures:h3(a),defaultMeasure:m3(a),description:n===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":a==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${i.label} event with a ${a} payload.`}}const p3=[...oS.map(n=>({id:n.id,source:"pool",sourceId:n.field,name:n.field,label:n.label,category:"pool",payloadKind:n.payloadKind,allowedMeasures:lS,defaultMeasure:"payload-latest",description:n.description})),...Hf.map(n=>uS(n.id)),...Bu.map(n=>({id:Gs(n.id),source:"log",sourceId:n.id,name:n.name,label:`${n.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:el,defaultMeasure:"occurrence-rate",description:`${n.label} log message volume. Message text is not interpreted as numeric data.`})),{id:If,source:"native",sourceId:"top",name:"canonical_top",label:"Current top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}],Jp=p3,g3=new Map(Jp.map(n=>[n.id,n]));function cs(n){const i=g3.get(n);if(i)return i;const a=/^event:(\d+)$/u.exec(n);return a?uS(Number(a[1])):{id:n,source:"event",sourceId:-1,name:n,label:n,category:"unknown",payloadKind:"unknown",allowedMeasures:el,defaultMeasure:"occurrence-rate",description:"Unknown signal; only occurrence measurements are available."}}function Fs(n,i){const a=aS[i];if(i.startsWith("occurrence")||i==="cumulative-occurrences")return a;const l=i==="payload-change-rate"?"height-per-second":n.payloadKind==="height"?"height":n.payloadKind==="duration"?"milliseconds":n.payloadKind==="fee-rate"?"sat-per-vbyte":n.payloadKind==="transactions"||n.payloadKind==="vbytes"||n.payloadKind==="satoshis"?n.payloadKind:"count";return{...a,unit:l}}function v3(n,i){return n.allowedMeasures.includes(i)}function y3(n,i){return mo(n).valueKind==="fee-rate"?i/1e3:ZA(n,i)??i}const b3=3600*1e3,_3=1e3,S3=1e3,x3=1e3;class Qb{constructor(i){this.capacity=i,this.#e=Array.from({length:i})}capacity;#e;#t=0;#n=0;#i=null;get size(){return this.#n}push(i){const a=this.#n===this.capacity;return this.#i=null,this.#e[this.#t]=i,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity),a}clear(){this.#i=null,this.#e.fill(void 0),this.#t=0,this.#n=0}newestFir)DELIM" +R"DELIM(st(){if(this.#i)return this.#i;const i=[];for(let a=0;athis.#k;getRecentLogs=()=>this.#i.newestFirst();getRecentEvents=()=>this.#s.newestFirst();subscribe=i=>(this.#n.add(i),()=>{this.#n.delete(i)});start(){this.#O||(this.tick(),this.#O=setInterval(()=>{this.tick()},1e3))}stop(){this.#O&&(clearInterval(this.#O),this.#O=null),this.#d&&(clearTimeout(this.#d),this.#d=null)}ingest(i,a=this.#e()){const l=this.#N(a);this.#_+=1,CA(i)?this.#U(i,l):DA(i)?this.#j(i,l):UA(i)&&(this.#v+=1),this.#C()}recordInvalidFrame(){this.#w+=1,this.#C()}recordNativeTop(i,a=this.#e()){const l=this.#N(a),u=this.#a[If];u?.value===i&&l-u.time<15e3||(this.#R(If,l,i),this.#D(l),this.#C())}recordNativeFees(i,a=this.#e()){if(!Number.isFinite(a)||a=Zu||this.#M!==null&&a<=this.#M.receivedAt)return;const l=this.#N(a);this.#M={data:i,receivedAt:a};for(const u of oS)this.#R(u.id,l,i[u.field]);this.#D(l),this.#C()}clearLogs(){this.#E+=this.#i.size,this.#i.clear(),this.flush()}clearEvents(){this.#s.clear(),this.flush()}reset(){this.#i.clear(),this.#s.clear(),this.#r.clear(),this.#l={},this.#f={},this.#u={},this.#o={},this.#b={},this.#a={},this.#g={},this.#c=this.#N(this.#e()),this.#_=0,this.#m=0,this.#S=0,this.#E=0,this.#x=0,this.#v=0,this.#w=0,this.#p=null,this.#A=null,this.#M=null,this.#T=0,this.#z(this.#c),this.flush()}tick(){const i=this.#N(this.#e());this.#z(i),this.#D(i),this.#C()}flush(){this.#d&&(clearTimeout(this.#d),this.#d=null),this.#k=this.#Z();for(const i of this.#n)i()}#U(i,a){this.#m+=1,this.#p=a,this.#T+=1,this.#i.push({...i,id:this.#T,receivedAt:a})&&(this.#S+=1),this.#R(Gs(i.level),a,null)}#j(i,a){this.#x+=1,this.#A=a,this.#T+=1,this.#s.push({...i,id:this.#T,receivedAt:a}),this.#R(Ui(i.event),a,y3(i.event,i.value))}#N(i){return Number.isFinite(i)?(this.#h=Math.max(this.#h,i),this.#h):this.#h}#R(i,a,l){const u=this.#z(a);u.snapshot=null;const f=u.signals.get(i)??w3();if(f.count+=1,_f(this.#o,i,1),l!==null){f.samples+=1,f.sum+=l,f.minimum=f.minimum===null?l:Math.min(f.minimum,l),f.maximum=f.maximum===null?l:Math.max(f.maximum,l),(f.firstAt===null||a=f.lastAt)&&(f.last=l,f.lastAt=a),_f(this.#b,i,l);const d=this.#a[i];(!d||a>=d.time)&&(this.#a[i]={value:l,time:a}),this.#g[i]=Math.max(this.#g[i]??l,l)}u.signals.set(i,f)}#z(i){const a=Math.floor(i/1e3)*1e3,l=this.#r.get(a);if(l)return l;const u={time:a,signals:new Map,snapshot:null};return this.#r.set(a,u),u}#D(i){const a=i-b3;for(const[l,u]of this.#r){if(l>=a)break;for(const[f,d]of u.signals)if(_f(this.#l,f,d.count),_f(this.#f,f,d.sum),d.last!==null&&d.lastAt!==null){const m=this.#u[f];(!m||d.lastAt>=m.time)&&(this.#u[f]={value:d.last,time:d.lastAt})}this.#r.delete(l)}}#C(){!this.#t||this.#d||(this.#d=setTimeout(()=>{this.#d=null,this.flush()},_3))}#Z(){const i=[...this.#r.values()].map(a=>(a.snapshot??={time:a.time,signals:Object.fromEntries([...a.signals].map(([l,u])=>[l,{...u}]))},a.snapshot));return{now:this.#N(this.#e()),sessionStartedAt:this.#c,totalFrames:this.#_,totalLogs:this.#m,evictedLogs:this.#S,clearedLogs:this.#E,totalEvents:this.#x,totalAcks:this.#v,invalidFrames:this.#w,buckets:i,priorSignalCounts:{...this.#l},priorSignalSums:{...this.#f},priorSignalLatest:Jb(this.#u),signalTotals:{...this.#o},signalSums:{...this.#b},signalLatest:Jb(this.#a),signalMaximums:{...this.#g},recentLogs:this.#i.newestFirst(),recentEvents:this.#s.newestFirst(),lastLogAt:this.#p,lastEventAt:this.#A,poolSnapshot:this.#M}}}function z3(n,i,a,l,u=n[0]?.time??a){const f=a-l*1e3,d=f<=u,m=d?Math.floor(u/1e3)*1e3:Math.ceil(f/1e3)*1e3,p=d?u:m,g=Math.floor(a/1e3)*1e3,y=n.filter(O=>O.time>=m&&O.time<=g).reduce((O,T)=>O+(T.signals[i]?.count??0),0),w=Math.max(0,(a-p)/1e3);return w>0?y/w:0}function T3(n,i){const a=d=>z3(n.buckets,Ui(d),n.now,i,n.sessionStartedAt),l=a(2)+a(14);if(l>0)return{label:"Reorganizing",rate:l};const f=[{label:"Confirming blocks",rate:a(6)},{label:"Validating blocks",rate:a(5)},{label:"Archiving blocks",rate:a(3)},{label:"Synchronizing headers",rate:Math.max(a(0),a(1))}].reduce((d,m)=>m.rate>d.rate?m:d);return f.rate>0?f:{label:"Idle",rate:0}}const td=18,E3=600*1e3;function O3(n,i,a){if(n===null||!Number.isSafeInteger(n)||n<0||i===null||!Number.isSafeInteger(i.height)||i.height<0||i.height>n||!Number.isFinite(i.timestamp)||i.timestamp<=0||!Number.isFinite(a)||a<0)return null;const l=Math.max(0,a-i.timestamp*1e3),u=Math.max(n,i.height+Math.ceil(l/E3));return{blocksRemaining:u-n,estimatedTop:u,progress:u===0?100:n/u*100}}function Sf({label:n,value:i,detail:a,numeric:l=!0,emphasized:u=!1}){return x.jsxs("div",{className:"border-accent/30 bg-surface/80 min-w-0 space-y-2 rounded-2xl border p-5",children:[x.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),x.jsx("dd",{className:`text-2xl font-semibold break-words ${l?"tabular-nums":""} ${u?"text-accent":"text-textPrimary"}`,children:i}),x.jsx("dd",{className:"text-textMuted text-sm break-words",children:a})]})}function N3({confirmed:n,estimate:i}){if(n===null||i===null||i.blocksRemaining<=td)return null;const a=Math.min(99.99,Math.max(0,i.progress)),l=`${a.toFixed(2)}%`;return x.jsxs("section",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border","aria-labelledby":"node-sync-progress-title",children:[x.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3 px-5 pt-5",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node synchronization"}),x.jsx("h2",{id:"node-sync-progress-title",className:"text-accent mt-1 text-lg font-semibold",children:"Catching up to top candidate header"})]}),x.jsx("p",{className:"text-accent text-2xl font-semibold tabular-nums",children:l})]}),x.jsx("div",{className:"px-5 pt-4",children:x.jsx("div",{role:"progressbar","aria-label":"Node synchronization progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number(a.toFixed(2)),"aria-valuetext":`Approximately ${zn(i.blocksRemaining)} blocks remaining`,className:"bg-background border-accentSecondary/20 h-3 overflow-hidden rounded-full border",children:x.jsx("div",{className:"bg-accent h-full rounded-full transition-[width] duration-700",style:{width:`${String(a)}%`}})})}),x.jsxs("dl",{className:"bg-accentSecondary/10 mt-5 grid gap-px text-sm sm:grid-cols-3",children:[x.jsx(qm,{label:"Top confirmed block",value:zn(n)}),x.jsx(qm,{label:"Top candidate header",value:zn(i.estimatedTop)}),x.jsx(qm,{label:"Estimated blocks remaining",value:zn(i.blocksRemaining)})]}),x.jsx("p",{className:"bg-surface text-textMuted border-accentSecondary/20 border-t px-5 py-2 text-[11px]",children:"Estimated from the confirmed block timestamp and your browser clock, assuming one block every 10 minutes. Actual block counts may differ."})]})}function qm({label:n,value:i}){return x.jsxs("div",{className:"bg-surface px-5 py-3",children:[x.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),x.jsx("dd",{className:"text-textPrimary mt-1 text-lg font-semibold tabular-nums",children:i})]})}const Wl=16,up=8,nd=80,A3=[300,900,3600],cp=["line","step","area","bar"],cS=["linear","compressed"],Rt=["#ffa022","#38bdf8","#34d399","#c084fc","#fb7185","#e879f9","#facc15","#60a5fa"],M3=Du(["occurrence-count","occ)DELIM" +R"DELIM(urrence-rate","cumulative-occurrences","payload-latest","payload-average","payload-minimum","payload-maximum","payload-sum","payload-cumulative","payload-change-rate"]),j3=vi({id:ri().min(1).max(100),signalId:ri().min(1).max(100),measure:M3,color:ri().regex(/^#[\da-f]{6}$/iu),label:ri().max(80).optional()}).strict(),k3=vi({id:ri().min(1).max(100),title:ri().trim().min(1).max(nd),visualization:Du(cp),scale:Du(cS).default("linear"),range:ed([Au(300),Au(900),Au(3600)]),series:Wf(j3).min(1).max(up)}).strict(),R3=vi({id:ri().min(1).max(100),title:ri().trim().min(1).max(nd),visualization:Au("histogram"),scale:Du(cS).default("linear"),color:ri().regex(/^#[\da-f]{6}$/iu)}).strict(),fS=ed([k3,R3]),C3=vi({version:Au(1),charts:Wf(fS).max(Wl)}).strict();function ln(n){return n.visualization!=="histogram"}const Xp={id:"default-sync-pipeline",title:"Sync pipeline",visualization:"line",scale:"linear",range:900,series:[Tn("sync-header",Ui(0),"occurrence-rate",Rt[3]),Tn("sync-archive",Ui(3),"occurrence-rate",Rt[0]),Tn("sync-validate",Ui(5),"occurrence-rate",Rt[1]),Tn("sync-confirm",Ui(6),"occurrence-rate",Rt[2])]},dS={id:"default-chain-progress",title:"Chain progress",visualization:"step",scale:"linear",range:900,series:[Tn("progress-top",If,"payload-latest",Rt[0]),Tn("progress-organized",Ui(13),"payload-latest",Rt[2]),Tn("progress-confirmed",Ui(6),"payload-latest",Rt[1])]},hS={id:"default-log-volume",title:"Log volume",visualization:"bar",scale:"linear",range:900,series:[Tn("logs-news",Gs(1),"occurrence-rate",Rt[2]),Tn("logs-session",Gs(2),"occurrence-rate",Rt[3]),Tn("logs-protocol",Gs(3),"occurrence-rate",Rt[1]),Tn("logs-remote",Gs(5),"occurrence-rate",Rt[7]),Tn("logs-fault",Gs(6),"occurrence-rate",Rt[4]),Tn("logs-quitting",Gs(7),"occurrence-rate",Rt[0])]},id={id:"default-pool-transactions",title:"Pool transactions",visualization:"step",scale:"linear",range:900,series:[Tn("pool-count","pool:count","payload-latest",Rt[0])]},mS={...id,id:"default-pool-fees",title:"Pool total fees",series:[Tn("pool-fees","pool:total_fee","payload-latest",Rt[3])]},pS={...id,id:"default-pool-virtual-size",title:"Pool virtual size",series:[Tn("pool-size","pool:vsize","payload-latest",Rt[1])]},Wb={id:"default-transaction-archive-rate",title:"Transactions archived / second",visualization:"line",scale:"linear",range:900,series:[Tn("tx-archived",Ui(10),"occurrence-rate",Rt[2])]},gS={id:"default-pool-fee-histogram",title:"Pool fee distribution",visualization:"histogram",scale:"linear",color:Rt[0]},vS=[{id:"pool-fee-histogram",label:"Pool fee distribution",description:"Current pool virtual size grouped by fee rate.",chart:gS},{id:"sync-pipeline",label:"Sync pipeline",description:"Header and block lifecycle throughput.",chart:Xp},{id:"chain-progress",label:"Chain progress",description:"Canonical, organized, and confirmed heights.",chart:dS},{id:"log-volume",label:"Log volume",description:"Message rates grouped by log level.",chart:hS},{id:"pool-transactions",label:"Pool transactions",description:"Current pool transaction count, sampled every five seconds.",chart:id},{id:"transaction-archive-rate",label:"Transaction archive rate",description:"Newly archived transactions per second, including compact-block recovery.",chart:Wb},{id:"pool-virtual-size",label:"Pool virtual size",description:"Current pool virtual size in vbytes.",chart:pS},{id:"pool-fees",label:"Pool total fees",description:"Total fees currently in the pool, in satoshis.",chart:mS},{id:"transaction-fee-rate",label:"Archived transaction fee rate",description:"Average fee rate of newly archived transactions, in sat/vB.",chart:{...Wb,id:"template-tx-fees",title:"Archived transaction fee rate",series:[Tn("tx-fee-rate",Ui(10),"payload-average",Rt[0])]}}],yS="libbitcoinAdminDashboardCharts";let e_=0;function Tn(n,i,a,l){return{id:n,signalId:i,measure:a,color:l}}function Mu(n){return e_+=1,`${n}-${Date.now().toString(36)}-${String(e_)}`}function Wp(n,i=!1){return ln(n)?{...n,id:i?Mu("chart"):n.id,series:n.series.map(a=>({...a,id:i?Mu("series"):a.id}))}:{...n,id:i?Mu("chart"):n.id}}function jf(){return[Xp,dS,hS,id,mS,pS,gS].map(n=>Wp(n))}function D3(n){const i=vS.find(a=>a.id===n);return Wp(i?.chart??Xp,!0)}function bS(){return{id:Mu("chart"),title:"Custom chart",visualization:"line",scale:"linear",range:900,series:[{id:Mu("series"),signalId:Ui(3),measure:"occurrence-rate",color:Rt[0]}]}}function U3(n){const i=" copy",a=`${n.title.slice(0,nd-i.length).trimEnd()}${i}`;return{...Wp(n,!0),title:a}}function fp(n){if(!ln(n))return"vbytes";const i=new Set(n.series.map(a=>Fs(cs(a.signalId),a.measure).unit));return i.size===1?[...i][0]??null:null}function _S(n){const i=fS.safeParse(n);if(!i.success)return i.error.issues[0]?.message??"Invalid chart configuration";if(!ln(n))return null;for(const a of n.series){const l=cs(a.signalId);if(!v3(l,a.measure))return`${aS[a.measure].label} is not valid for ${l.label}.`;const u=Fs(l,a.measure);if(!u.chartTypes.includes(n.visualization))return`${u.label} cannot be displayed as a ${n.visualization} chart.`}return fp(n)===null?"All series on a chart must use compatible units.":null}function SS(n){const i=C3.safeParse(n);return!i.success||new Set(i.data.charts.map(a=>a.id)).size!==i.data.charts.length||i.data.charts.some(a=>ln(a)&&new Set(a.series.map(l=>l.id)).size!==a.series.length)?null:i.data.charts.every(a=>_S(a)===null)?i.data.charts:null}function xS(){try{return globalThis.window?.localStorage??null}catch{return null}}function Z3(n=xS()){try{const i=n?.getItem(yS);return i?SS(JSON.parse(i))??jf():jf()}catch{return jf()}}function $3(n,i=xS()){try{const a={version:1,charts:n};if(!SS(a))return;i?.setItem(yS,JSON.stringify(a))}catch{}}function eg(n,i){return n.signals[i]}function t_(n,i,a,l){let u=l==="count"?n.priorSignalCounts[i]??0:n.priorSignalSums[i]??0;for(const f of n.buckets){if(f.time>=a)break;const d=eg(f,i);u+=l==="count"?d?.count??0:d?.sum??0}return u}function L3(n,i,a){let l=n.priorSignalLatest[i]??null;for(const u of n.buckets){if(u.time>=a)break;const f=eg(u,i);f?.last!==null&&f?.last!==void 0&&f.lastAt!==null&&(l={value:f.last,time:f.lastAt})}return l}function H3(n,i){const a=i<=n.sessionStartedAt?Math.floor(n.sessionStartedAt/1e3)*1e3:Math.ceil(i/1e3)*1e3,l=Math.floor(n.now/1e3)*1e3,u=new Map(n.buckets.map(d=>[d.time,d])),f=[];for(let d=a;d<=l;d+=1e3)f.push(u.get(d)??{time:d,signals:{}});return f}function B3(n,i,a){const l=Math.max(n.time,a),u=Math.min(i,n.time+1e3);return Math.max(0,(u-l)/1e3)}function q3(n,i,a,l){const u=cs(l.signalId);let f=l.measure==="cumulative-occurrences"?t_(n,l.signalId,a,"count"):l.measure==="payload-cumulative"?t_(n,l.signalId,a,"sum"):0,d=L3(n,l.signalId,a);return i.map(m=>{const p=eg(m,l.signalId);switch(l.measure){case"occurrence-count":return p?.count??0;case"occurrence-rate":{const g=B3(m,n.now,n.sessionStartedAt);return g>0?(p?.count??0)/g:0}case"cumulative-occurrences":return f+=p?.count??0,f;case"payload-sum":return p&&p.samples>0?p.sum:null;case"payload-cumulative":return f+=p?.sum??0,f;case"payload-average":return p&&p.samples>0?p.sum/p.samples:null;case"payload-minimum":return p?.minimum??null;case"payload-maximum":return p?.maximum??null;case"payload-latest":{if(p?.last!==null&&p?.last!==void 0&&p.lastAt!==null)return d={value:p.last,time:p.lastAt},p.last;if(u.source==="pool"){const g=Math.min(m.time+1e3,n.now);return d&&g-d.time0?(p.last-g.value)/b:null}}})}function V3(n,i){const a=n.now-i.range*1e3,l=H3(n,a),u=l[0]?.time??Math.floor(n.now/1e3)*1e3,f=i.series[0],d=Fs(cs(f.signalId),f.measure).unit,m=i.series.filter(p=>(n.signalTotals[p.signalId]??0)===0).map(p=>p.label??cs(p.signalId).label);return{data:[l.map(p=>p.time/1e3),..)DELIM" +R"DELIM(.i.series.map(p=>q3(n,l,u,p))],unit:d,hasObservedData:m.length{const a=()=>{i(Date.now())},l=setInterval(a,1e3);return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{clearInterval(l),window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[]),n}const K3={300:"5 minutes",900:"15 minutes",3600:"1 hour"},G3={line:"Line",step:"Step",area:"Area",bar:"Bar"};function Y3(n){return ln(n)?{...n,series:n.series.map(i=>({...i}))}:{...n}}function F3(){const n=new Map;for(const i of Jp){const a=n.get(i.category)??[];a.push(i),n.set(i.category,a)}return[...n]}const Q3=F3();function J3({chart:n,mode:i,onCancel:a,onSave:l}){const[u,f]=se.useState(()=>Y3(n)),d=_S(u),m=fp(u);se.useEffect(()=>{function T(A){A.key==="Escape"&&a()}return globalThis.addEventListener("keydown",T),()=>{globalThis.removeEventListener("keydown",T)}},[a]);const p=se.useMemo(()=>new Set(cp.filter(T=>ln(u)&&u.series.every(A=>Fs(cs(A.signalId),A.measure).chartTypes.includes(T)))),[u]);function g(T){f(A=>ln(A)?T(A):A)}function b(T,A){g(k=>({...k,series:k.series.map((L,D)=>D===T?A:L)}))}function y(T,A){if(!ln(u))return;const k=u.series[T],L=cs(A);b(T,{...k,signalId:A,measure:L.defaultMeasure})}function w(){if(!ln(u)||u.series.length>=up)return;const T=fp(u),A=Jp.find(D=>D.allowedMeasures.some(X=>T===null||Fs(D,X).unit===T));if(!A)return;const k=A.allowedMeasures.find(D=>T===null||Fs(A,D).unit===T)??A.defaultMeasure,L={id:`series-${Date.now().toString(36)}-${String(u.series.length+1)}`,signalId:A.id,measure:k,color:Rt[u.series.length%Rt.length]??Rt[0]};g(D=>({...D,series:[...D.series,L]}))}function O(T){T.preventDefault(),!d&&l({...u,title:u.title.trim()})}return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:T=>{T.target===T.currentTarget&&a()},children:x.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"chart-editor-title",className:"border-accent/30 bg-surface/95 max-h-[92vh] w-full max-w-4xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/60",children:[x.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Dashboard builder"}),x.jsx("h2",{id:"chart-editor-title",className:"text-accent mt-1 text-xl font-semibold",children:i==="add"?"Add chart":"Edit chart"})]}),x.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close chart editor",children:"×"})]}),i==="add"&&x.jsxs("div",{className:"border-accentSecondary/20 border-b p-5",children:[x.jsx("p",{className:"text-accentSecondary mb-3 text-xs tracking-wide uppercase",children:"Start from a template"}),x.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-5",children:[vS.map(T=>x.jsxs("button",{type:"button",onClick:()=>{f(D3(T.id))},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[x.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:T.label}),x.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:T.description})]},T.id)),x.jsxs("button",{type:"button",onClick:()=>{f(bS())},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[x.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:"Custom"}),x.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:"Begin with one editable series."})]})]})]}),x.jsxs("form",{onSubmit:O,className:"space-y-6 p-5",children:[x.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_11rem_11rem]",children:[x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Chart title"}),x.jsx("input",{value:u.title,maxLength:nd,onChange:T=>{f(A=>({...A,title:T.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),ln(u)?x.jsxs(x.Fragment,{children:[x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Chart type"}),x.jsx("select",{value:u.visualization,onChange:T=>{g(A=>({...A,visualization:T.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:cp.map(T=>x.jsx("option",{value:T,disabled:!p.has(T),children:G3[T]},T))})]}),x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Time range"}),x.jsx("select",{value:u.range,onChange:T=>{g(A=>({...A,range:Number(T.target.value)}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:A3.map(T=>x.jsx("option",{value:T,children:K3[T]},T))})]})]}):x.jsxs("label",{className:"space-y-2",children:[x.jsx("span",{className:"text-sm font-medium",children:"Bar color"}),x.jsx("input",{type:"color",value:u.color,onChange:T=>{const A=T.target.value;f(k=>ln(k)?k:{...k,color:A})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]})]}),ln(u)?x.jsxs("section",{className:"space-y-3",children:[x.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[x.jsxs("div",{children:[x.jsx("h3",{className:"text-accent text-lg font-semibold",children:"Series"}),x.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:["One chart uses one axis unit",m===null?".":`: ${wS(m)}.`]})]}),x.jsx("button",{type:"button",onClick:w,disabled:u.series.length>=up,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary disabled:text-textMuted rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",children:"Add series"})]}),x.jsx("div",{className:"space-y-3",children:u.series.map((T,A)=>{const k=cs(T.signalId),L=Fs(k,T.measure);return x.jsxs("article",{className:"border-accentSecondary/20 bg-accent/5 grid gap-3 rounded-xl border p-4 lg:grid-cols-[minmax(12rem,1.2fr)_minmax(11rem,1fr)_minmax(9rem,0.8fr)_3.5rem_auto]",children:[x.jsxs("label",{className:"space-y-1.5",children:[x.jsxs("span",{className:"text-textMuted text-xs",children:["Signal ",String(A+1)]}),x.jsx("select",{"aria-label":`Signal ${String(A+1)}`,value:T.signalId,onChange:D=>{y(A,D.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0",children:Q3.map(([D,X])=>x.jsx("optgroup",{label:D,children:X.map(G=>x.jsx("option",{value:G.id,children:G.label},G.id))},D))})]}),x.jsxs("label",{className:"space-y-1.5",children:[x.jsx("span",{className:"text-textMuted text-xs",children:"Measurement"}),x.jsx("select",{"aria-label":`Measurement ${String(A+1)}`,value:T.measure,onChange:D=>{b(A,{...T,measure:D.target.value})},className:"border-accent/40 bg-background text-textPrimary focus:border-acce)DELIM" +R"DELIM(nt w-full rounded-md border px-2 py-2 text-sm focus:ring-0",title:L.description,children:k.allowedMeasures.map(D=>x.jsx("option",{value:D,children:Fs(k,D).label},D))})]}),x.jsxs("label",{className:"space-y-1.5",children:[x.jsx("span",{className:"text-textMuted text-xs",children:"Display label"}),x.jsx("input",{"aria-label":`Display label ${String(A+1)}`,value:T.label??"",onChange:D=>{b(A,{...T,label:D.target.value||void 0})},placeholder:k.label,className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/50 focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0"})]}),x.jsxs("label",{className:"space-y-1.5",children:[x.jsx("span",{className:"text-textMuted text-xs",children:"Color"}),x.jsx("input",{"aria-label":`Series color ${String(A+1)}`,type:"color",value:T.color,onChange:D=>{b(A,{...T,color:D.target.value})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]}),x.jsx("button",{type:"button",onClick:()=>{g(D=>({...D,series:D.series.filter((X,G)=>G!==A)}))},disabled:u.series.length===1,"aria-label":`Remove series ${String(A+1)}`,className:"text-textMuted self-end rounded-md px-3 py-2 text-sm hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-30",children:"Remove"})]},T.id)})})]}):x.jsx("p",{className:"text-textMuted text-sm",children:"Shows the latest transaction-pool fee distribution, refreshed every five seconds. Each bar shows the virtual size of one fee-rate group, labeled by its minimum fee rate in sat/vB."}),d&&x.jsx("p",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:d}),x.jsxs("div",{className:"border-accentSecondary/20 flex justify-end gap-2 border-t pt-4",children:[x.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded-md px-4 py-2 text-sm",children:"Cancel"}),x.jsx("button",{type:"submit",disabled:d!==null,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:i==="add"?"Add chart":"Save changes"})]})]})]})})}const X3=!0,pn="u-",W3="uplot",eM=pn+"hz",tM=pn+"vt",nM=pn+"title",iM=pn+"wrap",rM=pn+"under",sM=pn+"over",aM=pn+"axis",Ya=pn+"off",lM=pn+"select",oM=pn+"cursor-x",uM=pn+"cursor-y",cM=pn+"cursor-pt",fM=pn+"legend",dM=pn+"live",hM=pn+"inline",mM=pn+"series",pM=pn+"marker",n_=pn+"label",gM=pn+"value",zu="width",Tu="height",yu="top",i_="bottom",Xl="left",Vm="right",tg="#000",r_=tg+"0",Im="mousemove",s_="mousedown",Pm="mouseup",a_="mouseenter",l_="mouseleave",o_="dblclick",vM="resize",yM="scroll",u_="change",Pf="dppxchange",ng="--",po=typeof window<"u",dp=po?document:null,no=po?window:null,bM=po?navigator:null;let rt,xf;function hp(){let n=devicePixelRatio;rt!=n&&(rt=n,xf&&pp(u_,xf,hp),xf=matchMedia(`(min-resolution: ${rt-.001}dppx) and (max-resolution: ${rt+.001}dppx)`),Xa(u_,xf,hp),no.dispatchEvent(new CustomEvent(Pf)))}function Ci(n,i){if(i!=null){let a=n.classList;!a.contains(i)&&a.add(i)}}function mp(n,i){let a=n.classList;a.contains(i)&&a.remove(i)}function Et(n,i,a){n.style[i]=a+"px"}function vr(n,i,a,l){let u=dp.createElement(n);return i!=null&&Ci(u,i),a?.insertBefore(u,l),u}function Ji(n,i){return vr("div",n,i)}const c_=new WeakMap;function Lr(n,i,a,l,u){let f="translate("+i+"px,"+a+"px)",d=c_.get(n);f!=d&&(n.style.transform=f,c_.set(n,f),i<0||a<0||i>l||a>u?Ci(n,Ya):mp(n,Ya))}const f_=new WeakMap;function d_(n,i,a){let l=i+a,u=f_.get(n);l!=u&&(f_.set(n,l),n.style.background=i,n.style.borderColor=a)}const h_=new WeakMap;function m_(n,i,a,l){let u=i+""+a,f=h_.get(n);u!=f&&(h_.set(n,u),n.style.height=a+"px",n.style.width=i+"px",n.style.marginLeft=l?-i/2+"px":0,n.style.marginTop=l?-a/2+"px":0)}const ig={passive:!0},_M={...ig,capture:!0};function Xa(n,i,a,l){i.addEventListener(n,a,l?_M:ig)}function pp(n,i,a,l){i.removeEventListener(n,a,ig)}po&&hp();function yr(n,i,a,l){let u;a=a||0,l=l||i.length-1;let f=l<=2147483647;for(;l-a>1;)u=f?a+l>>1:Zi((a+l)/2),i[u]{let f=-1,d=-1;for(let m=l;m<=u;m++)if(n(a[m])){f=m;break}for(let m=u;m>=l;m--)if(n(a[m])){d=m;break}return[f,d]}}const ES=n=>n!=null,OS=n=>n!=null&&n>0,rd=TS(ES),SM=TS(OS);function xM(n,i,a,l=0,u=!1){let f=u?SM:rd,d=u?OS:ES;[i,a]=f(n,i,a);let m=n[i],p=n[i];if(i>-1)if(l==1)m=n[i],p=n[a];else if(l==-1)m=n[a],p=n[i];else for(let g=i;g<=a;g++){let b=n[g];d(b)&&(bp&&(p=b))}return[m??_t,p??-_t]}function sd(n,i,a,l){let u=v_(n),f=v_(i);n==i&&(u==-1?(n*=a,i/=a):(n/=a,i*=a));let d=a==10?fs:NS,m=u==1?Zi:Xi,p=f==1?Xi:Zi,g=m(d(mn(n))),b=p(d(mn(i))),y=lo(a,g),w=lo(a,b);return a==10&&(g<0&&(y=St(y,-g)),b<0&&(w=St(w,-b))),l||a==2?(n=y*u,i=w*f):(n=kS(n,y),i=ad(i,w)),[n,i]}function rg(n,i,a,l){let u=sd(n,i,a,l);return n==0&&(u[0]=0),i==0&&(u[1]=0),u}const sg=.1,p_={mode:3,pad:sg},ju={pad:0,soft:null,mode:0},wM={min:ju,max:ju};function Kf(n,i,a,l){return ld(a)?g_(n,i,a):(ju.pad=a,ju.soft=l?0:null,ju.mode=l?3:0,g_(n,i,wM))}function et(n,i){return n??i}function zM(n,i,a){for(i=et(i,0),a=et(a,n.length-1);i<=a;){if(n[i]!=null)return!0;i++}return!1}function g_(n,i,a){let l=a.min,u=a.max,f=et(l.pad,0),d=et(u.pad,0),m=et(l.hard,-_t),p=et(u.hard,_t),g=et(l.soft,_t),b=et(u.soft,-_t),y=et(l.mode,0),w=et(u.mode,0),O=i-n,T=fs(O),A=si(mn(n),mn(i)),k=fs(A),L=mn(k-T);(O<1e-24||L>10)&&(O=0,(n==0||i==0)&&(O=1e-24,y==2&&g!=_t&&(f=0),w==2&&b!=-_t&&(d=0)));let D=O||A||1e3,X=fs(D),G=lo(10,Zi(X)),ee=D*(O==0?n==0?.1:1:f),V=St(kS(n-ee,G/10),24),ne=n>=g&&(y==1||y==3&&V<=g||y==2&&V>=g)?g:_t,ae=si(m,V=ne?ne:br(ne,V)),ye=D*(O==0?i==0?.1:1:d),ue=St(ad(i+ye,G/10),24),J=i<=b&&(w==1||w==3&&ue>=b||w==2&&ue<=b)?b:-_t,we=br(p,ue>J&&i<=J?J:si(J,ue));return ae==we&&ae==0&&(we=100),[ae,we]}const TM=new Intl.NumberFormat(po?bM.language:"en-US"),ag=n=>TM.format(n),$i=Math,kf=$i.PI,mn=$i.abs,Zi=$i.floor,dn=$i.round,Xi=$i.ceil,br=$i.min,si=$i.max,lo=$i.pow,v_=$i.sign,fs=$i.log10,NS=$i.log2,EM=(n,i=1)=>$i.sinh(n)*i,Km=(n,i=1)=>$i.asinh(n/i),_t=1/0;function y_(n){return(fs((n^n>>31)-(n>>31))|0)+1}function gp(n,i,a){return br(si(n,i),a)}function AS(n){return typeof n=="function"}function Qe(n){return AS(n)?n:()=>n}const OM=()=>{},MS=n=>n,jS=(n,i)=>i,NM=n=>null,b_=n=>!0,__=(n,i)=>n==i,AM=/\.\d*?(?=9{6,}|0{6,})/gm,tl=n=>{if(CS(n)||ea.has(n))return n;const i=`${n}`,a=i.match(AM);if(a==null)return n;let l=a[0].length-1;if(i.indexOf("e-")!=-1){let[u,f]=i.split("e");return+`${tl(u)}e${f}`}return St(n,l)};function Ka(n,i){return tl(St(tl(n/i))*i)}function ad(n,i){return tl(Xi(tl(n/i))*i)}function kS(n,i){return tl(Zi(tl(n/i))*i)}function St(n,i=0){if(CS(n))return n;let a=10**i,l=n*a*(1+Number.EPSILON);return dn(l)/a}const ea=new Map;function RS(n){return((""+n).split(".")[1]||"").length}function $u(n,i,a,l){let u=[],f=l.map(RS);for(let d=i;d=0?0:m)+(d>=f[g]?0:f[g]),w=n==10?b:St(b,y);u.push(w),ea.set(w,y)}}return u}const ku={},lg=[],oo=[null,null],Ys=Array.isArray,CS=Number.isInteger,MM=n=>n===void 0;function S_(n){return typeof n=="string"}function ld(n){let i=!1;if(n!=null){let a=n.constructor;i=a==null||a==Object}return i}function jM(n){return n!=null&&typeof n=="object"}const kM=Object.getPrototypeOf(Uint8Array),DS="__proto__";function uo(n,i=ld){let a;if(Ys(n)){let l=n.find(u=>u!=null);if(Ys(l)||i(l)){a=Array(n.length);for(let u=0;uf){for(u=d-1;u>=0&&n[u]==null;)n[u--]=null;for(u=d+1;ud-m)],u=l[0].length,f=new Map;for(let d=0;d"u"?n=>Promise.resolve().then(n):queueMicrotask;function LM(n){let i=n[0],a=i.length,l=Array(a);for(let f=0;fi[f]-i[d]);let u=[];for(let f=0;f=l&&n[u]==null;)u--;if(u<=l)return!0;const f=si(1,Zi((u-l+1)/i));for(let d=n[l],m=l+f;m<=u;m+=f){const p=n[m];if(p!=null){if(p<=d)return!1;d=p}}return!0}const US=["January","February","March","April","May","June","July","August","September","October","November","December"],ZS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function $S(n){return n.slice(0,3)}const qM=ZS.map($S),VM=US.map($S),IM={MMMM:US,MMM:VM,WWWW:ZS,WWW:qM};function bu(n){return(n<10?"0":"")+n}function PM(n){return(n<10?"00":n<100?"0":"")+n}const KM={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,i)=>i.MMMM[n.getMonth()],MMM:(n,i)=>i.MMM[n.getMonth()],MM:n=>bu(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>bu(n.getDate()),D:n=>n.getDate(),WWWW:(n,i)=>i.WWWW[n.getDay()],WWW:(n,i)=>i.WWW[n.getDay()],HH:n=>bu(n.getHours()),H:n=>n.getHours(),h:n=>{let i=n.getHours();return i==0?12:i>12?i-12:i},AA:n=>n.getHours()>=12?"PM":"AM",aa:n=>n.getHours()>=12?"pm":"am",a:n=>n.getHours()>=12?"p":"a",mm:n=>bu(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>bu(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>PM(n.getMilliseconds())};function og(n,i){i=i||IM;let a=[],l=/\{([a-z]+)\}|[^{]+/gi,u;for(;u=l.exec(n);)a.push(u[0][0]=="{"?KM[u[1]]:u[0]);return f=>{let d="";for(let m=0;mn%1==0,Gf=[1,2,2.5,5],FM=$u(10,-32,0,Gf),HS=$u(10,0,32,Gf),QM=HS.filter(LS),Ga=FM.concat(HS),ug=` +`,BS="{YYYY}",x_=ug+BS,qS="{M}/{D}",Eu=ug+qS,wf=Eu+"/{YY}",VS="{aa}",JM="{h}:{mm}",eo=JM+VS,w_=ug+eo,z_=":{ss}",lt=null;function IS(n){let i=n*1e3,a=i*60,l=a*60,u=l*24,f=u*30,d=u*365,p=(n==1?$u(10,0,3,Gf).filter(LS):$u(10,-3,0,Gf)).concat([i,i*5,i*10,i*15,i*30,a,a*5,a*10,a*15,a*30,l,l*2,l*3,l*4,l*6,l*8,l*12,u,u*2,u*3,u*4,u*5,u*6,u*7,u*8,u*9,u*10,u*15,f,f*2,f*3,f*4,f*6,d,d*2,d*5,d*10,d*25,d*50,d*100]);const g=[[d,BS,lt,lt,lt,lt,lt,lt,1],[u*28,"{MMM}",x_,lt,lt,lt,lt,lt,1],[u,qS,x_,lt,lt,lt,lt,lt,1],[l,"{h}"+VS,wf,lt,Eu,lt,lt,lt,1],[a,eo,wf,lt,Eu,lt,lt,lt,1],[i,z_,wf+" "+eo,lt,Eu+" "+eo,lt,w_,lt,1],[n,z_+".{fff}",wf+" "+eo,lt,Eu+" "+eo,lt,w_,lt,1]];function b(y){return(w,O,T,A,k,L)=>{let D=[],X=k>=d,G=k>=f&&k=u?u:k,ue=Zi(T)-Zi(V),J=ae+ue+ad(V-ae,ye);D.push(J);let we=y(J),he=we.getHours()+we.getMinutes()/a+we.getSeconds()/l,Oe=k/l,fe=w.axes[O]._space,Q=L/fe;for(;J=St(J+k,n==1?0:3),!(J>A);)if(Oe>1){let W=Zi(St(he+Oe,6))%24,Se=y(J).getHours()-W;Se>1&&(Se=-1),J-=Se*l,he=(he+Oe)%24;let Be=D[D.length-1];St((J-Be)/k,3)*Q>=.7&&D.push(J)}else D.push(J)}return D}}return[p,g,b]}const[XM,WM,e4]=IS(1),[t4,n4,i4]=IS(.001);$u(2,-53,53,[1]);function T_(n,i){return n.map(a=>a.map((l,u)=>u==0||u==8||l==null?l:i(u==1||a[8]==0?l:a[1]+l)))}function E_(n,i){return(a,l,u,f,d)=>{let m=i.find(T=>d>=T[0])||i[i.length-1],p,g,b,y,w,O;return l.map(T=>{let A=n(T),k=A.getFullYear(),L=A.getMonth(),D=A.getDate(),X=A.getHours(),G=A.getMinutes(),ee=A.getSeconds(),V=k!=p&&m[2]||L!=g&&m[3]||D!=b&&m[4]||X!=y&&m[5]||G!=w&&m[6]||ee!=O&&m[7]||m[1];return p=k,g=L,b=D,y=X,w=G,O=ee,V(A)})}}function r4(n,i){let a=og(i);return(l,u,f,d,m)=>u.map(p=>a(n(p)))}function Gm(n,i,a){return new Date(n,i,a)}function O_(n,i){return i(n)}const s4="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function N_(n,i){return(a,l,u,f)=>f==null?ng:i(n(l))}function a4(n,i){let a=n.series[i];return a.width?a.stroke(n,i):a.points.width?a.points.stroke(n,i):null}function l4(n,i){return n.series[i].fill(n,i)}const o4={show:!0,live:!0,isolate:!1,mount:OM,markers:{show:!0,width:2,stroke:a4,fill:l4,dash:"solid"},idx:null,idxs:null,values:[]};function u4(n,i){let a=n.cursor.points,l=Ji(),u=a.size(n,i);Et(l,zu,u),Et(l,Tu,u);let f=u/-2;Et(l,"marginLeft",f),Et(l,"marginTop",f);let d=a.width(n,i,u);return d&&Et(l,"borderWidth",d),l}function c4(n,i){let a=n.series[i].points;return a._fill||a._stroke}function f4(n,i){let a=n.series[i].points;return a._stroke||a._fill}function d4(n,i){return n.series[i].points.size}const Ym=[0,0];function h4(n,i,a){return Ym[0]=i,Ym[1]=a,Ym}function zf(n,i,a,l=!0){return u=>{u.button==0&&(!l||u.target==i)&&a(u)}}function Fm(n,i,a,l=!0){return u=>{(!l||u.target==i)&&a(u)}}const m4={show:!0,x:!0,y:!0,lock:!1,move:h4,points:{one:!1,show:u4,size:d4,width:0,stroke:f4,fill:c4},bind:{mousedown:zf,mouseup:zf,click:zf,dblclick:zf,mousemove:Fm,mouseleave:Fm,mouseenter:Fm},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(n,i)=>{i.stopPropagation(),i.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(n,i,a,l,u)=>l-u,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},PS={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},cg=an({},PS,{filter:jS}),KS=an({},cg,{size:10}),GS=an({},PS,{show:!1}),fg='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',YS="bold "+fg,FS=1.5,A_={show:!0,scale:"x",stroke:tg,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:YS,side:2,grid:cg,ticks:KS,border:GS,font:fg,lineGap:FS,rotate:0},p4="Value",g4="Time",M_={show:!0,scale:"x",auto:!1,sorted:1,min:_t,max:-_t,idxs:[]};function v4(n,i,a,l,u){return i.map(f=>f==null?"":ag(f))}function y4(n,i,a,l,u,f,d){let m=[],p=ea.get(u)||0;a=d?a:St(ad(a,u),p);for(let g=a;g<=l;g=St(g+u,p))m.push(Object.is(g,-0)?0:g);return m}function vp(n,i,a,l,u,f,d){const m=[],p=n.scales[n.axes[i].scale].log,g=p==10?fs:NS,b=Zi(g(a));u=lo(p,b),p==10&&(u=Ga[yr(u,Ga)]);let y=a,w=u*p;p==10&&(w=Ga[yr(w,Ga)]);do m.push(y),y=y+u,p==10&&!ea.has(y)&&(y=St(y,ea.get(u))),y>=w&&(u=y,w=u*p,p==10&&(w=Ga[yr(w,Ga)]));while(y<=l);return m}function b4(n,i,a,l,u,f,d){let p=n.scales[n.axes[i].scale].asinh,g=l>p?vp(n,i,si(p,a),l,u):[p],b=l>=0&&a<=0?[0]:[];return(a<-p?vp(n,i,si(p,-l),-a,u):[p]).reverse().map(w=>-w).concat(b,g)}const QS=/./,_4=/[12357]/,S4=/[125]/,j_=/1/,yp=(n,i,a,l)=>n.map((u,f)=>i==4&&u==0||f%l==0&&a.test(u.toExponential()[u<0?1:0])?u:null);function x4(n,i,a,l,u){let f=n.axes[a],d=f.scale,m=n.scales[d],p=n.valToPos,g=f._space,b=p(10,d),y=p(9,d)-b>=g?QS:p(7,d)-b>=g?_4:p(5,d)-b>=g?S4:j_;if(y==j_){let w=mn(p(1,d)-b);if(wu,C_={show:!0,auto:!0,sorted:0,gaps:JS,alpha:1,facets:[an({},R_,{scale:"x"}),an({},R_,{scale:"y"})]},D_={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:JS,alpha:1,points:{show:E4,filter:null},values:null,min:_t,max:-_t,idxs:[],path:null,clip:null};function O4(n,i,a,l,u){return a/10}const XS={time:X3,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},N4=an({},XS,{time:!1,ori:1}),U_={};function WS(n,i){let a=U_[n];return a||(a={key:n,plots:[],sub(l){a.plots.push(l)},unsub(l){a.plots=a.plots.filter(u=>u!=l)},pub(l,u,f,d,m,p,g){for(let b=0;b{let L=d.pxRound;const D=g.dir*(g.ori==0?1:-1),X=g.ori==0?go:vo;let G,ee;D==1?(G=a,ee=l):(G=l,ee=a);let V=L(y(m[G],g,A,O)),ne=L(w(p[G],b,k,T)),ae=L(y(m[ee],g,A,O)),ye=L(w(f==1?b.max:b.min,b,k,T)),ue=new Path2D(u);return X(ue,ae,ye),X(ue,V,ye),X(ue,V,ne),ue})}function od(n,i,a,l,u,f){let d=null;if(n.length>0){d=new Path2D;const m=i==0?fd:mg;let p=a;for(let y=0;yw[0]){let O=w[0]-p;O>0&&m(d,p,l,O,l+f),p=w[1]}}let g=a+u-p,b=10;g>0&&m(d,p,l-b/2,g,l+f+b)}return d}function M4(n,i,a){let l=n[n.length-1];l&&l[0]==i?l[1]=a:n.push([i,a])}function hg(n,i,a,l,u,f,d){let m=[],p=n.length;for(let g=u==1?a:l;g>=a&&g<=l;g+=u)if(i[g]===null){let y=g,w=g;if(u==1)for(;++g<=l&&i[g]===null;)w=g;else for(;--g>=a&&i[g]===null;)w=g;let O=f(n[y]),T=w==y?O:f(n[w]),A=y-u;O=d<=0&&A>=0&&A=0&&L>=0&&L=O&&m.push([O,T])}return m}function Z_(n){return n==0?MS:n==1?dn:i=>Ka(i,n)}function ex(n){let i=n==0?ud:cd,a=n==0?(u,f,d,m,p,g)=>{u.arcTo(f,d,m,p,g)}:(u,f,d,m,p,g)=>{u.arcTo(d,f,p,m,g)},l=n==0?(u,f,d,m,p)=>{u.rect(f,d,m,p)}:(u,f,d,m,p)=>{u.rect(d,f,p,m)};return(u,f,d,m,p,g=0,b=0)=>{g==0&&b==0?l(u,f,d,m,p):(g=br(g,m/2,p/2),b=br(b,m/2,p/2),i(u,f+g,d),a(u,f+m,d,f+m,d+p,g),a(u,f+m,d+p,f,d+p,b),a(u,f,d+p,f,d,b),a(u,f,d,f+m,d,g),u.closePath())}}const ud=(n,i,a)=>{n.moveTo(i,a)},cd=(n,i,a)=>{n.moveTo(a,i)},go=(n,i,a)=>{n.lineTo(i,a)},vo=(n,i,a)=>{n.lineTo(a,i)},fd=ex(0),mg=ex(1),tx=(n,i,a,l,u,f)=>{n.arc(i,a,l,u,f)},nx=(n,i,a,l,u,f)=>{n.arc(a,i,l,u,f)},ix=(n,i,a,l,u,f,d)=>{n.bezierCurveTo(i,a,l,u,f,d)},rx=(n,i,a,l,u,f,d)=>{n.bezierCurveTo(a,i,u,l,d,f)};function sx(n){return(i,a,l,u,f)=>nl(i,a,(d,m,p,g,b,y,w,O,T,A,k)=>{let{pxRound:L,points:D}=d,X,G;g.ori==0?(X=ud,G=tx):(X=cd,G=nx);const ee=St(D.width*rt,3);let V=(D.size-D.width)/2*rt,ne=St(V*2,3),ae=new Path2D,ye=new Path2D,{left:ue,top:J,width:we,height:he}=i.bbox;fd(ye,ue-ne,J-ne,we+ne*2,he+ne*2);const Oe=fe=>{if(p[fe]!=null){let Q=L(y(m[fe],g,A,O)),W=L(w(p[fe],b,k,T));X(ae,Q+V,W),G(ae,Q,W,V,0,kf*2)}};if(f)f.forEach(Oe);else for(let fe=l;fe<=u;fe++)Oe(fe);return{stroke:ee>0?ae:null,fill:ae,clip:ye,flags:co|bp}})}function ax(n){return(i,a,l,u,f,d)=>{l!=u&&(f!=l&&d!=l&&n(i,a,l),f!=u&&d!=u&&n(i,a,u),n(i,a,d))}}const j4=ax(go),k4=ax(vo);function lx(n){const i=et(n?.alignGaps,0);return(a,l,u,f)=>nl(a,l,(d,m,p,g,b,y,w,O,T,A,k)=>{[u,f]=rd(p,u,f);let L=d.pxRound,D=he=>L(y(he,g,A,O)),X=he=>L(w(he,b,k,T)),G,ee;g.ori==0?(G=go,ee=j4):(G=vo,ee=k4);const V=g.dir*(g.ori==0?1:-1),ne={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:co},ae=ne.stroke;let ye=!1;if(f-u>=A*4){let he=be=>a.posToVal(be,g.key,!0),Oe=null,fe=null,Q,W,xe,Me=D(m[V==1?u:f]),Se=D(m[u]),Be=D(m[f]),Re=he(V==1?Se+1:Be-1);for(let be=V==1?u:f;be>=u&&be<=f;be+=V){let M=m[be],le=(V==1?MRe)?Me:D(M),re=p[be];le==Me?re!=null?(W=re,Oe==null?(G(ae,le,X(W)),Q=Oe=fe=W):Wfe&&(fe=W)):re===null&&(ye=!0):(Oe!=null&&ee(ae,Me,X(Oe),X(fe),X(Q),X(W)),re!=null?(W=re,G(ae,le,X(W)),Oe=fe=Q=W):(Oe=fe=null,re===null&&(ye=!0)),Me=le,Re=he(Me+V))}Oe!=null&&Oe!=fe&&xe!=Me&&ee(ae,Me,X(Oe),X(fe),X(Q),X(W))}else for(let he=V==1?u:f;he>=u&&he<=f;he+=V){let Oe=p[he];Oe===null?ye=!0:Oe!=null&&G(ae,D(m[he]),X(Oe))}let[J,we]=dg(a,l);if(d.fill!=null||J!=0){let he=ne.fill=new Path2D(ae),Oe=d.fillTo(a,l,d.min,d.max,J),fe=X(Oe),Q=D(m[u]),W=D(m[f]);V==-1&&([W,Q]=[Q,W]),G(he,W,fe),G(he,Q,fe)}if(!d.spanGaps){let he=[];ye&&he.push(...hg(m,p,u,f,V,D,i)),ne.gaps=he=d.gaps(a,l,u,f,he),ne.clip=od(he,g.ori,O,T,A,k)}return we!=0&&(ne.band=we==2?[ds(a,l,u,f,ae,-1),ds(a,l,u,f,ae,1)]:ds(a,l,u,f,ae,we)),ne})}function R4(n){const i=et(n.align,1),a=et(n.ascDesc,!1),l=et(n.alignGaps,0),u=et(n.extend,!1);return(f,d,m,p)=>nl(f,d,(g,b,y,w,O,T,A,k,L,D,X)=>{[m,p]=rd(y,m,p);let G=g.pxRound,{left:ee,width:V}=f.bbox,ne=Se=>G(T(Se,w,D,k)),ae=Se=>G(A(Se,O,X,L)),ye=w.ori==0?go:vo;const ue={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:co},J=ue.stroke,we=w.dir*(w.ori==0?1:-1);let he=ae(y[we==1?m:p]),Oe=ne(b[we==1?m:p]),fe=Oe,Q=Oe;u&&i==-1&&(Q=ee,ye(J,Q,he)),ye(J,Oe,he);for(let Se=we==1?m:p;Se>=m&&Se<=p;Se+=we){let Be=y[Se];if(Be==null)continue;let Re=ne(b[Se]),be=ae(Be);i==1?ye(J,Re,he):ye(J,fe,be),ye(J,Re,be),he=be,fe=Re}let W=fe;u&&i==1&&(W=ee+V,ye(J,W,he));let[xe,Me]=dg(f,d);if(g.fill!=null||xe!=0){let Se=ue.fill=new Path2D(J),Be=g.fillTo(f,d,g.min,g.max,xe),Re=ae(Be);ye(Se,W,Re),ye(Se,Q,Re)}if(!g.spanGaps){let Se=[];Se.push(...hg(b,y,m,p,we,ne,l));let Be=g.width*rt/2,Re=a||i==1?Be:-Be,be=a||i==-1?-Be:Be;Se.forEach(M=>{M[0]+=Re,M[1]+=be}),ue.gaps=Se=g.gaps(f,d,m,p,Se),ue.clip=od(Se,w.ori,k,L,D,X)}return Me!=0&&(ue.band=Me==2?[ds(f,d,m,p,J,-1),ds(f,d,m,p,J,1)]:ds(f,d,m,p,J,Me)),ue})}function $_(n,i,a,l,u,f,d=_t){if(n.length>1){let m=null;for(let p=0,g=1/0;p{}),{fill:y,stroke:w}=g;return(O,T,A,k)=>nl(O,T,(L,D,X,G,ee,V,ne,ae,ye,ue,J)=>{let we=L.pxRound,he=a,Oe=l*rt,fe=m*rt,Q=p*rt,W,xe;G.ori==0?[W,xe]=f(O,T):[xe,W]=f(O,T);const Me=G.dir*(G.ori==0?1:-1);let Se=G.ori==0?fd:mg,Be=G.ori==0?b:(me,nt,Zt,qr,Zn,li,nr)=>{b(me,nt,Zt,Zn,qr,nr,li)},Re=et(O.bands,lg).find(me=>me.series[0]==T),be=Re!=null?Re.dir:0,M=L.fillTo(O,T,L.min,L.max,be),F=we(ne(M,ee,J,ye)),le,re,$e,Ue=ue,Ae=we(L.width*rt),pe=!1,Ne=null,Bt=null,Li=null,bi=null;y!=null&&(Ae==0||w!=null)&&(pe=!0,Ne=y.values(O,T,A,k),Bt=new Map,new Set(Ne).forEach(me=>{me!=null&&Bt.set(me,new Path2D)}),Ae>0&&(Li=w.values(O,T,A,k),bi=new Map,new Set(Li).forEach(me=>{me!=null&&bi.set(me,new Path2D)})));let{x0:En,size:Ut}=g;if(En!=null&&Ut!=null){he=1,D=En.values(O,T,A,k),En.unit==2&&(D=D.map(Zt=>O.posToVal(ae+Zt*ue,G.key,!0)));)DELIM" +R"DELIM(let me=Ut.values(O,T,A,k);Ut.unit==2?re=me[0]*ue:re=V(me[0],G,ue,ae)-V(0,G,ue,ae),Ue=$_(D,X,V,G,ue,ae,Ue),$e=Ue-re+Oe}else Ue=$_(D,X,V,G,ue,ae,Ue),$e=Ue*d+Oe,re=Ue-$e;$e<1&&($e=0),Ae>=re/2&&(Ae=0),$e<5&&(we=MS);let tt=$e>0,gn=Ue-$e-(tt?Ae:0);re=we(gp(gn,Q,fe)),le=(he==0?re/2:he==Me?0:re)-he*Me*((he==0?Oe/2:0)+(tt?Ae/2:0));const Gt={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},In=pe?null:new Path2D;let ai=null;if(Re!=null)ai=O.data[Re.series[1]];else{let{y0:me,y1:nt}=g;me!=null&&nt!=null&&(X=nt.values(O,T,A,k),ai=me.values(O,T,A,k))}let Hi=W*re,Ce=xe*re;for(let me=Me==1?A:k;me>=A&&me<=k;me+=Me){let nt=X[me];if(nt==null)continue;if(ai!=null){let vn=ai[me]??0;if(nt-vn==0)continue;F=ne(vn,ee,J,ye)}let Zt=G.distr!=2||g!=null?D[me]:me,qr=V(Zt,G,ue,ae),Zn=ne(et(nt,M),ee,J,ye),li=we(qr-le),nr=we(si(Zn,F)),Pn=we(br(Zn,F)),Kn=nr-Pn;if(nt!=null){let vn=nt<0?Ce:Hi,Gn=nt<0?Hi:Ce;pe?(Ae>0&&Li[me]!=null&&Se(bi.get(Li[me]),li,Pn+Zi(Ae/2),re,si(0,Kn-Ae),vn,Gn),Ne[me]!=null&&Se(Bt.get(Ne[me]),li,Pn+Zi(Ae/2),re,si(0,Kn-Ae),vn,Gn)):Se(In,li,Pn+Zi(Ae/2),re,si(0,Kn-Ae),vn,Gn),Be(O,T,me,li-Ae/2,Pn,re+Ae,Kn)}}return Ae>0?Gt.stroke=pe?bi:In:pe||(Gt._fill=L.width==0?L._fill:L._stroke??L._fill,Gt.width=0),Gt.fill=pe?Bt:In,Gt})}function D4(n,i){const a=et(i?.alignGaps,0);return(l,u,f,d)=>nl(l,u,(m,p,g,b,y,w,O,T,A,k,L)=>{[f,d]=rd(g,f,d);let D=m.pxRound,X=W=>D(w(W,b,k,T)),G=W=>D(O(W,y,L,A)),ee,V,ne;b.ori==0?(ee=ud,ne=go,V=ix):(ee=cd,ne=vo,V=rx);const ae=b.dir*(b.ori==0?1:-1);let ye=X(p[ae==1?f:d]),ue=ye,J=[],we=[];for(let W=ae==1?f:d;W>=f&&W<=d;W+=ae)if(g[W]!=null){let Me=p[W],Se=X(Me);J.push(ue=Se),we.push(G(g[W]))}const he={stroke:n(J,we,ee,ne,V,D),fill:null,clip:null,band:null,gaps:null,flags:co},Oe=he.stroke;let[fe,Q]=dg(l,u);if(m.fill!=null||fe!=0){let W=he.fill=new Path2D(Oe),xe=m.fillTo(l,u,m.min,m.max,fe),Me=G(xe);ne(W,ue,Me),ne(W,ye,Me)}if(!m.spanGaps){let W=[];W.push(...hg(p,g,f,d,ae,X,a)),he.gaps=W=m.gaps(l,u,f,d,W),he.clip=od(W,b.ori,T,A,k,L)}return Q!=0&&(he.band=Q==2?[ds(l,u,f,d,Oe,-1),ds(l,u,f,d,Oe,1)]:ds(l,u,f,d,Oe,Q)),he})}function U4(n){return D4(Z4,n)}function Z4(n,i,a,l,u,f){const d=n.length;if(d<2)return null;const m=new Path2D;if(a(m,n[0],i[0]),d==2)l(m,n[1],i[1]);else{let p=Array(d),g=Array(d-1),b=Array(d-1),y=Array(d-1);for(let w=0;w0!=g[w]>0?p[w]=0:(p[w]=3*(y[w-1]+y[w])/((2*y[w]+y[w-1])/g[w-1]+(y[w]+2*y[w-1])/g[w]),isFinite(p[w])||(p[w]=0));p[d-1]=g[d-2];for(let w=0;w{on.pxRatio=rt}));const $4=lx(),L4=sx();function H_(n,i,a,l){return(l?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((f,d)=>Sp(f,d,i,a))}function H4(n,i){return n.map((a,l)=>l==0?{}:an({},i,a))}function Sp(n,i,a,l){return an({},i==0?a:l,n)}function ox(n,i,a){return i==null?oo:[i,a]}const B4=ox;function q4(n,i,a){return i==null?oo:Kf(i,a,sg,!0)}function ux(n,i,a,l){return i==null?oo:sd(i,a,n.scales[l].log,!1)}const V4=ux;function cx(n,i,a,l){return i==null?oo:rg(i,a,n.scales[l].log,!1)}const I4=cx;function P4(n,i,a,l,u){let f=si(y_(n),y_(i)),d=i-n,m=yr(u/l*d,a);do{let p=a[m],g=l*p/d;if(g>=u&&f+(p<5?ea.get(p):0)<=17)return[p,g]}while(++m(i=dn((a=+u)*rt))+"px"),[n,i,a]}function K4(n){n.show&&[n.font,n.labelFont].forEach(i=>{let a=St(i[2]*rt,1);i[0]=i[0].replace(/[0-9.]+px/,a+"px"),i[1]=a})}function on(n,i,a){const l={mode:et(n.mode,1)},u=l.mode;function f(v,S,z,E){let R=S.valToPct(v);return E+z*(S.dir==-1?1-R:R)}function d(v,S,z,E){let R=S.valToPct(v);return E+z*(S.dir==-1?R:1-R)}function m(v,S,z,E){return S.ori==0?f(v,S,z,E):d(v,S,z,E)}l.valToPosH=f,l.valToPosV=d;let p=!1;l.status=0;const g=l.root=Ji(W3);if(n.id!=null&&(g.id=n.id),Ci(g,n.class),n.title){let v=Ji(nM,g);v.textContent=n.title}const b=vr("canvas"),y=l.ctx=b.getContext("2d"),w=Ji(iM,g);Xa("click",w,v=>{v.target===T&&(vt!=_s||xt!=Qr)&&ht.click(l,v)},!0);const O=l.under=Ji(rM,w);w.appendChild(b);const T=l.over=Ji(sM,w);n=uo(n);const A=+et(n.pxAlign,1),k=Z_(A);(n.plugins||[]).forEach(v=>{v.opts&&(n=v.opts(l,n)||n)});const L=n.ms||.001,D=l.series=u==1?H_(n.series||[],M_,D_,!1):H4(n.series||[null],C_),X=l.axes=H_(n.axes||[],A_,k_,!0),G=l.scales={},ee=l.bands=n.bands||[];ee.forEach(v=>{v.fill=Qe(v.fill||null),v.dir=et(v.dir,-1)});const V=u==2?D[1].facets[0].scale:D[0].scale,ne={axes:dl,series:Iu},ae=(n.drawOrder||["axes","series"]).map(v=>ne[v]);function ye(v){const S=v.distr==3?z=>fs(z>0?z:v.clamp(l,z,v.min,v.max,v.key)):v.distr==4?z=>Km(z,v.asinh):v.distr==100?z=>v.fwd(z):z=>z;return z=>{let E=S(z),{_min:R,_max:H}=v,P=H-R;return(E-R)/P}}function ue(v){let S=G[v];if(S==null){let z=(n.scales||ku)[v]||ku;if(z.from!=null){ue(z.from);let E=an({},G[z.from],z,{key:v});E.valToPct=ye(E),G[v]=E}else{S=G[v]=an({},v==V?XS:N4,z),S.key=v;let E=S.time,R=S.range,H=Ys(R);if((v!=V||u==2&&!E)&&(H&&(R[0]==null||R[1]==null)&&(R={min:R[0]==null?p_:{mode:1,hard:R[0],soft:R[0]},max:R[1]==null?p_:{mode:1,hard:R[1],soft:R[1]}},H=!1),!H&&ld(R))){let P=R;R=(te,ie,ce)=>ie==null?oo:Kf(ie,ce,P)}S.range=Qe(R||(E?B4:v==V?S.distr==3?V4:S.distr==4?I4:ox:S.distr==3?ux:S.distr==4?cx:q4)),S.auto=Qe(H?!1:S.auto),S.clamp=Qe(S.clamp||O4),S._min=S._max=null,S.valToPct=ye(S)}}}ue("x"),ue("y"),u==1&&D.forEach(v=>{ue(v.scale)}),X.forEach(v=>{ue(v.scale)});for(let v in n.scales)ue(v);const J=G[V],we=J.distr;let he,Oe;J.ori==0?(Ci(g,eM),he=f,Oe=d):(Ci(g,tM),he=d,Oe=f);const fe={};for(let v in G){let S=G[v];(S.min!=null||S.max!=null)&&(fe[v]={min:S.min,max:S.max},S.min=S.max=null)}const Q=n.tzDate||(v=>new Date(dn(v/L))),W=n.fmtDate||og,xe=L==1?e4(Q):i4(Q),Me=E_(Q,T_(L==1?WM:n4,W)),Se=N_(Q,O_(s4,W)),Be=[],Re=l.legend=an({},o4,n.legend),be=l.cursor=an({},m4,{drag:{y:u==2}},n.cursor),M=Re.show,F=be.show,le=Re.markers;Re.idxs=Be,le.width=Qe(le.width),le.dash=Qe(le.dash),le.stroke=Qe(le.stroke),le.fill=Qe(le.fill);let re,$e,Ue,Ae=[],pe=[],Ne,Bt=!1,Li={};if(Re.live){const v=D[1]?D[1].values:null;Bt=v!=null,Ne=Bt?v(l,1,0):{_:0};for(let S in Ne)Li[S]=ng}if(M)if(re=vr("table",fM,g),Ue=vr("tbody",null,re),Re.mount(l,re),Bt){$e=vr("thead",null,re,Ue);let v=vr("tr",null,$e);vr("th",null,v);for(var bi in Ne)vr("th",n_,v).textContent=bi}else Ci(re,hM),Re.live&&Ci(re,dM);const En={show:!0},Ut={show:!1};function tt(v,S){if(S==0&&(Bt||!Re.live||u==2))return oo;let z=[],E=vr("tr",mM,Ue,Ue.childNodes[S]);Ci(E,v.class),v.show||Ci(E,Ya);let R=vr("th",null,E);if(le.show){let te=Ji(pM,R);if(S>0){let ie=le.width(l,S);ie&&(te.style.border=ie+"px "+le.dash(l,S)+" "+le.stroke(l,S)),te.style.background=le.fill(l,S)}}let H=Ji(n_,R);v.label instanceof HTMLElement?H.appendChild(v.label):H.textContent=v.label,S>0&&(le.show||(H.style.color=v.width>0?le.stroke(l,S):le.fill(l,S)),Gt("click",R,te=>{if(be._lock)return;Ft(te);let ie=D.indexOf(v);if((te.ctrlKey||te.metaKey)!=Re.isolate){let ce=D.some((de,ge)=>ge>0&&ge!=ie&&de.show);D.forEach((de,ge)=>{ge>0&&Ln(ge,ce?ge==ie?En:Ut:En,!0,$t.setSeries)})}else Ln(ie,{show:!v.show},!0,$t.setSeries)},!1),ps&&Gt(a_,R,te=>{be._lock||(Ft(te),Ln(D.indexOf(v),lr,!0,$t.setSeries))},!1));for(var P in Ne){let te=vr("td",gM,E);te.textContent="--",z.push(te)}return[E,z]}const gn=new Map;function Gt(v,S,z,E=!0){const R=gn.get(S)||{},H=be.bind[v](l,S,z,E);H&&(Xa(v,S,R[v]=H),gn.set(S,R))}function In(v,S,z){const E=gn.get(S)||{};for(let R in E)(v==null||R==v)&&(pp(R,S,E[R]),delete E[R]);v==null&&gn.delete(S)}let ai=0,Hi=0,Ce=0,me=0,nt=0,Zt=0,qr=nt,Zn=Zt,li=Ce,nr=me,Pn=0,Kn=0,vn=0,Gn=0;l.bbox={};let ia=!1,il=!1,ms=!1,Yt=!1,rl=!1,Yn=!1;function sl(v,S,z){(z||v!=l.width||S!=l.height)&&ra(v,S),$n(!1),ms=!0,il=!0,Gr()}function ra(v,S){l.width=ai=Ce=v,l.height=Hi=me=S,nt=Zt=0,md(),sa();let z=l.bbox;Pn=z.left=Ka(nt*rt,.5),Kn=z.top=Ka(Zt*rt,.5),vn=z.width=Ka(Ce*rt)DELIM" +R"DELIM(,.5),Gn=z.height=Ka(me*rt,.5)}const dd=3;function Vu(){let v=!1,S=0;for(;!v;){S++;let z=Pu(S),E=fl(S);v=S==dd||z&&E,v||(ra(l.width,l.height),il=!0)}}function hd({width:v,height:S}){sl(v,S)}l.setSize=hd;function md(){let v=!1,S=!1,z=!1,E=!1;X.forEach((R,H)=>{if(R.show&&R._show){let{side:P,_size:te}=R,ie=P%2,ce=R.label!=null?R.labelSize:0,de=te+ce;de>0&&(ie?(Ce-=de,P==3?(nt+=de,E=!0):z=!0):(me-=de,P==0?(Zt+=de,v=!0):S=!0))}}),xr[0]=v,xr[1]=z,xr[2]=S,xr[3]=E,Ce-=ui[1]+ui[3],nt+=ui[3],me-=ui[2]+ui[0],Zt+=ui[0]}function sa(){let v=nt+Ce,S=Zt+me,z=nt,E=Zt;function R(H,P){switch(H){case 1:return v+=P,v-P;case 2:return S+=P,S-P;case 3:return z-=P,z+P;case 0:return E-=P,E+P}}X.forEach((H,P)=>{if(H.show&&H._show){let te=H.side;H._pos=R(te,H._size),H.label!=null&&(H._lpos=R(te,H.labelSize))}})}if(be.dataIdx==null){let v=be.hover,S=v.skip=new Set(v.skip??[]);S.add(void 0);let z=v.prox=Qe(v.prox),E=v.bias??=0;be.dataIdx=(R,H,P,te)=>{if(H==0)return P;let ie=P,ce=z(R,H,P,te)??_t,de=ce>=0&&ce<_t,ge=J.ori==0?Ce:me,De=be.left,Ie=i[0],Je=i[H];if(S.has(Je[P])){ie=null;let qe=null,je=null,ze;if(E==0||E==-1)for(ze=P;qe==null&&ze-- >0;)S.has(Je[ze])||(qe=ze);if(E==0||E==1)for(ze=P;je==null&&ze++ce&&(ie=null);return ie}}const Ft=v=>{be.event=v};be.idxs=Be,be._lock=!1;let Tt=be.points;Tt.show=Qe(Tt.show),Tt.size=Qe(Tt.size),Tt.stroke=Qe(Tt.stroke),Tt.width=Qe(Tt.width),Tt.fill=Qe(Tt.fill);const Nt=l.focus=an({},n.focus||{alpha:.3},be.focus),ps=Nt.prox>=0,gs=ps&&Tt.one;let oi=[],ir=[],rr=[];function aa(v,S){let z=Tt.show(l,S);if(z instanceof HTMLElement)return Ci(z,cM),Ci(z,v.class),Lr(z,-10,-10,Ce,me),T.insertBefore(z,oi[S]),z}function Sr(v,S){if(u==1||S>0){let z=u==1&&G[v.scale].time,E=v.value;v.value=z?S_(E)?N_(Q,O_(E,W)):E||Se:E||z4,v.label=v.label||(z?g4:p4)}if(gs||S>0){v.width=v.width==null?1:v.width,v.paths=v.paths||$4||NM,v.fillTo=Qe(v.fillTo||A4),v.pxAlign=+et(v.pxAlign,A),v.pxRound=Z_(v.pxAlign),v.stroke=Qe(v.stroke||null),v.fill=Qe(v.fill||null),v._stroke=v._fill=v._paths=v._focus=null;let z=T4(si(1,v.width),1),E=v.points=an({},{size:z,width:si(1,z*.2),stroke:v.stroke,space:z*2,paths:L4,_stroke:null,_fill:null},v.points);E.show=Qe(E.show),E.filter=Qe(E.filter),E.fill=Qe(E.fill),E.stroke=Qe(E.stroke),E.paths=Qe(E.paths),E.pxAlign=v.pxAlign}if(M){let z=tt(v,S);Ae.splice(S,0,z[0]),pe.splice(S,0,z[1]),Re.values.push(null)}if(F){Be.splice(S,0,null);let z=null;gs?S==0&&(z=aa(v,S)):S>0&&(z=aa(v,S)),oi.splice(S,0,z),ir.splice(S,0,0),rr.splice(S,0,0)}en("addSeries",S)}function al(v,S){S=S??D.length,v=u==1?Sp(v,S,M_,D_):Sp(v,S,{},C_),D.splice(S,0,v),Sr(D[S],S)}l.addSeries=al;function la(v){if(D.splice(v,1),M){Re.values.splice(v,1),pe.splice(v,1);let S=Ae.splice(v,1)[0];In(null,S.firstChild),S.remove()}F&&(Be.splice(v,1),oi.splice(v,1)[0].remove(),ir.splice(v,1),rr.splice(v,1)),en("delSeries",v)}l.delSeries=la;const xr=[!1,!1,!1,!1];function pd(v,S){if(v._show=v.show,v.show){let z=v.side%2,E=G[v.scale];E==null&&(v.scale=z?D[1].scale:V,E=G[v.scale]);let R=E.time;v.size=Qe(v.size),v.space=Qe(v.space),v.rotate=Qe(v.rotate),Ys(v.incrs)&&v.incrs.forEach(P=>{!ea.has(P)&&ea.set(P,RS(P))}),v.incrs=Qe(v.incrs||(E.distr==2?QM:R?L==1?XM:t4:Ga)),v.splits=Qe(v.splits||(R&&E.distr==1?xe:E.distr==3?vp:E.distr==4?b4:y4)),v.stroke=Qe(v.stroke),v.grid.stroke=Qe(v.grid.stroke),v.ticks.stroke=Qe(v.ticks.stroke),v.border.stroke=Qe(v.border.stroke);let H=v.values;v.values=Ys(H)&&!Ys(H[0])?Qe(H):R?Ys(H)?E_(Q,T_(H,W)):S_(H)?r4(Q,H):H||Me:H||v4,v.filter=Qe(v.filter||(E.distr>=3&&E.log==10?x4:E.distr==3&&E.log==2?w4:jS)),v.font=B_(v.font),v.labelFont=B_(v.labelFont),v._size=v.size(l,null,S,0),v._space=v._rotate=v._incrs=v._found=v._splits=v._values=null,v._size>0&&(xr[S]=!0,v._el=Ji(aM,w))}}function vs(v,S,z,E){let[R,H,P,te]=z,ie=S%2,ce=0;return ie==0&&(te||H)&&(ce=S==0&&!R||S==2&&!P?dn(A_.size/3):0),ie==1&&(R||P)&&(ce=S==1&&!H||S==3&&!te?dn(k_.size/2):0),ce}const ll=l.padding=(n.padding||[vs,vs,vs,vs]).map(v=>Qe(et(v,vs))),ui=l._padding=ll.map((v,S)=>v(l,S,xr,0));let un,Qt=null,Jt=null;const oa=u==1?D[0].idxs:null;let Fn=null,Vr=!1;function yo(v,S){if(i=v??[],l.data=l._data=i,u==2){un=0;for(let z=1;z=0,Yn=!0,Gr()}}l.setData=yo;function ol(){Vr=!0;let v,S;u==1&&(un>0?(Qt=oa[0]=0,Jt=oa[1]=un-1,v=i[0][Qt],S=i[0][Jt],we==2?(v=Qt,S=Jt):v==S&&(we==3?[v,S]=sd(v,v,J.log,!1):we==4?[v,S]=rg(v,v,J.log,!1):J.time?S=v+dn(86400/L):[v,S]=Kf(v,S,sg,!0))):(Qt=oa[0]=v=null,Jt=oa[1]=S=null)),sr(V,v,S)}let ci,At,yn,wr,ul,bo,_o,cl,Ir,cn;function ua(v,S,z,E,R,H){v??=r_,z??=lg,E??="butt",R??=r_,H??="round",v!=ci&&(y.strokeStyle=ci=v),R!=At&&(y.fillStyle=At=R),S!=yn&&(y.lineWidth=yn=S),H!=ul&&(y.lineJoin=ul=H),E!=bo&&(y.lineCap=bo=E),z!=wr&&y.setLineDash(wr=z)}function zr(v,S,z,E){S!=At&&(y.fillStyle=At=S),v!=_o&&(y.font=_o=v),z!=cl&&(y.textAlign=cl=z),E!=Ir&&(y.textBaseline=Ir=E)}function Tr(v,S,z,E,R=0){if(E.length>0&&v.auto(l,Vr)&&(S==null||S.min==null)){let H=et(Qt,0),P=et(Jt,E.length-1),te=z.min==null?xM(E,H,P,R,v.distr==3):[z.min,z.max];v.min=br(v.min,z.min=te[0]),v.max=si(v.max,z.max=te[1])}}const ys={min:null,max:null};function bs(){for(let E in G){let R=G[E];fe[E]==null&&(R.min==null||fe[V]!=null&&R.auto(l,Vr))&&(fe[E]=ys)}for(let E in G){let R=G[E];fe[E]==null&&R.from!=null&&fe[R.from]!=null&&(fe[E]=ys)}fe[V]!=null&&$n(!0);let v={};for(let E in fe){let R=fe[E];if(R!=null){let H=v[E]=uo(G[E],jM);if(R.min!=null)an(H,R);else if(E!=V||u==2)if(un==0&&H.from==null){let P=H.range(l,null,null,E);H.min=P[0],H.max=P[1]}else H.min=_t,H.max=-_t}}if(un>0){D.forEach((E,R)=>{if(u==1){let H=E.scale,P=fe[H];if(P==null)return;let te=v[H];if(R==0){let ie=te.range(l,te.min,te.max,H);te.min=ie[0],te.max=ie[1],Qt=yr(te.min,i[0]),Jt=yr(te.max,i[0]),Jt-Qt>1&&(i[0][Qt]te.max&&Jt--),E.min=Fn[Qt],E.max=Fn[Jt]}else E.show&&E.auto&&Tr(te,P,E,i[R],E.sorted);E.idxs[0]=Qt,E.idxs[1]=Jt}else if(R>0&&E.show&&E.auto){let[H,P]=E.facets,te=H.scale,ie=P.scale,[ce,de]=i[R],ge=v[te],De=v[ie];ge!=null&&Tr(ge,fe[te],H,ce,H.sorted),De!=null&&Tr(De,fe[ie],P,de,P.sorted),E.min=P.min,E.max=P.max}});for(let E in v){let R=v[E],H=fe[E];if(R.from==null&&(H==null||H.min==null)){let P=R.range(l,R.min==_t?null:R.min,R.max==-_t?null:R.max,E);R.min=P[0],R.max=P[1]}}}for(let E in v){let R=v[E];if(R.from!=null){let H=v[R.from];if(H.min==null)R.min=R.max=null;else{let P=R.range(l,H.min,H.max,E);R.min=P[0],R.max=P[1]}}}let S={},z=!1;for(let E in v){let R=v[E],H=G[E];if(H.min!=R.min||H.max!=R.max){H.min=R.min,H.max=R.max;let P=H.distr;H._min=P==3?fs(H.min):P==4?Km(H.min,H.asinh):P==100?H.fwd(H.min):H.min,H._max=P==3?fs(H.max):P==4?Km(H.max,H.asinh):P==100?H.fwd(H.max):H.max,S[E]=z=!0}}if(z){D.forEach((E,R)=>{u==2?R>0&&S.y&&(E._paths=null):S[E.scale]&&(E._paths=null)});for(let E in S)ms=!0,en("setScale",E);F&&be.left>=0&&(Yt=Yn=!0)}for(let E in fe)fe[E]=null}function Wt(v){let S=gp(Qt-1,0,un-1),z=gp(Jt+1,0,un-1);for(;v[S]==null&&S>0;)S--;for(;v[z]==null&&z0){let v=D.some(S=>S._focus)&&cn!=Nt.alpha;v&&(y.globalAlpha=cn=Nt.alpha),D.forEach((S,z)=>{if(z>0&&S.show&&(So(z,!1),So(z,!0),S._paths==null)){let E=cn;cn!=S.alpha&&(y.globalAlpha=cn=S.alpha);let R=u==2?[0,i[z][0].length-1]:Wt(i[z]);S._paths=S.paths(l,z,R[0],R[1]),cn!=E&&(y.globalAlpha=cn=E)}}),D.forEach((S,z)=>{if(z>0&&S.show){let E=cn;cn!=S.alpha&&(y.globalAlpha=cn=S.alpha),S._paths!=null&&xo(z,!1);{let R=S._paths!=null?S._paths.gaps:null,H=S.points.show(l,z,Qt,Jt,R),P=S.points.filter(l,z,H,R);(H)DELIM" +R"DELIM(||P)&&(S.points._paths=S.points.paths(l,z,Qt,Jt,P),xo(z,!0))}cn!=E&&(y.globalAlpha=cn=E),en("drawSeries",z)}}),v&&(y.globalAlpha=cn=1)}}function So(v,S){let z=S?D[v].points:D[v];z._stroke=z.stroke(l,v),z._fill=z.fill(l,v)}function xo(v,S){let z=S?D[v].points:D[v],{stroke:E,fill:R,clip:H,flags:P,_stroke:te=z._stroke,_fill:ie=z._fill,_width:ce=z.width}=z._paths;ce=St(ce*rt,3);let de=null,ge=ce%2/2;S&&ie==null&&(ie=ce>0?"#fff":te);let De=z.pxAlign==1&&ge>0;if(De&&y.translate(ge,ge),!S){let Ie=Pn-ce/2,Je=Kn-ce/2,qe=vn+ce,je=Gn+ce;de=new Path2D,de.rect(Ie,Je,qe,je)}S?wo(te,ce,z.dash,z.cap,ie,E,R,P,H):Pr(v,te,ce,z.dash,z.cap,ie,E,R,P,de,H),De&&y.translate(-ge,-ge)}function Pr(v,S,z,E,R,H,P,te,ie,ce,de){let ge=!1;ie!=0&&ee.forEach((De,Ie)=>{if(De.series[0]==v){let Je=D[De.series[1]],qe=i[De.series[1]],je=(Je._paths||ku).band;Ys(je)&&(je=De.dir==1?je[0]:je[1]);let ze,mt=null;Je.show&&je&&zM(qe,Qt,Jt)?(mt=De.fill(l,Ie)||H,ze=Je._paths.clip):je=null,wo(S,z,E,R,mt,P,te,ie,ce,de,ze,je),ge=!0}}),ge||wo(S,z,E,R,H,P,te,ie,ce,de)}const Kr=co|bp;function wo(v,S,z,E,R,H,P,te,ie,ce,de,ge){ua(v,S,z,E,R),(ie||ce||ge)&&(y.save(),ie&&y.clip(ie),ce&&y.clip(ce)),ge?(te&Kr)==Kr?(y.clip(ge),de&&y.clip(de),fa(R,P),ca(v,H,S)):te&bp?(fa(R,P),y.clip(ge),ca(v,H,S)):te&co&&(y.save(),y.clip(ge),de&&y.clip(de),fa(R,P),y.restore(),ca(v,H,S)):(fa(R,P),ca(v,H,S)),(ie||ce||ge)&&y.restore()}function ca(v,S,z){z>0&&(S instanceof Map?S.forEach((E,R)=>{y.strokeStyle=ci=R,y.stroke(E)}):S!=null&&v&&y.stroke(S))}function fa(v,S){S instanceof Map?S.forEach((z,E)=>{y.fillStyle=At=E,y.fill(z)}):S!=null&&v&&y.fill(S)}function gd(v,S,z,E){let R=X[v],H;if(E<=0)H=[0,0];else{let P=R._space=R.space(l,v,S,z,E),te=R._incrs=R.incrs(l,v,S,z,E,P);H=P4(S,z,te,E,P)}return R._found=H}function Ge(v,S,z,E,R,H,P,te,ie,ce){let de=P%2/2;A==1&&y.translate(de,de),ua(te,P,ie,ce,te),y.beginPath();let ge,De,Ie,Je,qe=R+(E==0||E==3?-H:H);z==0?(De=R,Je=qe):(ge=R,Ie=qe);for(let je=0;je{if(!z.show)return;let R=G[z.scale];if(R.min==null){z._show&&(S=!1,z._show=!1,$n(!1));return}else z._show||(S=!1,z._show=!0,$n(!1));let H=z.side,P=H%2,{min:te,max:ie}=R,[ce,de]=gd(E,te,ie,P==0?Ce:me);if(de==0)return;let ge=R.distr==2,De=z._splits=z.splits(l,E,te,ie,ce,de,ge),Ie=R.distr==2?De.map(ze=>Fn[ze]):De,Je=R.distr==2?Fn[De[1]]-Fn[De[0]]:ce,qe=z._values=z.values(l,z.filter(l,Ie,E,de,Je),E,de,Je);z._rotate=H==2?z.rotate(l,qe,E,de):0;let je=z._size;z._size=Xi(z.size(l,qe,E,v)),je!=null&&z._size!=je&&(S=!1)}),S}function fl(v){let S=!0;return ll.forEach((z,E)=>{let R=z(l,E,xr,v);R!=ui[E]&&(S=!1),ui[E]=R}),S}function dl(){for(let v=0;vFn[Nn]):Ie,qe=de.distr==2?Fn[Ie[1]]-Fn[Ie[0]]:ie,je=S.ticks,ze=S.border,mt=je.show?je.size:0,pt=dn(mt*rt),Mt=dn((S.alignTo==2?S._size-mt-S.gap:S.gap)*rt),st=S._rotate*-kf/180,yt=k(S._pos*rt),Hn=(pt+Mt)*te,_n=yt+Hn;H=E==0?_n:0,R=E==1?_n:0;let Bn=S.font[0],Jn=S.align==1?Xl:S.align==2?Vm:st>0?Xl:st<0?Vm:E==0?"center":z==3?Vm:Xl,Ei=st||E==1?"middle":z==2?yu:i_;zr(Bn,P,Jn,Ei);let qn=S.font[1]*S.lineGap,Xn=Ie.map(Nn=>k(m(Nn,de,ge,De))),Oi=S._values;for(let Nn=0;Nn{z>0&&(S._paths=null,v&&(u==1?(S.min=null,S.max=null):S.facets.forEach(E=>{E.min=null,E.max=null})))})}let bn=!1,hl=!1,da=[];function zo(){hl=!1;for(let v=0;v0&&queueMicrotask(zo)}l.batch=vd;function Qn(){if(ia&&(bs(),ia=!1),ms&&(Vu(),ms=!1),il){if(Et(O,Xl,nt),Et(O,yu,Zt),Et(O,zu,Ce),Et(O,Tu,me),Et(T,Xl,nt),Et(T,yu,Zt),Et(T,zu,Ce),Et(T,Tu,me),Et(w,zu,ai),Et(w,Tu,Hi),b.width=dn(ai*rt),b.height=dn(Hi*rt),X.forEach(({_el:v,_show:S,_size:z,_pos:E,side:R})=>{if(v!=null)if(S){let H=R===3||R===0?z:0,P=R%2==1;Et(v,P?"left":"top",E-H),Et(v,P?"width":"height",z),Et(v,P?"top":"left",P?Zt:nt),Et(v,P?"height":"width",P?me:Ce),mp(v,Ya)}else Ci(v,Ya)}),ci=At=yn=ul=bo=_o=cl=Ir=wr=null,cn=1,Sa(!0),nt!=qr||Zt!=Zn||Ce!=li||me!=nr){$n(!1);let v=Ce/li,S=me/nr;if(F&&!Yt&&be.left>=0){be.left*=v,be.top*=S,_i&&Lr(_i,dn(be.left),0,Ce,me),Yr&&Lr(Yr,0,dn(be.top),Ce,me);for(let z=0;z=0&&We.width>0){We.left*=v,We.width*=v,We.top*=S,We.height*=S;for(let z in xa)Et(xi,z,We[z])}qr=nt,Zn=Zt,li=Ce,nr=me}en("setSize"),il=!1}ai>0&&Hi>0&&(y.clearRect(0,0,b.width,b.height),en("drawClear"),ae.forEach(v=>v()),en("draw")),We.show&&rl&&(pa(We),rl=!1),F&&Yt&&(Bi(null,!0,!1),Yt=!1),Re.show&&Re.live&&Yn&&(ba(),Yn=!1),p||(p=!0,l.status=1,en("ready")),Vr=!1,bn=!1}l.redraw=(v,S)=>{ms=S||!1,v!==!1?sr(V,J.min,J.max):Gr()};function ha(v,S){let z=G[v];if(z.from==null){if(un==0){let E=z.range(l,S.min,S.max,v);S.min=E[0],S.max=E[1]}if(S.min>S.max){let E=S.min;S.min=S.max,S.max=E}if(un>1&&S.min!=null&&S.max!=null&&S.max-S.min<1e-16)return;v==V&&z.distr==2&&un>0&&(S.min=yr(S.min,i[0]),S.max=yr(S.max,i[0]),S.min==S.max&&S.max++),fe[v]=S,ia=!0,Gr()}}l.setScale=ha;let ml,ma,_i,Yr,To,Fr,_s,Qr,Eo,pl,vt,xt,Si=!1;const ht=be.drag;let qt=ht.x,Vt=ht.y;F&&(be.x&&(ml=Ji(oM,T)),be.y&&(ma=Ji(uM,T)),J.ori==0?(_i=ml,Yr=ma):(_i=ma,Yr=ml),vt=be.left,xt=be.top);const We=l.select=an({show:!0,over:!0,left:0,width:0,top:0,height:0},n.select),xi=We.show?Ji(lM,We.over?T:O):null;function pa(v,S){if(We.show){for(let z in v)We[z]=v[z],z in xa&&Et(xi,z,v[z]);S!==!1&&en("setSelect")}}l.setSelect=pa;function Oo(v){if(D[v].show)M&&mp(Ae[v],Ya);else if(M&&Ci(Ae[v],Ya),F){let z=gs?oi[0]:oi[v];z!=null&&Lr(z,-10,-10,Ce,me)}}function sr(v,S,z){ha(v,{min:S,max:z})}function Ln(v,S,z,E){S.focus!=null&&gl(v),S.show!=null&&D.forEach((R,H)=>{H>0&&(v==H||v==null)&&(R.show=S.show,Oo(H),u==2?(sr(R.facets[0].scale,null,null),sr(R.facets[1].scale,null,null)):sr(R.scale,null,null),Gr())}),z!==!1&&en("setSeries",v,S),E&&wa("setSeries",l,v,S)}l.setSeries=Ln;function ar(v,S){an(ee[v],S)}function No(v,S){v.fill=Qe(v.fill||null),v.dir=et(v.dir,-1),S=S??ee.length,ee.splice(S,0,v)}function ga(v){v==null?ee.length=0:ee.splice(v,1)}l.addBand=No,l.setBand=ar,l.delBand=ga;function Er(v,S){D[v].alpha=S,F&&oi[v]!=null&&(oi[v].style.opacity=S),M&&Ae[v]&&(Ae[v].style.opacity=S)}let wi,zi,Or;const lr={focus:!0};function gl(v){if(v!=Or){let S=v==null,z=Nt.alpha!=1;D.forEach((E,R)=>{if(u==1||R>0){let H=S||R==0||R==v;E._focus=S?null:H,z&&Er(R,H?1:Nt.alpha)}}),Or=v,z&&Gr()}}M&&ps&&Gt(l_,re,v=>{be._lock||(Ft(v),Or!=null&&Ln(null,lr,!0,$t.setSeries))});function Ti(v,S,z){let E=G[S];z&&(v=v/rt-(E.ori==1?Zt:nt));let R=Ce;E.ori==1&&(R=me,v=R-v),E.dir==-1&&(v=R-v);let H=E._min,P=E._max,te=v/R,ie=H+(P-H)*te,ce=E.distr;return ce==3?lo(10,ie):ce==4?EM(ie,E.asinh):ce==100?E.bwd(ie):ie}function On(v,S){let z=Ti(v,V,S);retur)DELIM" +R"DELIM(n yr(z,i[0],Qt,Jt)}l.valToIdx=v=>yr(v,i[0]),l.posToIdx=On,l.posToVal=Ti,l.valToPos=(v,S,z)=>G[S].ori==0?f(v,G[S],z?vn:Ce,z?Pn:0):d(v,G[S],z?Gn:me,z?Kn:0),l.setCursor=(v,S,z)=>{vt=v.left,xt=v.top,Bi(null,S,z)};function or(v,S){Et(xi,Xl,We.left=v),Et(xi,zu,We.width=S)}function va(v,S){Et(xi,yu,We.top=v),Et(xi,Tu,We.height=S)}let ur=J.ori==0?or:va,ya=J.ori==1?or:va;function Ao(){if(M&&Re.live)for(let v=u==2?1:0;v{Be[E]=z}):MM(v.idx)||Be.fill(v.idx),Re.idx=Be[0]),M&&Re.live){for(let z=0;z0||u==1&&!Bt)&&_a(z,Be[z]);Ao()}Yn=!1,S!==!1&&en("setLegend")}l.setLegend=ba;function _a(v,S){let z=D[v],E=v==0&&we==2?Fn:i[v],R;Bt?R=z.values(l,v,S)??Li:(R=z.value(l,S==null?null:E[S],v,S),R=R==null?Li:{_:R}),Re.values[v]=R}function Bi(v,S,z){Eo=vt,pl=xt,[vt,xt]=be.move(l,vt,xt),be.left=vt,be.top=xt,F&&(_i&&Lr(_i,dn(vt),0,Ce,me),Yr&&Lr(Yr,0,dn(xt),Ce,me));let E,R=Qt>Jt;wi=_t,zi=null;let H=J.ori==0?Ce:me,P=J.ori==1?Ce:me;if(vt<0||un==0||R){E=be.idx=null;for(let te=0;te0&&mt.show){let Hn=st==null?-10:st==E?ce:he(u==1?i[0][st]:i[ze][0][st],J,H,0),_n=yt==null?-10:Oe(yt,u==1?G[mt.scale]:G[mt.facets[1].scale],P,0);if(ps&&yt!=null){let Bn=J.ori==1?vt:xt,Jn=mn(Nt.dist(l,ze,st,_n,Bn));if(Jn=0?1:-1,Oi=qn>=0?1:-1;Oi==Xn&&(Oi==1?Ei==1?yt>=qn:yt<=qn:Ei==1?yt<=qn:yt>=qn)&&(wi=Jn,zi=ze)}else wi=Jn,zi=ze}}if(Yn||gs){let Bn,Jn;J.ori==0?(Bn=Hn,Jn=_n):(Bn=_n,Jn=Hn);let Ei,qn,Xn,Oi,qi,Nn,Wn=!0,Jr=Tt.bbox;if(Jr!=null){Wn=!1;let ut=Jr(l,ze);Xn=ut.left,Oi=ut.top,Ei=ut.width,qn=ut.height}else Xn=Bn,Oi=Jn,Ei=qn=Tt.size(l,ze);if(Nn=Tt.fill(l,ze),qi=Tt.stroke(l,ze),gs)ze==zi&&wi<=Nt.prox&&(de=Xn,ge=Oi,De=Ei,Ie=qn,Je=Wn,qe=Nn,je=qi);else{let ut=oi[ze];ut!=null&&(ir[ze]=Xn,rr[ze]=Oi,m_(ut,Ei,qn,Wn),d_(ut,Nn,qi),Lr(ut,Xi(Xn),Xi(Oi),Ce,me))}}}}if(gs){let ze=Nt.prox,mt=Or==null?wi<=ze:wi>ze||zi!=Or;if(Yn||mt){let pt=oi[0];pt!=null&&(ir[0]=de,rr[0]=ge,m_(pt,De,Ie,Je),d_(pt,qe,je),Lr(pt,Xi(de),Xi(ge),Ce,me))}}}if(We.show&&Si)if(v!=null){let[te,ie]=$t.scales,[ce,de]=$t.match,[ge,De]=v.cursor.sync.scales,Ie=v.cursor.drag;if(qt=Ie._x,Vt=Ie._y,qt||Vt){let{left:Je,top:qe,width:je,height:ze}=v.select,mt=v.scales[ge].ori,pt=v.posToVal,Mt,st,yt,Hn,_n,Bn=te!=null&&ce(te,ge),Jn=ie!=null&&de(ie,De);Bn&&qt?(mt==0?(Mt=Je,st=je):(Mt=qe,st=ze),yt=G[te],Hn=he(pt(Mt,ge),yt,H,0),_n=he(pt(Mt+st,ge),yt,H,0),ur(br(Hn,_n),mn(_n-Hn))):ur(0,H),Jn&&Vt?(mt==1?(Mt=Je,st=je):(Mt=qe,st=ze),yt=G[ie],Hn=Oe(pt(Mt,De),yt,P,0),_n=Oe(pt(Mt+st,De),yt,P,0),ya(br(Hn,_n),mn(_n-Hn))):ya(0,P)}else jo()}else{let te=mn(Eo-To),ie=mn(pl-Fr);if(J.ori==1){let De=te;te=ie,ie=De}qt=ht.x&&te>=ht.dist,Vt=ht.y&&ie>=ht.dist;let ce=ht.uni;ce!=null?qt&&Vt&&(qt=te>=ce,Vt=ie>=ce,!qt&&!Vt&&(ie>te?Vt=!0:qt=!0)):ht.x&&ht.y&&(qt||Vt)&&(qt=Vt=!0);let de,ge;qt&&(J.ori==0?(de=_s,ge=vt):(de=Qr,ge=xt),ur(br(de,ge),mn(ge-de)),Vt||ya(0,P)),Vt&&(J.ori==1?(de=_s,ge=vt):(de=Qr,ge=xt),ya(br(de,ge),mn(ge-de)),qt||ur(0,H)),!qt&&!Vt&&(ur(0,0),ya(0,0))}if(ht._x=qt,ht._y=Vt,v==null){if(z){if(tc!=null){let[te,ie]=$t.scales;$t.values[0]=te!=null?Ti(J.ori==0?vt:xt,te):null,$t.values[1]=ie!=null?Ti(J.ori==1?vt:xt,ie):null}wa(Im,l,vt,xt,Ce,me,E)}if(ps){let te=z&&$t.setSeries,ie=Nt.prox;Or==null?wi<=ie&&Ln(zi,lr,!0,te):wi>ie?Ln(null,lr,!0,te):zi!=Or&&Ln(zi,lr,!0,te)}}Yn&&(Re.idx=E,ba()),S!==!1&&en("setCursor")}let cr=null;Object.defineProperty(l,"rect",{get(){return cr==null&&Sa(!1),cr}});function Sa(v=!1){v?cr=null:(cr=T.getBoundingClientRect(),en("syncRect",cr))}function Ku(v,S,z,E,R,H,P){be._lock||Si&&v!=null&&v.movementX==0&&v.movementY==0||(Mo(v,S,z,E,R,H,P,!1,v!=null),v!=null?Bi(null,!0,!0):Bi(S,!0,!1))}function Mo(v,S,z,E,R,H,P,te,ie){if(cr==null&&Sa(!1),Ft(v),v!=null)z=v.clientX-cr.left,E=v.clientY-cr.top;else{if(z<0||E<0){vt=-10,xt=-10;return}let[ce,de]=$t.scales,ge=S.cursor.sync,[De,Ie]=ge.values,[Je,qe]=ge.scales,[je,ze]=$t.match,mt=S.axes[0].side%2==1,pt=J.ori==0?Ce:me,Mt=J.ori==1?Ce:me,st=mt?H:R,yt=mt?R:H,Hn=mt?E:z,_n=mt?z:E;if(Je!=null?z=je(ce,Je)?m(De,G[ce],pt,0):-10:z=pt*(Hn/st),qe!=null?E=ze(de,qe)?m(Ie,G[de],Mt,0):-10:E=Mt*(_n/yt),J.ori==1){let Bn=z;z=E,E=Bn}}ie&&(S==null||S.cursor.event.type==Im)&&((z<=1||z>=Ce-1)&&(z=Ka(z,Ce)),(E<=1||E>=me-1)&&(E=Ka(E,me))),te?(To=z,Fr=E,[_s,Qr]=be.move(l,z,E)):(vt=z,xt=E)}const xa={width:0,height:0,left:0,top:0};function jo(){pa(xa,!1)}let Gu,Yu,Fu,Qu;function ko(v,S,z,E,R,H,P){Si=!0,qt=Vt=ht._x=ht._y=!1,Mo(v,S,z,E,R,H,P,!0,!1),v!=null&&(Gt(Pm,dp,Ju,!1),wa(s_,l,_s,Qr,Ce,me,null));let{left:te,top:ie,width:ce,height:de}=We;Gu=te,Yu=ie,Fu=ce,Qu=de}function Ju(v,S,z,E,R,H,P){Si=ht._x=ht._y=!1,Mo(v,S,z,E,R,H,P,!1,!0);let{left:te,top:ie,width:ce,height:de}=We,ge=ce>0||de>0,De=Gu!=te||Yu!=ie||Fu!=ce||Qu!=de;if(ge&&De&&pa(We),ht.setScale&&ge&&De){let Ie=te,Je=ce,qe=ie,je=de;if(J.ori==1&&(Ie=ie,Je=de,qe=te,je=ce),qt&&sr(V,Ti(Ie,V),Ti(Ie+Je,V)),Vt)for(let ze in G){let mt=G[ze];ze!=V&&mt.from==null&&mt.min!=_t&&sr(ze,Ti(qe+je,ze),Ti(qe,ze))}jo()}else be.lock&&(be._lock=!be._lock,Bi(S,!0,v!=null));v!=null&&(In(Pm,dp),wa(Pm,l,vt,xt,Ce,me,null))}function yd(v,S,z,E,R,H,P){if(be._lock)return;Ft(v);let te=Si;if(Si){let ie=!0,ce=!0,de=10,ge,De;J.ori==0?(ge=qt,De=Vt):(ge=Vt,De=qt),ge&&De&&(ie=vt<=de||vt>=Ce-de,ce=xt<=de||xt>=me-de),ge&&ie&&(vt=vt<_s?0:Ce),De&&ce&&(xt=xt{let R=$t.match[2];z=R(l,S,z),z!=-1&&Ln(z,E,!0,!1)},F&&(Gt(s_,T,ko),Gt(Im,T,Ku),Gt(a_,T,v=>{Ft(v),Sa(!1)}),Gt(l_,T,yd),Gt(o_,T,Xu),_p.add(l),l.syncRect=Sa);const vl=l.hooks=n.hooks||{};function en(v,S,z){hl?da.push([v,S,z]):v in vl&&vl[v].forEach(E=>{E.call(null,l,S,z)})}(n.plugins||[]).forEach(v=>{for(let S in v.hooks)vl[S]=(vl[S]||[]).concat(v.hooks[S])});const ec=(v,S,z)=>z,$t=an({key:null,setSeries:!1,filters:{pub:b_,sub:b_},scales:[V,D[1]?D[1].scale:null],match:[__,__,ec],values:[null,null]},be.sync);$t.match.length==2&&$t.match.push(ec),be.sync=$t;const tc=$t.key,Ro=WS(tc);function wa(v,S,z,E,R,H,P){$t.filters.pub(v,S,z,E,R,H,P)&&Ro.pub(v,S,z,E,R,H,P)}Ro.sub(l);function bd(v,S,z,E,R,H,P){$t.filters.sub(v,S,z,E,R,H,P)&&Nr[v](null,S,z,E,R,H,P)}l.pub=bd;function _d(){Ro.unsub(l),_p.delete(l),gn.clear(),pp(Pf,no,Wu),g.remove(),re?.remove(),en("destroy")}l.destroy=_d;function Co(){en("init",n,i),yo(i||n.data,!1),fe[V]?ha(V,fe[V]):ol(),rl=We.show&&(We.width>0||We.height>0),Yt=Yn=!0,sl(n.width,n.height)}return D.forEach(Sr),X.forEach(pd),a?a instanceof HTMLElement?(a.appendChild(g),Co()):a(l,Co):Co(),l}on.assign=an;on.fmtNum=ag;on.rangeNum=Kf;on.rangeLog=sd;on.rangeAsinh=rg;on.orient=nl;on.pxRatio=rt;on.join=ZM;on.fmtDate=og,on.tzDate=YM;on.sync=WS;{on.addGap=M4,on.clipGaps=od;let n=on.paths={points:sx};n.linear=lx,n.stepped=R4,n.bars=C4,n.spline=U4}const fx=(n,i,a,l,u)=>{if(!Number.isFinite(a)||!Number.isFinite(l)||l<=a)return[];const f=[];if(Math.asinh(l)-Math.asinh(a)<1.5){const p=Number.isFinite(u)&&u>0?u:(l-a)/4,g=Math.ceil(a/p)*p;for(let b=0;b<100;b++){const y=Number((g+b*p).toPrecision(14));if(y>l)break;f.push({value:y,priority:y===0?0:1})}}else{const p=Math.ceil(Math.log10(Math.max(Math.abs(a),Math.abs(l))));for(let )DELIM" +R"DELIM(g=Math.min(-1,p-1);g<=p;g++)for(const b of[1,2,5]){const y=b*10**g;for(const w of[-y,y])Number.isFinite(w)&&w>=a&&w<=l&&f.push({value:w,priority:b===1?1:2})}a<=0&&l>=0&&f.push({value:0,priority:0})}f.sort((p,g)=>p.priority-g.priority||p.value-g.value);const d=[],m=[];for(const{value:p}of f){const g=n.valToPos(p,"y");Number.isFinite(g)&&m.every(b=>Math.abs(g-b)>=36)&&(d.push(p),m.push(g))}return d.sort((p,g)=>p-g),d};function dx(n,i){const a=Rt.indexOf(n.toLowerCase());return a===-1?n:i.getPropertyValue(`--chart-color-${String(a)}`).trim()||n}function G4(n){const i=n.filter(([,a])=>a>0).map(([a,l])=>({minimumRate:a,virtualSize:l}));return i.sort((a,l)=>a.minimumRate-l.minimumRate),i}const Y4=new Intl.NumberFormat(void 0,{maximumSignificantDigits:8}),F4=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function xp(n){return Y4.format(n)}function hx(n){return`${F4.format(n)} vB`}function Q4({snapshot:n,now:i,color:a,scale:l}){const u=se.useMemo(()=>G4(n?.data.histogram??[]),[n]),f=n!==null&&i-n.receivedAt>=Zu,d=n===null?"Waiting for transaction-pool fee data…":f?"Fee distribution is stale. Waiting for a fresh pool snapshot…":n.data.count===0?"The transaction pool is empty.":u.length===0?"No fee distribution is available for this pool snapshot.":null;return x.jsxs("div",{className:"space-y-3",children:[d?x.jsx("p",{role:"status",className:"text-textMuted flex min-h-72 items-center justify-center px-4 text-center text-sm",children:d}):x.jsxs(x.Fragment,{children:[x.jsx(J4,{bins:u,color:a,scale:l}),x.jsx("p",{className:"text-textMuted text-xs",children:"Each bar is a fee-rate group, labeled by its minimum rate. Bar height is virtual size, not transaction count. Groups are spaced evenly."}),x.jsxs("details",{className:"border-accentSecondary/20 rounded-md border text-xs",children:[x.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-3 py-2",children:["View ",zn(u.length)," fee-rate ",u.length===1?"group":"groups"]}),x.jsx("div",{className:"border-accentSecondary/20 max-h-56 overflow-auto border-t",children:x.jsxs("table",{className:"w-full text-left tabular-nums",children:[x.jsx("caption",{className:"sr-only",children:"Transaction-pool fee-rate groups"}),x.jsx("thead",{className:"bg-surface text-textMuted sticky top-0",children:x.jsxs("tr",{children:[x.jsx("th",{scope:"col",className:"px-3 py-2",children:"Minimum rate (sat/vB)"}),x.jsx("th",{scope:"col",className:"px-3 py-2 text-right",children:"Virtual size (vB)"})]})}),x.jsx("tbody",{className:"divide-accentSecondary/20 divide-y",children:u.map((m,p)=>x.jsxs("tr",{children:[x.jsx("td",{className:"px-3 py-2",children:xp(m.minimumRate)}),x.jsx("td",{className:"px-3 py-2 text-right",children:zn(m.virtualSize)})]},p))})]})})]})]}),n&&x.jsxs("p",{className:"text-textMuted text-xs",children:[f?"Last snapshot":"Snapshot"," ",Uu(n.receivedAt),!f&&` · ${zn(n.data.count)} transactions · ${hx(n.data.virtual)}`]})]})}function J4({bins:n,color:i,scale:a}){const l=Rp(),u=se.useRef(null),f=se.useRef(null),d=se.useRef(n);return se.useLayoutEffect(()=>{d.current=n;const m=f.current;m&&(m.setData([n.map((p,g)=>g),n.map(p=>p.virtualSize)]),m.redraw(!1,!0))},[n]),se.useLayoutEffect(()=>{const m=u.current;if(!m)return;const p=getComputedStyle(m),g=dx(i,p),b=`12px ${p.fontFamily}`,y=[d.current.map((A,k)=>k),d.current.map(A=>A.virtualSize)],w={width:Math.max(240,m.clientWidth),height:280,padding:[12,12,0,0],cursor:{drag:{x:!1,y:!1}},legend:{show:!0,live:!0},scales:{x:{time:!1,range:()=>[-.5,d.current.length-.5]},y:{distr:a==="compressed"?4:1,asinh:1,range:(A,k,L)=>[0,Math.max(1,L*1.08)]}},axes:[{stroke:p.color,font:b,grid:{show:!1},ticks:{stroke:p.getPropertyValue("--chart-ticks").trim(),width:1},splits:A=>{const k=d.current,L=Math.max(1,Math.ceil(k.length/Math.max(1,Math.floor(A.width/80))));return k.map((D,X)=>X).filter(D=>D%L===0)},values:(A,k)=>k.map(L=>xp(d.current[L].minimumRate))},{size:76,stroke:p.color,font:b,grid:{stroke:p.getPropertyValue("--chart-grid").trim(),width:1},ticks:{stroke:p.getPropertyValue("--chart-ticks").trim(),width:1},values:(A,k)=>k.map(L=>zn(L)),...a==="compressed"?{splits:fx,filter:(A,k)=>k}:{}}],series:[{label:"Min rate",value:(A,k)=>{const L=k===null?void 0:d.current[k];return L?`${xp(L.minimumRate)} sat/vB`:"—"}},{label:"Virtual size",stroke:g,fill:`${g}90`,width:1,points:{show:!1},paths:on.paths.bars?.({size:[.85,48]}),value:(A,k)=>k===null?"—":hx(k)}]},O=new on(w,y,m);f.current=O;const T=new ResizeObserver(A=>{const k=A[0]?.contentRect.width;k&&k>0&&O.setSize({width:Math.round(k),height:280})});return T.observe(m),()=>{T.disconnect(),O.destroy(),f.current=null}},[i,a,l]),x.jsxs("div",{role:"img","aria-label":"Transaction-pool fee distribution: virtual size in vbytes by minimum fee rate in satoshis per vbyte",children:[x.jsx("p",{className:"text-textMuted mb-2 text-xs",children:"Virtual size (vB)"}),x.jsx("div",{ref:u,className:"text-textMuted min-w-0 overflow-hidden"}),x.jsx("p",{className:"text-textMuted text-center text-xs",children:"Minimum fee rate per group (sat/vB)"})]})}function X4({data:n,series:i,height:a=280,emptyMessage:l="Waiting for live data…",valueSuffix:u="",zeroBased:f=!0,valueFormatter:d=nj,visualization:m="line",scale:p="linear",forceEmpty:g=!1}){const b=Rp(),y=se.useRef(null),w=se.useRef(null),O=se.useRef(!1),T=se.useRef(null),A=se.useMemo(()=>tj(n),[n]),k=se.useRef(A),L=!g&&n[0]?.length>0;return se.useLayoutEffect(()=>{k.current=A},[A]),se.useLayoutEffect(()=>{const D=y.current;if(!D)return;const X=getComputedStyle(D),G=`12px ${X.fontFamily}`,ee={width:Math.max(240,D.clientWidth),height:a,padding:[12,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},focus:{prox:24}},hooks:{setSelect:[ye=>{ye.select.width>0&&(O.current=!0)}]},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,distr:p==="compressed"?4:1,asinh:1,...f?{range:(ye,ue,J)=>[Math.min(0,ue),J===0?1:J*1.08]}:{range:(ye,ue,J)=>{const we=J-ue,he=we===0?Math.max(1,Math.abs(J)*5e-4):we*.08;return[ue-he,J+he]}}}},axes:[{stroke:X.color,grid:{stroke:X.getPropertyValue("--chart-grid").trim(),width:1},ticks:{stroke:X.getPropertyValue("--chart-ticks").trim(),width:1},font:G},{size:72,stroke:X.color,grid:{stroke:X.getPropertyValue("--chart-grid").trim(),width:1},ticks:{stroke:X.getPropertyValue("--chart-ticks").trim(),width:1},font:G,values:(ye,ue)=>ue.map(J=>J===null?null:`${d(J)}${u}`),...p==="compressed"?{splits:fx,filter:(ye,ue)=>ue}:{}}],series:[{},...i.map((ye,ue)=>{const J=dx(ye.color,X),we=m==="step"?on.paths.stepped?.({align:1}):m==="bar"?W4(ue,i.length):void 0;return{label:ye.label,stroke:J,fill:m==="area"||m==="bar"?ye.fill??`${J}24`:ye.fill,width:ye.width??2,paths:we,points:{show:m==="line"?ye.points??!1:!1},value:(he,Oe)=>Oe===null?"—":`${d(Oe)}${u}`}})]},V=new on(ee,k.current,D),ne=T.current;ne&&V.setScale("x",ne),w.current=V;const ae=new ResizeObserver(ye=>{const ue=ye[0]?.contentRect.width;ue&&ue>0&&V.setSize({width:Math.round(ue),height:a})});return ae.observe(D),()=>{T.current=O.current&&V.scales.x.min!=null&&V.scales.x.max!=null?{min:V.scales.x.min,max:V.scales.x.max}:null,ae.disconnect(),V.destroy(),w.current=null}},[a,i,d,u,m,f,p,b]),se.useEffect(()=>{const D=w.current;if(!D)return;const X=!O.current;D.setData(A,X),X||D.redraw()},[A]),x.jsxs("div",{className:"relative min-w-0",children:[x.jsx("div",{ref:y,className:"text-textMuted min-w-0 overflow-hidden"}),!L&&x.jsx("div",{className:"bg-surface text-textMuted pointer-events-none absolute inset-0 z-10 flex items-center justify-center text-sm",children:l})]})}function W4(n,i){const a=Math.max(1,i);return on.paths.bars?.({size:[1,48/a,0],disp:{x0:{unit:1,values:l=>{const u=q_(l,a),f=-u.groupWidth/2+u.barWidth*n;return Array.from(l.data[0],d=>d+f)}},size:{unit:1,values:l=>[q_(l,a).barWidth]}}})}function q_(n,i){const a=ej(n.data[0]),l=Math.abs(n.posToVal(48,"x")-n.posToVal(0,"x")),u=Math.min(a*.72,l);return{groupWidth:u,barWidth:u/i}}function ej(n){let i=Number.POSITIVE_INFINITY,a;for(const l of n)if(Number.isFi)DELIM" +R"DELIM(nite(l)){if(a!==void 0){const u=Math.abs(l-a);u>0&&u=2)return n;const a=Date.now()/1e3,l=i[0]??a,u=[l-1,l],f=n.slice(1).map(d=>{const m=d[0]??null;return[m,m]});return[u,...f]}function nj(n){return Math.abs(n)>=1e6?`${(n/1e6).toFixed(1)}m`:Math.abs(n)>=1e3?`${(n/1e3).toFixed(1)}k`:Math.abs(n)>=10?n.toFixed(0):Math.abs(n)>=1?n.toFixed(1):n.toFixed(2)}const ij={300:"5m",900:"15m",3600:"1h"},rj=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),sj=new Intl.NumberFormat(void 0,{maximumFractionDigits:2});function aj(n){return rj.format(n)}function lj(n){return sj.format(n)}function oj(n){return n==="height"||n==="occurrences"?aj:lj}function uj({metrics:n}){const i=zS(),[a,l]=se.useState(Z3),[u,f]=se.useState(null),[d,m]=se.useState(!1);se.useEffect(()=>{$3(a)},[a]);function p(y){l(w=>u?.mode==="add"?w.length>=Wl?w:[...w,y]:w.map(O=>O.id===y.id?y:O)),f(null)}function g(y,w){l(O=>{const T=y+w;if(T<0||T>=O.length)return O;const A=[...O],k=A[y],L=A[T];return A[y]=L,A[T]=k,A})}function b(){if(!d){m(!0);return}l(jf()),m(!1)}return x.jsxs("section",{className:"space-y-4",children:[x.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[x.jsxs("div",{children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Live telemetry"}),x.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Custom charts"}),x.jsxs("p",{className:"text-textMuted mt-1 text-sm",children:["Session data only · ",String(a.length)," of ",String(Wl)," charts"]})]}),x.jsxs("div",{className:"flex flex-wrap gap-2",children:[x.jsx("button",{type:"button",onClick:()=>{m(!1),f({mode:"add",chart:bS()})},disabled:a.length>=Wl,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:"Add chart"}),x.jsx("button",{type:"button",onClick:b,onBlur:()=>{m(!1)},className:`rounded-md border px-3 py-2 text-sm font-medium ${d?"border-amber-400/60 text-amber-200":"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary"}`,children:d?"Confirm reset":"Reset defaults"})]})]}),a.length===0?x.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border border-dashed px-6 py-16 text-center",children:[x.jsx("p",{className:"text-textPrimary font-medium",children:"No charts in this dashboard."}),x.jsx("p",{className:"text-textMuted mt-2 text-sm",children:"Add a custom chart or start from a template."})]}):x.jsx("div",{className:"grid gap-6 xl:grid-cols-2",children:a.map((y,w)=>x.jsx(cj,{chart:y,metrics:n,now:i,canMoveEarlier:w>0,canMoveLater:w{l(O=>O.map(T=>T.id===y.id?{...T,scale:T.scale==="compressed"?"linear":"compressed"}:T))},onDelete:()=>{l(O=>O.filter(T=>T.id!==y.id))},onDuplicate:()=>{l(O=>O.length>=Wl?O:[...O,U3(y)])},onEdit:()=>{f({mode:"edit",chart:y})},onMoveEarlier:()=>{g(w,-1)},onMoveLater:()=>{g(w,1)}},y.id))}),u&&x.jsx(J3,{chart:u.chart,mode:u.mode,onCancel:()=>{f(null)},onSave:p},`${u.mode}-${u.chart.id}`)]})}function cj({chart:n,metrics:i,now:a,canMoveEarlier:l,canMoveLater:u,canDuplicate:f,onDelete:d,onDuplicate:m,onEdit:p,onMoveEarlier:g,onMoveLater:b,onToggleScale:y}){const[w,O]=se.useState(null),[T,A]=se.useState(0),k=w??i,L=se.useMemo(()=>ln(n)?V3(k,n):null,[n,k]),D=se.useMemo(()=>ln(n)?n.series.map(ee=>({label:ee.label??cs(ee.signalId).label,color:ee.color})):[],[n]),X=oj(L?.unit??"vbytes"),G=`Waiting for ${D.length===1?D[0]?.label?.toLowerCase():"the selected signals"}…`;return x.jsxs("article",{className:"border-accent/30 bg-surface/80 min-w-0 overflow-hidden rounded-2xl border",children:[x.jsx("header",{className:"border-accentSecondary/20 space-y-3 border-b px-4 py-4 sm:px-5",children:x.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsx("h3",{className:"text-accent truncate text-lg font-semibold",title:n.title,children:n.title}),x.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:[ln(n)&&L?`${wS(L.unit)} · ${ij[n.range]} · ${n.visualization}`:"Virtual size by fee-rate group · latest snapshot",n.scale==="compressed"?" · compressed scale":"",w?" · paused":""]})]}),x.jsxs("div",{className:"flex flex-wrap justify-end gap-1 text-xs",children:[x.jsx("button",{type:"button","aria-label":`Compress peaks for ${n.title}`,"aria-pressed":n.scale==="compressed",title:"Use a log-like Y axis to compress large peaks. Zero, negative values, and original measurements are preserved.",onClick:y,className:`rounded-md border px-2 py-1.5 ${n.scale==="compressed"?"border-accent/40 bg-accentSecondary/20 text-accent":"border-accent/30 text-textMuted hover:text-accent hover:bg-accentSecondary/10"}`,children:"Compress peaks"}),x.jsx(Pa,{label:w?"Resume chart":"Pause chart",onClick:()=>{O(ee=>ee?null:ln(n)?i:{...i,now:a})},children:w?"Resume":"Pause"}),ln(n)&&x.jsx(Pa,{label:"Reset chart zoom",onClick:()=>{A(ee=>ee+1)},children:"Reset zoom"}),x.jsx(Pa,{label:"Edit chart",onClick:p,children:"Edit"}),x.jsx(Pa,{label:"Duplicate chart",onClick:m,disabled:!f,children:"Duplicate"}),x.jsx(Pa,{label:`Move ${n.title} earlier`,onClick:g,disabled:!l,children:"←"}),x.jsx(Pa,{label:`Move ${n.title} later`,onClick:b,disabled:!u,children:"→"}),x.jsx(Pa,{label:"Delete chart",onClick:d,danger:!0,children:"Delete"})]})]})}),x.jsx("div",{className:"min-w-0 p-3 sm:p-5",children:ln(n)&&L?x.jsx(X4,{data:L.data,series:D,visualization:n.visualization,scale:n.scale,zeroBased:P3(L.unit),valueFormatter:X,valueSuffix:I3(L.unit),forceEmpty:!L.hasObservedData,emptyMessage:G},T):!ln(n)&&x.jsx(Q4,{snapshot:k.poolSnapshot,now:w?.now??a,color:n.color,scale:n.scale})}),n.scale==="compressed"&&x.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Log-like Y axis · peaks compressed · labels and hover values show original measurements."}),ln(n)&&n.series.some(ee=>ee.signalId==="event:10")&&x.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Archival includes compact-block recovery; rejected and duplicate submissions are excluded."}),L&&L.unobservedLabels.length>0&&L.hasObservedData&&x.jsxs("footer",{className:"border-accent/10 text-textMuted border-t px-5 py-2 text-[11px]",children:["Not observed this session: ",L.unobservedLabels.join(", ")]})]})}function Pa({label:n,children:i,onClick:a,disabled:l=!1,danger:u=!1}){return x.jsx("button",{type:"button","aria-label":n,onClick:a,disabled:l,className:`rounded-md px-2 py-1.5 disabled:cursor-not-allowed disabled:opacity-30 ${u?"text-textMuted hover:bg-red-500/10 hover:text-red-300":"text-textMuted hover:text-accent hover:bg-accentSecondary/10"}`,children:i})}const fj=[{event:0,label:"Header archived"},{event:3,label:"Block archived"},{event:5,label:"Block validated"},{event:6,label:"Block confirmed"},{event:13,label:"Block organized"},{event:14,label:"Block reorganized"}];function dj({adminStatus:n,endpoints:i,metrics:a,native:l,syncEstimate:u}){const f=T3(a,10),d=l.configuration,m=sS(d?.forks??[]),p=hj(n,l.status),g=[n.error?`Admin: ${n.error}`:null,l.status.error?`Native: ${l.status.error}`:null,l.transport==="none"&&l.restError?`Native REST: ${l.restError}`:null,a.invalidFrames>0?`${String(a.invalidFrames)} malformed admin frame${a.invalidFrames===1?"":"s"} ignored`:null,l.live.invalidFrames>0?`${String(l.live.invalidFrames)} malformed native frame${l.live.invalidFrames===1?"":"s"} ignored`:null,l.status.phase==="connected"&&l.transport==="none"?"Native: Connected, but no fresh valid state has been received":null].filter(b=>b!==null);return x.jsxs("div",{className:"space-y-6",children:[g.length>0&&x.jsxs("section",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3",children:[x.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Transport notice"}),x.jsx)DELIM" +R"DELIM(("ul",{className:"text-textMuted mt-1 space-y-1 text-xs",children:g.map(b=>x.jsx("li",{children:b},b))})]}),x.jsx(N3,{confirmed:l.top,estimate:u}),x.jsxs("dl",{"aria-label":"Node summary",className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[x.jsx(Sf,{label:"Current top",value:l.top===null?"—":zn(l.top),detail:l.transport==="none"?"Waiting for native API":`${pj(u)} · via ${l.transport==="websocket"?"native WebSocket":"REST fallback"}`,emphasized:!0}),x.jsx(Sf,{label:"Current activity",value:f.label,detail:f.rate>0?`${HA(f.rate)} over the last 10 seconds`:"No lifecycle events in the last 10 seconds",numeric:!1}),x.jsx(Sf,{label:"Collection uptime",value:LA(a.now-a.sessionStartedAt),detail:`${zn(a.totalEvents)} events · ${zn(a.totalLogs)} logs`}),x.jsx(Sf,{label:"Connection",value:p.phase==="connected"?QA(i.adminUrl).replace(/\/$/u,""):"[disconnected]",detail:`${p.lastMessageAt?`Last frame ${Uu(p.lastMessageAt)}`:"Waiting for the first frame"} · ${String(p.reconnects)} reconnect${p.reconnects===1?"":"s"}`,numeric:!1})]}),x.jsx(uj,{metrics:a}),x.jsxs("section",{className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[x.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border",children:[x.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Lifecycle heights"}),x.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Highest observed event values"})]}),x.jsx("div",{className:"bg-accentSecondary/10 grid gap-px sm:grid-cols-2 lg:grid-cols-3",children:fj.map(({event:b,label:y})=>{const w=a.signalMaximums[Ui(b)];return x.jsxs("div",{className:"bg-surface px-5 py-4",children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:y}),x.jsx("p",{className:"text-textPrimary mt-2 text-xl font-semibold tabular-nums",children:w===void 0?"—":zn(w)})]},b)})})]}),x.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[x.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Capabilities"}),x.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Native configuration"})]}),d?x.jsxs("div",{className:"space-y-4 p-5 text-sm",children:[x.jsxs(_u,{title:"Store configuration",children:[x.jsx(Qm,{items:[["Address index",d.store.address],["Client filters index",d.store.filter],["Silent payments index",d.store.silent!==null],["Turbo",d.store.turbo]]}),x.jsx(Tf,{items:[["Silent payments from",d.store.silent===null?"Not indexed":zn(d.store.silent)]]})]}),x.jsxs(_u,{title:"Node services",children:[x.jsx(Qm,{items:[["Blocks",d.node.blocks],["Limited",d.node.limited],["Witness",d.node.witness],["Filters",d.node.filters],["Privacy",d.node.privacy]]}),x.jsx(Tf,{items:[["Inputs pruned below",d.store.pruned>0?zn(d.store.pruned):"Not pruned"]]})]}),d.network&&x.jsxs(_u,{title:"Peer protocol",children:[x.jsx(Qm,{items:[["Relay",d.network.relay],["Compact",d.network.compact],["Address",d.network.address],["Witness tx",d.network.witness_tx],["Memory pool",d.network.memory_pool],["Not found",d.network.not_found],["Reject",d.network.reject],["Alert",d.network.alert]]}),x.jsx(Tf,{items:[["Protocol minimum",String(d.network.protocol_minimum)],["Protocol maximum",String(d.network.protocol_maximum)]]})]}),d.wallet&&x.jsx(_u,{title:"Wallet",children:x.jsx(Tf,{items:[["P2PKH version",String(d.wallet.p2kh),Ia(m,"p2kh",d.wallet.p2kh)],["P2SH version",String(d.wallet.p2sh),Ia(m,"p2sh",d.wallet.p2sh)],["WIF version",String(d.wallet.wif),Ia(m,"wif",d.wallet.wif)],["Witness prefix",d.wallet.witness,Ia(m,"witness",d.wallet.witness)],["Silent prefix",d.wallet.silent,Ia(m,"silent",d.wallet.silent)],["HD private",I_(d.wallet.hd_private),Ia(m,"hdPrivate",d.wallet.hd_private)],["HD public",I_(d.wallet.hd_public),Ia(m,"hdPublic",d.wallet.hd_public)]]})}),x.jsx(_u,{title:"Configured forks",children:x.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.forks.map(b=>x.jsx("span",{className:"text-textPrimary bg-accentSecondary/15 rounded-full px-2 py-0.5 font-mono text-xs",children:b},b))})})]}):x.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Waiting for native configuration."})]})]}),x.jsx("section",{children:x.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[x.jsx("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:x.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Recent events"})}),a.recentEvents.length===0?x.jsx(mj,{text:"No events observed yet."}):x.jsx("ul",{className:"divide-accentSecondary/20 divide-y",children:a.recentEvents.slice(0,6).map(b=>x.jsxs("li",{className:"flex items-center gap-3 px-5 py-3 text-xs",children:[x.jsx("time",{className:"text-textMuted w-24 shrink-0 font-mono",children:Uu(b.time)}),x.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:mo(b.event).name}),x.jsx("span",{className:"text-accent tabular-nums",children:rS(b.event,b.value)})]},b.id))})]})})]})}const V_={connected:0,connecting:1,reconnecting:2,idle:3};function hj(n,i){const a=V_[i.phase]>V_[n.phase]?i:n,l=Math.max(n.lastMessageAt??0,i.lastMessageAt??0);return{...a,reconnects:n.reconnects+i.reconnects,lastMessageAt:l>0?l:null}}function _u({title:n,children:i}){return x.jsxs("section",{className:"border-accentSecondary/20 space-y-2 border-t pt-3 first:border-t-0 first:pt-0",children:[x.jsx("h3",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),i]})}function Qm({items:n}){const i=n.filter(([,a])=>a!==void 0);return x.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(([a,l])=>x.jsx("span",{className:`rounded-full border px-2 py-0.5 text-xs ${l?"border-emerald-500/50 bg-emerald-500/15 text-emerald-300":"text-textMuted border-slate-500/40"}`,children:a},a))})}function Tf({items:n}){const i=n.some(l=>l.length>2),a=i?"grid-cols-[10rem_max-content_auto]":"grid-cols-[10rem_max-content]";return x.jsx("dl",{className:`grid ${a} items-baseline gap-x-4 gap-y-1`,children:n.map(([l,u,f])=>x.jsxs(se.Fragment,{children:[x.jsx("dt",{className:"text-textMuted",children:l}),x.jsx("dd",{className:"text-textPrimary font-mono",children:u}),i&&x.jsx("dd",{className:"text-textMuted",children:f})]},l))})}function I_(n){return`0x${n.toString(16).padStart(8,"0")}`}function mj({text:n}){return x.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}function pj(n){return n?n.blocksRemaining<=td?"Near current (estimated)":`${zn(n.blocksRemaining)} blocks remaining (estimated)`:"Waiting for confirmed block timestamp"}const gj=8e3;function vj({estimate:n,browserNotificationsEnabled:i}){const a=se.useRef(null),[l,u]=se.useState(null),f=n?.blocksRemaining??null;if(se.useEffect(()=>{const m=bj(f);if(!m)return;const p=a.current;if(a.current=m.state,!(p===null||p===m.state)&&(u(m),i)){const g=yj(m);Kz(g.title,{body:g.body,tag:"libbitcoin-sync-status"})}},[i,f]),se.useEffect(()=>{if(!l)return;const m=setTimeout(()=>{u(p=>p===l?null:p)},gj);return()=>{clearTimeout(m)}},[l]),!l)return null;const d=l.state==="near-current";return x.jsx("aside",{role:"status","aria-live":"polite","aria-atomic":"true",className:`fixed right-4 bottom-4 left-4 z-[60] rounded-xl border p-4 shadow-2xl shadow-black/50 sm:left-auto sm:w-96 ${d?"bg-noticeSuccess/95 border-emerald-400/35":"bg-noticeWarning/95 border-amber-400/35"}`,children:x.jsxs("div",{className:"flex items-start gap-4",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("p",{className:d?"font-semibold text-emerald-200":"font-semibold text-amber-200",children:d?"Node near current (estimated)":"Node fell behind (estimated)"}),x.jsx("p",{className:"text-noticeText/75 mt-1 text-sm",children:wp(l)})]}),x.jsx("button",{type:")DELIM" +R"DELIM(button","aria-label":"Dismiss synchronization notification",onClick:()=>{u(null)},className:"text-noticeText/60 hover:text-noticeText text-lg leading-none",children:"×"})]})})}function yj(n){return n.state==="near-current"?{title:"Libbitcoin node near current (estimated)",body:wp(n)}:{title:"Libbitcoin node fell behind (estimated)",body:wp(n)}}function bj(n){return n===null?null:{state:n<=td?"near-current":"behind",blocksBehind:n}}function wp(n){return n.state==="near-current"?`Confirmed top is approximately ${String(td)} blocks from the top candidate header, based on block time.`:`Confirmed top is approximately ${zn(n.blocksBehind)} blocks from the top candidate header, based on block time.`}const mx='(function(){"use strict";function je(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function gt(e,t="|"){return e.map(n=>kt(n)).join(t)}function Me(e,t){return typeof t=="bigint"?t.toString():t}class gr{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Le(e){return new gr(e)}function _r(e){return e==null}function Fe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function vr(e,t){const n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r){const c=t._zod.def.shape[s];return r?r(c,s):c}):bt(e,s,r?r(o.value,s):o.value))}}function br(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?vt(e,n,()=>t[n]):bt(e,n,r.value))}}function N(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function yr(e){return JSON.stringify(e)}function wr(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,"").replace(/[\\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const yt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function de(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const kr=Le(()=>{if(R.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function G(e){if(de(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(de(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wt(e){return G(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const zr=new Set(["string","number","symbol"]);function pe(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function K(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function kt(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Sr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const zt={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]},$r={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Or(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return q(s,e,me(e,t)),K(e,N(n,{shape:s,checks:[]}))}function me(e,t){const n=x(e),r=[];for(const i of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,i)?.enumerable)throw new Error(`Unrecognized key: "${String(i)}"`);t[i]&&r.push(i)}return r}function Er(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(me(e,t)),o={};return q(o,e,Reflect.ownKeys(x(e)).filter(c=>!s.has(c))),K(e,N(n,{shape:o,checks:[]}))}function Ir(e,t){if(!G(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=x(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return K(e,N(e._zod.def,{shape:St(e,t)}))}function St(e,t){const n={};return q(n,e,Reflect.ownKeys(x(e))),br(n,t),n}function Tr(e,t){if(!G(t))throw new Error("Invalid input to safeExtend: expected a plain object");return K(e,N(e._zod.def,{shape:St(e,t)}))}function Pr(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};q(n,e,Reflect.ownKeys(x(e))),q(n,t,Reflect.ownKeys(x(t)));const r=N(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return K(e,r)}function $t(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const c=n?new Set(me(t,n)):void 0,a={};return q(a,t,Reflect.ownKeys(x(t)),e&&((u,l)=>c&&!c.has(l)?u:new e({type:"optional",innerType:u}))),K(t,N(t._zod.def,{shape:a,checks:[]}))}function Zr(e,t,n){const r=n?new Set(me(t,n)):void 0,i={};return q(i,t,Reflect.ownKeys(x(t)),(s,o)=>r&&!r.has(o)?s:new e({type:"nonoptional",innerType:s})),K(t,N(t._zod.def,{shape:i}))}function L(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function re(e){return typeof e=="string"?e:e?.message}function Ot(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const i=r.maximum??r.length??r.size;i>=0&&t.push([i,n])}return t}function Ce(e,t,n){var r;for(let i=t;ie;return t[Dr]=!0,t}var Tt;const Ke={value:void 0,enumerable:!1};let Pt="captureStackTrace"in Error?Error:null;function Ur(e){const t=Pt;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return Pt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function f(e,t,n,r){const i={};function s(p){this.def=p,this.constr=h,this.traits=new Set}s.prototype=i;const o=n,c=o&&new WeakSet;function a(p,d){if(p._zod){if(p._zod.traits.has(e))return}else{Ke.value=new s(d);try{Object.defineProperty(p,"_zod",Ke)}finally{Ke.value=void 0}}if(p._zod.traits.add(e),t(p,d),c){const g=Object.getPrototypeOf(p),v=p._zod.constr.prototype;let b=g;for(;b&&b!==v;)b=Object.getPrototypeOf(b);const A=b??g;c.has(A)||(c.add(A),jr(A,o))}const m=h.prototype;for(const g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}const u=r?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function h(p){const d=r?.Parent?Ur(l):this;a(d,p);const m=d._zod.deferred;if(m){for(const v of m)v();d._zod.deferred=void 0}const g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(d),d}return Object.defineProperty(h,"init",{value:a}),Object.defineProperty(h,Symbol.hasInstance,{value:p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(h,"name",{value:e}),h}class H extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Zt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Tt=globalThis).__zod_globalConfig??(Tt.__zod_globalConfig={});const R=globalThis.__zod_globalConfig;function F(e){return e&&Object.assign(R,e),R}function Kr(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Me,2)),e.message}function Jr(e){this._zod.message=e}const Br={get:Kr,set:Jr,enumerable:!0,configurable:!0},Je={value:void 0,enumerable:!1},At=new WeakSet([Object.prototype,Error.prototype]),Vr=f("$ZodError",(e,t)=>{e.name="$ZodError",Je.value=t,Object.defineProperty(e,"issues",Je),Je.value=void 0,Object.defineProperty(e,"message",Br);const n=Object.getPrototypeOf(e);At.has(n)||(At.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))});function Wr(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function qr(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?Wr(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Hr(e,t=n=>n.message){const n={_errors:[]},r=(i,s=[])=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>r({issues:c},[...s,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...s,...o.path]);else{const c=[...s,...o.path];if(c.length===0)n._errors.push(t(o));else{let a=n,u=0;for(;u{const t=(n,r,i,s)=>{const o=i?{...i,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise)throw new H;if(c.issues.length){const a=new(s?.Err??e)(c.issues.map(u=>B(u,o,F())));throw yt(a,s?.callee??t),a}return c.value};return t},Ve=e=>{const t=async(n,r,i,s)=>{const o=i?{...i,async:!0}:{async:!0};let c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const a=new(s?.Err??e)(c.issues.map(u=>B(u,o,F())));throw yt(a,s?.callee??t),a}return c.value};return t},We=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new H;return s.issues.length?Nt(e,s.issues,i):{success:!0,data:s.value}};function Nt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(i=>B(i,n,F()))),t=void 0,n=void 0),r},set error(i){r=i,t=void 0,n=void 0}}}const qe=e=>async(t,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?Nt(e,s.issues,i):{success:!0,data:s.value}},Gr=Symbol.for("zod.compile.invalid"),Yr=Symbol.for("zod.compile.fallback"),Xr=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Gr)return!0;if(r.definite===!0&&n===void 0)return!1}return Qr(e,t,n)});function Qr(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun;let s;if(i?(r[Yr]=!0,s=i({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new H;return s.issues.length===0}const ei=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ti=e=>{const t=Be(e),n=(r,i,s,o)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,i,c,ge(n,o))};return n},ni=e=>{const t=Be(e),n=(r,i,s,o)=>t(r,i,s,ge(n,o));return n},ri=e=>{const t=Ve(e),n=async(r,i,s,o)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,i,c,ge(n,o))};return n},ii=e=>{const t=Ve(e),n=async(r,i,s,o)=>await t(r,i,s,ge(n,o));return n},si=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return We(e)(t,n,i)},oi=e=>(t,n,r)=>We(e)(t,n,r),ci=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return qe(e)(t,n,i)},ai=e=>async(t,n,r)=>qe(e)(t,n,r),ui=/^[cC][0-9a-z]{6,}$/,li=/^[0-9a-z]+$/,fi=)DELIM" +R"DELIM(/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,hi=/^[0-9a-vA-V]{20}$/,di=/^[A-Za-z0-9]{27}$/,pi=/^[a-zA-Z0-9_-]{21}$/;function mi(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const gi=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,_i=/^([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})$/,Rt=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)$/,vi=/^(?:[A-Za-z0-9_\'+\\-]+\\.)*[A-Za-z0-9_\'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,bi="^(?=[\\\\s\\\\S]*[\\\\p{Extended_Pictographic}\\\\p{Regional_Indicator}\\\\u20E3])[\\\\p{Extended_Pictographic}\\\\p{Emoji_Component}]+$";function yi(){return new RegExp(bi,"u")}const wi=/^(?:(?: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])$/,ki=/^(([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}|:))$/,zi=/^((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])$/,Si=/^(([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}|:))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$i=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Oi=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ei=/^https?$/,Ii=/^\\+[1-9]\\d{6,14}$/,jt="(?:(?:\\\\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])))";function Ti(e){return new RegExp(`^${e}$`)}const Pi=Ti(jt);function He(e){const t="(?:[01]\\\\d|2[0-3]):[0-5]\\\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\\\d`:`${t}:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\\\d(?:\\\\.\\\\d+)?`:`${t}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`}function Zi(e){return new RegExp(`^${He(e)}$`)}function Ai(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)");const n=`${He({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${He({precision:e.precision})}`:n;return new RegExp(`^${jt}T(?:${r})$`)}const Ni=/^[\\s\\S]{0,}$/,Ri=/^-?\\d+$/,Ge=/^-?\\d+(?:\\.\\d+)?$/,ji=/^(?:true|false)$/i,Mi=/^[^A-Z]*$/,Li=/^[^a-z]*$/,Z=f("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ye=e=>{const t=e.value;return!_r(t)&&t.length!==void 0},_e={number:"number",bigint:"bigint",object:"date"},Mt=f("$ZodCheckLessThan",(e,t)=>{Z.init(e,t);const n=_e[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{Z.init(e,t);const n=_e[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:_e[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fi=f("$ZodCheckMultipleOf",(e,t)=>{Z.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):vr(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ci=f("$ZodCheckNumberFormat",(e,t)=>{Z.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=zt[t.format];e._zod.check=o=>{const c=o.value;if(n){if(!Number.isInteger(c)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}cs&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Di=f("$ZodCheckMaxLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Ye),e._zod.check=r=>{const i=r.value,s=i.length;if((typeof i=="string"&&s>t.maximum?De(i):s)<=t.maximum)return;const c=xe(i);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),xi=f("$ZodCheckMinLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Ye),e._zod.check=r=>{const i=r.value,s=i.length;if((typeof i=="string"&&s>=t.minimum&&s=t.minimum)return;const c=xe(i);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ui=f("$ZodCheckLengthEquals",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=Ye),e._zod.check=r=>{const i=r.value,s=i.length,o=typeof i=="string"&&s>=t.length&&s<=t.length*2?De(i):s;if(o===t.length)return;const c=xe(i),a=o>t.length;r.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ve=f("$ZodCheckStringFormat",(e,t)=>{var n,r;Z.init(e,t),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ki=f("$ZodCheckRegex",(e,t)=>{ve.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ji=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Mi),ve.init(e,t)}),Bi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Li),ve.init(e,t)}),Vi=f("$ZodCheckIncludes",(e,t)=>{Z.init(e,t);const n=pe(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Wi=f("$ZodCheckStartsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`^${pe(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),qi=f("$ZodCheckEndsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`.*${pe(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",fo)DELIM" +R"DELIM(rmat:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Hi=f("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Gi{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`\n`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {\n${n.join(`\n`)}\n};`)(...Object.values(this.closed))}}const Yi={major:4,minor:6,patch:7},k=f("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Yi;const r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(const s of i)for(const o of s._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,a,u)=>{if(c.memo)return c;let l=L(c),h;for(const p of a){if(p._zod.def.when){if(Ar(c)||!p._zod.def.when(c))continue}else if(l)continue;const d=c.issues.length,m=p._zod.check(c);if(m instanceof Promise&&u?.async===!1)throw new H;if(h||m instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await m,c.issues.length!==d&&(Ce(c.issues,d,e),l||(l=L(c,d)))});else{if(c.issues.length===d)continue;Ce(c.issues,d,e),l||(l=L(c,d))}}return h?h.then(()=>c):c},o=(c,a,u)=>{if(L(c))return c.aborted=!0,c;const l=s(a,i,u);if(l instanceof Promise){if(u.async===!1)throw new H;return l.then(h=>e._zod.parse(h,u))}return e._zod.parse(l,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){const l=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(h=>o(h,c,a)):o(l,c,a)}const u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new H;return u.then(l=>s(l,i,a))}return s(u,i,a)}}},{get"~standard"(){return Et(this,"~standard",Ct(this))},set"~standard"(e){V(this,"~standard",e)}}),Ft=(e,t)=>e.issues.length?{issues:e.issues.map(n=>B(n,t,F()))}:{value:e.value};async function Xi(e,t){const n={async:!0};return Ft(await e._zod.run({value:t,issues:[]},n),n)}function Ct(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Ft(r,n)}catch{}return Xi(e,t)},vendor:"zod",version:1}}const Xe=f("$ZodString",(e,t)=>{k.init(e,t),e._zod.pattern=t.pattern??Ni,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),z=f("$ZodStringFormat",(e,t)=>{ve.init(e,t),Xe.init(e,t)}),Qi=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_i),z.init(e,t)}),es=f("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Rt(r))}else t.pattern??(t.pattern=Rt());z.init(e,t)}),ts=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=vi),z.init(e,t)}),Dt=1,be=2;function xt(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ns(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?xt(e)||be:rs(e,t)}function rs(e,t){if(!t.normalize&&t.protocol?.source===Ei.source&&!/^https?:\\/\\//i.test(e))return Dt;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(e)??be}return new URL(e)}catch{return be}}const is=/[\\t\\n\\r]/g;function Ut(e){return e.replace(is,"")}function ss(e,t){return t.lastIndex=0,t.test(e.hostname)}function os(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const cs=f("$ZodURL",(e,t)=>{z.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=ns(r,t);if(i===Dt){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(i===be){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Ut(r);return}t.hostname&&!ss(i,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!os(i,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Ut(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),as=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=yi()),z.init(e,t)}),us=f("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?pi:mi(t.length)),z.init(e,t)}),ls=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ui),z.init(e,t)}),fs=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=li),z.init(e,t)}),hs=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=fi),z.init(e,t)}),ds=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=hi),z.init(e,t)}),ps=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=di),z.init(e,t)}),ms=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ai(t)),z.init(e,t)}),gs=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Pi),z.init(e,t)}),_s=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Zi(t)),z.init(e,t)}),vs=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gi),z.init(e,t)}),bs=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wi),z.init(e,t)}),ys=/^[0-9a-fA-F:.]+$/;function Kt(e){return ys.test(e)?xt(`http://[${e}]`):!1}const ws=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ki),z.init(e,t),e._zod.check=n=>{Kt(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),ks=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zi),z.init(e,t)});function zs(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const i=Number(r);return`${i}`!==r||i<0||i>128?!1:Kt(n)}const Ss=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Si),z.init(e,t),e._zod.check=n=>{zs(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Jt(e){if(e==="")return!0;if(/\\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Bt=/^[0-9a-zA-Z+/]*={0,2}$/,$s=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bt),z.init(e,t),e._zod.check=n=>{Jt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Qe=/^[A-Za-z0-9_-]*$/;function Os(e){if(!Qe.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Jt(n)}const Es=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qe),z.init(e,t),e._zod.check=n=>{Os(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Is=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ii),z.init(e,t)});function Ts(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const Ps=f("$ZodJWT",(e,t)=>{z.init(e,t),e._zod.check=n=>{Ts(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Vt=f("$ZodNumber",(e,t)=>{k.init(e,t),e._zod.pattern=Ge,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...)DELIM" +R"DELIM(s?{received:s}:{}}),n}}),Zs=f("$ZodNumberFormat",(e,t)=>{Ci.init(e,t),Vt.init(e,t)}),As=f("$ZodBoolean",(e,t)=>{k.init(e,t),e._zod.pattern=ji,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Ns=f("$ZodUnknown",(e,t)=>{k.init(e,t),e._zod.parse=n=>n}),Rs=f("$ZodNever",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function js(e,t){const n=Ot(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(s=>s[0])),i=e._zod.parse;e._zod.parse=(s,o)=>{const c=t(s.value);if(c>r&&!o?.skipChecks&&o?.direction!=="backward"){for(const[a,u]of Ot(e._zod.def.checks))if(c>a&&u._zod.def.when(s)){const l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Ce(s.issues,l,e),s}}return i(s,o)}}const Ms=e=>Array.isArray(e)?e.length:-1;function Wt(e,t,n){e.issues.length&&t.issues.push(...J(n,e.issues)),t.value[n]=e.value}const Ls=f("$ZodArray",(e,t)=>{k.init(e,t);const n=R.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),i):Array(s.length);const o=[],c=i?.abortEarly;for(let a=0;aWt(h,r,a)));else if(Wt(l,r,a),c&&l.issues.length!==0&&L(l))break}return o.length?Promise.all(o).then(()=>r):r},js(e,Ms)});function ye(e,t,n,r,i,s){const o=n in r,c=s==="optional";if(!(!o&&c&&i==="optional")){if(e.issues.length){if(i!==void 0&&c&&!o)return;t.issues.push(...J(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(o||i==="defaulted"&&!c)&&(t.value[n]=void 0):t.value[n]=e.value}}const Fs=[];function qt(e){const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Fs,i=r.length?[...t,...r]:t;for(const o of i)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(o)}": expected a Zod schema`);const s=Sr(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Ht(e,t,n,r,i,s,o){const c=[],a=i.keySet,u=i.catchall._zod,l=u.def.type,h=u.optin,p=u.optout;let d=0;for(const m in t){if(o&&n.issues.length!==d){if(L(n,d))break;d=n.issues.length}if(a.has(m))continue;if(m==="__proto__"){l==="never"&&c.push(m);continue}if(l==="never"){c.push(m);continue}const g=u.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(v=>ye(v,n,m,t,h,p))):ye(g,n,m,t,h,p)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Cs=f("$ZodObject",(e,t)=>{k.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){const u=()=>{const l={...r};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=r,Object.defineProperty(t,"shape",{get:u})}const i=Le(()=>qt(t));y(e,"propValues",u=>{const l=u.def.shape,h={};for(const p in l){const d=l[p]._zod;if(d.values){Object.prototype.hasOwnProperty.call(h,p)||U(h,p,new Set);for(const m of d.values)h[p].add(m);d.optin!==void 0&&h[p].add(void 0)}}return h});const s=de,o=t.catchall;let c;const a=R.memoizer;a?.attach(e),e._zod.parse=(u,l)=>{c??(c=i.value);const h=u.value;if(!s(h))return u.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),u;u.value=a?a.alloc(e,u,{},l):{};const p=[],d=c.shape,m=l?.abortEarly;let g=u.issues.length;for(const v of c.allKeys){if(m&&u.issues.length!==g){if(L(u,g))break;g=u.issues.length}if(v==="__proto__")continue;const b=d[v],A=b._zod.optin,fe=b._zod.optout,he=b._zod.run({value:h[v],issues:[]},l);he instanceof Promise?p.push(he.then(I=>ye(I,u,v,h,A,fe))):ye(he,u,v,h,A,fe)}return o?Ht(p,h,u,l,i.value,e,m===!0):p.length?Promise.all(p).then(()=>u):u}}),Ds=f("$ZodObjectJIT",(e,t)=>{Cs.init(e,t);const n=e._zod.parse,r=Le(()=>qt(t)),i=R.memoizer,s=d=>{const m=r.value,g=m.symbolKeys,v=new Gi(["payload","ctx"],{shape:d,inst:e,memo:i,syms:g}),b=I=>`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`,A=(I,w)=>`\n let ${I}_ab = false;\n for (let i = 0; i < ${I}.issues.length; i++) {\n const iss = ${I}.issues[i];\n iss.path = iss.path ? [${w}, ...iss.path] : [${w}];\n payload.issues.push(iss);\n if (iss.continue !== true) ${I}_ab = true;\n }\n if (${I}_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }`;v.write("const input = payload.value;");const fe=Object.create(null);let he=0;for(const I of m.allKeys)fe[I]=`key_${he++}`;v.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const I of m.allKeys){if(I==="__proto__")continue;const w=fe[I],D=typeof I=="symbol"?`syms[${g.indexOf(I)}]`:yr(I),pt=`${D} in input`,pr=d[I],mt=pr?._zod?.optin,mr=mt!==void 0,Ru=pr?._zod?.optout==="optional";if(v.write(`const ${w} = ${b(D)};`),mr&&Ru){const ju=mt==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;v.write(`\n const ${w}_present = ${pt};\n if (!${w}.issues.length || ${w}_present) {\n if (${w}.issues.length) {${A(w,D)}\n }\n\n if (${ju}) {\n newResult[${D}] = ${w}.value;\n }\n }\n\n `)}else mr?(v.write(`\n if (${w}.issues.length) {${A(w,D)}\n }\n `),mt==="defaulted"?v.write(`newResult[${D}] = ${w}.value;`):v.write(`\n if (${w}.value !== undefined || ${pt}) {\n newResult[${D}] = ${w}.value;\n }\n `)):v.write(`\n const ${w}_present = ${pt};\n if (${w}.issues.length) {${A(w,D)}\n }\n if (!${w}_present && !${w}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${D}]\n });\n if (ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (${w}_present) {\n newResult[${D}] = ${w}.value;\n }\n\n `)}return v.write("payload.value = newResult;"),v.write("return payload;"),v.compile()};let o;const c=de,a=!R.jitless,l=a&&kr.value,h=t.catchall;let p;e._zod.parse=(d,m)=>{p??(p=r.value);const g=d.value;return c(g)?a&&l&&m?.async===!1&&m.jitless!==!0?(o||(o=s(t.shape)),d=o(d,m),h?Ht([],g,d,m,p,e,m?.abortEarly===!0):d):n(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),d)}});function Gt(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!L(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(o=>B(o,r,F())))}),t)}const xs=f("$ZodUnion",(e,t)=>{k.init(e,t),y(e,"optin",r=>r.def.options.some(i=>i._zod.optin==="defaulted")?"defaulted":r.def.options.some(i=>i._zod.optin!==void 0)?"optional":void 0),y(e,"optout",r=>r.def.options.some(i=>i._zod.optout==="optional")?"optional":void 0),y(e,"values",r=>{if(r.def.options.every(i=>i._zod.values))return new Set(r.def.options.flatMap(i=>Array.from(i._zod.values)))}),y(e,"pattern",r=>{if(r.def.options.every(i=>i._zod.pattern)){const i=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Fe(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1;const o=[];for(const c of t.options){const a=c._zod.run({value:r.value,issues:[]},i);if(a instanceof Promise)o.push(a),s=!0;else{if(a.issues.length===0)return a;o.push(a)}}return s?Promise.all(o).then(c=>Gt(c,r,e,i)):Gt(o,r,e,i)}}),Us=f("$ZodIntersect)DELIM" +R"DELIM(ion",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([a,u])=>Yt(n,a,u)):Yt(n,s,o)}});function et(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(G(e)&&G(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(const s of r){if(s==="__proto__")continue;const o=et(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r{let h;if(u.code==="unrecognized_keys"&&!u.path?.length)i??(i=u),h=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){const p=String(u.path[0]);s.has(p)||s.set(p,u),h=[p]}else return!1;for(const p of h)r.has(p)||r.set(p,{}),r.get(p)[l]=!0;return!0};for(const u of t.issues)o(u,"l")||e.issues.push(u);for(const u of n.issues)o(u,"r")||e.issues.push(u);const c=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){const u=i?c.filter(l=>i.keys.includes(l)):[];u.length&&e.issues.push({...i,keys:u});for(const l of c)!u.includes(l)&&s.has(l)&&e.issues.push(s.get(l))}const a=et(t.value,n.value);if(!a.valid){if(L(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}const Ks=f("$ZodTuple",(e,t)=>{k.init(e,t);const n=t.items,r=R.memoizer;r?.attach(e),e._zod.parse=(i,s)=>{const o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],s):[];const c=[],a=Xt(n,"optin"),u=Xt(n,"optout");if(!t.rest){if(o.lengthn.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:e,origin:"array"})}const l=new Array(n.length),h=t.rest?s?.abortEarly:void 0;let p=!1;for(let d=0;d{l[d]=g})):(l[d]=m,h&&!p&&m.issues.length&&(p=L(m)))}if(t.rest&&!p){let d=n.length-1;const m=o.slice(n.length);let g=i.issues.length;for(const v of m){if(h&&i.issues.length!==g){if(L(i,g))break;g=i.issues.length}d++;const b=t.rest._zod.run({value:v,issues:[]},s);b instanceof Promise?c.push(b.then(A=>Qt(A,i,d))):Qt(b,i,d)}}return c.length?Promise.all(c).then(()=>en(l,i,n,o,u)):en(l,i,n,o,u)}});function Xt(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Qt(e,t,n){e.issues.length&&t.issues.push(...J(n,e.issues)),t.value[n]=e.value}function en(e,t,n,r,i){for(let s=0;s=i&&n[s]._zod.optin==="optional"){t.value.length=s;break}if(o.issues.length){if(!c&&s>=i){t.value.length=s;break}t.issues.push(...J(s,o.issues))}t.value[s]=o.value}for(let s=t.value.length-1;s>=r.length&&(n[s]._zod.optout==="optional"&&t.value[s]===void 0);s--)t.value.length=s;return t}const Js=f("$ZodRecord",(e,t)=>{k.init(e,t);const n=R.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{const s=r.value;if(!G(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const o=[],c=t.keyType._zod.values;if(c&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};const a=new Set;for(const l of c)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(a.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;const h=t.keyType._zod.run({value:l,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(m=>B(m,i,F())),input:l,path:[l],inst:e});continue}const p=h.value;if(p==="__proto__")continue;const d=t.valueType._zod.run({value:s[l],issues:[]},i);d instanceof Promise?o.push(d.then(m=>{m.issues.length&&r.issues.push(...J(l,m.issues)),r.value[p]=m.value})):(d.issues.length&&r.issues.push(...J(l,d.issues)),r.value[p]=d.value)}let u;for(const l in s)if(!a.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;r.value[l]=s[l]}else u=u??[],u.push(l);u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let a;for(const u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ge.test(u)&&l.issues.length){const m=t.keyType._zod.run({value:Number(u),issues:[]},i);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(l=m)}if(l.issues.length){t.mode==="loose"?r.value[u]=s[u]:c?(a=a??[],a.push(u)):r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>B(m,i,F())),input:u,path:[u],inst:e});continue}const p=l.value;if(p==="__proto__")continue;const d=t.valueType._zod.run({value:s[u],issues:[]},i);d instanceof Promise?o.push(d.then(m=>{m.issues.length&&r.issues.push(...J(u,m.issues)),r.value[p]=m.value})):(d.issues.length&&r.issues.push(...J(u,d.issues)),r.value[p]=d.value)}a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Bs=f("$ZodEnum",(e,t)=>{k.init(e,t);const n=je(t.entries),r=new Set(n);e._zod.values=r,y(e,"pattern",i=>{const s=je(i.def.entries).filter(o=>zr.has(typeof o));return new RegExp(s.length?`^(${s.map(o=>pe(o.toString())).join("|")})$`:"^[^\\\\s\\\\S]$")}),e._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),Vs=f("$ZodTransform",(e,t)=>{k.init(e,t),e._zod.optin="optional",R.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Zt(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new H;return n.value=i,n}});function tn(e,t){return e.value=t.issues.length?void 0:t.value,e}const nn=f("$ZodOptional",(e,t)=>{k.init(e,t),y(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),y(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Fe(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(s=>tn(n,s)):tn(n,i)}return t.innerType._zod.run(n,r)}}),Ws=f("$ZodExactOptional",(e,t)=>{nn.init(e,t),y(e,"values",n=>n.def.innerType._zod.values),y(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),qs=f("$ZodNullable",(e,t)=>{k.init(e,t),y(e,"optin",n=>n.def.innerType._zod.optin),y(e,"optout",n=>n.def.innerType._zod.optout),y(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Fe(r.source)}|null)$`):void 0}),y(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Hs=f("$ZodDefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",n=>n.def.innerTyp)DELIM" +R"DELIM(e._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>rn(s,t)):rn(i,t)}});function rn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Gs=f("$ZodPrefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Ys=f("$ZodNonOptional",(e,t)=>{k.init(e,t),y(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>sn(s,e)):sn(i,e)}});function sn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function on(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(i=>B(i,r,F()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Xs=f("$ZodCatch",(e,t)=>{k.init(e,t),y(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",n=>n.def.innerType._zod.optout),y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(s=>on(n,s,t,r)):on(n,i,t,r)}}),Qs=f("$ZodPipe",(e,t)=>{k.init(e,t),y(e,"values",n=>n.def.in._zod.values),y(e,"optin",n=>n.def.in._zod.optin),y(e,"optout",n=>n.def.out._zod.optout),y(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(o=>we(o,t.in,r)):we(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>we(s,t.out,r)):we(i,t.out,r)}});function we(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const eo=f("$ZodReadonly",(e,t)=>{k.init(e,t),y(e,"propValues",n=>n.def.innerType._zod.propValues),y(e,"values",n=>n.def.innerType._zod.values),y(e,"optin",n=>n.def.innerType?._zod?.optin),y(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(cn):cn(i)}});function cn(e){return e.memo||(e.value=Object.freeze(e.value)),e}const to=f("$ZodCustom",(e,t)=>{Z.init(e,t),k.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>an(s,n,r,e));an(i,n,r,e)}});function an(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(ie(i))}}class no extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const tt="~memo",un=[];function ln(e){return e!==null&&typeof e=="object"}function nt(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const fn=new WeakMap,se=0,ke=1,oe=2;function ze(e,t,n){const r=fn.get(e);if(r!==void 0)return r?oe:se;if(t.has(e))return oe;t.add(e);let i=se;const s=l=>{if(i!==oe&&l?._zod){const h=ze(l,t);h>i&&(i=h)}},o=(l,h)=>{let p=se;for(const d of Reflect.ownKeys(l)){const m=Object.getOwnPropertyDescriptor(l,d);if(!m.enumerable)continue;const g=m.get?ke:m.value?._zod?ze(m.value,t):se;g>p&&(p=g)}return p},c=l=>{l>i&&(i=l)},a=e._zod.def;switch(a.type){case"object":{const l=_t(a);c(l?o(l):ke),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(const l of a.items)s(l);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(const l of a.options)s(l);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{const l=a._cachedInner??void 0;c(l?ze(l,t):ke);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const l in a){const h=Object.getOwnPropertyDescriptor(a,l);if(!h||h.get)continue;const p=h.value;if(!(!p||typeof p!="object")){if(p._zod)s(p);else if(Array.isArray(p))for(const d of p)s(d)}}}return t.delete(e),ro(e,i)}function ro(e,t){return t!==ke&&fn.set(e,t===oe),t}function io(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let Se;const $e=[],so={alloc(e,t,n){const r=Se;if(!r)return n;Se=void 0;const i={value:n,issues:null};return r.set(t.value,i),$e.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(i,s)=>{if(s.direction!=="backward"&&co(s,i.value))throw new no;return n(i,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,i,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const o=e._zod.parse,c=(a,u)=>{if(n===void 0){const b=ze(e,new Set);if(b===se)return e._zod.parse=o,e._zod.run===c&&(e._zod.run=o),o(a,u);b===oe||r?n=!0:r=!0}const l=a.value;if(!ln(l))return o(a,u);let h=u[tt];h||(h={buckets:new WeakMap,backEdges:void 0},u[tt]=h);let p;i===u?p=s:(p=io(h,e),i=u,s=p);const d=p.get(l);if(d)return a.value=d.value,d.issues?d.issues.length&&a.issues.push(...nt(d.issues)):(a.memo=!0,h.backEdges??(h.backEdges=new WeakSet),h.backEdges.add(d.value)),a;Se=p;const m=$e.length,g=o(a,u);Se=void 0;const v=$e.length>m?$e.pop():void 0;return g instanceof Promise?g.then(b=>(v&&(v.issues=b.issues.length?nt(b.issues):un),b)):(v&&(v.issues=g.issues.length?nt(g.issues):un),g)};e._zod.parse=c,e._zod.run===o&&(e._zod.run=c)})}};function oo(){return so}function co(e,t){const n=e[tt]?.backEdges;return n!==void 0&&ln(t)&&n.has(t)}const ao=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function i(s,o){return s==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const o=i(s.expected),c=Rr(s.input),a=i(c,s.input);return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${kt(s.values[0])}`:`Invalid option: expected one of ${gt(s.values,"|")}`;case"too_big":{const o=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);return c?`Too big: expected ${s.origin??"value"} to have ${o}${s.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${o}${s.maximum.toString()}`}case"too_small":{const o=s.exact?"exactly ":s.inclusive?">=":">",c=t(s.origin);return c?`Too small: expected ${s.origin} to have ${o}${s.minimum.toString()} ${c.unit}`:`Too small: expected ${s.origin} to be ${o}${s)DELIM" +R"DELIM(.minimum.toString()}`}case"invalid_format":{const o=s;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${gt(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(c=>`\'${c}\'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function uo(){return{localeError:ao()}}var hn;class lo{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fo(){return new lo}(hn=globalThis).__zod_globalRegistry??(hn.__zod_globalRegistry=fo());const ce=globalThis.__zod_globalRegistry;function dn(e){return e.checks&&(e.checks=[...e.checks]),e}function ho(e,t){return new e(dn({type:"string",..._(t)}))}function po(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._(t)})}function mo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._(t)})}function go(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._(t)})}function _o(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._(t)})}function vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._(t)})}function bo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._(t)})}function yo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._(t)})}function wo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._(t)})}function ko(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._(t)})}function zo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._(t)})}function So(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._(t)})}function $o(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._(t)})}function Oo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._(t)})}function Eo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._(t)})}function Io(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._(t)})}function To(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._(t)})}function Po(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._(t)})}function Zo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._(t)})}function Ao(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._(t)})}function No(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._(t)})}function Ro(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._(t)})}function jo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._(t)})}function Mo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._(t)})}function Lo(e,t){return new e({type:"string",format:"date",check:"string_format",..._(t)})}function Fo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._(t)})}function Co(e,t){return new e({type:"string",format:"duration",check:"string_format",..._(t)})}function Do(e,t){return new e(dn({type:"number",checks:[],..._(t)}))}function xo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._(t)})}function Uo(e,t){return new e({type:"boolean",..._(t)})}function Ko(e){return new e({type:"unknown"})}function Jo(e,t){return new e({type:"never",..._(t)})}function pn(e,t){return new Mt({check:"less_than",..._(t),value:e,inclusive:!1})}function rt(e,t){return new Mt({check:"less_than",..._(t),value:e,inclusive:!0})}function mn(e,t){return new Lt({check:"greater_than",..._(t),value:e,inclusive:!1})}function it(e,t){return new Lt({check:"greater_than",..._(t),value:e,inclusive:!0})}function gn(e,t){return new Fi({check:"multiple_of",..._(t),value:e})}function _n(e,t){return new Di({check:"max_length",..._(t),maximum:e})}function Oe(e,t){return new xi({check:"min_length",..._(t),minimum:e})}function vn(e,t){return new Ui({check:"length_equals",..._(t),length:e})}function Bo(e,t){return new Ki({check:"string_format",format:"regex",..._(t),pattern:e})}function Vo(e){return new Ji({check:"string_format",format:"lowercase",..._(e)})}function Wo(e){return new Bi({check:"string_format",format:"uppercase",..._(e)})}function qo(e,t){return new Vi({check:"string_format",format:"includes",..._(t),includes:e})}function Ho(e,t){return new Wi({check:"string_format",format:"starts_with",..._(t),prefix:e})}function Go(e,t){return new qi({check:"string_format",format:"ends_with",..._(t),suffix:e})}function Y(e){return new Hi({check:"overwrite",tx:e})}function Yo(e){return Y(t=>t.normalize(e))}function Xo(){return Y(e=>e.trim())}function Qo(){return Y(e=>e.toLowerCase())}function ec(){return Y(e=>e.toUpperCase())}function tc(){return Y(e=>wr(e))}function nc(e,t,n){return new e({type:"array",element:t,..._(n)})}function rc(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._(n)})}function ic(e,t){const n=sc(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(ie(i,r.value,n._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(ie(s))}},e(r.value,r)),t);return n}function sc(e,t){const n=new Z({check:"custom",..._(t)});return n._zod.check=e,n}function ae(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&U(e,r,n[r]);return e}function bn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ce,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function X(e,t,n,r,i){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(i);return Object.assign(n,s),!0}function O(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e)DELIM" +R"DELIM(._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,l);else{const p=o.schema,d=t.processors[i.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);d(e,t,p,l)}const h=e._zod.parent;h&&(o.ref||(o.ref=h),O(h,t,l),t.seen.get(h).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&ae(o.schema,a),t.io==="input"&&P(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function yn(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function wn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const o of e.seen.entries()){const c=e.metadataRegistry.get(o[0])?.id;if(c){const a=r.get(c);if(a&&a!==o[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,o[0])}}const i=o=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(o[0])?.id,p=e.external.uri??(m=>m);if(h)return{ref:p(h)};const d=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=d,{defId:d,ref:`${p("__shared")}#/${c}/${yn(d)}`}}const a="#",u=`${a}/${c}/`;if(o[1]===n&&!o[1].schema.id)return{ref:a};const l=o[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+yn(l)}},s=o=>{if(o[1].schema.$ref)return;const c=o[1],{ref:a,defId:u}=i(o);c.def={...c.schema},u&&(c.defId=u);const l=c.schema;for(const h in l)delete l[h];l.$ref=a};if(e.cycles==="throw")for(const o of e.seen.entries()){const c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/\n\nSet the \\`cycles\\` parameter to \\`"ref"\\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const c=o[1];if(t===o[0]){s(o);continue}if(e.external){const u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(c.cycle){s(o);continue}c.count>1&&e.reused==="ref"&&s(o)}e.external&&(e.sharedDefsExtractedFor=e.external)}function kn(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;kn(r);const i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;const s=r.type;for(const o of Array.isArray(s)?s:[s]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const zn=new Set(["type","properties","required","additionalProperties"]),Sn=["oneOf","anyOf"];function $n(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function st(e){const t=[];for(const s of e){if(typeof s!="object"||s.type!=="object")return null;for(const o in s)if(!zn.has(o))return null;t.push(s)}const n={},r=new Set;for(const s of t){for(const o in s.properties){if(Object.prototype.hasOwnProperty.call(n,o))continue;const c=[];for(const u of t){const l=u.properties?.[o]??$n(u);l!=null&&(c.some(h=>JSON.stringify(h)===JSON.stringify(l))||c.push(l))}const a=c.length===1?c[0]:st(c)??{allOf:c};U(n,o,a)}for(const o of s.required??[])r.add(o)}const i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(s=>s.additionalProperties===!1))i.additionalProperties=!1;else{const s=[];for(const o of t){const c=$n(o);c&&!s.some(a=>JSON.stringify(a)===JSON.stringify(c))&&s.push(c)}s.length===1?i.additionalProperties=s[0]:s.length>1&&(i.additionalProperties={allOf:s})}return i}function oc(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const i of zn)if(i in e)return;const n=t.filter(i=>Sn.some(s=>Array.isArray(i[s])));let r=null;if(!n.length)r=st(t);else{const i=n[0],s=Sn.find(a=>Array.isArray(i[a]));if(Object.keys(i).length!==1)return;const o=t.filter(a=>a!==i),c=i[s].map(a=>st([...o,a]));if(c.some(a=>!a))return;r={[s]:c}}r&&(delete e.allOf,ae(e,r))}function On(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=c=>{const a=e.seen.get(c);if(a.ref===null)return;const u=a.def??a.schema,l={...u},h=a.ref;if(a.ref=null,h){r(h);const d=e.seen.get(h),m=d.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):ae(u,m),ae(u,l),c._zod.parent===h)for(const v in u)v==="$ref"||v==="allOf"||v in l||delete u[v];if(m.$ref&&d.def)for(const v in u)v==="$ref"||v==="allOf"||v in d.def&&JSON.stringify(u[v])===JSON.stringify(d.def[v])&&delete u[v]}const p=c._zod.parent;if(p&&p!==h){r(p);const d=e.seen.get(p);if(d?.schema.$ref&&(u.$ref=d.schema.$ref,d.def))for(const m in u)m==="$ref"||m==="allOf"||m in d.def&&JSON.stringify(u[m])===JSON.stringify(d.def[m])&&delete u[m]}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const c of[...e.seen.entries()].reverse())r(c[0]);if(e.target!=="openapi-3.0")for(const c of e.seen.entries())kn(c[1].def??c[1].schema);for(const c of e.deferred)c();if(e.intersections.length){const c=new Map;for(const a of e.seen.values())for(const u of[a.schema,a.def]){const l=u?.allOf;if(!Array.isArray(l))continue;const h=c.get(l);h?h.push(u):c.set(l,[u])}for(const a of e.intersections)for(const u of c.get(a)??[])oc(u)}}const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(c)}ae(i,n.defId?n.schema:n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&i.id===s&&delete i.id;const o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const c of e.seen.entries()){const a=c[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,U(o,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const c=JSON.parse(JSON.stringify(i));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ee(t,"input",e.processors),output:Ee(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function P(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return P(r.element,n);if(r.type==="set")return P(r.valueType,n);if(r.type==="lazy")return P(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return P(r.innerType,n);if(r.type==="intersection")return P(r.left,n)||P(r.right,n);if(r.type==="record"||r.type==="map")return P(r.keyType,n)||P(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:P(r.in,n)||P(r.out,n);if(r.type==="object"){for(const i in r.shape)if(P(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(P(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(P(i,n))return!0;return!!(r.rest&&P(r.rest,n))}return!1}const cc=(e,t={})=>n=>{const r=bn({...n,processors:t});return O(e,r),wn(r,e),On(r,e)},Ee=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=bn({...i??{},target:s,io:t,processors:n});return O(e,o),wn(o,e),On(o,e)},Q=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ee=(e,t,n)=>{(e[t]===void 0||n{Q(e,"minimum",t),ee(e,"maximum",t)},In=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Tn=(e,t)=>{e.patterns??(e.patterns=new )DELIM" +R"DELIM(Set),e.patterns.add(t)},Pn=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},Zn=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},An=(e,t)=>Q(e,"minimum",t.minimum),Nn=(e,t)=>ee(e,"maximum",t.maximum),Rn=e=>(t,n)=>{Zn(t,n.format);const[r,i]=e[n.format];Q(t,"minimum",r),ee(t,"maximum",i)},ac={greater_than:(e,t)=>Q(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ee(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>In(e,t.value),number_format:Rn(zt),bigint_format:Rn($r),min_length:An,max_length:Nn,length_equals:(e,t)=>En(e,t.length),min_size:An,max_size:Nn,size_equals:(e,t)=>En(e,t.size),string_format:(e,t)=>{Zn(e,t.format),t.pattern&&Tn(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Pn(e,t.mime)};function j(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const s of r)ac[s._zod.def.check]?.(t,s._zod.def);const i=e._zod.bag;i.minimum!==void 0&&Q(t,"minimum",i.minimum),i.exclusiveMinimum!==void 0&&Q(t,"exclusiveMinimum",i.exclusiveMinimum),i.maximum!==void 0&&ee(t,"maximum",i.maximum),i.exclusiveMaximum!==void 0&&ee(t,"exclusiveMaximum",i.exclusiveMaximum),i.multipleOf!==void 0&&In(t,i.multipleOf),i.format!==void 0&&(t.format??(t.format=i.format),i.format.includes("int")&&(t.isInt=!0)),i.mime&&Pn(t,i.mime);for(const s of i.patterns??[])Tn(t,s);return t}const uc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lc=new Map([[Bt,$i],[Qe,Oi]]),jn=e=>lc.get(e)??e,fc=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:c,patterns:a,contentEncoding:u,laxFormat:l}=j(e);if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),c&&(i.format=uc[c]??c,i.format===""&&delete i.format,(c==="time"||l)&&delete i.format),u&&(i.contentEncoding=u),a&&a.size>0){const h=[...a].map(jn);h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},hc=(e,t,n,r)=>{const i=n,{minimum:s,maximum:o,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:l}=j(e);i.type=l?"integer":"number";const h=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),p=typeof a=="number"&&a<=(o??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";if(h?d?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),p?d?(i.maximum=a,i.exclusiveMaximum=!0):i.exclusiveMaximum=a:typeof o=="number"&&(i.maximum=o),c){const m=new Set;for(const b of c)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):X(e,t,i,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,...v]=m;g!==void 0&&(i.multipleOf=g),v.length&&(i.allOf=[...i.allOf??[],...v.map(b=>({multipleOf:b}))])}},dc=(e,t,n,r)=>{n.type="boolean"},pc=(e,t,n,r)=>{n.not={}},mc=(e,t,n,r)=>{},gc=(e,t,n,r)=>{const i=e._zod.def,s=je(i.entries);if(s.length===0){n.not={};return}s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},_c=(e,t,n,r)=>{X(e,t,n,r,"Custom types cannot be represented in JSON Schema")},vc=(e,t,n,r)=>{X(e,t,n,r,"Transforms cannot be represented in JSON Schema")},bc=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:o,maximum:c}=j(e);typeof o=="number"&&(i.minItems=o),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=O(s.element,t,{...r,path:[...r.path,"items"]})};function ue(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?ue(t.out):t.type==="catch"?ue(t.innerType):e._zod.optin}const yc=(e,t,n,r)=>{const i=n,s=e._zod.def,o=s.shape;if(Object.getOwnPropertySymbols(o).length&&X(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(const u in o)U(i.properties,u,O(o[u],t,{...r,path:[...r.path,"properties",u]}));const a=[];for(const u of Object.keys(o)){const l=s.shape[u];(t.io==="input"?ue(l)===void 0:l._zod.optout===void 0)&&a.push(u)}a.length>0&&(i.required=a),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=O(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},wc=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,o=i.options.map((c,a)=>O(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=o:n.anyOf=o},kc=(e,t,n,r)=>{const i=e._zod.def,s=O(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=O(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(o)?o.allOf:[o]];n.allOf=a,t.intersections.push(a)},zc=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="array";const o=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((g,v)=>O(g,t,{...r,path:[...r.path,o,v]})),u=s.rest?O(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;let l=s.items.length;for(;l>0;){const g=s.items[l-1];if(!(t.io==="input"?ue(g)!==void 0:g._zod.optout==="optional"))break;l--}const h=s.items.length,p=!s.rest;t.target==="draft-2020-12"?(i.prefixItems=a,p?i.items=!1:u&&(i.items=u),l>0&&(i.minItems=l),p&&(i.maxItems=h)):t.target==="openapi-3.0"?(i.items={anyOf:a},u&&i.items.anyOf.push(u),l>0&&(i.minItems=l),p&&(i.maxItems=h)):(i.items=a,p?i.additionalItems=!1:u&&(i.additionalItems=u),l>0&&(i.minItems=l),p&&(i.maxItems=h));const{minimum:d,maximum:m}=j(e);typeof d=="number"&&(i.minItems=d),typeof m=="number"&&(i.maxItems=m)};function ot(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const m=e.get(t)?.def;if(!m)return t;const g=ot(e,m,n);return g===m?t:g}for(const m of["anyOf","oneOf"]){const g=t[m];if(!Array.isArray(g))continue;const v=g.map(b=>ot(e,b,n));v.some((b,A)=>b!==g[A])&&(t={...t,[m]:v})}const r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!i&&!s?.some(m=>typeof m=="number"))return t;const{minimum:o,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:l,format:h,id:p,...d}=t;return d.enum?d.enum=d.enum.map(m=>typeof m=="number"?String(m):m):typeof d.const=="number"&&(d.const=String(d.const)),i&&(d.type="string",s||(d.pattern=(r.includes("number")?Ge:Ri).source)),d}const ct=new WeakMap;function Sc(e){const t=new Map;for(const r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);const n=new Map;for(const r of ct.get(e)??[]){const i=e.seen.get(r),s=(i?.def??i?.schema)?.propertyNames;if(!s||s===!0||n.has(s))continue;const o=ot(t,s,new Set);o!==s&&n.set(s,o)}if(n.size)for(const r of e.seen.values())for(const i of[r.schema,r.def]){const s=i&&n.get(i.propertyNames);s&&(i.propertyNames=s)}}const $c=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const o=s.keyType,c=j(o).patterns;if(s.mode==="loose"&&c&&c.size>0){const l=O(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const h of c)U(i.patternProperties,jn(h).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){i.propertyNames=O(s.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=ct.get(t);l||(l=[],ct.set(t,l),t.deferred.push(()=>Sc(t))),l.push(e)}i.additionalProperties=O(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const a=o._zod.values,u=t.io==="input"&&ue(s.valueType)!==void 0;if(a&&!s.partial&&!u){const l=[...a].filter(h=>typeof h=="string"||typeof h=="number");l.length>0&&(i.required=l.map(String))}},Oc=(e,t,n,r)=>{const i=e._zod.def,s=O(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},Ec=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},at=Symbol();function Mn(e,t,n,r,i){let s=!1;const o=JSON.stringify(e,(c,a)=>typeof)DELIM" +R"DELIM( a!="bigint"?a:(s=!0,null));return s?(X(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),at):JSON.parse(o)}const Ic=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;const o=Mn(i.defaultValue,e,t,n,r);o!==at&&(n.default=o)},Tc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);if(s.ref=i.innerType,t.io!=="input")return;const o=Mn(i.defaultValue,e,t,n,r);o!==at&&(n._prefault=o)},Pc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{X(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},Zc=(e,t,n,r)=>{const i=e._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?s?i.out:i.in:i.out;O(o,t,r);const c=t.seen.get(e);c.ref=o},Ac=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},Ln=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},Fn=new WeakSet([Object.prototype,Error.prototype]);function Ie(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const M=f("ZodError",(e,t)=>{Vr.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Fn.has(n)||(Fn.add(n),Ie(n,"format",r=>i=>Hr(r,i)),Ie(n,"flatten",r=>i=>qr(r,i)),Ie(n,"addIssue",r=>i=>{r.issues.push(i),r.message=JSON.stringify(r.issues,Me,2)}),Ie(n,"addIssues",r=>i=>{r.issues.push(...i),r.message=JSON.stringify(r.issues,Me,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Nc=Be(M),Rc=Ve(M),jc=We(M),Mc=qe(M),Lc=ti(M),Fc=ni(M),Cc=ri(M),Dc=ii(M),xc=si(M),Uc=oi(M),Kc=ci(M),Jc=ai(M);function Bc(){R.localeError||F(uo())}function le(){R.memoizer||F({memoizer:oo()})}const S=f("ZodType",(e,t)=>(Bc(),k.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(N(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return K(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ja(e,t))},superRefine(e,t){return this.check(Ba(e,t))},overwrite(e){return this.check(Y(e))},optional(){return Vn(this)},exactOptional(){return Za(this)},nullable(){return qn(this)},nullish(){return Vn(qn(this))},nonoptional(e){return La(this,e)},array(){return Kn(this)},or(e){return Jn([this,e])},and(e){return Sa(this,e)},transform(e){return Gn(this,Pa(e))},default(e){return Ra(this,e)},prefault(e){return Ma(this,e)},catch(e){return Ca(this,e)},pipe(e){return Gn(this,e)},readonly(){return Ua(this)},describe(e){const t=this.clone();return ce.add(t,{description:e}),t},meta(...e){if(e.length===0)return ce.get(this);const t=this.clone();return ce.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Et(this,"~standard",{...Ct(this),jsonSchema:{input:Ee(this,"input"),output:Ee(this,"output")}})},set"~standard"(e){V(this,"~standard",e)},parse:function e(t,n){return Nc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Rc(this,t,n,{callee:e})},safeParse(e,t){return jc(this,e,t)},async safeParseAsync(e,t){return Mc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){V(this,"spa",e)},validate(e,t){return Xr(this,e,t)},validateAsync(e,t){return ei(this,e,t)},encode:function e(t,n){return Lc(this,t,n,{callee:e})},decode:function e(t,n){return Fc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Cc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Dc(this,t,n,{callee:e})},safeEncode(e,t){return xc(this,e,t)},safeDecode(e,t){return Uc(this,e,t)},async safeEncodeAsync(e,t){return Kc(this,e,t)},async safeDecodeAsync(e,t){return Jc(this,e,t)},toJSONSchema(e){return cc(this,{})(e)},get description(){return ce.get(this)?.description},get _def(){return this._zod.def}}),Cn=f("_ZodString",(e,t)=>{Xe.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fc(e,n,r)},It({format:e=>j(e).format??null,minLength:e=>j(e).minimum??null,maxLength:e=>j(e).maximum??null},{regex(...e){return this.check(Bo(...e))},includes(...e){return this.check(qo(...e))},startsWith(...e){return this.check(Ho(...e))},endsWith(...e){return this.check(Go(...e))},min(...e){return this.check(Oe(...e))},max(...e){return this.check(_n(...e))},length(...e){return this.check(vn(...e))},nonempty(...e){return this.check(Oe(1,...e))},lowercase(e){return this.check(Vo(e))},uppercase(e){return this.check(Wo(e))},trim(){return this.check(Xo())},normalize(...e){return this.check(Yo(...e))},toLowerCase(){return this.check(Qo())},toUpperCase(){return this.check(ec())},slugify(){return this.check(tc())}})),Vc=f("ZodString",(e,t)=>{Xe.init(e,t),Cn.init(e,t)},{email(e){return this.check(po(Yc,e))},url(e){return this.check(yo(Qc,e))},jwt(e){return this.check(jo(pa,e))},emoji(e){return this.check(wo(ea,e))},guid(e){return this.check(mo(Xc,e))},uuid(e){return this.check(go(Te,e))},uuidv4(e){return this.check(_o(Te,e))},uuidv6(e){return this.check(vo(Te,e))},uuidv7(e){return this.check(bo(Te,e))},nanoid(e){return this.check(ko(ta,e))},cuid(e){return this.check(zo(na,e))},cuid2(e){return this.check(So(ra,e))},ulid(e){return this.check($o(ia,e))},base64(e){return this.check(Ao(fa,e))},base64url(e){return this.check(No(ha,e))},xid(e){return this.check(Oo(sa,e))},ksuid(e){return this.check(Eo(oa,e))},ipv4(e){return this.check(Io(ca,e))},ipv6(e){return this.check(To(aa,e))},cidrv4(e){return this.check(Po(ua,e))},cidrv6(e){return this.check(Zo(la,e))},e164(e){return this.check(Ro(da,e))},datetime(e){return this.check(Mo(Wc,e))},date(e){return this.check(Lo(qc,e))},time(e){return this.check(Fo(Hc,e))},duration(e){return this.check(Co(Gc,e))}});function te(e){return ho(Vc,e)}const $=f("ZodStringFormat",(e,t)=>{z.init(e,t),Cn.init(e,t)}),Wc=f("ZodISODateTime",(e,t)=>{ms.init(e,t),$.init(e,t)}),qc=f("ZodISODate",(e,t)=>{gs.init(e,t),$.init(e,t)}),Hc=f("ZodISOTime",(e,t)=>{_s.init(e,t),$.init(e,t)}),Gc=f("ZodISODuration",(e,t)=>{vs.init(e,t),$.init(e,t)}),Yc=f("ZodEmail",(e,t)=>{ts.init(e,t),$.init(e,t)}),Xc=f("ZodGUID",(e,t)=>{Qi.init(e,t),$.init(e,t)}),Te=f("ZodUUID",(e,t)=>{es.init(e,t),$.init(e,t)}),Qc=f("ZodURL",(e,t)=>{cs.init(e,t),$.init(e,t)}),ea=f("ZodEmoji",(e,t)=>{as.init(e,t),$.init(e,t)}),ta=f("ZodNanoID",(e,t)=>{us.init(e,t),$.init(e,t)}),na=f("ZodCUID",(e,t)=>{ls.init(e,t),$.init(e,t)}),ra=f("ZodCUID2",(e,t)=>{fs.init(e,t),$.init(e,t)}),ia=f("ZodULID",(e,t)=>{hs.init(e,t),$.init(e,t)}),sa=f("ZodXID",(e,t)=>{ds.init(e,t),$.init(e,t)}),oa=f("ZodKSUID",(e,t)=>{ps.init(e,t),$.init(e,t)}),ca=f("ZodIPv4",(e,t)=>{bs.init(e,t),$.init(e,t)}),aa=f("ZodIPv6",(e,t)=>{ws.init(e,t),$.init(e,t)}),ua=f("ZodCIDRv4",(e,t)=>{ks.init(e,t),$.init(e,t)}),la=f("ZodCIDRv6",(e,t)=>{Ss.init(e,t),$.init(e,t)}),fa=f("ZodBase64",(e,t)=>{$s.init(e,t),$.init(e,t)}),ha=f("ZodBase64URL",(e,t)=>{Es.init(e,t),$.init(e,t)}),da=f("ZodE164",(e,t)=>{Is.init(e,t),$.init(e,t)}),pa=f("ZodJWT",(e,t)=>{Ps.init(e,t),$.init(e,t)}),Dn=f("ZodNumber",(e,t)=>{Vt.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hc(e,n,r,i),e.isFinite=!0},It({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=j(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=j(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=j(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>j(e).format??null},{gt(e,t){return this.check(mn(e,t))},gte(e,t){return this.check(it(e,t))},min(e,t){return this)DELIM" +R"DELIM(.check(it(e,t))},lt(e,t){return this.check(pn(e,t))},lte(e,t){return this.check(rt(e,t))},max(e,t){return this.check(rt(e,t))},int(e){return this.check(xn(e))},safe(e){return this.check(xn(e))},positive(e){return this.check(mn(0,e))},nonnegative(e){return this.check(it(0,e))},negative(e){return this.check(pn(0,e))},nonpositive(e){return this.check(rt(0,e))},multipleOf(e,t){return this.check(gn(e,t))},step(e,t){return this.check(gn(e,t))},finite(){return this}}));function E(e){return Do(Dn,e)}const ma=f("ZodNumberFormat",(e,t)=>{Zs.init(e,t),Dn.init(e,t)});function xn(e){return xo(ma,e)}const ga=f("ZodBoolean",(e,t)=>{As.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dc(e,n,r)});function T(e){return Uo(ga,e)}const _a=f("ZodUnknown",(e,t)=>{Ns.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mc()});function Un(){return Ko(_a)}const va=f("ZodNever",(e,t)=>{Rs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pc(e,n,r)});function ba(e){return Jo(va,e)}const ya=f("ZodArray",(e,t)=>{le(),Ls.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bc(e,n,r,i),e.element=t.element},{min(e,t){return this.check(Oe(e,t))},nonempty(e){return this.check(Oe(1,e))},max(e,t){return this.check(_n(e,t))},length(e,t){return this.check(vn(e,t))},unwrap(){return this.element}});function Kn(e,t){return nc(ya,e,t)}const wa=f("ZodObject",(e,t)=>{le(),Ds.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yc(e,n,r,i),Cr(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Ia(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(N(this._zod.def,{catchall:e}))},passthrough(){return this.clone(N(this._zod.def,{catchall:Un()}))},loose(){return this.clone(N(this._zod.def,{catchall:Un()}))},strict(){return this.clone(N(this._zod.def,{catchall:ba()}))},strip(){return this.clone(N(this._zod.def,{catchall:void 0}))},extend(e){return Ir(this,e)},safeExtend(e){return Tr(this,e)},merge(e){return Pr(this,e)},pick(e){return Or(this,e)},omit(e){return Er(this,e)},partial(...e){return $t(lt,this,e[0])},exactPartial(...e){return $t(Wn,this,e[0],"exactPartial")},required(...e){return Zr(Hn,this,e[0])}});function C(e,t){const n={type:"object",shape:e??{},..._(t)};return new wa(n)}const ka=f("ZodUnion",(e,t)=>{xs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wc(e,n,r,i),e.options=t.options});function Jn(e,t){return new ka({type:"union",options:e,..._(t)})}const za=f("ZodIntersection",(e,t)=>{Us.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kc(e,n,r,i)});function Sa(e,t){return new za({type:"intersection",left:e,right:t})}const $a=f("ZodTuple",(e,t)=>{le(),Ks.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zc(e,n,r,i)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){const e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new lt({type:"optional",innerType:t}))})}});function Oa(e,t,n){const r=t instanceof k,i=r?n:t,s=r?t:null;return new $a({type:"tuple",items:e,rest:s,..._(i)})}const Bn=f("ZodRecord",(e,t)=>{le(),Js.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$c(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Ea(e,t,n){return!t||!t._zod?new Bn({type:"record",keyType:te(),valueType:e,..._(t)}):new Bn({type:"record",keyType:e,valueType:t,..._(n)})}const ut=f("ZodEnum",(e,t)=>{Bs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(r,i,s)=>gc(e,r,i),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ut({...t,checks:[],..._(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new ut({...t,checks:[],..._(i),entries:s})}});function Ia(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ut({type:"enum",entries:n,..._(t)})}const Ta=f("ZodTransform",(e,t)=>{le(),Vs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vc(e,n,r,i),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Zt(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(ie(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=e),n.issues.push(ie(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function Pa(e){return new Ta({type:"transform",transform:e})}const lt=f("ZodOptional",(e,t)=>{nn.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ln(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Vn(e){return new lt({type:"optional",innerType:e})}const Wn=f("ZodExactOptional",(e,t)=>{Ws.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ln(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Wn({type:"optional",innerType:e})}const Aa=f("ZodNullable",(e,t)=>{qs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Oc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function qn(e){return new Aa({type:"nullable",innerType:e})}const Na=f("ZodDefault",(e,t)=>{Hs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ic(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ra(e,t){return new Na({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wt(t)}})}const ja=f("ZodPrefault",(e,t)=>{Gs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Tc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ma(e,t){return new ja({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wt(t)}})}const Hn=f("ZodNonOptional",(e,t)=>{Ys.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ec(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function La(e,t){return new Hn({type:"nonoptional",innerType:e,..._(t)})}const Fa=f("ZodCatch",(e,t)=>{Xs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Pc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ca(e,t){return new Fa({type:"catch",innerType:e,catchValue:typeof t=="function"?t:xr(t)})}const Da=f("ZodPipe",(e,t)=>{Qs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Zc(e,n,r,i),e.in=t.in,e.out=t.out});function Gn(e,t){return new Da({type:"pipe",in:e,out:t})}const xa=f("ZodReadonly",(e,t)=>{eo.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ac(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ua(e){return new xa({type:"readonly",innerType:e})}const Ka=f("ZodCustom",(e,t)=>{to.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_c(e,n,r,i)});function Ja(e,t={}){return rc(Ka,e,t)}function Ba(e,t){return ic(e,t)}const Pe=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],ft=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"block)DELIM" +R"DELIM(s",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],Yn=E().int().nonnegative().max(864e13),Xn=C({level:E().int().nonnegative(),time:Yn,message:te()}),Qn=C({event:E().int().nonnegative(),value:E().nonnegative(),time:Yn}),er=C({previous:E().nonnegative()});Jn([Xn,Qn,er]);const Va=2**Pe.length-1,tr=2**ft.length-1;function nr(e,t){return Number.isInteger(t)&&t>=0&&t{this.#u(r)},onHeartbeat:r=>{this.#u(r)},onBeforeStop:r=>{r.send("/v1/log/subscribe?filter=0"),r.send("/v1/event/subscribe?filter=0")},onMessage:r=>{const i=Ha(r);if(!i)return!1;if(rr(i)&&!nr(this.#e,i.level))return!0;for(const s of this.#t)s(i);return!0},onUnclaimed:r=>{for(const i of this.#i)i(r)}}}getStatus=()=>this.#c.getStatus();subscribeStatus=t=>this.#c.subscribeStatus(t);start(){this.#r??=this.#c.attach(this.#a)}stop(){this.#r?.(),this.#r=null}subscribeFrames(t){return this.#t.add(t),()=>{this.#t.delete(t)}}subscribeInvalidFrames(t){return this.#i.add(t),()=>{this.#i.delete(t)}}setFilters(t,n){this.#e!==t&&(this.#e=t,this.#c.send(`/v1/log/subscribe?filter=${String(t)}`)),this.#n!==n&&(this.#n=n,this.#c.send(`/v1/event/subscribe?filter=${String(n)}`))}#u(t){t.send(`/v1/log/subscribe?filter=${String(this.#e)}`),t.send(`/v1/event/subscribe?filter=${String(this.#n)}`)}}function Qa(e){const t=e.trim();if(!t)throw new Error("Endpoint URL is required");const n=/^[a-z][a-z\\d+\\-.]*:\\/\\//iu.test(t)?t:`http://${t}`,r=new URL(n);if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return r.pathname=r.pathname.replace(/\\/+$/u,"")||"/",r.search="",r.hash="",r.toString().replace(/\\/$/u,"")}function eu(e){const t=new URL(Qa(e));return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.pathname="/",t.search="",t.hash="",t.toString()}const tu=C({store:C({address:T(),filter:T(),silent:E().int().nonnegative().nullable(),turbo:T(),pruned:E().int().nonnegative()}),node:C({network:te(),limited:T().optional(),blocks:T().optional(),witness:T().optional(),filters:T().optional(),privacy:T().optional()}),wallet:C({p2kh:E().int(),p2sh:E().int(),wif:E().int(),witness:te(),silent:te(),hd_private:E().int(),hd_public:E().int()}).optional(),network:C({relay:T(),alert:T(),reject:T(),compact:T(),address:T(),witness_tx:T(),memory_pool:T(),not_found:T(),protocol_maximum:E().int(),protocol_minimum:E().int()}).optional(),forks:Ea(te(),T()).transform(e=>Object.keys(e).filter(t=>e[t]))}),nu=C({height:E().int().nonnegative(),timestamp:E().int().positive().max(4294967295)}),Ae=E().int().nonnegative().max(Number.MAX_SAFE_INTEGER),ru=C({count:Ae,virtual:Ae,fee:Ae,histogram:Kn(Oa([E().nonnegative(),Ae]))}),iu="/v1/fees?format=json",su=5e3,ou=15e3,cu=E().int().nonnegative();function au(e){try{const t=JSON.parse(e),n=tu.safeParse(t);if(n.success)return{type:"configuration",payload:n.data};const r=nu.safeParse(t);if(r.success)return{type:"header",payload:r.data};const i=ru.safeParse(t);if(i.success)return{type:"fees",payload:i.data};const s=cu.safeParse(t);return s.success?{type:"top",payload:s.data}:null}catch{return null}}function uu(e){return`/v1/block/height/${String(e)}/header?format=json`}const ir=15e3,sr=3*ir,or={configuration:null,configurationReceivedAt:null,top:null,topReceivedAt:null,topHeader:null,headerReceivedAt:null,fees:null,invalidFrames:0};class lu{#e=or;#n=new Set;#t;#i;#c=null;#a=null;#r;#u=null;#s=null;#o=null;#p;#f=null;#h=null;constructor(t,n={}){this.#r=n.now??Date.now,this.#p=n.pollIntervalMs??ir,this.#t=t,this.#i={heartbeatMs:this.#p,onOpen:r=>{this.#u=this.#r(),r.send("/v1/configuration?format=json"),r.send("/v1/top/subscribe?format=json"),this.#h=null,this.#g()},onHeartbeat:r=>{const i=this.#e.topReceivedAt??this.#u;if(i!==null&&this.#r()-i>=sr){try{r.close(4e3,"Native top response timed out")}catch{}return}r.send("/v1/top?format=json")},onBeforeStop:r=>{r.send("/v1/top/subscribe?format=json&stop=true")},onMessage:r=>{const i=au(r);return i?(this.#d(i),!0):!1},onUnclaimed:()=>{this.#l({...this.#e,invalidFrames:this.#e.invalidFrames+1})}}}getStatus=()=>this.#t.getStatus();subscribeStatus=t=>this.#t.subscribeStatus(t);getState=()=>this.#e;subscribeState=t=>(this.#n.add(t),()=>{this.#n.delete(t)});start(){this.#f??=setInterval(()=>{this.#g()},su),this.#a??=this.#t.subscribeStatus(()=>{this.#t.getStatus().phase!=="connected"&&(this.#u=null,this.#h=null,this.#s=null,this.#o=null,this.#v())}),this.#c??=this.#t.attach(this.#i)}stop(){this.#f!==null&&clearInterval(this.#f),this.#f=null,this.#h=null,this.#a?.(),this.#a=null,this.#c?.(),this.#c=null}#d(t){const n=this.#r();if(t.type==="fees"){this.#h=null,this.#l({...this.#e,fees:{data:t.payload,receivedAt:n}});return}if(t.type==="top"){const r=this.#e.top!==null&&t.payloadnew WebSocket(n))},this.#s=this.#e.retryMinimumMs}getStatus=()=>this.#n;subscribeStatus=t=>(this.#i.add(t),()=>{this.#i.delete(t)});attach(t){this.#r.push(t);const n=this.#t;return n?.readyState===1&&this.#n.phase==="connected"&&(t.onOpen?.(n),this.#h(n,t)),()=>{const r=this.#r.indexOf(t);if(r<0)return;this.#r.splice(r,1),this.#m(t);const i=this.#t;if(i?.readyState===1)try{t.onBeforeStop?.(i)}catch{}}}start(){this.#o||(this.#o=!0,this.#s=this.#e.retryMinimumMs,this.#p())}stop(){this.#o=!1,this.#v();const t=this.#t;if(this.#t=null,t)try{if(t.readyState===1)for(const n of[...this.#r])n.onBeforeStop?.(t);t.close()}catch{}this.#l(cr)}send(t){if(this.#t?.readyState!==1)return!1;try{return this.#t.send(t),!0}catch{return!1}}#p(){if(!this.#o||this.#t)return;const t=this.#n.reconnects>0;this.#l({...this.#n,phase:t?"reconnecting":"connecting",attempt:this.#n.attempt+1,error:null});let n;try{n=this.#e.webSocketFactory(this.#e.url),this.#t=n}catch(r){this.#l({...this.#n,error:du(r)}),this.#f();return}this.#c=setTimeout(()=>{if(this.#t===n){this.#l({...this.#n,error:"Connection timed out"});try{n.close()}catch{this.#t=null,this.#f()}}},this.#e.connectTimeoutMs),n.addEventListener("open",()=>{if(!(this.#t!==n||!this.#o)){this.#d(),this.#s=this.#e.retryMinimumMs,this.#l({...this.#n,phase:"connected",connectedAt:this.#e.now(),error:null});for(const r of[...this.#r]){if(this.#t!==n)return;r.onOpen?.(n),this.#h(n,r)}}}),n.addEventListener("message",r=>{if(this.#t!==n||!this.#o)return;const i=hu(r.data);if(i===null)return;const s=this.#e.now();(this.#n.lastMessageAt===null||s-this.#n.lastMessageAt>=1e3)&&this.#l({...this.#n,lastMessageAt:s});const o=[...this.#r];if(!o.some(c=>c.onMessage(i)))for(const c of o)c.onUnclaimed?.(i)}),n.addEventListener("error",()=>{if(!(this.#t!==n||!this.#o)){this.#l({...this.#n,error:"WebSocket connection failed"});try{n.close()}catch{this.#t=null,this.#f()}}}),n.addEventListener("close",()=>{this.#t===n&&(this.#t=null,this.#d(),this.#g(),this.#o&&this.#f())})}#f(){if(!this.#o||this.#a)return;const t=1+(this.#e.random()*2-1)*this.#e.jitterRatio,n=Math.max(0,Math.round(this.#s*t));this.#s=Math.min(this.#s*2,this.#e.retryMaximumMs),this.#l({...this.#n,phase:"reconnecting",reconnects:this.#n.reconnects+1,connectedAt:null}),this.#a=setTimeout(()=>{this.#a=null,this.#p()},n)}#h(t,n){this.#m(n);const r=n.heartbeatMs??24e4;if(!n.onHeartbeat||r<=0)return;const i=setInterval(()=>{this.#t===t&&t.readyState===1&&n.onHeartbeat?.(t)},r);this.#u.set(n,i)}#d(){this.#c&&(clearTimeout(this.#c),this.#c=null)}#m(t){const n=this.#u.get(t);n!==void 0&&(clearInterval(n),this.#u.delete(t))}#g(){for(const t of this.#u.values())clearInterval(t);this.#u.clear()}#v(){this.#d(),this.#g(),this.#a&&(clearTimeout(this.#a),this.#a=null)}#l(t){this.#n=t;for(const n of this.#i)n()}}function hu(e){return typeof e=="string"?e:e instanceof ArrayBuffer?new TextDecoder().decode(e):null}function du(e){return e instanceof Error?e.message:"Unable to create WebSocket"}const ne=["occurrence-rate","occurrence-count","cumulative-occurrences"],pu=["payload-latest","payload-maximum","payload-change-rate",...ne],mu=["payload-average","payload-latest","payload-minimum","payload-maximum",...ne],gu=["payload-sum","payload-cumulative","payload-latest","payload-average",...ne],ar=["payload-latest","payload-average","payload-minimum","payload-maximum"],ur=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function lr(e){return`event:${String(e)}`}function fr(e){return`log:${String(e)}`}const ht="native:top";function _u(e){switch(e){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function vu(e){switch(e){case"height":return pu;case"duration":return mu;case"count":return gu;case"fee-rate":return[...ar,...ne];default:return ne}}function bu(e){switch(e){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function yu(e){const t=Ze(e),n=_u(t.valueKind);return{id:lr(e),source:"event",sourceId:e,name:t.name,label:t.label,category:t.category,payloadKind:n,allowedMeasures:vu(n),defaultMeasure:bu(n),description:e===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":n==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${t.label} event with a ${n} payload.`}}const wu=[...ur.map(e=>({id:e.id,source:"pool",sourceId:e.field,name:e.field,label:e.label,category:"pool",payloadKind:e.payloadKind,allowedMeasures:ar,defaultMeasure:"payload-latest",description:e.description})),...ft.map(e=>yu(e.id)),...Pe.map(e=>({id:fr(e.id),source:"log",sourceId:e.id,name:e.name,label:`${e.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:ne,defaultMeasure:"occurrence-rate",description:`${e.label} log message volume. Message text is not interpreted as numeric data.`})),{id:ht,source:"native",sourceId:"top",name:"canonical_top",label:"Current top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}];new Map(wu.map(e=>[e.id,e]));function ku(e,t){return Ze(e).valueKind==="fee-rate"?t/1e3:Ya(e,t)??t}const zu=3600*1e3,Su=1e3,$u=1e3,Ou=1e3;class hr{constructor(t){this.capacity=t,this.#e=Array.from({length:t})}capacity;#e;#n=0;#t=0;#i=null;get size(){return this.#t}push(t){const n=this.#t===this.capacity;return this.#i=null,this.#e[this.#n]=t,this.#n=(this.#n+1)%this.capacity,this.#t=Math.min(this.#t+1,this.capacity),n}clear(){this.#i=null,this.#e.fill(void 0),this.#n=0,this.#t=0}newestFirst(){if(this.#i)return this.#i;const t=[];for(let n=0;nthis.#A;getRecentLogs=()=>this.#i.newestFirst();getRecentEvents=()=>this.#c.newestFirst();subscribe=t=>(this.#t.add(t),()=>{this.#t.delete(t)});start(){thi)DELIM" +R"DELIM(s.#k||(this.tick(),this.#k=setInterval(()=>{this.tick()},1e3))}stop(){this.#k&&(clearInterval(this.#k),this.#k=null),this.#_&&(clearTimeout(this.#_),this.#_=null)}ingest(t,n=this.#e()){const r=this.#b(n);this.#g+=1,rr(t)?this.#j(t,r):Wa(t)?this.#M(t,r):qa(t)&&(this.#I+=1),this.#z()}recordInvalidFrame(){this.#T+=1,this.#z()}recordNativeTop(t,n=this.#e()){const r=this.#b(n),i=this.#f[ht];i?.value===t&&r-i.time<15e3||(this.#S(ht,r,t),this.#N(r),this.#z())}recordNativeFees(t,n=this.#e()){if(!Number.isFinite(n)||n=ou||this.#y!==null&&n<=this.#y.receivedAt)return;const r=this.#b(n);this.#y={data:t,receivedAt:n};for(const i of ur)this.#S(i.id,r,t[i.field]);this.#N(r),this.#z()}clearLogs(){this.#O+=this.#i.size,this.#i.clear(),this.flush()}clearEvents(){this.#c.clear(),this.flush()}reset(){this.#i.clear(),this.#c.clear(),this.#a.clear(),this.#r={},this.#u={},this.#s={},this.#o={},this.#p={},this.#f={},this.#h={},this.#d=this.#b(this.#e()),this.#g=0,this.#v=0,this.#l=0,this.#O=0,this.#E=0,this.#I=0,this.#T=0,this.#P=null,this.#Z=null,this.#y=null,this.#w=0,this.#$(this.#d),this.flush()}tick(){const t=this.#b(this.#e());this.#$(t),this.#N(t),this.#z()}flush(){this.#_&&(clearTimeout(this.#_),this.#_=null),this.#A=this.#R();for(const t of this.#t)t()}#j(t,n){this.#v+=1,this.#P=n,this.#w+=1,this.#i.push({...t,id:this.#w,receivedAt:n})&&(this.#l+=1),this.#S(fr(t.level),n,null)}#M(t,n){this.#E+=1,this.#Z=n,this.#w+=1,this.#c.push({...t,id:this.#w,receivedAt:n}),this.#S(lr(t.event),n,ku(t.event,t.value))}#b(t){return Number.isFinite(t)?(this.#m=Math.max(this.#m,t),this.#m):this.#m}#S(t,n,r){const i=this.#$(n);i.snapshot=null;const s=i.signals.get(t)??Eu();if(s.count+=1,Ne(this.#o,t,1),r!==null){s.samples+=1,s.sum+=r,s.minimum=s.minimum===null?r:Math.min(s.minimum,r),s.maximum=s.maximum===null?r:Math.max(s.maximum,r),(s.firstAt===null||n=s.lastAt)&&(s.last=r,s.lastAt=n),Ne(this.#p,t,r);const o=this.#f[t];(!o||n>=o.time)&&(this.#f[t]={value:r,time:n}),this.#h[t]=Math.max(this.#h[t]??r,r)}i.signals.set(t,s)}#$(t){const n=Math.floor(t/1e3)*1e3,r=this.#a.get(n);if(r)return r;const i={time:n,signals:new Map,snapshot:null};return this.#a.set(n,i),i}#N(t){const n=t-zu;for(const[r,i]of this.#a){if(r>=n)break;for(const[s,o]of i.signals)if(Ne(this.#r,s,o.count),Ne(this.#u,s,o.sum),o.last!==null&&o.lastAt!==null){const c=this.#s[s];(!c||o.lastAt>=c.time)&&(this.#s[s]={value:o.last,time:o.lastAt})}this.#a.delete(r)}}#z(){!this.#n||this.#_||(this.#_=setTimeout(()=>{this.#_=null,this.flush()},Su))}#R(){const t=[...this.#a.values()].map(n=>(n.snapshot??={time:n.time,signals:Object.fromEntries([...n.signals].map(([r,i])=>[r,{...i}]))},n.snapshot));return{now:this.#b(this.#e()),sessionStartedAt:this.#d,totalFrames:this.#g,totalLogs:this.#v,evictedLogs:this.#l,clearedLogs:this.#O,totalEvents:this.#E,totalAcks:this.#I,invalidFrames:this.#T,buckets:t,priorSignalCounts:{...this.#r},priorSignalSums:{...this.#u},priorSignalLatest:dr(this.#s),signalTotals:{...this.#o},signalSums:{...this.#p},signalLatest:dr(this.#f),signalMaximums:{...this.#h},recentLogs:this.#i.newestFirst(),recentEvents:this.#c.newestFirst(),lastLogAt:this.#P,lastEventAt:this.#Z,poolSnapshot:this.#y}}}const Re=40;function Tu(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>nr(t.filter,o.level)&&(!n||o.message.toLowerCase().includes(n)||Ga(o.level).name.includes(n))),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-Re));return{logs:r.slice(s,s+Re),retained:e.length,matched:r.length,offset:s}}function Pu(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>{const c=Ze(o.event);return(t.category==="all"||c.category===t.category)&&(!n||c.name.includes(n)||c.label.toLowerCase().includes(n)||String(o.value).includes(n))}),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-Re));return{events:r.slice(s,s+Re),retained:e.length,matched:r.length,offset:s}}function Zu(e,t){const{buckets:n,recentLogs:r,recentEvents:i,...s}=e,o=new Map(t?.buckets.map(c=>[c.time,c]));return{summary:s,reset:t===null,firstBucketTime:n[0]?.time??e.now,buckets:n.filter(c=>o.get(c.time)!==c),recentLogs:r===t?.recentLogs?null:r,recentEvents:i===t?.recentEvents?null:i}}class Au{constructor(t,n=i=>new fu({url:eu(i)}),r=Date.now){this.send=t,this.createSocket=n,this.#e=new Iu(r,!1)}send;createSocket;#e;#n=null;#t=null;#i=[];#c=null;#a=null;#r=0;#u=null;#s=null;#o=null;#p=[];handle(t){if(t.type==="stop"){this.#d(),this.#e.stop(),this.send({type:"stopped"});return}if(t.type==="configure"){if(t.generation=this.#r&&this.#f(t.generation);return}if(t.generation===this.#r)switch(t.type){case"pause-display":{t.stream==="logs"?this.#s=t.paused?this.#s??this.#e.getRecentLogs():null:this.#o=t.paused?this.#o??this.#e.getRecentEvents():null;break}case"poll-events":{this.send({type:"events",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:Pu(this.#o??this.#e.getRecentEvents(),t.query)});break}case"poll-logs":{this.send({type:"logs",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:Tu(this.#s??this.#e.getRecentLogs(),t.query)});break}case"native-top":{this.#e.recordNativeTop(t.height,t.receivedAt);break}case"native-fees":{this.#e.recordNativeFees(t.fees,t.receivedAt);break}case"clear-logs":{this.#e.clearLogs(),this.#s!==null&&(this.#s=[]);break}case"clear-events":{this.#e.clearEvents(),this.#o!==null&&(this.#o=[]);break}case"poll":{if(!this.#n)return;this.#e.flush();const n=this.#e.getSnapshot();this.send({type:"snapshot",generation:this.#r,requestId:t.requestId,status:this.#n.getStatus(),update:Zu(n,this.#u)}),this.#u=n;break}}}#f(t){this.#r=t,this.#u=null,this.#s!==null&&(this.#s=[]),this.#o!==null&&(this.#o=[]),this.#e.reset()}#h(t,n,r){this.#d(),this.#c=t,this.#a=n;const i=this.createSocket(t),s=n===t?i:this.createSocket(n);this.#i=i===s?[i]:[i,s];const o=new Xa(i,{logFilter:r}),c=new lu(s),a=()=>{this.send({type:"native",status:c.getStatus(),live:c.getState()})};this.#n=o,this.#t=c,this.#p=[o.subscribeFrames(u=>{this.#e.ingest(u)}),o.subscribeInvalidFrames(()=>{this.#e.recordInvalidFrame()}),c.subscribeStatus(a),c.subscribeState(a)],o.start(),c.start();for(const u of this.#i)u.start()}#d(){for(const t of this.#p)t();this.#p=[];for(const t of this.#i)t.stop();this.#n?.stop(),this.#t?.stop(),this.#i=[],this.#n=null,this.#t=null}}const dt=globalThis,Nu=new Au(e=>{dt.postMessage(e)});dt.addEventListener("message",e=>{Nu.handle(e.data),e.data.type==="stop"&&dt.close()})})();\n',P_=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",mx],{type:"text/javascript;charset=utf-8"});function _j(n){let i;try{if(i=P_&&(self.URL||self.webkitURL).createObjectURL(P_),!i)throw"";const a=new Worker(i,{name:n?.name});return a.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(i)}),a}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(mx),{name:n?.name})}}const K_=100,px=15e3,Sj=3*px,Su={configuration:null,configurationReceivedAt:null,top:null,topReceivedAt:null,topHeader:null,headerReceivedAt:null,fees:null,invalidFrames:0};function xj(n,i){const a=new Map((i.reset?[]:n.buckets).filter(l=>l.time>=i.firstBucketTime).map(l=>[l.time,l]));for(const l of i.buckets)a.set(l.time,l);return{...i.summary,buckets:[...a.values()],recentLogs:Yf(i.reset?[]:n.recentLogs,i.recentLogs),recentEvents:Yf(i.reset?[]:n.recentEvents,i.recentEvents)}}function Yf(n,i){if(i===null)return n;const a=new Map(n.map(l=>[l.id,l]));return i.map(l=>a.get(l.id)??l)}const Hr={phase:"idle",attempt:0,reco)DELIM" +R"DELIM(nnects:0,connectedAt:null,lastMessageAt:null,error:null};class wj{constructor(i=()=>new _j){this.createWorker=i}createWorker;#e=null;#t=new Xb().getSnapshot();#n=Hr;#i=new Set;#s=new Set;#r=Hr;#l=Su;#f=new Set;#u=null;#o=null;#b=to;#a=0;#g=0;#c=null;#h=null;#_=null;#m=new Set;#S={logs:[],retained:0,matched:0,offset:0};#E={search:"",filter:to,offset:0};#x=0;#v=null;#w=null;#p=new Set;#A={events:[],retained:0,matched:0,offset:0};#M={search:"",category:"all",offset:0};#T=0;#d=null;#O=!1;#k=!1;getSnapshot=()=>this.#t;getStatus=()=>this.#n;getNativeStatus=()=>this.#r;getNativeLive=()=>this.#l;subscribeNative=i=>(this.#f.add(i),()=>{this.#f.delete(i)});getLogWindow=()=>this.#S;getEventWindow=()=>this.#A;subscribeEvents=i=>(this.#p.add(i),this.#j(),this.#U(),()=>{this.#p.delete(i),this.#p.size===0&&this.#N()});subscribeLogs=i=>(this.#m.add(i),this.#z(),this.#R(),()=>{this.#m.delete(i),this.#m.size===0&&this.#D()});subscribe=i=>(this.#i.add(i),()=>{this.#i.delete(i)});subscribeStatus=i=>(this.#s.add(i),()=>{this.#s.delete(i)});configure(i,a,l){i===this.#u&&a===this.#o&&l===this.#b||(this.#u!==null&&i!==this.#u&&(this.reset(),this.#L({...Hr,phase:"connecting"})),this.#o!==null&&a!==this.#o&&this.#$({...Hr,phase:"connecting"},Su),this.#u=i,this.#o=a,this.#b=l,this.#C())}start(){if(!(this.#e||this.#u===null||this.#o===null))try{const i=this.createWorker();this.#e=i,this.#S={logs:[],retained:0,matched:0,offset:0},this.#A={events:[],retained:0,matched:0,offset:0};for(const a of this.#m)a();for(const a of this.#p)a();this.#L({...Hr,phase:"connecting"}),this.#$({...Hr,phase:"connecting"},Su),i.onmessage=a=>{if(this.#e!==i)return;const l=a.data;if(l.type==="events"){if(l.requestId!==this.#d||(this.#d=null,l.generation!==this.#a))return;if(l.queryVersion!==this.#T){this.#j();return}this.#A={...l.window,events:Yf(this.#A.events,l.window.events)};for(const u of this.#p)u();return}if(l.type==="logs"){if(l.requestId!==this.#v||(this.#v=null,l.generation!==this.#a))return;if(l.queryVersion!==this.#x){this.#z();return}this.#S={...l.window,logs:Yf(this.#S.logs,l.window.logs)};for(const u of this.#m)u();return}if(l.type==="native"){this.#$(l.status,l.live);return}if(l.type==="snapshot"&&l.requestId===this.#c&&(this.#c=null,l.generation===this.#a)){this.#t=xj(this.#t,l.update),this.#L(l.status);for(const u of this.#i)u()}},i.onerror=()=>{this.#H("Telemetry worker failed. Reload the dashboard to reconnect.")},i.onmessageerror=()=>{this.#H("Unable to read telemetry worker data. Reload the dashboard to reconnect.")},this.#C(),this.#O&&this.#y({type:"pause-display",generation:this.#a,stream:"logs",paused:!0}),this.#k&&this.#y({type:"pause-display",generation:this.#a,stream:"events",paused:!0}),this.#Z(),this.getStatus().error===null&&(this.#h=setInterval(()=>{this.#Z()},1e3)),this.#R(),this.#U()}catch(i){this.#H(`Unable to start telemetry worker: ${i instanceof Error?i.message:String(i)}`)}}stop(){this.#B();const i=this.#e;if(this.#e=null,i){const a=setTimeout(()=>{i.terminate()},500),l=()=>{clearTimeout(a),i.terminate()};i.onmessage=u=>{u.data.type==="stopped"&&l()},i.onerror=l,i.onmessageerror=l;try{i.postMessage({type:"stop"})}catch{l()}}this.#L(Hr),this.#$(Hr,Su)}recordNativeTop(i,a=Date.now()){this.#y({type:"native-top",generation:this.#a,height:i,receivedAt:a})}recordNativeFees(i,a=Date.now()){this.#y({type:"native-fees",generation:this.#a,fees:i,receivedAt:a})}clearLogs(){this.#y({type:"clear-logs",generation:this.#a}),this.#x+=1,this.#z()}clearEvents(){this.#y({type:"clear-events",generation:this.#a}),this.#T+=1,this.#j()}setLogsPaused(i){i!==this.#O&&(this.#O=i,this.#D(),this.#y({type:"pause-display",generation:this.#a,stream:"logs",paused:i}),this.#x+=1,this.#z(),this.#R())}setEventsPaused(i){i!==this.#k&&(this.#k=i,this.#N(),this.#y({type:"pause-display",generation:this.#a,stream:"events",paused:i}),this.#T+=1,this.#j(),this.#U())}reset(){this.#a+=1,this.#c=null,this.#v=null,this.#d=null,this.#S={logs:[],retained:0,matched:0,offset:0},this.#A={events:[],retained:0,matched:0,offset:0},this.#t=new Xb().getSnapshot(),this.#y({type:"reset",generation:this.#a});for(const i of this.#i)i();for(const i of this.#m)i();for(const i of this.#p)i()}setLogQuery(i){JSON.stringify(i)!==JSON.stringify(this.#E)&&(this.#E=i,this.#x+=1,this.#z())}setEventQuery(i){JSON.stringify(i)!==JSON.stringify(this.#M)&&(this.#M=i,this.#T+=1,this.#j())}#U(){!this.#e||this.#p.size===0||this.#w||this.#k||(this.#w=setInterval(()=>{this.#j()},K_),this.#j())}#j(){this.#d!==null||!this.#e||this.#p.size===0||(this.#d=++this.#g,this.#y({type:"poll-events",generation:this.#a,requestId:this.#d,queryVersion:this.#T,query:this.#M}))}#N(){this.#w&&clearInterval(this.#w),this.#w=null,this.#d=null}#R(){!this.#e||this.#m.size===0||this.#_||this.#O||(this.#_=setInterval(()=>{this.#z()},K_),this.#z())}#z(){this.#v!==null||!this.#e||this.#m.size===0||(this.#v=++this.#g,this.#y({type:"poll-logs",generation:this.#a,requestId:this.#v,queryVersion:this.#x,query:this.#E}))}#D(){this.#_&&clearInterval(this.#_),this.#_=null,this.#v=null}#C(){this.#u!==null&&this.#o!==null&&this.#y({type:"configure",generation:this.#a,endpoint:this.#u,nativeEndpoint:this.#o,logFilter:this.#b})}#Z(){this.#c!==null||!this.#e||(this.#c=++this.#g,this.#y({type:"poll",generation:this.#a,requestId:this.#c}))}#y(i){try{this.#e?.postMessage(i)}catch{this.#H("Unable to communicate with telemetry worker. Reload the dashboard to reconnect.")}}#B(){this.#D(),this.#N(),this.#h&&clearInterval(this.#h),this.#h=null,this.#c=null}#H(i){this.#B(),this.#e?.terminate(),this.#e=null,this.#L({...Hr,error:i}),this.#$({...Hr,error:i},Su)}#$(i,a){this.#r=i,this.#l=a;for(const l of this.#f)l()}#L(i){if(JSON.stringify(i)!==JSON.stringify(this.#n)){this.#n=i;for(const a of this.#s)a()}}}const gx="libbitcoinAdminDashboardLogFilter";function vx(){try{return globalThis.localStorage}catch{return null}}function zj(n=vx()){try{const i=n?.getItem(gx);if(!i)return to;const a=JSON.parse(i);return typeof a=="number"&&Number.isInteger(a)&&a>=0&&a<=Fp?a:to}catch{return to}}function Tj(n,i=vx()){try{i?.setItem(gx,String(n))}catch{}}const yx=se.createContext(void 0),Ej=n=>{const i=se.useContext(yx);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},Oj=({client:n,children:i})=>(se.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),x.jsx(yx.Provider,{value:n,children:i})),Nj={setTimeout:(n,i)=>setTimeout(n,i),clearTimeout:n=>clearTimeout(n),setInterval:(n,i)=>setInterval(n,i),clearInterval:n=>clearInterval(n)};var Aj=class{#e=Nj;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,i){return this.#e.setTimeout(n,i)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,i){return this.#e.setInterval(n,i)}clearInterval(n){this.#e.clearInterval(n)}};const Qa=new Aj;function Mj(n){setTimeout(n,0)}const jj=typeof window>"u"||"Deno"in globalThis;function gi(){}function kj(n,i){return typeof n=="function"?n(i):n}function bx(n){return typeof n=="number"&&n>=0&&n!==1/0}function _x(n,i){return Math.max(n+(i||0)-Date.now(),0)}function kt(n,i){return typeof n=="function"?n(i):n}function G_(n,i){const{type:a="all",exact:l,fetchStatus:u,predicate:f,queryKey:d,stale:m}=n;if(d){if(l){if(i.queryHash!==pg(d,i.options))return!1}else if(!fo(i.queryKey,d))return!1}if(a!=="all"){const p=i.isActive();if(a==="active"&&!p||a==="inactive"&&p)return!1}return!(typeof m=="boolean"&&i.isStale()!==m||u&&u!==i.state.fetchStatus||f&&!f(i))}function Y_(n,i){const{exact:a,status:l,predicate:u,mutationKey:f}=n;if(f){if(!i.options.mutationKey)return!1;if(a){if(Lu(i.options.mutationKey)!==Lu(f))return!1}else if(!fo(i.options.mutationKey,f))return!1}return!(l&&i.state.status!==l||u&&!u(i))}function pg(n,i){return(i?.queryKeyHashFn||Lu)(n)}function Lu(n){return JSON.stringify(n,(i,a)=>zp(a)?Object.keys(a).sort().reduce((l,u)=>(l[u]=a[u],l),{}):a)}function fo(n,i){if(n===i)return!0;if(typeof n!=typeof i)return!1;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(Array.isArray(n)&&Array.isArra)DELIM" +R"DELIM(y(i)){if(i.length>n.length)return!1;for(let l=0;l500)return i;const l=F_(n)&&F_(i);if(!l&&!(zp(n)&&zp(i)))return i;const u=(l?n:Object.keys(n)).length,f=l?i:Object.keys(i),d=f.length,m=l?new Array(d):{};let p=0;for(let g=0;g{Qa.setTimeout(i,n)})}function Tp(n,i,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,i):a.structuralSharing!==!1?xx(n,i):i}function Cj(n,i,a=0){const l=[...n,i];return a&&l.length>a?l.slice(-a):l}function Dj(n,i,a=0){const l=[i,...n];return a&&l.length>a?l.slice(0,a):l}const gg=Symbol();function wx(n,i){return!n.queryFn&&i?.initialPromise?()=>i.initialPromise:!n.queryFn||n.queryFn===gg?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function zx(n,i){return typeof n=="function"?n(...i):!!n}const vg=Symbol();function Uj(n,i,a,l){let u=!1,f;return Object.defineProperties(n,{[vg]:{value:l},signal:{enumerable:!0,get:()=>(f??=i(),u||(u=!0,f.aborted?a():f.addEventListener("abort",a,{once:!0})),f)}}),n}let Zj=()=>jj;const yg=()=>Zj();var qu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$j=class extends qu{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(i=>{i(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const bg=new $j,Lj=Mj;function Hj(){let n=[],i=0,a=m=>{m()},l=m=>{m()},u=Lj;const f=m=>{i?n.push(m):u(()=>{a(m)})},d=()=>{const m=n;n=[],m.length&&u(()=>{l(()=>{m.forEach(p=>{a(p)})})})};return{batch:m=>{let p;i++;try{p=m()}finally{i--,i||d()}return p},batchCalls:m=>(...p)=>{f(()=>{m(...p)})},schedule:f,setNotifyFunction:m=>{a=m},setBatchNotifyFunction:m=>{l=m},setScheduler:m=>{u=m}}}const Un=Hj();var Bj=class extends qu{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(i=>{i(n)}))}isOnline(){return this.#e}};const Ff=new Bj;function qj(n){return Math.min(1e3*2**n,3e4)}function Tx(n){return(n??"online")==="online"?Ff.isOnline():!0}var Ep=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function Ex(n){let i=!1,a=0,l,u="pending",f,d;const m=new Promise((D,X)=>{f=D,d=X});m.catch(gi);const p=()=>u!=="pending",g=D=>{if(!p()){const X=new Ep(D);A(X),n.onCancel?.(X)}},b=()=>{i=!0},y=()=>{i=!1},w=()=>bg.isFocused()&&(n.networkMode==="always"||Ff.isOnline())&&n.canRun(),O=()=>Tx(n.networkMode)&&n.canRun(),T=D=>{p()||(l?.(),u="resolved",f(D))},A=D=>{p()||(l?.(),u="rejected",d(D))},k=D=>new Promise(X=>{l=G=>{(p()||D())&&X(G)},n.onPause?.()}).then(()=>{l=void 0,p()||n.onContinue?.()}),L=()=>{if(p())return;let D;const X=a===0?n.initialPromise:void 0;try{D=X??n.fn()}catch(G){D=Promise.reject(G)}Promise.resolve(D).then(T).catch(G=>{if(p())return;const ee=n.retry??(yg()?0:3),V=n.retryDelay??qj,ne=typeof V=="function"?V(a,G):V,ae=ee===!0||typeof ee=="number"&&ap()||w()?void 0:k(w)).then(()=>{i?A(G):L()})})};return{promise:m,status:()=>u,cancel:g,continue:()=>(l?.(),m),cancelRetry:b,continueRetry:y,canStart:O,start:()=>(O()?L():k(O).then(L),m)}}var Ox=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),bx(this.gcTime)&&(this.#e=Qa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(yg()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Qa.clearTimeout(this.#e),this.#e=void 0)}};function Vj(n){return{onFetch:(i,a)=>{const l=i.options,u=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],d=i.state.data?.pageParams||[];let m={pages:[],pageParams:[]},p=0;const g=async()=>{let b=!1;const y=i,w=A=>{Uj(A,()=>i.signal,()=>b=!0,y[vg])},O=wx(i.options,i.fetchOptions),T=async(A,k,L)=>{if(b)return Promise.reject(i.signal.reason);if(k==null&&A.pages.length)return Promise.resolve(A);const X=(()=>{const ne={client:i.client,queryKey:i.queryKey,pageParam:k,direction:L?"backward":"forward",meta:i.options.meta};return w(ne),ne})(),G=await O(X),{maxPages:ee}=i.options,V=L?Dj:Cj;return{pages:V(A.pages,G,ee),pageParams:V(A.pageParams,k,ee)}};if(u&&f.length){const A=u==="backward",k=A?Ij:J_,L={pages:f,pageParams:d};m=await T(L,k(l,L),A)}else{const A=n??f.length;do{const k=p===0?d[0]===void 0?l.initialPageParam:d[0]:J_(l,m);if(p>0&&k==null)break;m=await T(m,k),p++}while(pi.options.persister?.(g,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},a):i.fetchFn=g}}}function J_(n,{pages:i,pageParams:a}){const l=i.length-1;return i.length>0?n.getNextPageParam(i[l],i,a[l],a):void 0}function Ij(n,{pages:i,pageParams:a}){return i.length>0?n.getPreviousPageParam?.(i[0],i,a[0],a):void 0}var Pj=class extends Ox{#e;#t;#n;#i;#s;#r;#l;#f;#u;constructor(n){super(),this.#u=!1,this.#f=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#s=n.client,this.#i=this.#s.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=W_(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(n){if(this.options={...this.#f,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=W_(this.options);i.data!==void 0&&(this.setState(X_(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(n,i){const a=Tp(this.state.data,n,this.options);return this.#o({data:a,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),a}setState(n){this.#o({type:"setState",state:n})}cancel(n){const i=this.#r?.promise;return this.#r?.cancel(n),i?i.then(gi).catch(gi):Promise.resolve()})DELIM" +R"DELIM(destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>kt(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(n=>kt(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!_x(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const i=this.observers.indexOf(n);i!==-1&&(this.observers.splice(i,1),this.observers.length||(this.#r&&(this.#u||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(n,i){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#r&&this.#l)return this.#r.continueRetry(),this.#l}if(n&&this.setOptions(n),!this.options.queryFn){const g=this.observers.find(b=>b.options.queryFn);g&&this.setOptions(g.options)}const a=new AbortController,l=g=>{Object.defineProperties(g,{[vg]:{value:a.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#u=!0,a.signal)}})},u=()=>{const g=wx(this.options,i),y=(()=>{const w={client:this.#s,queryKey:this.queryKey,meta:this.meta};return l(w),w})();return this.#u=!1,this.options.persister?this.options.persister(g,y,this):g(y)},d=(()=>{const g={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:u};return l(g),g})();(this.#e==="infinite"?Vj(this.options.pages):this.options.behavior)?.onFetch(d,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#o({type:"fetch",meta:d.fetchOptions?.meta});const m=this.#r=Ex({initialPromise:i?.initialPromise,fn:d.fetchFn,onCancel:g=>{g instanceof Ep&&g.revert&&this.setState({...this.#n,fetchStatus:"idle"}),a.abort()},onFail:(g,b)=>{this.#o({type:"failed",failureCount:g,error:b})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}),p=(async()=>{try{const g=await m.promise;if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#i.config.onSuccess?.(g,this),this.#i.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof Ep){if(g.silent){if(this.#r!==m&&this.#l)return this.#l;throw g}else if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#o({type:"error",error:g}),this.#i.config.onError?.(g,this),this.#i.config.onSettled?.(this.state.data,g,this),g}finally{this.#r===m&&(this.#r=void 0,this.#l=void 0),this.scheduleGc()}})();return this.#l=p,m.start(),p}#o(n){const i=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Nx(a.data,this.options),fetchMeta:n.meta??null};case"success":const l={...a,...X_(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?l:void 0,l;case"error":const u=n.error;return{...a,error:u,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=i(this.state),Un.batch(()=>{this.observers.slice().forEach(a=>{a.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:n})})}};function Nx(n,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tx(i.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function X_(n,i){return{data:n,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function W_(n){const i=typeof n.initialData=="function"?n.initialData():n.initialData,a=i!==void 0,l=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:a?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Kj=class extends qu{#e;#t=void 0;#n=void 0;#i=void 0;#s;#r;#l;#f;#u;#o;#b;#a;#g;#c=new Set;constructor(n,i){super(),this.options=i,this.#e=n,this.#l=null,this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),e1(this.#t,this.options)?this.#h():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Op(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Op(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#w(),this.#t.removeObserver(this)}setOptions(n){const i=this.options,a=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#p(),this.#t.setOptions(this.options),i._defaulted&&!Jm(this.options,i)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&t1(this.#t,a,this.options,i)&&this.#h(),this.updateResult(),l&&(this.#t!==a||kt(this.options.enabled,this.#t)!==kt(i.enabled,this.#t)||kt(this.options.staleTime,this.#t)!==kt(i.staleTime,this.#t))&&this.#m();const u=this.#S();l&&(this.#t!==a||kt(this.options.enabled,this.#t)!==kt(i.enabled,this.#t)||u!==this.#g)&&this.#E(u)}getOptimisticResult(n){const i=this.#e.getQueryCache().build(this.#e,n),a=this.createResult(i,n);return Jm(this.getCurrentResult(),a)||(this.#i=a,this.#r=this.options,this.#s=this.#t.state),a}getCurrentResult(){return this.#i}trackResult(n,i){return new Proxy(n,{get:(a,l)=>(this.trackProp(l),i?.(l),Reflect.get(a,l))})}trackProp(n){this.#c.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const i=this.#e.defaultQueryOptions(n),a=this.#e.getQueryCache().build(this.#e,i);let l=()=>{},u;const f=new Promise(d=>{u=d,l=this.#e.getQueryCache().subscribe(m=>{m.type==="updated"&&m.query.queryHash===a.queryHash&&a.state.data!==void 0&&(l(),d(this.createResult(a,i)))})});return Promise.race([a.fetch(i).then(()=>{const d=this.createResult(a,i);return u?.(d),d}).finally(()=>{l()}),f])}fetch(n){return this.#h({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(n){this.#p();let i=this.#t.fetch(this.options,n);return n?.throwOnError||(i=i.catch)DELIM" +R"DELIM((gi)),i}#_(n){return!yg()&&kt(this.options.enabled,this.#t)!==!1&&bx(n)}#m(){this.#v();const n=kt(this.options.staleTime,this.#t);if(this.#i.isStale||!this.#_(n))return;const i=_x(this.#i.dataUpdatedAt,n)+1;this.#b=Qa.setTimeout(()=>{this.#i.isStale||this.updateResult()},i)}#S(){return kt(this.options.refetchInterval,this.#t)??!1}#E(n){this.#w(),this.#g=n,!(this.#g===0||!this.#_(this.#g))&&(this.#a=Qa.setInterval(()=>{(this.options.refetchIntervalInBackground||bg.isFocused())&&this.#h()},this.#g))}#x(){this.#m(),this.#E(this.#S())}#v(){this.#b!==void 0&&(Qa.clearTimeout(this.#b),this.#b=void 0)}#w(){this.#a!==void 0&&(Qa.clearInterval(this.#a),this.#a=void 0)}createResult(n,i){const a=this.#t,l=this.options,u=this.#i,f=this.#s,d=this.#r,m=n!==a?n.state:this.#n,{state:p}=n;let g={...p},b=!1,y;if(i._optimisticResults){const ee=this.hasListeners(),V=!ee&&e1(n,i),ne=ee&&t1(n,a,i,l);(V||ne)&&(g={...g,...Nx(p.data,n.options)}),i._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:w,errorUpdatedAt:O,status:T}=g;y=g.data;let A=!1;if(i.placeholderData!==void 0&&y===void 0&&T==="pending"){let ee;u?.isPlaceholderData&&i.placeholderData===d?.placeholderData?(ee=u.data,A=!0):ee=typeof i.placeholderData=="function"?i.placeholderData(this.#o?.state.data,this.#o):i.placeholderData,ee!==void 0&&(T="success",y=Tp(u?.data,ee,i),b=!0)}if(i.select&&y!==void 0&&!A)if(u&&y===f?.data&&i.select===this.#f)y=this.#u;else try{this.#f=i.select,y=i.select(y),y=Tp(u?.data,y,i),this.#u=y,this.#l=null}catch(ee){this.#l=ee}else y===void 0&&(this.#l=null);this.#l&&(w=this.#l,y=this.#u,O=u?.error===w?u.errorUpdatedAt:Date.now(),T="error",b=!1);const k=g.fetchStatus==="fetching",L=T==="pending",D=T==="error",X=L&&k,G=y!==void 0;return{status:T,fetchStatus:g.fetchStatus,isPending:L,isSuccess:T==="success",isError:D,isInitialLoading:X,isLoading:X,data:y,dataUpdatedAt:g.dataUpdatedAt,error:w,errorUpdatedAt:O,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:g.dataUpdateCount>m.dataUpdateCount||g.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!L,isLoadingError:D&&!G,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:D&&G,isStale:_g(n,i),refetch:this.refetch,isEnabled:kt(i.enabled,n)!==!1}}updateResult(){const n=this.#i,i=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#r=this.options,this.#s.data!==void 0&&(this.#o=this.#t),Jm(i,n))return;this.#i=i;const l=(()=>{if(!n)return!0;const{notifyOnChangeProps:u}=this.options,f=typeof u=="function"?u():u;if(f==="all"||!f&&!this.#c.size||this.options.throwOnError&&this.#i.error!==n.error)return!0;for(const d of f??this.#c)if(this.#i[d]!==n[d])return!0;return!1})();Un.batch(()=>{l&&this.listeners.forEach(u=>{u(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#p(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const i=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(i?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}};function Gj(n,i){return kt(i.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&kt(i.retryOnMount,n)===!1)}function e1(n,i){return Gj(n,i)||n.state.data!==void 0&&Op(n,i,i.refetchOnMount)}function Op(n,i,a){if(kt(i.enabled,n)!==!1&&kt(i.staleTime,n)!=="static"){const l=kt(a,n);return l==="always"||l!==!1&&_g(n,i)}return!1}function t1(n,i,a,l){return(n!==i||kt(l.enabled,n)===!1)&&(!a.suspense||n.state.status!=="error")&&_g(n,a)}function _g(n,i){return kt(i.enabled,n)!==!1&&n.isStaleByTime(kt(i.staleTime,n))}var Yj=class extends Ox{#e;#t;#n;#i;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||Fj(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(i=>i!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){const i=()=>{this.#s({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},l=this.#i=Ex({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(d,m)=>{this.#s({type:"failed",failureCount:d,error:m})},onPause:()=>{this.#s({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),u=this.state.status==="pending",f=!l.canStart();try{if(u)i();else{this.#s({type:"pending",variables:n,isPaused:f}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,a);const m=await this.options.onMutate?.(n,a);m!==this.state.context&&this.#s({type:"pending",context:m,variables:n,isPaused:f})}this.state.isPaused&&l.canStart()&&i();const d=await l.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,a),await this.options.onSuccess?.(d,n,this.state.context,a),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(d,null,n,this.state.context,a),this.#s({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,a)}catch(m){Promise.reject(m)}try{await this.options.onError?.(d,n,this.state.context,a)}catch(m){Promise.reject(m)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,a)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,a)}catch(m){Promise.reject(m)}throw this.#s({type:"error",error:d}),d}finally{this.#i===l&&(this.#i=void 0),this.#n.runNext(this)}}#s(n){const i=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Un.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function Fj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qj=class extends qu{#e;#t;#n;constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}build(n,i,a){const l=new Yj({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(i),state:a});return this.add(l),l}add(n){this.#e.add(n);const i=Ef(n);if(typeof i=="string"){const a=this.#t.get(i);a?a.push(n):this.#t.set(i,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const i=Ef(n);if(typeof i=="string"){const a=this.#t.get(i);if(a)if(a.length>1){const l=a.indexOf(n);l!==-1&&a.splice(l,1)}else a[0]===n&&this.#t.delete(i)}}this.notify({type:"removed",mutation:n})}canRun(n){const i=Ef(n);if(typeof i=="string"){const a=this.#t.get(i)?.find(l=>l.state.status==="pending");return!a||a===n}else return!0}runNext(n){const i=Ef(n);return typeof i=="string"?this.#t.get(i)?.find(a=>a!==n&&a)DELIM" +R"DELIM(.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Un.batch(()=>{const n=this.getAll();this.#e.clear(),this.#t.clear(),n.forEach(i=>{this.notify({type:"removed",mutation:i})})})}getAll(){return Array.from(this.#e)}find(n){const i={exact:!0,...n};return this.getAll().find(a=>Y_(i,a))}findAll(n={}){return this.getAll().filter(i=>Y_(n,i))}notify(n){Un.batch(()=>{this.listeners.forEach(i=>{i(n)})})}resumePausedMutations(){const n=this.getAll().filter(i=>i.state.isPaused);return Un.batch(()=>Promise.all(n.map(i=>i.continue().catch(gi))))}};function Ef(n){return n.options.scope?.id}var Jj=class extends qu{#e;constructor(n={}){super(),this.config=n,this.#e=new Map}build(n,i,a){const l=i.queryKey,u=i.queryHash??pg(l,i);let f=this.get(u);return f||(f=new Pj({client:n,queryKey:l,queryHash:u,options:n.defaultQueryOptions(i),state:a,defaultOptions:n.getQueryDefaults(l)}),this.add(f)),f}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){this.#e.get(n.queryHash)===n&&(n.destroy(),this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Un.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const i={exact:!0,...n};return this.getAll().find(a=>G_(i,a))}findAll(n={}){const i=this.getAll();return Object.keys(n).length>0?i.filter(a=>G_(n,a)):i}notify(n){Un.batch(()=>{this.listeners.forEach(i=>{i(n)})})}onFocus(){Un.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Un.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Xj=class{#e;#t;#n;#i;#s;#r;#l;#f;constructor(n={}){this.#e=n.queryCache||new Jj,this.#t=n.mutationCache||new Qj,this.#n=n.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#l=bg.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#f=Ff.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#f?.(),this.#f=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state.data}ensureQueryData(n){const i=this.defaultQueryOptions(n),a=this.#e.build(this,i),l=a.state.data;return l===void 0?this.fetchQuery(n):(n.revalidateIfStale&&a.isStaleByTime(kt(i.staleTime,a))&&this.prefetchQuery(i),Promise.resolve(l))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:i,state:a})=>[i,a.data])}setQueryData(n,i,a){const l=this.defaultQueryOptions({queryKey:n}),u=this.#e.get(l.queryHash)?.state.data,f=kj(i,u);if(f!==void 0)return this.#e.build(this,l).setData(f,{...a,manual:!0})}setQueriesData(n,i,a){return Un.batch(()=>this.#e.findAll(n).map(({queryKey:l})=>[l,this.setQueryData(l,i,a)]))}getQueryState(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state}removeQueries(n){const i=this.#e;Un.batch(()=>{i.findAll(n).forEach(a=>{i.remove(a)})})}resetQueries(n,i){const a=this.#e;return Un.batch(()=>{const l=a.findAll(n),u=new Set(l);return l.forEach(f=>{f.reset()}),this.refetchQueries({type:"active",predicate:f=>u.has(f)},i)})}cancelQueries(n,i={}){const a={revert:!0,...i},l=Un.batch(()=>this.#e.findAll(n).map(u=>u.cancel(a)));return Promise.all(l).then(gi).catch(gi)}invalidateQueries(n,i={}){return Un.batch(()=>(this.#e.findAll(n).forEach(a=>{a.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},i)))}refetchQueries(n,i={}){const a={...i,cancelRefetch:i.cancelRefetch??!0},l=Un.batch(()=>this.#e.findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,a);const d=u.state.fetchStatus==="paused";return(!a.throwOnError||d)&&(f=f.catch(gi)),d?Promise.resolve():f}));return Promise.all(l).then(gi)}async query(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const a=this.#e.build(this,i),l=a.isStaleByTime(kt(i.staleTime,a))?await a.fetch(i):a.state.data,u=i.select;return u?u(l):l}fetchQuery(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const a=this.#e.build(this,i);return a.isStaleByTime(kt(i.staleTime,a))?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(gi).catch(gi)}infiniteQuery(n){return n._type="infinite",this.query(n)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(gi).catch(gi)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Ff.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,i){this.#i.set(Lu(n),{queryKey:n,defaultOptions:i})}getQueryDefaults(n){const i=[...this.#i.values()],a={};return i.forEach(l=>{fo(n,l.queryKey)&&Object.assign(a,l.defaultOptions)}),a}setMutationDefaults(n,i){this.#s.set(Lu(n),{mutationKey:n,defaultOptions:i})}getMutationDefaults(n){const i=[...this.#s.values()],a={};return i.forEach(l=>{fo(n,l.mutationKey)&&Object.assign(a,l.defaultOptions)}),a}defaultQueryOptions(n){if(n._defaulted)return n;const i={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return i.queryHash||(i.queryHash=pg(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===gg&&(i.enabled=!1),i}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const Ax=se.createContext(!1),Wj=()=>se.useContext(Ax);Ax.Provider;function ek(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const tk=se.createContext(ek()),nk=()=>se.useContext(tk),ik=(n,i,a)=>{const l=a?.state.status==="error"&&typeof n.throwOnError=="function"?zx(n.throwOnError,[a.state.error,a]):n.throwOnError;(n.suspense||l)&&(i.isReset()||(n.retryOnMount=!1))},rk=n=>{se.useEffect(()=>{n.clearReset()},[n])},sk=({result:n,errorResetBoundary:i,throwOnError:a,query:l,suspense:u})=>n.isError&&!i.isReset()&&!n.isFetching&&l&&(u&&n.data===void 0||zx(a,[n.error,l])),ak=n=>{if(n.suspense){const a=u=>u==="static"?u:Math.max(u??1e3,1e3),l=n.staleTime;n.staleTime=typeof l=="function"?(...u)=>a(l(...u)):a(l),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},lk=(n,i)=>n?.suspense&&i.isPending,ok=(n,i,a)=>i.fetchOptimistic(n).catch(()=>{a.clearReset()});function uk(n,i,a){const l=Wj(),u=nk(),f=Ej(),d=f.defaultQueryOptions(n),m=f.getQueryCache().get(d.queryHash),p=n.subscribed!==!1;d._optimisticResults=l?"isRestoring":p?"optimistic":void 0,ak(d),ik(d,u,m),rk(u);const[g]=se.useState(()=>new i(f,d)),b=g.getOptimisticResult(d);se.useEffect(()=>{g.setOptions(d)},[d,g]);const y=!l&&p;if(se.useSyncExternalStore(se.useCallback(w=>{const O=y?g.subscribe(Un.batchCalls(w)):gi;return g.updateResult(),O},[g,y]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),lk(d,b))throw ok(d,g,u);if(sk({result:b,errorResetBoundary:u,throwOnError:d.throwOnError,query:m,suspense:d.suspense}))throw b.error;return d.notifyOnChangeProps?b:g.trackResult(b)}function n1(n,i){return uk(n,Kj)}function ck(n,i,a,l=to){const u=se.useSyncExternalStore(a.subscribeStatus,a.getStatus,a.getStatus);return se.useEffect(()=>{a.configure(n,i,l)},[n,i,a,l]),se.useEffect(()=>(a.start(),()=>{a.stop()}),[a]),u}function fk(n,i,a){const l=se.useMemo(()=>JA(n),[n]),u=se.useSyncExternalStore(i.subscribeNative,i.getNativeStatus,i.getNativeStatus),f=se.useSyncExternalStore(i.subscribeNati)DELIM" +R"DELIM(ve,i.getNativeLive,i.getNativeLive),d=Mx(u,f,a),m=n1({queryKey:["native-snapshot",n],queryFn:({signal:w})=>s3(n,w),enabled:l&&!d,refetchInterval:px,retry:!1}),p=dk(u,f,m.data??null,a),g=i1(u,f,null,a),b=n1({queryKey:["native-fees",n],queryFn:({signal:w})=>l3(n,w),enabled:l&&g===null,refetchInterval:i3,retry:!1}),y=i1(u,f,b.data??null,a);return se.useEffect(()=>{y!==null&&i.recordNativeFees(y.data,y.receivedAt)},[y,i]),se.useEffect(()=>{p.top!==null&&i.recordNativeTop(p.top,p.receivedAt??Date.now())},[i,p.receivedAt,p.top]),{status:u,live:f,...p,restError:m.error instanceof Error?m.error.message:null}}function Mx(n,i,a){return n.phase==="connected"&&i.top!==null&&i.topReceivedAt!==null&&i.configuration!==null&&i.configurationReceivedAt!==null&&Np(i.topReceivedAt,a)}function dk(n,i,a,l){return Mx(n,i,l)?{top:i.top,topHeader:i.headerReceivedAt!==null&&Np(i.headerReceivedAt,l)?i.topHeader:null,configuration:i.configuration,receivedAt:i.topReceivedAt,transport:"websocket"}:a&&Np(a.receivedAt,l)?{top:a.top,topHeader:a.topHeader,configuration:a.configuration,receivedAt:a.receivedAt,transport:"rest"}:{top:null,topHeader:null,configuration:null,receivedAt:null,transport:"none"}}function i1(n,i,a,l){return n.phase==="connected"&&i.fees!==null&&l-i.fees.receivedAtnew wj,[]),i=zS(),[a]=se.useState(XA),[l,u]=se.useState("overview"),[f,d]=se.useState(!1),[m,p]=se.useState(zj),[g,b]=se.useState(!1),[y,w]=se.useState(!1),[O,T]=se.useState(Iz),A=se.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),k=ck(a.adminUrl,a.nativeUrl,n,m),L=fk(a.nativeUrl,n,i),D=L.configuration?`${sS(L.configuration.forks)} ${L.configuration.node.network}`:" ",X=O3(L.top,L.topHeader,i);function G(V){Pz(V),T(V)}function ee(V){Tj(V),p(V)}return x.jsxs("div",{className:"bg-background text-textPrimary min-h-screen",children:[x.jsx("header",{className:"border-accent/30 bg-surface/90 border-b backdrop-blur",children:x.jsx("div",{className:"mx-auto max-w-7xl px-4 py-4",children:x.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",children:[x.jsxs("div",{className:"order-1 flex flex-col",children:[x.jsx("button",{type:"button",onClick:()=>{u("overview")},className:"text-accent text-left text-lg font-semibold tracking-tight",children:"Libbitcoin Server"}),x.jsx("span",{className:"text-textMuted text-sm",children:D})]}),x.jsx("nav",{className:"text-textMuted order-3 flex w-full items-center gap-3 text-sm md:order-2 md:w-auto",children:hk.map(V=>x.jsxs("button",{type:"button",onClick:()=>{u(V.id)},className:`text-textMuted hover:text-accent rounded-md px-3 py-1 text-sm transition ${l===V.id?"bg-accentSecondary/20 text-accent":""}`,children:[V.label,V.id==="logs"&&A.totalLogs>0&&x.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:A.totalLogs>999?"999+":String(A.totalLogs)}),V.id==="events"&&A.totalEvents>0&&x.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:A.totalEvents>999?"999+":String(A.totalEvents)})]},V.id))}),x.jsx("div",{className:"order-2 ml-auto flex items-center gap-3 md:order-3",children:x.jsx("button",{type:"button",onClick:()=>{d(!0)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Settings"})})]})})}),x.jsxs("main",{className:"mx-auto min-h-[calc(100vh-4rem)] max-w-7xl min-w-0 space-y-6 px-4 py-8",children:[x.jsxs("header",{children:[x.jsx("p",{className:"text-accentSecondary text-sm tracking-wide uppercase",children:"Administration"}),x.jsx("h1",{className:"text-accent text-3xl font-semibold",children:"Admin Dashboard"})]}),l==="overview"&&x.jsx(dj,{adminStatus:k,endpoints:a,metrics:A,native:L,syncEstimate:X}),l==="logs"&&x.jsx(PA,{metrics:n,delivery:A,status:k,logFilter:m,paused:g,onLogFilterChange:ee,onPausedChange:V=>{n.setLogsPaused(V),b(V)},onClear:()=>{n.clearLogs()}}),l==="events"&&x.jsx(VA,{metrics:n,paused:y,onPausedChange:V=>{n.setEventsPaused(V),w(V)},onClear:()=>{n.clearEvents()}})]}),x.jsx(vj,{estimate:X,browserNotificationsEnabled:O}),f&&x.jsx(Gz,{browserNotificationsEnabled:O,onClose:()=>{d(!1)},onBrowserNotificationsEnabledChange:G})]})}function pk({children:n}){const[i]=se.useState(()=>new Xj({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return x.jsx(Oj,{client:i,children:n})}Zz();const jx=document.querySelector("#root");if(!jx)throw new Error("Root element not found");Dz.createRoot(jx).render(x.jsx(Oz.StrictMode,{children:x.jsx(pk,{children:x.jsx(mk,{})})})); )DELIM" ) diff --git a/console/embedded/native_css.cpp b/console/embedded/native_css.cpp index e9c55651..26f4fb40 100644 --- a/console/embedded/native_css.cpp +++ b/console/embedded/native_css.cpp @@ -52,9 +52,10 @@ R"DELIM(/*! */ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--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}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, 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-amber-300:oklch(87.9% .169 91.605);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--spacing:.25rem;--container-lg:32rem;--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-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--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-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--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,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, 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:where(:not(iframe)){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,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-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)DELIM" R"DELIM(-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;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: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{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.inset-y-0{inset-block:0}.top-1\/2{top:50%}.left-0{left:0}.left-3{left:calc(var(--spacing) * 3)}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.order-3{order:3}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-2{margin-right:calc(var(--spacing) * 2)}.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-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-full{height:100%}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[85vh\]{max-height:85vh}.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-5{width:calc(var(--spacing) * 5)}.w-\[calc\(100\%_-_2rem\)\]{width:calc(100% - 2rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-7xl{max-width:var(--container-7xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.cursor-pointer{cursor:pointer}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end)DELIM" -R"DELIM(}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.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)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * 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-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * 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:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:color-mix(in oklab,var(--theme-accent-secondary) 30%,transparent)}}.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:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.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-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent,.border-accent\/20{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/20{border-color:color-mix(in oklab,var(--theme-accent) 20%,transparent)}}.border-accent\/30{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/30{border-color:color-mix(in oklab,var(--theme-accent) 30%,transparent)}}.border-accent\/40{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/40{border-color:color-mix(in oklab,var(--theme-accent) 40%,transparent)}}.border-accent\/50{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/50{border-color:color-mix(in oklab,var(--theme-accent) 50%,transparent)}}.border-accentSecondary\/20{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/20{border-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.border-accentSecondary\/30{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/30{border-color:color-mix(in oklab,var(--theme-accent-secondary) 30%,transparent)}}.border-accentSecondary\/40{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/40{border-color:color-mix(in oklab,var(--theme-accent-secondary) 40%,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-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-textMuted\/10{border-color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.border-textMuted\/10{border-color:color-mix(in oklab,var(--theme-text-muted) 10%,transparent)}}.border-textMuted\/30{border-color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.border-textMuted\/30{border-color:color-mix(in oklab,var(--theme-text-muted) 30%,transparent)}}.bg-accent,.bg-accent\/5{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/5{background-color:color-mix(in oklab,var(--theme-accent) 5%,transparent)}}.bg-accent\/10{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/10{background-color:color-mix(in oklab,var(--theme-accent) 10%,transparent)}}.bg-accentSecondary,.bg-accentSecondary\/10{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/10{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.bg-accentSecondary\/15{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/15{background-color:color-mix(in oklab,var(--theme-accent-secondary) 15%,transparent)}}.bg-accentSecondary\/20{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/20{background-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.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:var(--theme-background)}.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-500\/5{background-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/5{background-color:color-mix(in oklab,var(--color-emerald-500) 5%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.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-inset{background-color:var(--theme-inset)}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.b)DELIM" -R"DELIM(g-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-surface,.bg-surface\/60{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--theme-surface) 60%,transparent)}}.bg-surface\/80{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/80{background-color:color-mix(in oklab,var(--theme-surface) 80%,transparent)}}.bg-surface\/90{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/90{background-color:color-mix(in oklab,var(--theme-surface) 90%,transparent)}}.bg-surface\/95{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/95{background-color:color-mix(in oklab,var(--theme-surface) 95%,transparent)}}.bg-textMuted\/5{background-color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-textMuted\/5{background-color:color-mix(in oklab,var(--theme-text-muted) 5%,transparent)}}.bg-textPrimary{background-color:var(--theme-text-primary)}.bg-transparent{background-color:#0000}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.from-accent\/8{--tw-gradient-from:color-mix(in oklab, var(--theme-accent) 8%, transparent)}}.from-accent\/8{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.to-surface\/60{--tw-gradient-to:color-mix(in oklab, var(--theme-surface) 60%, transparent)}}.to-surface\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.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)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-9{padding-left:calc(var(--spacing) * 9)}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--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}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--theme-accent)}.text-accentSecondary{color:var(--theme-accent-secondary)}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:var(--theme-text-muted)}.text-textPrimary{color:var(--theme-text-primary)}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.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-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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent{--tw-ring-color:var(--theme-accent)}.ring-inset{--tw-ring-color:var(--theme-inset)}.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))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-trans)DELIM" -R"DELIM(ition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.ring-inset{--tw-ring-inset:inset}.placeholder\:text-textMuted::placeholder{color:var(--theme-text-muted)}.backdrop\:bg-black\/70::backdrop{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/70::backdrop{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.checked\:bg-accent:checked{background-color:var(--theme-accent)}@media(hover:hover){.hover\:border-accent:hover{border-color:var(--theme-accent)}.hover\:border-accentSecondary:hover{border-color:var(--theme-accent-secondary)}.hover\:bg-accentSecondary\/10:hover{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accentSecondary\/10:hover{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.hover\:text-accent:hover{color:var(--theme-accent)}.hover\:text-accentSecondary:hover{color:var(--theme-accent-secondary)}}.focus\:border-accent:focus{border-color:var(--theme-accent)}.focus\:ring-accent:focus{--tw-ring-color:var(--theme-accent)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@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\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,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-\[16rem_minmax\(0\,1fr\)\]{grid-template-columns:16rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark;--theme-background:#272822;--theme-surface:#1f211c;--theme-accent:#ffa022;--theme-accent-secondary:#c85637;--theme-text-primary:#ededed;--theme-text-muted:#cfcfcf;--theme-inset:#0000004d;--theme-notice-success:#022c22;--theme-notice-warning:#451a03;--theme-notice-text:#fff;--chart-grid:#c8563733;--chart-ticks:#ffa0224d}:root[data-theme=light]{color-scheme:light;--theme-background:#f5f3ed;--theme-surface:#fff;--theme-accent:#9c4a04;--theme-accent-secondary:#9b4430;--theme-text-primary:#222923;--theme-text-muted:#526052;--theme-inset:#2229230d;--theme-notice-success:#ecfdf5;--theme-notice-warning:#fffbeb;--theme-notice-text:#222923;--chart-grid:#52605226;--chart-ticks:#52605266;--chart-color-0:#9c4a04;--chart-color-1:#0369a1;--chart-color-2:#047857;--chart-color-3:#7e22ce;--chart-color-4:#be123c;--chart-color-5:#a21caf;--chart-color-6:#854d0e;--chart-color-7:#1d4ed8;--color-emerald-200:#065f46;--color-emerald-300:#065f46;--color-amber-200:#92400e;--color-amber-300:#92400e;--color-red-300:#991b1b;--color-rose-300:#9f1239;--color-orange-300:#9a3412;--color-sky-300:#075985;--color-cyan-300:#155e75;--color-blue-300:#1e40af;--color-violet-300:#5b21b6;--color-slate-300:#475569}:root[data-theme=midnight]{color-scheme:dark;--theme-background:#0e1525;--theme-surface:#141e32;--theme-accent:#7dd3fc;--theme-accent-secondary:#a5b4fc;--theme-text-primary:#e6edf7;--theme-text-muted:#a9bad0;--theme-inset:#00000040;--chart-grid:#a5b4fc33;--chart-ticks:#7dd3fc4d}html{scrollbar-gutter:stable}body{background-color:var(--theme-background);font-family:var(--font-sans);color:var(--theme-text-primary)}::selection{background-color:var(--theme-accent);color:var(--theme-background)}[tabindex="-1"]:focus{outline:none}@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-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-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@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{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false} +R"DELIM(}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.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)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * 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-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * 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)))}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}: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:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:color-mix(in oklab,var(--theme-accent-secondary) 30%,transparent)}}.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:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.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-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent,.border-accent\/20{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/20{border-color:color-mix(in oklab,var(--theme-accent) 20%,transparent)}}.border-accent\/30{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/30{border-color:color-mix(in oklab,var(--theme-accent) 30%,transparent)}}.border-accent\/40{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/40{border-color:color-mix(in oklab,var(--theme-accent) 40%,transparent)}}.border-accent\/50{border-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/50{border-color:color-mix(in oklab,var(--theme-accent) 50%,transparent)}}.border-accentSecondary\/20{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/20{border-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.border-accentSecondary\/30{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/30{border-color:color-mix(in oklab,var(--theme-accent-secondary) 30%,transparent)}}.border-accentSecondary\/40{border-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.border-accentSecondary\/40{border-color:color-mix(in oklab,var(--theme-accent-secondary) 40%,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-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-textMuted\/10{border-color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.border-textMuted\/10{border-color:color-mix(in oklab,var(--theme-text-muted) 10%,transparent)}}.border-textMuted\/30{border-color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.border-textMuted\/30{border-color:color-mix(in oklab,var(--theme-text-muted) 30%,transparent)}}.bg-accent,.bg-accent\/5{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/5{background-color:color-mix(in oklab,var(--theme-accent) 5%,transparent)}}.bg-accent\/10{background-color:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.bg-accent\/10{background-color:color-mix(in oklab,var(--theme-accent) 10%,transparent)}}.bg-accentSecondary,.bg-accentSecondary\/10{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/10{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.bg-accentSecondary\/15{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/15{background-color:color-mix(in oklab,var(--theme-accent-secondary) 15%,transparent)}}.bg-accentSecondary\/20{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.bg-accentSecondary\/20{background-color:color-mix(in oklab,var(--theme-accent-secondary) 20%,transparent)}}.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:var(--theme-background)}.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-500\/5{background-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/5{background-color:color-mix(in oklab,var(--color-emerald-500) 5%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.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-inset{background-color:var(--theme-inset)}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-)DELIM" +R"DELIM(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,.bg-surface\/60{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--theme-surface) 60%,transparent)}}.bg-surface\/80{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/80{background-color:color-mix(in oklab,var(--theme-surface) 80%,transparent)}}.bg-surface\/90{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/90{background-color:color-mix(in oklab,var(--theme-surface) 90%,transparent)}}.bg-surface\/95{background-color:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/95{background-color:color-mix(in oklab,var(--theme-surface) 95%,transparent)}}.bg-textMuted\/5{background-color:var(--theme-text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-textMuted\/5{background-color:color-mix(in oklab,var(--theme-text-muted) 5%,transparent)}}.bg-textPrimary{background-color:var(--theme-text-primary)}.bg-transparent{background-color:#0000}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:var(--theme-accent)}@supports (color:color-mix(in lab,red,red)){.from-accent\/8{--tw-gradient-from:color-mix(in oklab, var(--theme-accent) 8%, transparent)}}.from-accent\/8{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:var(--theme-surface)}@supports (color:color-mix(in lab,red,red)){.to-surface\/60{--tw-gradient-to:color-mix(in oklab, var(--theme-surface) 60%, transparent)}}.to-surface\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.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)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-9{padding-left:calc(var(--spacing) * 9)}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--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}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--theme-accent)}.text-accentSecondary{color:var(--theme-accent-secondary)}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:var(--theme-text-muted)}.text-textPrimary{color:var(--theme-text-primary)}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.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-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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent{--tw-ring-color:var(--theme-accent)}.ring-inset{--tw-ring-color:var(--theme-inset)}.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))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default)DELIM" +R"DELIM(-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.ring-inset{--tw-ring-inset:inset}.placeholder\:text-textMuted::placeholder{color:var(--theme-text-muted)}.backdrop\:bg-black\/70::backdrop{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/70::backdrop{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.checked\:bg-accent:checked{background-color:var(--theme-accent)}@media(hover:hover){.hover\:border-accent:hover{border-color:var(--theme-accent)}.hover\:border-accentSecondary:hover{border-color:var(--theme-accent-secondary)}.hover\:bg-accentSecondary\/10:hover{background-color:var(--theme-accent-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accentSecondary\/10:hover{background-color:color-mix(in oklab,var(--theme-accent-secondary) 10%,transparent)}}.hover\:text-accent:hover{color:var(--theme-accent)}.hover\:text-accentSecondary:hover{color:var(--theme-accent-secondary)}}.focus\:border-accent:focus{border-color:var(--theme-accent)}.focus\:ring-accent:focus{--tw-ring-color:var(--theme-accent)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@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\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,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-\[19rem\]{width:19rem}.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-\[16rem_minmax\(0\,1fr\)\]{grid-template-columns:16rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark;--theme-background:#272822;--theme-surface:#1f211c;--theme-accent:#ffa022;--theme-accent-secondary:#c85637;--theme-text-primary:#ededed;--theme-text-muted:#cfcfcf;--theme-inset:#0000004d;--theme-notice-success:#022c22;--theme-notice-warning:#451a03;--theme-notice-text:#fff;--chart-grid:#c8563733;--chart-ticks:#ffa0224d}:root[data-theme=light]{color-scheme:light;--theme-background:#f5f3ed;--theme-surface:#fff;--theme-accent:#9c4a04;--theme-accent-secondary:#9b4430;--theme-text-primary:#222923;--theme-text-muted:#526052;--theme-inset:#2229230d;--theme-notice-success:#ecfdf5;--theme-notice-warning:#fffbeb;--theme-notice-text:#222923;--chart-grid:#52605226;--chart-ticks:#52605266;--chart-color-0:#9c4a04;--chart-color-1:#0369a1;--chart-color-2:#047857;--chart-color-3:#7e22ce;--chart-color-4:#be123c;--chart-color-5:#a21caf;--chart-color-6:#854d0e;--chart-color-7:#1d4ed8;--color-emerald-200:#065f46;--color-emerald-300:#065f46;--color-amber-200:#92400e;--color-amber-300:#92400e;--color-red-300:#991b1b;--color-rose-300:#9f1239;--color-orange-300:#9a3412;--color-sky-300:#075985;--color-cyan-300:#155e75;--color-blue-300:#1e40af;--color-violet-300:#5b21b6;--color-slate-300:#475569}:root[data-theme=midnight]{color-scheme:dark;--theme-background:#0e1525;--theme-surface:#141e32;--theme-accent:#7dd3fc;--theme-accent-secondary:#a5b4fc;--theme-text-primary:#e6edf7;--theme-text-muted:#a9bad0;--theme-inset:#00000040;--chart-grid:#a5b4fc33;--chart-ticks:#7dd3fc4d}html{scrollbar-gutter:stable}body{background-color:var(--theme-background);font-family:var(--font-sans);color:var(--theme-text-primary)}::selection{background-color:var(--theme-accent);color:var(--theme-background)}[tabindex="-1"]:focus{outline:none}@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-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-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@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{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax)DELIM" +R"DELIM(:"*";inherits:false} )DELIM" ) diff --git a/console/embedded/native_ecma.cpp b/console/embedded/native_ecma.cpp index 2959b7f0..83de7bf8 100644 --- a/console/embedded/native_ecma.cpp +++ b/console/embedded/native_ecma.cpp @@ -312,55 +312,55 @@ R"DELIM(to deal * SOFTWARE. */ function Qk(e,r){for(var i=0;is[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();function Dp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var um={exports:{}},dl={};var Gb;function Xk(){if(Gb)return dl;Gb=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(s,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var f in l)f!=="key"&&(c[f]=l[f])}else c=l;return l=c.ref,{$$typeof:e,type:s,key:d,ref:l!==void 0?l:null,props:c}}return dl.Fragment=r,dl.jsx=i,dl.jsxs=i,dl}var Kb;function Jk(){return Kb||(Kb=1,um.exports=Xk()),um.exports}var p=Jk(),dm={exports:{}},$e={};var Qb;function Wk(){if(Qb)return $e;Qb=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),w=Symbol.iterator;function E(j){return j===null||typeof j!="object"?null:(j=w&&j[w]||j["@@iterator"],typeo)DELIM" -R"DELIM(f j=="function"?j:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,H={};function O(j,G,he){this.props=j,this.context=G,this.refs=H,this.updater=he||_}O.prototype.isReactComponent={},O.prototype.setState=function(j,G){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,G,"setState")},O.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function se(){}se.prototype=O.prototype;function ce(j,G,he){this.props=j,this.context=G,this.refs=H,this.updater=he||_}var K=ce.prototype=new se;K.constructor=ce,N(K,O.prototype),K.isPureReactComponent=!0;var oe=Array.isArray;function R(){}var k={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function P(j,G,he){var ee=he.ref;return{$$typeof:e,type:j,key:G,ref:ee!==void 0?ee:null,props:he}}function F(j,G){return P(j.type,G,j.props)}function X(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function fe(j){var G={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(he){return G[he]})}var ge=/\/+/g;function re(j,G){return typeof j=="object"&&j!==null&&j.key!=null?fe(""+j.key):G.toString(36)}function Q(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(R,R):(j.status="pending",j.then(function(G){j.status==="pending"&&(j.status="fulfilled",j.value=G)},function(G){j.status==="pending"&&(j.status="rejected",j.reason=G)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function Y(j,G,he,ee,je){var J=typeof j;(J==="undefined"||J==="boolean")&&(j=null);var me=!1;if(j===null)me=!0;else switch(J){case"bigint":case"string":case"number":me=!0;break;case"object":switch(j.$$typeof){case e:case r:me=!0;break;case v:return me=j._init,Y(me(j._payload),G,he,ee,je)}}if(me)return je=je(j),me=ee===""?"."+re(j,0):ee,oe(je)?(he="",me!=null&&(he=me.replace(ge,"$&/")+"/"),Y(je,G,he,"",function(be){return be})):je!=null&&(X(je)&&(je=F(je,he+(je.key==null||j&&j.key===je.key?"":(""+je.key).replace(ge,"$&/")+"/")+me)),G.push(je)),1;me=0;var W=ee===""?".":ee+":";if(oe(j))for(var le=0;le>>1,ye=Q[$];if(0>>1,ye=Q[$];if(0>>1;$l(Ce,ie))jl(G,Ce)?(Q[$]=G,Q[j]=ie,$=j):(Q[$]=Ce,Q[xe]=ie,$=xe);else if(jl(G,ie))Q[$]=G,Q[j]=ie,$=j;else break e}}return Y}function l(Q,Y){var ie=Q.sortIndex-Y.sortIndex;return ie!==0?ie:Q.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],g=[],v=1,y=null,x=3,w=!1,E=!1,_=!1,N=!1,H=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,se=typeof setImmediate<"u"?setImmediate:null;function ce(Q){for(var Y=i(g);Y!==null;){if(Y.callback===null)s(g);else if(Y.startTime<=Q)s(g),Y.sortIndex=Y.expirationTime,r(m,Y);else break;Y=i(g)}}function K(Q){if(_=!1,ce(Q),!E)if(i(m)!==null)E=!0,oe||(oe=!0,X());else{var Y=i(g);Y!==null&&re(K,Y.startTime-Q)}}var oe=!1,R=-1,k=5,z=-1;function P(){return N?!0:!(e.unstable_now()-zQ&&P());){var $=y.callback;if(typeof $=="function"){y.callback=null,x=y.priorityLevel;var ye=$(y.expirationTime<=Q);if(Q=e.unstable_now(),typeof ye=="function"){y.callback=ye,ce(Q),Y=!0;break t}y===i(m)&&s(m),ce(Q)}else s(m);y=i(m)}if(y!==null)Y=!0;else{var He=i(g);He!==null&&re(K,He.startTime-Q),Y=!1}}break e}finally{y=null,x=ie,w=!1}Y=void 0}}finally{Y?X():oe=!1}}}var X;if(typeof se=="function")X=function(){se(F)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ge=fe.port2;fe.port1.onmessage=F,X=function(){ge.postMessage(null)}}else X=function(){H(F,0)};function re(Q,Y){R=H(function(){Q(e.unstable_now())},Y)}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(Q){Q.callback=null},e.unstable_forceFrameRate=function(Q){0>Q||125$?(Q.sortIndex=ie,r(g,Q),i(m)===null&&Q===i(g)&&(_?(O(R),R=-1):_=!0,re(K,ie-$))):(Q.sortIndex=ye,r(m,Q),E||w||(E=!0,oe||(oe=!0,X()))),Q},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(Q){var Y=x;return function(){var ie=x;x=Y;try{return Q.apply(this,arguments)}finally{x=ie}}}})(mm)),mm}var Wb;function n_(){return Wb||(Wb=1,hm.exports=t_()),hm.exports}var pm={exports:{}},gn={};var ex;function r_(){if(ex)return gn;ex=1;var e=Lp();function r(v){var y="https://react.dev/errors/"+v;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),pm.exports=r_(),pm.exports}var nx;function a_(){if(nx)return fl;nx=1;var e=n_(),r=Lp(),i=yw();function s(t){var n="https://react.dev/errors/"+t;if(1_e||(t.current=pe[_e],pe[_e]=null,_e--)}function Ue(t,n){_e++,pe[_e]=t.current,t.current=n}var dt=Me(null),qt=Me(null),Ye=Me(null),st=Me(null);function ot(t,n){switch(Ue(Ye,n),Ue(qt,t),Ue(dt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?rb(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=rb(n),t=ab(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Le(dt),Ue(dt,t)}function at(){Le(dt),Le(qt),Le(Ye)}function wt(t){var n=t.memoizedState;n!==null&&($s._currentValue=n.memoizedState,Ue(st,t)),n=dt.current;var a=ab(n,t.type);n!==a&&(Ue(qt,t),Ue(dt,a))}function ln(t){qt.current===t&&(Le(dt),Le(qt)),st.current===t&&(Le(st),$s._currentValue=be)}var xn,Ar;function Dt(t){if(xn===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);xn=n&&n[1]||"",Ar=-1_e||(t.current=pe[_e],pe[_e]=null,_e--)}function Ue(t,n){_e++,pe[_e]=t.current,t.current=n}var dt=Me(null),qt=Me(null),Ye=Me(null),st=Me(null);function ot(t,n){switch(Ue(Ye,n),Ue(qt,t),Ue(dt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?rb(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=rb(n),t=ab(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Le(dt),Ue(dt,t)}function at(){Le(dt),Le(qt),Le(Ye)}function wt(t){var n=t.memoizedState;n!==null&&(qs._currentValue=n.memoizedState,Ue(st,t)),n=dt.current;var a=ab(n,t.type);n!==a&&(Ue(qt,t),Ue(dt,a))}function ln(t){qt.current===t&&(Le(dt),Le(qt)),st.current===t&&(Le(st),qs._currentValue=be)}var xn,Ar;function Dt(t){if(xn===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);xn=n&&n[1]||"",Ar=-1)":-1u||C[o]!==U[u]){var V=` -`+C[o].replace(" at new "," at ");return t.displayName&&V.includes("")&&(V=V.replace("",t.displayName)),V}while(1<=o&&0<=u);break}}}finally{kn=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Dt(a):""}function Dd(t,n){switch(t.tag){case 26:case 27:case 5:return Dt(t.type);case 16:return Dt("Lazy");case 13:return t.child!==n&&n!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return vo(t.type,!1);case 11:return vo(t.type.render,!1);case 1:return vo(t.type,!0);case 31:return Dt("Activity");case 30:return Dt("ViewTransition");default:return""}}function es(t){try{var n="",a=null;do n+=Dd(t,a),a=t,t=t.return;while(t);return n}catch(o){return` +`+C[o].replace(" at new "," at ");return t.displayName&&V.includes("")&&(V=V.replace("",t.displayName)),V}while(1<=o&&0<=u);break}}}finally{kn=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Dt(a):""}function Dd(t,n){switch(t.tag){case 26:case 27:case 5:return Dt(t.type);case 16:return Dt("Lazy");case 13:return t.child!==n&&n!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return vo(t.type,!1);case 11:return vo(t.type.render,!1);case 1:return vo(t.type,!0);case 31:return Dt("Activity");case 30:return Dt("ViewTransition");default:return""}}function ts(t){try{var n="",a=null;do n+=Dd(t,a),a=t,t=t.return;while(t);return n}catch(o){return` Error generating stack: `+o.message+` -`+o.stack}}var bo=Object.prototype.hasOwnProperty,Zn=e.unstable_scheduleCallback,ts=e.unstable_cancelCallback,nc=e.unstable_shouldYield,rc=e.unstable_requestPaint,_n=e.unstable_now,ac=e.unstable_getCurrentPriorityLevel,yi=e.unstable_ImmediatePriority,xo=e.unstable_UserBlockingPriority,ka=e.unstable_NormalPriority,Ld)DELIM" -R"DELIM(=e.unstable_LowPriority,wo=e.unstable_IdlePriority,Bd=e.log,ic=e.unstable_setDisableYieldValue,Or=null,Jt=null;function br(t){if(typeof Bd=="function"&&ic(t),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(Or,t)}catch{}}var Nn=Math.clz32?Math.clz32:D,Ud=Math.log,A=Math.LN2;function D(t){return t>>>=0,t===0?32:31-(Ud(t)/A|0)|0}var I=256,ue=262144,de=4194304;function Te(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&-t;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 Se(t,n,a){var o=t.pendingLanes;if(o===0)return 0;var u=0,h=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~h,o!==0?u=Te(o):(b&=S,b!==0?u=Te(b):a||(a=S&~t,a!==0&&(u=Te(a))))):(S=o&~h,S!==0?u=Te(S):b!==0?u=Te(b):a||(a=o&~t,a!==0&&(u=Te(a)))),u===0?0:n!==0&&n!==u&&(n&h)===0&&(h=u&-u,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:u}function Ne(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Ee(t,n){(n&8)!==0&&(n|=n&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=n;0a;a++)n.push(t);return n}function ze(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function lt(t,n,a,o,u,h){var b=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var S=t.entanglements,C=t.expirationTimes,U=t.hiddenUpdates;for(a=b&~a;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vd=!1;if(aa)try{var To={};Object.defineProperty(To,"passive",{get:function(){Vd=!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{Vd=!1}var Ca=null,Yd=null,uc=null;function Wg(){if(uc)return uc;var t,n=Yd,a=n.length,o,u="value"in Ca?Ca.value:Ca.textContent,h=u.length;)DELIM" -R"DELIM(for(t=0;t=No),iy=" ",sy=!1;function oy(t,n){switch(t){case"keyup":return Y2.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ly(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cs=!1;function K2(t,n){switch(t){case"compositionend":return ly(n);case"keypress":return n.which!==32?null:(sy=!0,iy);case"textInput":return t=n.data,t===iy&&sy?null:t;default:return null}}function Q2(t,n){if(cs)return t==="compositionend"||!Jd&&oy(t,n)?(t=Wg(),uc=Yd=Ca=null,cs=!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"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function yy(t,n){var a=gy(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=n&&o>=n)return{node:a,offset:n-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=gy(a)}}function vy(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?vy(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function by(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=tf(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=tf(t.document)}return n}function nf(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 aT=aa&&"documentMode"in document&&11>=document.documentMode,us=null,rf=nul)DELIM" -R"DELIM(l,Ao=null,af=!1;function xy(t,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;af||us==null||us!==tf(o)||(o=us,"selectionStart"in o&&nf(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}),Ao&&Ro(Ao,o)||(Ao=o,o=pu(rf,"onSelect"),0>=b,u-=b,Ur=1<<32-Nn(n)+u|a<Be?(Vt=Oe,Oe=null):Vt=Oe.sibling;var nt=L(B,Oe,q[Be],te);if(nt===null){Oe===null&&(Oe=Vt);break}t&&Oe&&nt.alternate===null&&n(B,Oe),M=h(nt,M,Be),We===null?we=nt:We.sibling=nt,We=nt,Oe=Vt}if(Be===q.length)return a(B,Oe),Ke&&la(B,Be),we;if(Oe===null){for(;BeBe?(Vt=Oe,Oe=null):Vt=Oe.sibling;var Wa=L(B,Oe,nt.value,te);if(Wa===null){Oe===null&&(Oe=Vt);break}t&&Oe&&Wa.alternate===null&&n(B,Oe),M=h(Wa,M,Be),We===null?we=Wa:We.sibling=Wa,We=Wa,Oe=Vt}if(nt.done)return a(B,Oe),Ke&&la(B,Be),we;if(Oe===null){for(;!nt.done;Be++,nt=q.next())nt=ne(B,nt.value,te),nt!==null&&(M=h(nt,M,Be),We===null?we=nt:We.sibling=nt,We=nt);return Ke&&la(B,Be),we}for(Oe=o(Oe);!nt.done;Be++,nt=q.next())nt=Z(Oe,B,Be,nt.value,te),nt!==null&&(t&&(Vt=nt.alternate,Vt!==null&&Oe.delete(Vt.key===null?Be:Vt.key)),M=h(nt,M,Be),We===null?we=nt:We.sibling=nt,We=nt);return t&&Oe.forEach(function(Kk){return n(B,Kk)}),Ke&&la(B,Be),we}function Fe(B,M,q,te){if(typeof q=="object"&&q!==null&&q.type===F&&q.key===null&&q.props.ref===void 0&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case z:e:{for(var we=q.key;M!==null;){if(M.key===we){if(we=q.type,we===F){if(M.tag===7){a(B,M.sibling),te=u(M,q.props.children),za(te,q),te.return=B,B=te;break e}}else if(M.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===ye&&Ri(we)===M.type){a(B,M.sibling),te=u(M,q.props),za(te,q),te.return=B,B=te;break e}a(B,M);break}else n(B,M);M=M.sibling}q.type===F?(te=Ei(q.props.children,B.mode,te,q.key),za(te,q),te.return=B,B=te):(te=xc(q.type,q.key,q.props,null,B.mode,te),za(te,q),te.return=B,B=te)}return b(B);case P:e:{for(we=q.key;M!==null;){if(M.key===we)if(M.tag===4&&M.stateNode.containerInfo===q.containerInfo&&M.stateNode.implementation===q.implementation){a(B,M.sibling),te=u(M,q.children||[]),te.return=B,B=te;break e}else{a(B,M);break}else n(B,M);M=M.sibling}te=ff(q,B.mode,te),te.return=B,B=te}return b(B);case ye:return q=Ri(q),Fe(B,M,q,te)}if(me(q))return ve(B,M,q,te);if(ee(q)){if(we=ee(q),typeof we!="function")throw Error(s(150));return q=we.call(q),ke(B,M,q,te)}if(typeof q.then=="function")return Fe(B,M,Rc(q),te);if(q.$$typeof===re)return Fe(B,M,_c(B,q),te);Ac(B,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,M!==null&&M.tag===6?(a(B,M.sibling),te=u(M,q),te.return=B,B=te):(a(B,M),te=df(q,B.mode,te),te.return=B,B=te),b(B)):a(B,M)}return function(B,M,q,te){try{Bo=0;var we=Fe(B,M,q,te);return bs=null,we}catch(Oe){if(Oe===vs||Oe===Cc)throw Oe;var We=Ln(29,Oe,null,B.mode);return We.lanes=te,We.return=B,We}}}var Oi=Iy(!0),Fy=Iy(!1),Da=!1;function Sf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ef(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 La(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ba(t,n,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(ft&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=bc(t),Cy(t,null,a),n}return vc(t,o,n,a),bc(t)}function Uo(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Lt(t,a)}}function Tf(t,n){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var u=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?u=h=b:h=h.next=b,a=a.next}while(a!==null);h===null?u=h=n:h=h.next=n}else u=h=n;a={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var kf=!1;function Ho(){if(kf){var t=ys;if(t!==null)throw t}}function Po(t,n,a,o){kf=!1;var u=t.updateQueue;Da=!1;var h=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var C=S,U=C.next;C.next=null,b===null?h=U:b.next=U,b=C;var V=t.alternate;V!==null&&(V=V.updateQueue,S=V.lastBaseUpdate,S!==b&&(S===null?V.firstBaseUpdate=U:S.next=U,V.lastBaseUpdate=C))}if(h!==null){var ne=u.baseState;b=0,V=U=C=null,S=h;do{var L=S.lane&-536870913,Z=L!==S.lane;if(Z?(Je&L)===L:(o&L)===L){L!==0&&L===Ci&&(kf=!0),V!==null&&(V=V.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ve=t,ke=S;L=n;var Fe=a;switch(ke.tag){case 1:if(ve=ke.payload,typeof ve=="function"){ne=ve.call(Fe,ne,L);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ke.payload,L=typeof ve=="function"?ve.call(Fe,ne,L):ve,L==null)break e;ne=R({},ne,L);break e;case 2:Da=!0}}L=S.callback,L!==null&&(t.flags|=64,Z&&(t.flags|=8192),Z=u.callbacks,Z===null?u.callbacks=[L]:Z.push(L))}else Z={lane:L,tag:S.tag,payload:S.payload,callback:S.callback,next:null},V===null?(U=V=Z,C=ne):V=V.next=Z,b|=L;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;Z=S,S=Z.next,Z.next=null,u.lastBaseUpdate=Z,u.shared.pending=null}}while(!0);V===null&&(C=ne),u.baseState=C,u.firstBaseUpdate=U,u.lastBaseUpdate=V,h===null&&(u.shared.lanes=0),Ia|=b,t.lanes=b,t.memoizedState=ne}}function Vy(t,n){if(ty)DELIM" -R"DELIM(peof t!="function")throw Error(s(191,t));t.call(n)}function Yy(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;th?h:8;var b=W.T,S={};S.types=b!==null?b.types:null,W.T=S,Ff(t,!1,n,a);try{var C=u(),U=W.S;if(U!==null&&U(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var V=pT(C,o);Io(t,n,V,Qn(t))}else Io(t,n,o,Qn(t))}catch(ne){Io(t,n,{then:function(){},status:"rejected",reason:ne},Qn())}finally{le.p=h,b!==null&&S.types!==null&&(b.types=S.types),W.T=b}}function wT(){}function Zf(t,n,a,o){if(t.tag!==5)throw Error(s(476));var u=kv(t).queue;Tv(t,u,n,be,a===null?wT:function(){return _v(t),a(o)})}function kv(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:be},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function _v(t){var n=kv(t);n.next===null&&(n=t.alternate.memoizedState),Io(t,n.next.queue,{},Qn())}function If(){return dn($s)}function Nv(){return Ht().memoizedState}function Cv(){return Ht().memoizedState}function ST(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=Qn();t=La(a);var o=Ba(n,t,a);o!==null&&(Pn(o,n,a),Uo(o,n,a)),n={cache:vf()},t.payload=n;return}n=n.return}}function ET(t,n,a){var o=Qn();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$c(t)?Rv(n,a):(a=cf(t,n,a,o),a!==null&&(Pn(a,t,o),Av(a,n,o)))}function jv(t,n,a){var o=Qn();Io(t,n,a,o)}function Io(t,n,a,o){var u={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($c(t))Rv(n,u);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var b=n.lastRenderedState,S=h(b,a);if(u.hasEagerState=!0,u.eagerState=S,Fn(S,b))return vc(t,n,u,0),xt===null&&yc(),!1}catch{}if(a=cf(t,n,u,o),a!==null)return Pn(a,t,o),Av(a,n,o),!0}return!1}function Ff(t,n,a,o){if(o={lane:2,revertLane:Dh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},$c(t)){if(n)throw Error(s(479))}else n=cf(t,a,o,2),n!==null&&Pn(n,t,2)}function $c(t){var n=t.alternate;return t===Ie||n!==null&&n===Ie}function Rv(t,n){xs=zc=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function Av(t,n,a){if((a&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Lt(t,a)}}var qc={readContext:dn,use:Bc,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useLayoutEffect:Bt,useInsertionEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useSyncExternalStore:Bt,useId:Bt,useHostTransitionStatus:Bt,useFormState:Bt,useActionState:Bt,useOptimistic:Bt,useMemoCache:Bt,useCacheRefresh:Bt,useEffectEvent:Bt},Ov={readContext:dn,use:Bc,useCallback:function(t,n){return jn().memoizedState=[t,n===void 0?null:n],t},useContext:dn,useEffect:pv,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Hc(4194308,4,bv.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Hc(4194308,4,t,n)},useInsertionEffect:function(t,n){Hc(4,2,t,n)},useMemo:function(t,n){var a=jn();n=n===void 0?null:n;var o=t();if(Mi){br(!0);try{t()}finally{br(!1)}}return a.memoizedState=[o,n],o},useReducer:function(t,n,a){var o=jn();if(a!==void 0){var u=a(n);if(Mi){br(!0);try{a(n)}finally{br(!1)}}}else u=n;return o.memoizedState=o.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},o.queue=t,t=t.dispatch=ET.bind(null,Ie,t),[o.memoizedState,t]},useRef:function(t){var n=jn();return t={current:t},n.memoizedState=t},useState:function(t){t=Uf(t);var n=t.queue,a=jv.bind(null,Ie,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:$f,useDeferredValue:function(t,n){var a=jn();return qf(a,t,n)},useTransition:function(){var t=Uf(!1);return t=Tv.bind(null,Ie,t.queue,!0,!1),jn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var o=Ie,u=jn();if(Ke){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),xt===null)throw Error(s(349));(Je&127)!==0||Wy(o,n,a)}u.memoizedState=a;var h={value:a,getSnapshot:n};return u.queue=h,pv(tv.bind(null,o,h,t),[t]),o.flags|=2048,Ss(9,{destroy:void 0},ev.bind(null,o,h,a,n),null),a},useId:function(){var t=jn(),n=xt.identifierPrefix;if(Ke){var a=Hr,o=Ur;a=(o&~(1<<32-Nn(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Dc++,0>>=0,t===0?32:31-(Ud(t)/A|0)|0}var I=256,ue=262144,de=4194304;function Te(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&-t;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 Se(t,n,a){var o=t.pendingLanes;if(o===0)return 0;var u=0,h=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~h,o!==0?u=Te(o):(b&=S,b!==0?u=Te(b):a||(a=S&~t,a!==0&&(u=Te(a))))):(S=o&~h,S!==0?u=Te(S):b!==0?u=Te(b):a||(a=o&~t,a!==0&&(u=Te(a)))),u===0?0:n!==0&&n!==u&&(n&h)===0&&(h=u&-u,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:u}function Ne(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Ee(t,n){(n&8)!==0&&(n|=n&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=n;0a;a++)n.push(t);return n}function ze(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function lt(t,n,a,o,u,h){var b=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var S=t.entanglements,C=t.expirationTimes,U=t.hiddenUpdates;for(a=b&~a;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vd=!1;if(aa)try{var To={};Object.defineProperty(To,"passive",{get:function(){Vd=!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{Vd=!1}var Ca=null,Yd=null,uc=null;function Wg(){if(uc)return uc;var t,n=Yd,a=n.length,o,u="value"in Ca?Ca.value:Ca.textContent,h=u.length;)DELIM" +R"DELIM(for(t=0;t=No),iy=" ",sy=!1;function oy(t,n){switch(t){case"keyup":return Y2.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ly(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var us=!1;function K2(t,n){switch(t){case"compositionend":return ly(n);case"keypress":return n.which!==32?null:(sy=!0,iy);case"textInput":return t=n.data,t===iy&&sy?null:t;default:return null}}function Q2(t,n){if(us)return t==="compositionend"||!Jd&&oy(t,n)?(t=Wg(),uc=Yd=Ca=null,us=!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"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function yy(t,n){var a=gy(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=n&&o>=n)return{node:a,offset:n-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=gy(a)}}function vy(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?vy(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function by(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=tf(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=tf(t.document)}return n}function nf(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 aT=aa&&"documentMode"in document&&11>=document.documentMode,ds=null,rf=nul)DELIM" +R"DELIM(l,Ao=null,af=!1;function xy(t,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;af||ds==null||ds!==tf(o)||(o=ds,"selectionStart"in o&&nf(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}),Ao&&Ro(Ao,o)||(Ao=o,o=pu(rf,"onSelect"),0>=b,u-=b,Ur=1<<32-Nn(n)+u|a<Be?(Vt=Oe,Oe=null):Vt=Oe.sibling;var nt=L(B,Oe,q[Be],te);if(nt===null){Oe===null&&(Oe=Vt);break}t&&Oe&&nt.alternate===null&&n(B,Oe),M=h(nt,M,Be),We===null?we=nt:We.sibling=nt,We=nt,Oe=Vt}if(Be===q.length)return a(B,Oe),Ke&&la(B,Be),we;if(Oe===null){for(;BeBe?(Vt=Oe,Oe=null):Vt=Oe.sibling;var Wa=L(B,Oe,nt.value,te);if(Wa===null){Oe===null&&(Oe=Vt);break}t&&Oe&&Wa.alternate===null&&n(B,Oe),M=h(Wa,M,Be),We===null?we=Wa:We.sibling=Wa,We=Wa,Oe=Vt}if(nt.done)return a(B,Oe),Ke&&la(B,Be),we;if(Oe===null){for(;!nt.done;Be++,nt=q.next())nt=ne(B,nt.value,te),nt!==null&&(M=h(nt,M,Be),We===null?we=nt:We.sibling=nt,We=nt);return Ke&&la(B,Be),we}for(Oe=o(Oe);!nt.done;Be++,nt=q.next())nt=Z(Oe,B,Be,nt.value,te),nt!==null&&(t&&(Vt=nt.alternate,Vt!==null&&Oe.delete(Vt.key===null?Be:Vt.key)),M=h(nt,M,Be),We===null?we=nt:We.sibling=nt,We=nt);return t&&Oe.forEach(function(Kk){return n(B,Kk)}),Ke&&la(B,Be),we}function Fe(B,M,q,te){if(typeof q=="object"&&q!==null&&q.type===F&&q.key===null&&q.props.ref===void 0&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case z:e:{for(var we=q.key;M!==null;){if(M.key===we){if(we=q.type,we===F){if(M.tag===7){a(B,M.sibling),te=u(M,q.props.children),za(te,q),te.return=B,B=te;break e}}else if(M.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===ye&&Ri(we)===M.type){a(B,M.sibling),te=u(M,q.props),za(te,q),te.return=B,B=te;break e}a(B,M);break}else n(B,M);M=M.sibling}q.type===F?(te=Ei(q.props.children,B.mode,te,q.key),za(te,q),te.return=B,B=te):(te=xc(q.type,q.key,q.props,null,B.mode,te),za(te,q),te.return=B,B=te)}return b(B);case P:e:{for(we=q.key;M!==null;){if(M.key===we)if(M.tag===4&&M.stateNode.containerInfo===q.containerInfo&&M.stateNode.implementation===q.implementation){a(B,M.sibling),te=u(M,q.children||[]),te.return=B,B=te;break e}else{a(B,M);break}else n(B,M);M=M.sibling}te=ff(q,B.mode,te),te.return=B,B=te}return b(B);case ye:return q=Ri(q),Fe(B,M,q,te)}if(me(q))return ve(B,M,q,te);if(ee(q)){if(we=ee(q),typeof we!="function")throw Error(s(150));return q=we.call(q),ke(B,M,q,te)}if(typeof q.then=="function")return Fe(B,M,Rc(q),te);if(q.$$typeof===re)return Fe(B,M,_c(B,q),te);Ac(B,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,M!==null&&M.tag===6?(a(B,M.sibling),te=u(M,q),te.return=B,B=te):(a(B,M),te=df(q,B.mode,te),te.return=B,B=te),b(B)):a(B,M)}return function(B,M,q,te){try{Bo=0;var we=Fe(B,M,q,te);return xs=null,we}catch(Oe){if(Oe===bs||Oe===Cc)throw Oe;var We=Ln(29,Oe,null,B.mode);return We.lanes=te,We.return=B,We}}}var Oi=Iy(!0),Fy=Iy(!1),Da=!1;function Sf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ef(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 La(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ba(t,n,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(ft&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=bc(t),Cy(t,null,a),n}return vc(t,o,n,a),bc(t)}function Uo(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Lt(t,a)}}function Tf(t,n){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var u=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?u=h=b:h=h.next=b,a=a.next}while(a!==null);h===null?u=h=n:h=h.next=n}else u=h=n;a={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var kf=!1;function Ho(){if(kf){var t=vs;if(t!==null)throw t}}function Po(t,n,a,o){kf=!1;var u=t.updateQueue;Da=!1;var h=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var C=S,U=C.next;C.next=null,b===null?h=U:b.next=U,b=C;var V=t.alternate;V!==null&&(V=V.updateQueue,S=V.lastBaseUpdate,S!==b&&(S===null?V.firstBaseUpdate=U:S.next=U,V.lastBaseUpdate=C))}if(h!==null){var ne=u.baseState;b=0,V=U=C=null,S=h;do{var L=S.lane&-536870913,Z=L!==S.lane;if(Z?(Je&L)===L:(o&L)===L){L!==0&&L===Ci&&(kf=!0),V!==null&&(V=V.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ve=t,ke=S;L=n;var Fe=a;switch(ke.tag){case 1:if(ve=ke.payload,typeof ve=="function"){ne=ve.call(Fe,ne,L);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ke.payload,L=typeof ve=="function"?ve.call(Fe,ne,L):ve,L==null)break e;ne=R({},ne,L);break e;case 2:Da=!0}}L=S.callback,L!==null&&(t.flags|=64,Z&&(t.flags|=8192),Z=u.callbacks,Z===null?u.callbacks=[L]:Z.push(L))}else Z={lane:L,tag:S.tag,payload:S.payload,callback:S.callback,next:null},V===null?(U=V=Z,C=ne):V=V.next=Z,b|=L;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;Z=S,S=Z.next,Z.next=null,u.lastBaseUpdate=Z,u.shared.pending=null}}while(!0);V===null&&(C=ne),u.baseState=C,u.firstBaseUpdate=U,u.lastBaseUpdate=V,h===null&&(u.shared.lanes=0),Ia|=b,t.lanes=b,t.memoizedState=ne}}function Vy(t,n){if(ty)DELIM" +R"DELIM(peof t!="function")throw Error(s(191,t));t.call(n)}function Yy(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;th?h:8;var b=W.T,S={};S.types=b!==null?b.types:null,W.T=S,Ff(t,!1,n,a);try{var C=u(),U=W.S;if(U!==null&&U(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var V=pT(C,o);Io(t,n,V,Qn(t))}else Io(t,n,o,Qn(t))}catch(ne){Io(t,n,{then:function(){},status:"rejected",reason:ne},Qn())}finally{le.p=h,b!==null&&S.types!==null&&(b.types=S.types),W.T=b}}function wT(){}function Zf(t,n,a,o){if(t.tag!==5)throw Error(s(476));var u=kv(t).queue;Tv(t,u,n,be,a===null?wT:function(){return _v(t),a(o)})}function kv(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:be},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function _v(t){var n=kv(t);n.next===null&&(n=t.alternate.memoizedState),Io(t,n.next.queue,{},Qn())}function If(){return dn(qs)}function Nv(){return Ht().memoizedState}function Cv(){return Ht().memoizedState}function ST(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=Qn();t=La(a);var o=Ba(n,t,a);o!==null&&(Pn(o,n,a),Uo(o,n,a)),n={cache:vf()},t.payload=n;return}n=n.return}}function ET(t,n,a){var o=Qn();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$c(t)?Rv(n,a):(a=cf(t,n,a,o),a!==null&&(Pn(a,t,o),Av(a,n,o)))}function jv(t,n,a){var o=Qn();Io(t,n,a,o)}function Io(t,n,a,o){var u={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($c(t))Rv(n,u);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var b=n.lastRenderedState,S=h(b,a);if(u.hasEagerState=!0,u.eagerState=S,Fn(S,b))return vc(t,n,u,0),xt===null&&yc(),!1}catch{}if(a=cf(t,n,u,o),a!==null)return Pn(a,t,o),Av(a,n,o),!0}return!1}function Ff(t,n,a,o){if(o={lane:2,revertLane:Dh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},$c(t)){if(n)throw Error(s(479))}else n=cf(t,a,o,2),n!==null&&Pn(n,t,2)}function $c(t){var n=t.alternate;return t===Ie||n!==null&&n===Ie}function Rv(t,n){ws=zc=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function Av(t,n,a){if((a&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Lt(t,a)}}var qc={readContext:dn,use:Bc,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useLayoutEffect:Bt,useInsertionEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useSyncExternalStore:Bt,useId:Bt,useHostTransitionStatus:Bt,useFormState:Bt,useActionState:Bt,useOptimistic:Bt,useMemoCache:Bt,useCacheRefresh:Bt,useEffectEvent:Bt},Ov={readContext:dn,use:Bc,useCallback:function(t,n){return jn().memoizedState=[t,n===void 0?null:n],t},useContext:dn,useEffect:pv,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Hc(4194308,4,bv.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Hc(4194308,4,t,n)},useInsertionEffect:function(t,n){Hc(4,2,t,n)},useMemo:function(t,n){var a=jn();n=n===void 0?null:n;var o=t();if(Mi){br(!0);try{t()}finally{br(!1)}}return a.memoizedState=[o,n],o},useReducer:function(t,n,a){var o=jn();if(a!==void 0){var u=a(n);if(Mi){br(!0);try{a(n)}finally{br(!1)}}}else u=n;return o.memoizedState=o.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},o.queue=t,t=t.dispatch=ET.bind(null,Ie,t),[o.memoizedState,t]},useRef:function(t){var n=jn();return t={current:t},n.memoizedState=t},useState:function(t){t=Uf(t);var n=t.queue,a=jv.bind(null,Ie,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:$f,useDeferredValue:function(t,n){var a=jn();return qf(a,t,n)},useTransition:function(){var t=Uf(!1);return t=Tv.bind(null,Ie,t.queue,!0,!1),jn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var o=Ie,u=jn();if(Ke){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),xt===null)throw Error(s(349));(Je&127)!==0||Wy(o,n,a)}u.memoizedState=a;var h={value:a,getSnapshot:n};return u.queue=h,pv(tv.bind(null,o,h,t),[t]),o.flags|=2048,Es(9,{destroy:void 0},ev.bind(null,o,h,a,n),null),a},useId:function(){var t=jn(),n=xt.identifierPrefix;if(Ke){var a=Hr,o=Ur;a=(o&~(1<<32-Nn(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Dc++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?b.createElement("select",{is:o.is}):b.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?b.createElement(u,{is:o.is}):b.createElement(u)}}h[kt]=n,h[Rt]=o;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)h.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=h;e:switch(pn(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ma(n)}}return Et(n),n.subtreeFlags&=-33554433,ah(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ma(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(t=Ye.current,gs(n)){if(t=n.stateNode,a=n.memoizedProps,o=null,u=nn,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[kt]=n,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||tb(t.nodeValue,a)),t||Oa(n,!0)}else t=rl(t).createTextNode(o),t[kt]=n,n.stateNode=t}return Et(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(o=gs(n),a!==null){if(t===null){if(!o)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[kt]=n}else Ti(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),t=!1}else a=pf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(Vn(n),n):(Vn(n),null);if((n.flags&128)!==0)throw Error(s(558))}return Et(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=gs(n),o!==null&&o.dehydrated!==null){if(t===null){if(!u)throw Error(s(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[kt]=n}else Ti(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),u=!1}else u=pf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(Vn(n),n):(Vn(n),null)}return Vn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),a!==t&&a&&(n.child.flags|=8192),Gc(n,n.updateQueue),Et(n),null);case 4:return at(),t===null&&Hh(n.stateNode.containerInfo),n.flags|=67108864,Et(n),null;case 10:return ua(n.type),Et(n),null;case 19:if(jf(n),o=n.memoizedState,o===null)return Et(n),null;if(u=(n.flags&128)!==0,h=o.rendering,h===null)if(u)Vo(o,!1);else{if(Ut!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Mc(t),h!==null){for(n.flags|=128,Vo(o,!1),t=h.updateQueue,n.updateQueue=t,Gc(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)jy(a,t),a=a.sibling;return $o(n,hn.current&1|2),Ke&&la(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&_n()>su&&(n.flags|=128,u=!0,Vo(o,!1),n.lanes=4194304)}else{if(!u)if(t=Mc(h),t!==null){if(n.flags|=128,u=!0,t=t.updateQueue,n.updateQueue=t,Gc(n,t),Vo(o,!0),o.tail===null&&o.tailMode!=="collapsed"&&o.tailMode!=="visible"&&!h.alternate&&!Ke)return Et(n),null}else 2*_n()-o.renderingStartTime>su&&a!==536870912&&(n.flags|=128,u=!0,Vo(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}if(o.tail!==null){t=o.tail;e:{for(a=t;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_n(),t.sibling=null,h=hn.current,h=u?h&1|2:h&1,o.tailMode==="visible"||o.tailMode==="collapsed"||!a||Ke?$o(n,h):(a=h,Ue(fn,n),Ue(hn,a),Sn===null&&(Sn=n)),Ke&&la(n,o.treeForkCount),t}return Et(n),null;case 22:case 23:return Vn(n),Nf(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(Et(n),n.subtreeFlags&6&&(n.flags|=8192)):Et(n),a=n.updateQueue,a!==null&&Gc(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),t!==null&&Le(ji),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),ua(Zt),Et(n),null;case 25:return null;case 30:return n.flags|=33554432,Et(n),null}throw Error(s(156,n.tag))}function RT(t,n){switch(hf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ua(Zt),at(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return ln(n),null;case 31:if(n.memoizedState!==null){if(Vn(n),n.alternate===null)throw Error(s(340));Ti()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Vn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Ti()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return jf(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return at(),null;case 10:return ua(n.type),null;case 22:case 23:return Vn(n),Nf(),t!==null&&Le(ji),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ua(Zt),null;case 25:return null;default:return null}}function r0(t,n){switch(hf(n),n.tag){case 3:ua(Zt),at();break;case 26:case 27:case 5:ln(n);break;case 4:at();break;case 31:n.memoizedState!==null&&Vn(n);break;case 13:Vn(n);break;case 19:jf(n);break;case 10:ua(n.type);break;case 22:case 23:Vn(n),Nf(),t!==null&&Le(ji);break;case 24:ua(Zt)}}function Yo(t,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var u=o.next;a=u;do{if((a.tag&t)===t){o=void 0;var h=a.create,b=a.inst;o=h(),b.destroy=o}a=a.next}while(a!==u)DELIM" -R"DELIM()}}catch(S){yt(n,n.return,S)}}function $a(t,n,a){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&t)===t){var b=o.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=n;var C=a,U=S;try{U()}catch(V){yt(u,C,V)}}}o=o.next}while(o!==h)}}catch(V){yt(n,n.return,V)}}function a0(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{Yy(n,a)}catch(o){yt(t,t.return,o)}}}function i0(t,n,a){a.props=zi(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(o){yt(t,n,o)}}function Pr(t,n){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:var u=t.stateNode,h=ia(t.memoizedProps,u);(u.ref===null||u.ref.name!==h)&&(u.ref=fb(h)),o=u.ref;break;case 7:if(t.stateNode===null){var b=new Xn(t);y(t.child,!1,xk,b,void 0,void 0),t.stateNode=b}o=t.stateNode;break;default:o=t.stateNode}typeof a=="function"?t.refCleanup=a(o):a.current=o}}catch(S){yt(t,n,S)}}function mn(t,n){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(u){yt(t,n,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){yt(t,n,u)}else a.current=null}function Kc(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var a=0;a title"))),pn(o,n,a),o[kt]=t,Ze(o),n=o;break e;case"link":if(h=jb("link","href",u).get(n+(a.href||""))){for(b=0;bFe&&(b=Fe,Fe=ke,ke=b);var B=yy(S,ke),M=yy(S,Fe);if(B&&M&&(Z.rangeCount!==1||Z.anchorNode!==B.node||Z.anchorOffset!==B.offset||Z.focusNode!==M.node||Z.focusOffset!==M.offset)){var q=ne.createRange();q.setStart(B.node,B.offset),Z.removeAllRanges(),ke>Fe?(Z.addRange(q),Z.extend(M.node,M.offset)):(q.setEnd(M.node,M.offset),Z.addRange(q))}}}}for(ne=[],Z=S;Z=Z.parentNode;)Z.nodeType===1&&ne.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sa?32:a,W.T=null,a=kh,kh=null;var h=Tr,b=Vr;if(At=0,Ui=Tr=null,Vr=0,(ft&6)!==0)throw Error(s(331));var S=ft;if(ft|=4,C0(h.current),k0(h,h.current,b,a),ft=S,el(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(Or,h)}catch{}return!0}finally{le.p=u,W.T=o,Z0(t,n)}}function I0(t,n,a){n=ar(a,n),n=Gf(t.stateNode,n,2),t=Ba(t,n,2),t!==null&&(ze(t,2),Yr(t))}function yt(t,n,a){if(t.tag===3)I0(t,t,a);else for(;n!==null;){if(n.tag===3){I0(n,t,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Fa===null||!Fa.has(o))){t=ar(a,t),a=Pv(2),o=Ba(n,a,2),o!==null&&($v(a,o,n,t),ze(o,2),Yr(o));break}}n=n.return}}function Oh(t,n,a){var o=t.pingCache;if(o===null){o=t.pingCache=new zT;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(a)||(Sh=!0,u.add(a),t=qT.bind(null,t,n,a),n.then(t,t))}function qT(t,n,a){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,xt===t&&(Je&a)===a&&((Ut===4||Ut===3&&(Je&62914560)===Je&&300>_n()-iu)&&(ft&2)===0?Ms(t,0):au|=a,Cs===Je&&(Cs=0)),Yr(t)}function F0(t,n){n===0&&(n=Ae()),t=Si(t,n),t!==null&&(ze(t,n),Yr(t))}function ZT(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),F0(t,a)}function IT(t,n){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(a=u.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(n),F0(t,a)}function FT(t,n){return Zn(t,n)}var Ds=null,Ls=null,Mh=!1,hu=!1,zh=!1,Ya=0;function Yr(t){t!==Ls&&t.next===null&&(Ls===null?Ds=Ls=t:Ls=Ls.next=t),hu=!0,Mh||(Mh=!0,YT())}function el(t,n){if(!zh&&hu){zh=!0;do for(var a=!1,o=Ds;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var b=o.suspendedLanes,S=o.pingedLanes;h=(1<<31-Nn(42|t)+1)-1,h&=u)DELIM" -R"DELIM(&~(b&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,K0(o,h))}else h=Je,h=Se(o,o===xt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Ne(o,h)||(a=!0,K0(o,h));o=o.next}while(a);zh=!1}}function VT(){V0()}function V0(){hu=Mh=!1;var t=0;Ya!==0&&ak()&&(t=Ya);for(var n=_n(),a=null,o=Ds;o!==null;){var u=o.next,h=Y0(o,n);h===0?(o.next=null,a===null?Ds=u:a.next=u,u===null&&(Ls=a)):(a=o,(t!==0||(h&3)!==0)&&(hu=!0)),o=u}At!==0&&At!==5||el(t),Ya!==0&&(Ya=0)}function Y0(t,n){for(var a=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,h=t.pendingLanes&-62914561;0S)break;var V=C.transferSize,ne=C.initiatorType;V&&nb(ne)&&(C=C.responseEnd,b+=V*(Cvu){ke.length=ve;break}q=new Promise(uk.bind(q)),ke.push(q)}}}if(0"u"?null:document;function kb(t,n,a){var o=Us;if(o&&typeof n=="string"&&n){var u=nr(n);u='link[rel="'+t+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Tb.has(u)||(Tb.add(u),t={rel:t,crossOrigin:a,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),pn(n,"link",t),Ze(n),o.head.appendChild(n)))}}function jk(t){ga.D(t),kb("dns-prefetch",t,null)}function Rk(t,n){ga.C(t,n),kb("preconnect",t,n)}function Ak(t,n,a){ga.L(t,n,a);var o=Us;if(o&&t&&n){var u='link[rel="preload"][as="'+nr(n)+'"]';n==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+nr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+nr(a.imageSizes)+'"]')):u+='[href="'+nr(t)+'"]';var h=u;switch(n){case"style":h=Hs(t);break;case"script":h=Ps(t)}if(!(ur.has(h)||(t=R({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),ur.set(h,t),o.querySelector(u)!==null||n==="style"&&o.querySelector(il(h))||n==="script"&&o.querySelector(sl(h))))){var b=o.createElement("link");pn(b,"link",t),n==="style"&&(b[Ge]=!0,b.onload=b.onerror=function(){Lr(b)}),Ze(b),o.head.appendChild(b)}}}function Ok(t,n){ga.m(t,n);var a=Us;if(a&&t){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+nr(o)+'"][href="'+nr(t)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ps(t)}if(!ur.has(h)&&(t=R({rel:"modulepreload",href:t},n),ur.set(h,t),a.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(sl(h)))return}o=a.createElement("link"),pn(o,"link",t),Ze(o),a.head.appendChild(o)}}}function Mk(t,n,a){ga.S(t,n,a);var o=Us;if(o&&t){var u=Dr(o).hoistableStyles,h=Hs(t);n=n||"default";var b=u.get(h);if(!b){var S={loading:0,preload:null};if(b=o.querySelector(il(h)))S.loading=5;else{t=R({rel:"stylesheet",href:t,"data-precedence":n},a),(a=ur.get(h))&&tm(t,a);var C=b=o.createElement("link");Ze(C),pn(C,"link",t),C._p=new Promise(function(U,V){C.onload=U,C.onerror=V}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,gu(b,n,o)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(h,b)}}}function zk(t,n){ga.X(t,n);var a=Us;if(a&&t){var o=Dr(a).hoistableScripts,u=Ps(t),h=o.get(u);h||(h=a.querySelector(sl(u)),h||(t=R({src:t,async:!0},n),(n=ur.get(u))&&nm(t,n),h=a.createElement("script"),Ze(h),pn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function Dk(t,n){ga.M(t,n);var a=Us;if(a&&t){var o=Dr(a).hoistableScripts,u=Ps(t),h=o.get(u);h||(h=a.querySelector(sl(u)),h||(t=R({src:t,async:!0,type:"module"},n),(n=ur.get(u))&&nm(t,n),h=a.createElement("script"),Ze(h),pn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function _b(t,n,a,o){var u=(u=Ye.current)?al(u):null;if(!u)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=Hs(a.href),n=Dr(u).hoistableStyles,o=n.get(a),o||(o={type:"style",instance:null,count:0,state:null},n.set(a,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Hs(a.href);var h=Dr(u).hoistableStyles,b=h.get(t);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,b),(h=u.querySelector(il(t)))?h._p||(b.instance=h,b.state.loading=5):(h=ur.get(t),h||(h={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ur.set(t,h)),Lk(u,t,h,b.state))),n&&o===null)throw Error(s(528,""));return b}if(n&&o!==null)throw Error(s(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(a=Ps(a),n=Dr(u).hoistableScripts,o=n.get(a),o||(o={type:"script",instance:null,count:0,state:null},n.set(a,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Hs(t){return'href="'+nr(t)+'"'}function il(t){return'link[rel="stylesheet"]['+t+"]"}function Nb(t){return R({},t,{"data-precedence":t.precedence,precedence:null})}function Lk(t,n,a,o){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Ge]!==!0){o.loading=1;return}}else n=t.createElement("link"),n[Ge]=!0,n.onload=n.onerror=Lr.bind(null,n),pn(n,"link",a),Ze(n),t.head.appendChild(n);o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2})}function Ps(t){return'[src="'+nr(t)+'"]'}function sl(t){return"script[async]"+t}function Cb(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+nr(a.href)+'"]');if(o)return n.instance=o,Ze(o),o;var u=R({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ze(o),pn(o,"style",u),gu(o,a.precedence,t),n.instance=o;case"stylesheet":u=Hs(a.href);var h=t.querySelector(il(u));if(h)return n.state.loading|=4,n.instance=h,Ze(h),h;o=Nb(a),(u=ur.get(u))&&tm(o,u),h=(t.ownerDocument||t).createElement("link"),Ze(h);var b=h;return b._p=new Promise(function(S,C){b.onload=S,b.onerror=C}),pn(h,"link",o),n.state.loading|=4,gu(h,a.precedence,t),n.instance=h;case"script":return h=Ps(a.src),(u=t.querySelector(sl(h)))?(n.instance=u,Ze(u),u):(o=a,(u=ur.get(h))&&(o=R({},a),nm(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),Ze(u),pn(u,"link",o),t.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,gu(o,a.precedence,t));return n.instance}function gu(t,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,b=0;b title"):null)}function Bk(t,n,a){if(a===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):)DELIM" -R"DELIM(!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 Rb(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Ab(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ob(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Mb(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=Ob(n),t.suspenseyImages.push(n)),t=Pk.bind(t),n.decode().then(t,t))}function Uk(t,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Hs(o.href),h=n.querySelector(il(u));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ol.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=h,Ze(h);return}h=n.ownerDocument||n,o=Nb(o),(u=ur.get(u))&&tm(o,u),h=h.createElement("link"),Ze(h);var b=h;b._p=new Promise(function(S,C){b.onload=S,b.onerror=C}),pn(h,"link",o),a.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=ol.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var vu=0;function Hk(t,n){return t.stylesheets&&t.count===0&&xu(t,t.stylesheets),0vu?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function zb(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)xu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function ol(){this.count--,zb(this)}function Pk(){this.imgCount--,zb(this)}var bu=null;function xu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,bu=new Map,n.forEach($k,t),bu=null,ol.call(t))}function $k(t,n){if(!(n.state.loading&4)){var a=bu.get(t);if(a)var o=a.get(null);else{a=new Map,bu.set(t,a);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),fm.exports=a_(),fm.exports}var s_=i_();const o_=Dp(s_),l_=[{id:"current",label:"Classic"},{id:"light",label:"Light"},{id:"midnight",label:"Midnight"}],Bp="libbitcoinTheme",rd="libbitcoin-theme-change";function Up(e){return e==="light"||e==="midnight"?e:"current"}function vw(){try{return Up(localStorage.getItem(Bp))}catch{return"current"}}function Hp(e){document.documentElement.dataset.theme=e;const r=getComputedStyle(document.documentElement).getPropertyValue("--theme-background").trim();r&&document.querySelector('meta[name="theme-color"]')?.setAttribute("content",r)}function c_(){Hp(vw()),globalThis.addEventListener("storage",f_)}function u_(e){const r=Up(e);Hp(r);try{localStorage.setItem(Bp,r)}catch{}globalThis.dispatchEvent(new Event(rd))}function d_(){return Up(document.documentElement.dataset.theme)}function f_(e){e.key!==null&&e.key!==Bp||(Hp(vw()),globalThis.dispatchEvent(new Event(rd)))}function h_(e){return globalThis.addEventListener(rd,e),()=>{globalThis.removeEventListener(rd,e)}}function m_(){return T.useSyncExternalStore(h_,d_,()=>"current")}const bw=T.createContext(void 0),xw=e=>{const r=T.useContext(bw);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},p_=({client:e,children:r})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(bw.Provider,{value:e,children:r})),g_={setTimeout:(e,r)=>setTimeout(e,r),clearTimeout:e=>clearTimeout(e),setInterval:(e,r)=>setInterval(e,r),clearInterval:e=>clearInterval(e)};var y_=class{#e=g_;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,r){return this.#e.setTimeout(e,r)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,r){return this.#e.setInterval(e,r)}clearInterval(e){this.#e.clearInterval(e)}};const Fi=new y_;function v_(e){setTimeout(e,0)}const b_=typeof window>"u"||"Deno"in globalThis;function $n(){}function x_(e,r){return typeof e=="function"?e(r):e}function ww(e){return typeof e=="number"&&e>=0&&e!==1/0}function Sw(e,r){return Math.max(e+(r||0)-Date.now(),0)}function Nt(e,r){return typeof e=="function"?e(r):e}function ax(e,r){const{type:i="all",exact:s,fetchStatus:l,predicate:c,queryKey:d,stale:f}=e;if(d){if(s){if(r.queryHash!==Pp(d,r.options))return!1}else if(!ao(r.queryKey,d))return!1}if(i!=="all"){const m=r.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof f=="boolean"&&r.isStale()!==f||l&&l!==r.state.fetchStatus||c&&!c(r))}function ix(e,r){const{exact:i,status:s,predic)DELIM" -R"DELIM(ate:l,mutationKey:c}=e;if(c){if(!r.options.mutationKey)return!1;if(i){if(Bl(r.options.mutationKey)!==Bl(c))return!1}else if(!ao(r.options.mutationKey,c))return!1}return!(s&&r.state.status!==s||l&&!l(r))}function Pp(e,r){return(r?.queryKeyHashFn||Bl)(e)}function Bl(e){return JSON.stringify(e,(r,i)=>ep(i)?Object.keys(i).sort().reduce((s,l)=>(s[l]=i[l],s),{}):i)}function ao(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(Array.isArray(e)&&Array.isArray(r)){if(r.length>e.length)return!1;for(let s=0;s500)return r;const s=sx(e)&&sx(r);if(!s&&!(ep(e)&&ep(r)))return r;const l=(s?e:Object.keys(e)).length,c=s?r:Object.keys(r),d=c.length,f=s?new Array(d):{};let m=0;for(let g=0;g{Fi.setTimeout(r,e)})}function tp(e,r,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,r):i.structuralSharing!==!1?Tw(e,r):r}function S_(e,r,i=0){const s=[...e,r];return i&&s.length>i?s.slice(-i):s}function E_(e,r,i=0){const s=[r,...e];return i&&s.length>i?s.slice(0,i):s}const $p=Symbol();function kw(e,r){return!e.queryFn&&r?.initialPromise?()=>r.initialPromise:!e.queryFn||e.queryFn===$p?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _w(e,r){return typeof e=="function"?e(...r):!!e}const qp=Symbol();function T_(e,r,i,s){let l=!1,c;return Object.defineProperties(e,{[qp]:{value:s},signal:{enumerable:!0,get:()=>(c??=r(),l||(l=!0,c.aborted?i():c.addEventListener("abort",i,{once:!0})),c)}}),e}let k_=()=>b_;const Zp=()=>k_();var Fl=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(){}},__=class extends Fl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}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(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const Ip=new __,N_=v_;function C_(){let e=[],r=0,i=f=>{f()},s=f=>{f()},l=N_;const c=f=>{r?e.push(f):l(()=>{i(f)})},d=()=>{const f=e;e=[],f.length&&l(()=>{s(()=>{f.forEach(m=>{i(m)})})})};return{batch:f=>{let m;r++;try{m=f()}finally{r--,r||d()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{i=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{l=f}}}const bn=C_();var j_=class extends Fl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),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(r=>{r(e)}))}isOnline(){return this.#e}};const ad=new j_;function R_(e){return Math.min(1e3*2**e,3e4)}function Nw(e){return(e??"online")==="online"?ad.isOnline():!0}var np=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Cw(e){let r=!1,i=0,s,l="pending",c,d;const f=new Promise((O,se)=>{c=O,d=se});f.catch($n);const m=()=>l!=="pending",g=O=>{if(!m()){const se=new np(O);_(se),e.onCancel?.(se)}},v=()=>{r=!0},y=()=>{r=!1},x=()=>Ip.isFocused()&&(e.networkMode==="always"||ad.isOnline())&&e.canRun(),w=()=>Nw(e.networkMode)&&e.canRun(),E=O=>{m()||(s?.(),l="resolved",c(O))},_=O=>{m()||(s?.(),l="rejected",d(O))},N=O=>new Promise(se=>{s=ce=>{(m()||O())&&se(ce)},e.onPause?.()}).then(()=>{s=void 0,m()||e.onContinue?.()}),H=()=>{if(m())return;let O;const se=i===0?e.initialPromise:void 0;try{O=se??e.fn()}catch(ce){O=Promise.reject(ce)}Promise.resolve(O).then(E).catch(ce=>{if(m())return;const K=e.retry??(Zp()?0:3),oe=e.retryDelay??R_,R=typeof oe=="function"?oe(i,ce):oe,k=K===!0||typeof K=="number"&&im()||x()?void 0:N(x)).then(()=>{r?_(ce):H()})})};return{promise:f,status:()=>l,cancel:g,continue:()=>(s?.(),f),cancelRetry:v,continueRetry:y,canStart:w,start:()=>(w()?H():N(w).then(H),f)}}var jw=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ww(this.gcTime)&&(this.#e=Fi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Zp()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Fi.clearTimeout(this.#e),this.#e=void 0)}};function A_(e){return{onFetch:(r,i)=>{const s=r.options,l=r.fetchOptions?.meta?.fetchMore?.direction,c=r.state.data?.pages||[],d=r.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const g=async()=>{let v=!1;const y=r,x=_=>{T_(_,()=>r.signal,()=>v=!0,y[qp])},w=kw(r.options,r.fetchOptions),E=async(_,N,H)=>{if(v)return Promise.reject(r.signal.reason);if(N==null&&_.pages.length)return Promise.resolve(_);const se=(()=>{const R={client:r.client,queryKey:r.queryKey,pageParam:N,direction:H?"backward":"forward",meta:r.options.meta};return x(R),R})(),ce=await w(se),{maxPages:K}=r.options,oe=H?E_:S_;return{pages:oe(_.pages,ce,K),pageParams:oe(_.pageParams,N,K)}};if(l&&c.length){const _=l==="backward",N=_?O_:lx,H={pages:c,pageParams:d};f=await E(H,N(s,H),_)}else{const _=e??c.length;do{const N=m===0?d[0]===void 0?s.initialPageParam:d[0]:lx(s,f);if(m>0&&N==null)break;f=await E(f,N),m++}while(m<_)}return f};r.options.persister?r.fetchFn=()=>r.options.persister?.(g,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},i):r.fetchFn=g}}}function lx(e,{pages:r,pageParams:i}){const s=r.length-1;return r.length>0?e.getNextPageParam(r[s],r,i[s],i):void 0}function O_(e,{pages:r,pageParams:i}){return r.length>0?e.getPreviousPageParam?.(r[0],r,i[0],i):void 0}var M_=class extends jw{#e;#t;#n;#r;#i;#a;#s;#l;#c;constructor(e){super(),this.#c=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ux(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTim)DELIM" +R"DELIM(else throw Error(s(558));else if(Ft||_i(t,n,a,!1),u=(a&t.childLanes)!==0,Ft||u){if(Ua.current===null){if(o=xt,o!==null&&(b=ct(o,a),b!==0&&b!==h.retryLane))throw h.retryLane=b,Si(t,b),Pn(o,t,b),Kf;uu()}n=Yv(t,n,a)}else t=h.treeContext,St=cr(b.nextSibling),nn=n,Ke=!0,Aa=null,or=!1,t!==null&&My(n,t),n=Ic(n,o),n.flags|=134221824;return n}return t=oa(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Ts(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function Qf(t,n,a,o,u){return Ni(n),a=Af(t,n,a,o,void 0,u),o=Of(),t!==null&&!Ft?(Mf(t,n,u),ha(t,n,u)):(Ke&&o&&Sc(n),n.flags|=1,Qt(t,n,a,u),n.child)}function Gv(t,n,a,o,u,h){return Ni(n),n.updateQueue=null,a=Xy(n,o,a,u),Qy(t),o=Of(),t!==null&&!Ft?(Mf(t,n,h),ha(t,n,h)):(Ke&&o&&Sc(n),n.flags|=1,Qt(t,n,a,h),n.child)}function Kv(t,n,a,o,u){if(Ni(n),n.stateNode===null){var h=ms,b=a.contextType;typeof b=="object"&&b!==null&&(h=dn(b)),h=new a(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Yf,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},Sf(n),b=a.contextType,h.context=typeof b=="object"&&b!==null?dn(b):ms,h.state=n.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Vf(n,a,b,o),h.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&Yf.enqueueReplaceState(h,h.state,null),Po(n,o,h,u),Ho(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var S=n.memoizedProps,C=zi(a,S);h.props=C;var U=h.context,V=a.contextType;b=ms,typeof V=="object"&&V!==null&&(b=dn(V));var ne=a.getDerivedStateFromProps;V=typeof ne=="function"||typeof h.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,V||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S||U!==b)&&Dv(n,h,o,b),Da=!1;var L=n.memoizedState;h.state=L,Po(n,o,h,u),Ho(),U=n.memoizedState,S||L!==U||Da?(typeof ne=="function"&&(Vf(n,a,ne,o),U=n.memoizedState),(C=Da||zv(n,a,C,o,L,U,b))?(V||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=U),h.props=o,h.state=U,h.context=b,o=C):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,Ef(t,n),b=n.memoizedProps,V=zi(a,b),h.props=V,ne=n.pendingProps,L=h.context,U=a.contextType,C=ms,typeof U=="object"&&U!==null&&(C=dn(U)),S=a.getDerivedStateFromProps,(U=typeof S=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==ne||L!==C)&&Dv(n,h,o,C),Da=!1,L=n.memoizedState,h.state=L,Po(n,o,h,u),Ho();var Z=n.memoizedState;b!==ne||L!==Z||Da||t!==null&&t.dependencies!==null&&kc(t.dependencies)?(typeof S=="function"&&(Vf(n,a,S,o),Z=n.memoizedState),(V=Da||zv(n,a,V,o,L,Z,C)||t!==null&&t.dependencies!==null&&kc(t.dependencies))?(U||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Z,C),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Z,C)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===t.memoizedProps&&L===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&L===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Z),h.props=o,h.state=Z,h.context=C,o=V):(typeof h.componentDidUpdate!="function"||b===t.memoizedProps&&L===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&L===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,Ts(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=Oi(n,t.child,null,u),n.child=Oi(n,null,a,u)):Qt(t,n,a,u),n.memoizedState=h.state,t=n.child):t=ha(t,n,u),t}function Qv(t,n,a,o){return Ti(),n.flags|=256,Qt(t,n,a,o),n.child}var Xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jf(t){return{baseLanes:t,cachePool:Hy()}}function Wf(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=Kn),t}function Xv(t,n,a){var o=n.pendingProps,u=!1,h=(n.flags&128)!==0,b;if((b=h)||(b=t!==null&&t.memoizedState===null?!1:(hn.current&2)!==0),b&&(u=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ke){if(u?Ha(n):Pa(),(t=St)?(t=bb(t,or),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ra!==null?{id:Ur,overflow:Hr}:null,retryLane:536870912,hydrationErrors:null},a=Ry(t),a.return=n,n.child=a,nn=n,St=null)):t=null,t===null)throw Oa(n);return Jh(t)?n.lanes=32:n.lanes=536870912,null}return h=o.children,o=o.fallback,u?(Pa(),u=n.mode,h=Fc({mode:"hidden",children:h},u),o=Ei(o,u,a,null),h.return=n,o.return=n,h.sibling=o,n.child=h,o=n.child,o.memoizedState=Jf(a),o.childLanes=Wf(t,b,a),n.memoizedState=Xf,Fo(null,o)):(Ha(n),eh(n,h))}var S=t.memoizedState;if(S!==null){var C=S.dehydrated;if(C!==null)return NT(t,n,h,b,o,C,S,a)}return u?(Pa(),u=o.fallback,h=n.mode,S=t.child,C=S.sibling,o=oa(S,{mode:"hidden",children:o.children}),o.subtreeFlags=S.subtreeFlags&1206910976,C!==null?u=oa(C,u):(u=Ei(u,h,a,null),u.flags|=2),u.return=n,o.return=n,o.sibling=u,n.child=o,Fo(null,o),o=n.child,u=t.child.memoizedState,u===null?u=Jf(a):(h=u.cachePool,h!==null?(S=Zt._currentValue,h=h.parent!==S?{parent:S,pool:S}:h):h=Hy(),u={baseLanes:u.baseLanes|a,cachePool:h}),o.memoizedState=u,o.childLanes=Wf(t,b,a),n.memoizedState=Xf,Fo(t.child,o)):(Ha(n),a=t.child,t=a.sibling,a=oa(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,t!==null&&(b=n.deletions,b===null?(n.deletions=[t],n.flags|=16):b.push(t)),n.child=a,n.memoizedState=null,a)}function eh(t,n){return n=Fc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Fc(t,n){return t=Ln(22,t,null,n),t.lanes=0,t}function Vc(t,n,a){return Oi(n,t.child,null,a),t=eh(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function NT(t,n,a,o,u,h,b,S){if(a)return n.flags&256?(Ha(n),n.flags&=-257,Vc(t,n,S)):n.memoizedState!==null?(Pa(),n.child=t.child,n.flags|=128,null):(Pa(),h=u.fallback,b=n.mode,u=Fc({mode:"visible",children:u.children},b),h=Ei(h,b,S,null),h.flags|=2,u.return=n,h.return=n,u.sibling=h,n.child=u,Oi(n,t.child,null,S),u=n.child,u.memoizedState=Jf(S),u.childLanes=Wf(t,o,S),n.memoizedState=Xf,Fo(null,u));if(Ha(n),Jh(h)){if(o=h.nextSibling&&h.nextSibling.dataset,o)var C=o.dgst;return o=C,o!==""&&(u=Error(s(419)),u.stack="",u.digest=o,Mo({value:u,source:null,stack:null})),Vc(t,n,S)}if(Ft||_i(t,n,S,!1),o=(S&t.childLanes)!==0,Ft||o){if(Ua.current!==null)return Vc(t,n,S);if(o=xt,o!==null&&(u=ct(o,S),u!==0&&u!==b.retryLane))throw b.retryLane=u,Si(t,u),Pn(o,t,u),Kf;return Xh(h)||uu(),Vc(t,n,S)}return Xh(h)?(n.flags|=192,n.child=t.child,null):(t=b.treeContext,St=cr(h.nextSibling),nn=n,Ke=!0,Aa=null,or=!1,t!==null&&My(n,t),n=eh(n,u.children),n.flags|=134221824,n)}function Jv(t,n,a){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Tc(t.return,n,a)}function Wv(t){for(var n=null;t!==null;){var a=t.alternate;a!==null&&Mc(a)===null&&(n=t),t=t.sibl)DELIM" +R"DELIM(ing}return n}function Yc(t,n,a,o,u,h){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:u,treeForkCount:h}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=o,b.tail=a,b.tailMode=u,b.treeForkCount=h)}function th(t){var n=t.child;for(t.child=null;n!==null;){var a=n.sibling;n.sibling=t.child,t.child=n,n=a}}function nh(t,n,a){var o=n.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var b=hn.current;if(n.flags&128)return $o(n,b),null;var S=(b&2)!==0;if(S?(b=b&1|2,n.flags|=128):b&=1,$o(n,b),u==="backwards"&&t!==null?(th(t),Qt(t,n,o,a),th(t)):Qt(t,n,o,a),o=Ke?Oo:0,!S&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Jv(t,a,n);else if(t.tag===19)Jv(t,a,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(u){case"backwards":a=Wv(n.child),a===null?(u=n.child,n.child=null):(u=a.sibling,a.sibling=null,th(n)),Yc(n,!0,u,null,h,o);break;case"unstable_legacy-backwards":for(a=null,u=n.child,n.child=null;u!==null;){if(t=u.alternate,t!==null&&Mc(t)===null){n.child=u;break}t=u.sibling,u.sibling=a,a=u,u=t}Yc(n,!0,a,null,h,o);break;case"together":Yc(n,!1,null,null,void 0,o);break;case"independent":n.memoizedState=null;break;default:a=Wv(n.child),a===null?(u=n.child,n.child=null):(u=a.sibling,a.sibling=null),Yc(n,!1,u,a,h,o)}return n.child}function e0(t,n,a){var o=n.pendingProps;return Ma(n,n.type,o.value),Qt(t,n,o.children,a),n.child}function ha(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),Ia|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(_i(t,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,a=oa(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=oa(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function rh(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&kc(t)))}function CT(t,n,a){switch(n.tag){case 3:ot(n,n.stateNode.containerInfo),Ma(n,Zt,t.memoizedState.cache),Ti();break;case 27:case 5:wt(n);break;case 4:ot(n,n.stateNode.containerInfo);break;case 10:Ma(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Cf(n),null;break;case 13:var o=n.memoizedState;if(o!==null){if(o.dehydrated!==null)return Ha(n),n.flags|=128,null;o=_i(t,n,a,!1);var u=n.child.childLanes;return o||(a&u)!==0?Xv(t,n,a):(Ha(n),t=ha(t,n,a),t!==null?t.sibling:null)}Ha(n);break;case 19:if(n.flags&128)return nh(t,n,a);if(u=(t.flags&128)!==0,o=(a&n.childLanes)!==0,o||(_i(t,n,a,!1),o=(a&n.childLanes)!==0),u){if(o)return nh(t,n,a);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),$o(n,hn.current),o)break;return null;case 22:return n.lanes=0,Fv(t,n,a,n.pendingProps);case 24:Ma(n,Zt,t.memoizedState.cache)}return ha(t,n,a)}function t0(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ft=!0;else{if(!rh(t,a)&&(n.flags&128)===0)return Ft=!1,CT(t,n,a);Ft=(t.flags&131072)!==0}else Ft=!1,Ke&&(n.flags&1048576)!==0&&Oy(n,Oo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Ri(n.elementType),n.type=t,typeof t=="function")uf(t)?(o=zi(t,o),n.tag=1,n=Kv(null,n,t,o,a)):(n.tag=0,n=Qf(null,n,t,o,a));else{if(t!=null){var u=t.$$typeof;if(u===Q){n.tag=11,n=qv(null,n,t,o,a);break e}else if(u===$){n.tag=14,n=Zv(null,n,t,o,a);break e}else if(u===re){n.tag=10,n.type=t,n=e0(null,n,a);break e}}throw n=J(t)||t,Error(s(306,n,""))}}return n;case 0:return Qf(t,n,n.type,n.pendingProps,a);case 1:return o=n.type,u=zi(o,n.pendingProps),Kv(t,n,o,u,a);case 3:e:{if(ot(n,n.stateNode.containerInfo),t===null)throw Error(s(387));o=n.pendingProps;var h=n.memoizedState;u=h.element,Ef(t,n),Po(n,o,null,a);var b=n.memoizedState;if(o=b.cache,Ma(n,Zt,o),o!==h.cache&&yf(n,[Zt],a,!0),Ho(),o=b.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Qv(t,n,o,a);break e}else if(o!==u){u=ar(Error(s(424)),n),Mo(u),n=Qv(t,n,o,a);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,St=cr(t.firstChild),nn=n,Ke=!0,Aa=null,or=!0,a=Fy(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(Ti(),o===u){n=ha(t,n,a);break e}Qt(t,n,o,a)}n=n.child}return n;case 26:return Ts(t,n),t===null?(a=_b(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ke||(n.stateNode=ib(n.type,n.pendingProps,Ye.current,n)):n.memoizedState=_b(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return wt(n),t===null&&Ke&&(o=n.stateNode=Sb(n.type,n.pendingProps,Ye.current),nn=n,or=!0,u=St,Ga(n.type)?(Wh=u,St=cr(o.firstChild)):St=u),Qt(t,n,n.pendingProps.children,a),Ts(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ke&&((u=o=St)&&(o=Sk(o,n.type,n.pendingProps,or),o!==null?(n.stateNode=o,nn=n,St=cr(o.firstChild),or=!1,u=!0):u=!1),u||Oa(n)),wt(n),u=n.type,h=n.pendingProps,b=t!==null?t.memoizedProps:null,o=h.children,Ih(u,h)?o=null:b!==null&&Ih(u,b)&&(n.flags|=32),n.memoizedState!==null&&(u=Af(t,n,yT,null,null,a),qs._currentValue=u),Ts(t,n),Qt(t,n,o,a),n.child;case 6:return t===null&&Ke&&((t=a=St)&&(a=Ek(a,n.pendingProps,or),a!==null?(n.stateNode=a,nn=n,St=null,t=!0):t=!1),t||Oa(n)),null;case 13:return Xv(t,n,a);case 4:return ot(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Oi(n,null,o,a):Qt(t,n,o,a),n.child;case 11:return qv(t,n,n.type,n.pendingProps,a);case 7:return o=n.pendingProps,Ts(t,n),Qt(t,n,o,a),n.child;case 8:return Qt(t,n,n.pendingProps.children,a),n.child;case 12:return Qt(t,n,n.pendingProps.children,a),n.child;case 10:return e0(t,n,a);case 9:return u=n.type._context,o=n.pendingProps.children,Ni(n),u=dn(u),o=o(u),n.flags|=1,Qt(t,n,o,a),n.child;case 14:return Zv(t,n,n.type,n.pendingProps,a);case 15:return Iv(t,n,n.type,n.pendingProps,a);case 19:return nh(t,n,a);case 31:return _T(t,n,a);case 22:return Fv(t,n,a,n.pendingProps);case 24:return Ni(n),o=dn(Zt),t===null?(u=xf(),u===null&&(u=xt,h=vf(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=a),u=h),n.memoizedState={parent:o,cache:u},Sf(n),Ma(n,Zt,u)):((t.lanes&a)!==0&&(Ef(t,n),Po(n,null,null,a),Ho()),u=t.memoizedState,h=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),Ma(n,Zt,o)):(o=h.cache,Ma(n,Zt,o),o!==u.cache&&yf(n,[Zt],a,!0))),Qt(t,n,n.pendingProps.children,a),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),o=n.pendingProps,o.name!=null&&o.name!=="auto"?n.flags|=t===null?18882560:18874368:Ke&&Sc(n),t!==null&&t.memoizedProps.name!==o.name?n.flags|=4194816:Ts(t,n),Qt(t,n,o.children,a),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function ma(t){t.flags|=4}function ah(t,n,a,o,u){var h;if((h=(t.mode&32)!==0)&&(h=a===null?Rb(n,o):Rb(n,o)&&(o.src!==a.src||o.srcSet!==a.srcSet)),h){if(t.flags|=16777216,(u&335544128)===u)if(t.stateNode.complete)t.flags|=8192;else if(L0())t.flags|=8192;else throw Ai=jc,wf}else t.flags&=-16777217}function n0(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ab(n))if(L0())t.flags|=8192;else throw Ai=jc,wf}function Gc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Ae():536870912,t.lanes|=n,js|=n)}function Vo(t,n){if(!Ke)switch(t.tailMode){case"visible":break;case"collapsed":for(var a=t.tail,o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null;break;default:for(n=t.tail,a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null}}function Et(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(n)for(var u=t.child;u!==null;)a|=u.lanes|u.childLanes,o|)DELIM" +R"DELIM(=u.subtreeFlags&1206910976,o|=u.flags&1206910976,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=o,t.childLanes=a,n}function jT(t,n,a){var o=n.pendingProps;switch(hf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(n),null;case 1:return Et(n),null;case 3:return a=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),ua(Zt),at(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(ys(n)?ma(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,pf())),Et(n),null;case 26:var u=n.type,h=n.memoizedState;return t===null?(ma(n),h!==null?(Et(n),n0(n,h)):(Et(n),ah(n,u,null,o,a))):h?h!==t.memoizedState?(ma(n),Et(n),n0(n,h)):(Et(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&ma(n),Et(n),ah(n,u,t,o,a)),null;case 27:if(ln(n),a=Ye.current,u=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ma(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Et(n),n.subtreeFlags&=-33554433,null}t=dt.current,ys(n)?zy(n):(t=Sb(u,o,a),n.stateNode=t,ma(n))}return Et(n),n.subtreeFlags&=-33554433,null;case 5:if(ln(n),u=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ma(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Et(n),n.subtreeFlags&=-33554433,null}if(h=dt.current,ys(n))zy(n);else{var b=rl(Ye.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=b.createElement("div"),h.innerHTML="