diff --git a/ventures/havre/open/LICENSE.txt b/ventures/havre/open/LICENSE.txt new file mode 100644 index 0000000..6b02bc2 --- /dev/null +++ b/ventures/havre/open/LICENSE.txt @@ -0,0 +1,2 @@ +openvenice by nikshepsvn, MIT License: https://github.com/nikshepsvn/openvenice +Built into Havre at /open/ from commit d983874a79810edaffb85721911630af29d09d95, unchanged. diff --git a/ventures/havre/open/assets/index-BNadRIK3.css b/ventures/havre/open/assets/index-BNadRIK3.css new file mode 100644 index 0000000..47da47b --- /dev/null +++ b/ventures/havre/open/assets/index-BNadRIK3.css @@ -0,0 +1 @@ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-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-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:"Inter", "InterVariable", system-ui, sans-serif;--font-mono:"JetBrains Mono", "SF Mono", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-300:oklch(82.3% .12 346.018);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-3xl:48rem;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--leading-loose:2;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--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);--color-bg-base:#0a0a0c;--color-text-primary:#ffffffeb;--color-accent:#6ee7d3;--color-accent-soft:#6ee7d329}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-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}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.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}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.-top-1\.5{top:calc(var(--spacing) * -1.5)}.top-0{top:calc(var(--spacing) * 0)}.top-0\.5{top:calc(var(--spacing) * .5)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-\[2px\]{top:2px}.top-full{top:100%}.-right-1\.5{right:calc(var(--spacing) * -1.5)}.right-0{right:calc(var(--spacing) * 0)}.right-1\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:calc(var(--spacing) * 0)}.left-0\.5{left:calc(var(--spacing) * .5)}.left-3{left:calc(var(--spacing) * 3)}.left-\[2px\]{left:2px}.left-\[16px\]{left:16px}.left-\[20px\]{left:20px}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.-m-0\.5{margin:calc(var(--spacing) * -.5)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-px{margin-top:1px}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-6{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-8{-webkit-line-clamp:8;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.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}.aspect-square{aspect-ratio:1}.\!h-3{height:calc(var(--spacing) * 3)!important}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-\[14px\]{height:14px}.h-\[16px\]{height:16px}.h-\[18px\]{height:18px}.h-\[100dvh\]{height:100dvh}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-\[55vh\]{max-height:55vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[380px\]{max-height:380px}.max-h-\[calc\(100vh-240px\)\]{max-height:calc(100vh - 240px)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-\[40px\]{min-height:40px}.min-h-\[60px\]{min-height:60px}.min-h-full{min-height:100%}.\!w-3{width:calc(var(--spacing) * 3)!important}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1{width:calc(var(--spacing) * 1)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-96{width:calc(var(--spacing) * 96)}.w-\[14px\]{width:14px}.w-\[16px\]{width:16px}.w-\[72px\]{width:72px}.w-\[340px\]{width:340px}.w-\[420px\]{width:420px}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[78\%\]{max-width:78%}.max-w-\[88\%\]{max-width:88%}.max-w-\[90vw\]{max-width:90vw}.max-w-\[140px\]{max-width:140px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[280px\]{max-width:280px}.max-w-\[340px\]{max-width:340px}.max-w-\[860px\]{max-width:860px}.max-w-\[960px\]{max-width:960px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[60px\]{min-width:60px}.min-w-\[80px\]{min-width:80px}.min-w-\[240px\]{min-width:240px}.min-w-\[300px\]{min-width:300px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,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-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\.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)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.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-\[7px\]{border-radius:7px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-br-md{border-bottom-right-radius:var(--radius-md)}.\!border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.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-\[\#111\]{border-color:#111!important}.\!border-white\/\[0\.06\]{border-color:#ffffff0f!important}@supports (color:color-mix(in lab,red,red)){.\!border-white\/\[0\.06\]{border-color:color-mix(in oklab,var(--color-white) 6%,transparent)!important}}.border-\[var\(--color-accent\)\]{border-color:var(--color-accent)}.border-\[var\(--color-accent\)\]\/30{border-color:#6ee7d34d}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--color-accent\)\]\/30{border-color:color-mix(in oklab,var(--color-accent) 30%,transparent)}}.border-amber-400\/20{border-color:#fcbb0033}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/20{border-color:color-mix(in oklab,var(--color-amber-400) 20%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500) 30%,transparent)}}.border-emerald-400\/20{border-color:#00d29433}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/20{border-color:color-mix(in oklab,var(--color-emerald-400) 20%,transparent)}}.border-green-300\/60{border-color:#7bf1a899}@supports (color:color-mix(in lab,red,red)){.border-green-300\/60{border-color:color-mix(in oklab,var(--color-green-300) 60%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500) 30%,transparent)}}.border-green-500\/\[0\.08\]{border-color:#00c75814}@supports (color:color-mix(in lab,red,red)){.border-green-500\/\[0\.08\]{border-color:color-mix(in oklab,var(--color-green-500) 8%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500) 30%,transparent)}}.border-pink-400\/20{border-color:#fb64b633}@supports (color:color-mix(in lab,red,red)){.border-pink-400\/20{border-color:color-mix(in oklab,var(--color-pink-400) 20%,transparent)}}.border-pink-500\/30{border-color:#f6339a4d}@supports (color:color-mix(in lab,red,red)){.border-pink-500\/30{border-color:color-mix(in oklab,var(--color-pink-500) 30%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-red-500\/\[0\.08\]{border-color:#fb2c3614}@supports (color:color-mix(in lab,red,red)){.border-red-500\/\[0\.08\]{border-color:color-mix(in oklab,var(--color-red-500) 8%,transparent)}}.border-rose-400\/20{border-color:#ff667f33}@supports (color:color-mix(in lab,red,red)){.border-rose-400\/20{border-color:color-mix(in oklab,var(--color-rose-400) 20%,transparent)}}.border-sky-400\/20{border-color:#00bcfe33}@supports (color:color-mix(in lab,red,red)){.border-sky-400\/20{border-color:color-mix(in oklab,var(--color-sky-400) 20%,transparent)}}.border-violet-400\/20{border-color:#a685ff33}@supports (color:color-mix(in lab,red,red)){.border-violet-400\/20{border-color:color-mix(in oklab,var(--color-violet-400) 20%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.border-white\/15{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.border-white\/\[0\.1\]{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.1\]{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.border-white\/\[0\.04\]{border-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.04\]{border-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.border-white\/\[0\.05\]{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.05\]{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.border-white\/\[0\.06\]{border-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.06\]{border-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.border-white\/\[0\.07\]{border-color:#ffffff12}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.07\]{border-color:color-mix(in oklab,var(--color-white) 7%,transparent)}}.border-white\/\[0\.08\]{border-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.08\]{border-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.border-white\/\[0\.12\]{border-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.12\]{border-color:color-mix(in oklab,var(--color-white) 12%,transparent)}}.border-white\/\[0\.15\]{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.15\]{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.border-white\/\[0\.25\]{border-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.25\]{border-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500) 30%,transparent)}}.border-t-\[var\(--color-accent\)\]{border-top-color:var(--color-accent)}.border-t-transparent{border-top-color:#0000}.border-t-white\/40{border-top-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-t-white\/40{border-top-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.\!bg-\[\#0a0a0a\]{background-color:#0a0a0a!important}.\!bg-\[\#111\]{background-color:#111!important}.\!bg-white\/30{background-color:#ffffff4d!important}@supports (color:color-mix(in lab,red,red)){.\!bg-white\/30{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)!important}}.bg-\[\#0a0a0a\]{background-color:#0a0a0a}.bg-\[\#0a0a0c\]{background-color:#0a0a0c}.bg-\[\#0c0c10\]{background-color:#0c0c10}.bg-\[\#0d0d11\]{background-color:#0d0d11}.bg-\[\#0e0e0e\]{background-color:#0e0e0e}.bg-\[\#0e0e12\]{background-color:#0e0e12}.bg-\[\#111\]{background-color:#111}.bg-\[\#080808\]{background-color:#080808}.bg-\[\#101015\]{background-color:#101015}.bg-\[\#111114\]{background-color:#111114}.bg-\[var\(--color-accent\)\]{background-color:var(--color-accent)}.bg-\[var\(--color-accent-soft\)\]{background-color:var(--color-accent-soft)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-400\/15{background-color:#fcbb0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-400\/15{background-color:color-mix(in oklab,var(--color-amber-400) 15%,transparent)}}.bg-black{background-color:var(--color-black)}.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-black\/75{background-color:#000000bf}@supports (color:color-mix(in lab,red,red)){.bg-black\/75{background-color:color-mix(in oklab,var(--color-black) 75%,transparent)}}.bg-black\/85{background-color:#000000d9}@supports (color:color-mix(in lab,red,red)){.bg-black\/85{background-color:color-mix(in oklab,var(--color-black) 85%,transparent)}}.bg-black\/95{background-color:#000000f2}@supports (color:color-mix(in lab,red,red)){.bg-black\/95{background-color:color-mix(in oklab,var(--color-black) 95%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-400\/15{background-color:#00d29426}@supports (color:color-mix(in lab,red,red)){.bg-emerald-400\/15{background-color:color-mix(in oklab,var(--color-emerald-400) 15%,transparent)}}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500) 20%,transparent)}}.bg-green-500\/\[0\.04\]{background-color:#00c7580a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-green-500) 4%,transparent)}}.bg-green-500\/\[0\.06\]{background-color:#00c7580f}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-green-500) 6%,transparent)}}.bg-pink-400\/15{background-color:#fb64b626}@supports (color:color-mix(in lab,red,red)){.bg-pink-400\/15{background-color:color-mix(in oklab,var(--color-pink-400) 15%,transparent)}}.bg-red-400\/80{background-color:#ff6568cc}@supports (color:color-mix(in lab,red,red)){.bg-red-400\/80{background-color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.bg-red-500\/\[0\.04\]{background-color:#fb2c360a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-red-500) 4%,transparent)}}.bg-red-500\/\[0\.06\]{background-color:#fb2c360f}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-red-500) 6%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-400\/15{background-color:#ff667f26}@supports (color:color-mix(in lab,red,red)){.bg-rose-400\/15{background-color:color-mix(in oklab,var(--color-rose-400) 15%,transparent)}}.bg-sky-400\/15{background-color:#00bcfe26}@supports (color:color-mix(in lab,red,red)){.bg-sky-400\/15{background-color:color-mix(in oklab,var(--color-sky-400) 15%,transparent)}}.bg-transparent{background-color:#0000}.bg-violet-400\/15{background-color:#a685ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-400\/15{background-color:color-mix(in oklab,var(--color-violet-400) 15%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-white\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.bg-white\/30{background-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-white\/\[0\.1\]{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.1\]{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.bg-white\/\[0\.03\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.03\]{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.bg-white\/\[0\.05\]{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.05\]{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.bg-white\/\[0\.07\]{background-color:#ffffff12}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.07\]{background-color:color-mix(in oklab,var(--color-white) 7%,transparent)}}.bg-white\/\[0\.08\]{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.08\]{background-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.bg-white\/\[0\.09\]{background-color:#ffffff17}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.09\]{background-color:color-mix(in oklab,var(--color-white) 9%,transparent)}}.bg-white\/\[0\.015\]{background-color:#ffffff04}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.015\]{background-color:color-mix(in oklab,var(--color-white) 1.5%,transparent)}}.bg-yellow-400\/70{background-color:#fac800b3}@supports (color:color-mix(in lab,red,red)){.bg-yellow-400\/70{background-color:color-mix(in oklab,var(--color-yellow-400) 70%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[repeating-conic-gradient\(\#1a1a1a_0\%_25\%\,\#111_0\%_50\%\)_0_0\/20px_20px\]{background-image:repeating-conic-gradient(#1a1a1a 0% 25%,#111 0% 50%) 0 0/20px 20px}.from-white\/95{--tw-gradient-from:#fffffff2}@supports (color:color-mix(in lab,red,red)){.from-white\/95{--tw-gradient-from:color-mix(in oklab, var(--color-white) 95%, transparent)}}.from-white\/95{--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-white\/75{--tw-gradient-to:#ffffffbf}@supports (color:color-mix(in lab,red,red)){.to-white\/75{--tw-gradient-to:color-mix(in oklab, var(--color-white) 75%, transparent)}}.to-white\/75{--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))}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.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-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.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:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-\[2px\]{padding-block:2px}.py-\[3px\]{padding-block:3px}.py-\[6px\]{padding-block:6px}.py-px{padding-block:1px}.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-8{padding-top:calc(var(--spacing) * 8)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-2\.5{padding-bottom:calc(var(--spacing) * 2.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13\.5px\]{font-size:13.5px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15\.5px\]{font-size:15.5px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[20px\]{font-size:20px}.leading-loose{--tw-leading:var(--leading-loose);line-height:var(--leading-loose)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.1em\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--color-accent\)\]{color:var(--color-accent)}.text-amber-300{color:var(--color-amber-300)}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/50{color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/50{color:color-mix(in oklab,var(--color-blue-400) 50%,transparent)}}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-green-200\/85{color:#b9f8cfd9}@supports (color:color-mix(in lab,red,red)){.text-green-200\/85{color:color-mix(in oklab,var(--color-green-200) 85%,transparent)}}.text-green-300{color:var(--color-green-300)}.text-green-400\/40{color:#05df7266}@supports (color:color-mix(in lab,red,red)){.text-green-400\/40{color:color-mix(in oklab,var(--color-green-400) 40%,transparent)}}.text-green-400\/50{color:#05df7280}@supports (color:color-mix(in lab,red,red)){.text-green-400\/50{color:color-mix(in oklab,var(--color-green-400) 50%,transparent)}}.text-green-400\/60{color:#05df7299}@supports (color:color-mix(in lab,red,red)){.text-green-400\/60{color:color-mix(in oklab,var(--color-green-400) 60%,transparent)}}.text-green-400\/70{color:#05df72b3}@supports (color:color-mix(in lab,red,red)){.text-green-400\/70{color:color-mix(in oklab,var(--color-green-400) 70%,transparent)}}.text-orange-400\/50{color:#ff8b1a80}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/50{color:color-mix(in oklab,var(--color-orange-400) 50%,transparent)}}.text-pink-300{color:var(--color-pink-300)}.text-pink-400\/50{color:#fb64b680}@supports (color:color-mix(in lab,red,red)){.text-pink-400\/50{color:color-mix(in oklab,var(--color-pink-400) 50%,transparent)}}.text-purple-400\/50{color:#c07eff80}@supports (color:color-mix(in lab,red,red)){.text-purple-400\/50{color:color-mix(in oklab,var(--color-purple-400) 50%,transparent)}}.text-red-200\/85{color:#ffcacad9}@supports (color:color-mix(in lab,red,red)){.text-red-200\/85{color:color-mix(in oklab,var(--color-red-200) 85%,transparent)}}.text-red-300{color:var(--color-red-300)}.text-red-300\/70{color:#ffa3a3b3}@supports (color:color-mix(in lab,red,red)){.text-red-300\/70{color:color-mix(in oklab,var(--color-red-300) 70%,transparent)}}.text-red-300\/95{color:#ffa3a3f2}@supports (color:color-mix(in lab,red,red)){.text-red-300\/95{color:color-mix(in oklab,var(--color-red-300) 95%,transparent)}}.text-red-400\/40{color:#ff656866}@supports (color:color-mix(in lab,red,red)){.text-red-400\/40{color:color-mix(in oklab,var(--color-red-400) 40%,transparent)}}.text-red-400\/60{color:#ff656899}@supports (color:color-mix(in lab,red,red)){.text-red-400\/60{color:color-mix(in oklab,var(--color-red-400) 60%,transparent)}}.text-red-400\/70{color:#ff6568b3}@supports (color:color-mix(in lab,red,red)){.text-red-400\/70{color:color-mix(in oklab,var(--color-red-400) 70%,transparent)}}.text-rose-300{color:var(--color-rose-300)}.text-rose-300\/85{color:#ffa2aed9}@supports (color:color-mix(in lab,red,red)){.text-rose-300\/85{color:color-mix(in oklab,var(--color-rose-300) 85%,transparent)}}.text-sky-300{color:var(--color-sky-300)}.text-violet-300{color:var(--color-violet-300)}.text-white{color:var(--color-white)}.text-white\/10{color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.text-white\/10{color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.text-white\/15{color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.text-white\/15{color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.text-white\/18{color:#ffffff2e}@supports (color:color-mix(in lab,red,red)){.text-white\/18{color:color-mix(in oklab,var(--color-white) 18%,transparent)}}.text-white\/20{color:#fff3}@supports (color:color-mix(in lab,red,red)){.text-white\/20{color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.text-white\/25{color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.text-white\/25{color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.text-white\/30{color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.text-white\/35{color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.text-white\/35{color:color-mix(in oklab,var(--color-white) 35%,transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.text-white\/45{color:#ffffff73}@supports (color:color-mix(in lab,red,red)){.text-white\/45{color:color-mix(in oklab,var(--color-white) 45%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\/55{color:#ffffff8c}@supports (color:color-mix(in lab,red,red)){.text-white\/55{color:color-mix(in oklab,var(--color-white) 55%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/65{color:#ffffffa6}@supports (color:color-mix(in lab,red,red)){.text-white\/65{color:color-mix(in oklab,var(--color-white) 65%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.text-white\/75{color:#ffffffbf}@supports (color:color-mix(in lab,red,red)){.text-white\/75{color:color-mix(in oklab,var(--color-white) 75%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.text-white\/85{color:color-mix(in oklab,var(--color-white) 85%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.text-yellow-300\/85{color:#ffe02ad9}@supports (color:color-mix(in lab,red,red)){.text-yellow-300\/85{color:color-mix(in oklab,var(--color-yellow-300) 85%,transparent)}}.text-yellow-400\/50{color:#fac80080}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/50{color:color-mix(in oklab,var(--color-yellow-400) 50%,transparent)}}.text-zinc-100{color:var(--color-zinc-100)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.accent-white{accent-color:var(--color-white)}.accent-white\/50{accent-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.accent-white\/50{accent-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-80{opacity:.8}.opacity-100{opacity:1}.\!shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.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-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.05\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff0d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px 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-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)}.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)}.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)}.shadow-black\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\/30{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.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)}}.shadow-black\/70{--tw-shadow-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.shadow-black\/70{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 70%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-green-500\/30{--tw-ring-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.ring-green-500\/30{--tw-ring-color:color-mix(in oklab, var(--color-green-500) 30%, transparent)}}.ring-red-500\/30{--tw-ring-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.ring-red-500\/30{--tw-ring-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.ring-white\/20{--tw-ring-color:#fff3}@supports (color:color-mix(in lab,red,red)){.ring-white\/20{--tw-ring-color:color-mix(in oklab, var(--color-white) 20%, 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-md{--tw-backdrop-blur:blur(var(--blur-md));-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-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;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-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:text-\[var\(--color-accent\)\]:is(:where(.group):hover *){color:var(--color-accent)}.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/code\:opacity-100:is(:where(.group\/code):hover *){opacity:1}}.placeholder\:text-white\/8::placeholder{color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-white\/8::placeholder{color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.placeholder\:text-white\/12::placeholder{color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-white\/12::placeholder{color:color-mix(in oklab,var(--color-white) 12%,transparent)}}.placeholder\:text-white\/15::placeholder{color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-white\/15::placeholder{color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.placeholder\:text-white\/25::placeholder{color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-white\/25::placeholder{color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.placeholder\:text-white\/30::placeholder{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-white\/30::placeholder{color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.focus-within\:border-white\/\[0\.22\]:focus-within{border-color:#ffffff38}@supports (color:color-mix(in lab,red,red)){.focus-within\:border-white\/\[0\.22\]:focus-within{border-color:color-mix(in oklab,var(--color-white) 22%,transparent)}}.focus-within\:shadow-xl:focus-within{--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)}.focus-within\:shadow-black\/40:focus-within{--tw-shadow-color:#0006}@supports (color:color-mix(in lab,red,red)){.focus-within\:shadow-black\/40:focus-within{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 40%, transparent) var(--tw-shadow-alpha), transparent)}}@media(hover:hover){.hover\:border-white\/\[0\.1\]:hover{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.1\]:hover{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.hover\:border-white\/\[0\.2\]:hover{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.2\]:hover{border-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.hover\:border-white\/\[0\.12\]:hover{border-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.12\]:hover{border-color:color-mix(in oklab,var(--color-white) 12%,transparent)}}.hover\:border-white\/\[0\.14\]:hover{border-color:#ffffff24}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.14\]:hover{border-color:color-mix(in oklab,var(--color-white) 14%,transparent)}}.hover\:border-white\/\[0\.15\]:hover{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.15\]:hover{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.hover\:border-white\/\[0\.16\]:hover{border-color:#ffffff29}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.16\]:hover{border-color:color-mix(in oklab,var(--color-white) 16%,transparent)}}.hover\:border-white\/\[0\.18\]:hover{border-color:#ffffff2e}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.18\]:hover{border-color:color-mix(in oklab,var(--color-white) 18%,transparent)}}.hover\:border-white\/\[0\.22\]:hover{border-color:#ffffff38}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/\[0\.22\]:hover{border-color:color-mix(in oklab,var(--color-white) 22%,transparent)}}.hover\:bg-black:hover{background-color:var(--color-black)}.hover\:bg-black\/80:hover{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/80:hover{background-color:color-mix(in oklab,var(--color-black) 80%,transparent)}}.hover\:bg-black\/85:hover{background-color:#000000d9}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/85:hover{background-color:color-mix(in oklab,var(--color-black) 85%,transparent)}}.hover\:bg-green-500\/30:hover{background-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/30:hover{background-color:color-mix(in oklab,var(--color-green-500) 30%,transparent)}}.hover\:bg-white\/90:hover{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/90:hover{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.hover\:bg-white\/95:hover{background-color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/95:hover{background-color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.hover\:bg-white\/\[0\.02\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.02\]:hover{background-color:color-mix(in oklab,var(--color-white) 2%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.04\]:hover{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.hover\:bg-white\/\[0\.05\]:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.05\]:hover{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.hover\:bg-white\/\[0\.06\]:hover{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.06\]:hover{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.hover\:bg-white\/\[0\.14\]:hover{background-color:#ffffff24}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.14\]:hover{background-color:color-mix(in oklab,var(--color-white) 14%,transparent)}}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400\/60:hover{color:#ff656899}@supports (color:color-mix(in lab,red,red)){.hover\:text-red-400\/60:hover{color:color-mix(in oklab,var(--color-red-400) 60%,transparent)}}.hover\:text-rose-200:hover{color:var(--color-rose-200)}.hover\:text-rose-300:hover{color:var(--color-rose-300)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-white\/35:hover{color:#ffffff59}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/35:hover{color:color-mix(in oklab,var(--color-white) 35%,transparent)}}.hover\:text-white\/40:hover{color:#fff6}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/40:hover{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.hover\:text-white\/45:hover{color:#ffffff73}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/45:hover{color:color-mix(in oklab,var(--color-white) 45%,transparent)}}.hover\:text-white\/50:hover{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/50:hover{color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.hover\:text-white\/55:hover{color:#ffffff8c}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/55:hover{color:color-mix(in oklab,var(--color-white) 55%,transparent)}}.hover\:text-white\/60:hover{color:#fff9}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/60:hover{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.hover\:text-white\/65:hover{color:#ffffffa6}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/65:hover{color:color-mix(in oklab,var(--color-white) 65%,transparent)}}.hover\:text-white\/70:hover{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/70:hover{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.hover\:text-white\/80:hover{color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/80:hover{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.hover\:text-white\/85:hover{color:#ffffffd9}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/85:hover{color:color-mix(in oklab,var(--color-white) 85%,transparent)}}.hover\:text-white\/90:hover{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/90:hover{color:color-mix(in oklab,var(--color-white) 90%,transparent)}}}.focus\:border-white\/\[0\.1\]:focus{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.focus\:border-white\/\[0\.1\]:focus{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.focus\:border-white\/\[0\.2\]:focus{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.focus\:border-white\/\[0\.2\]:focus{border-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.focus\:border-white\/\[0\.12\]:focus{border-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.focus\:border-white\/\[0\.12\]:focus{border-color:color-mix(in oklab,var(--color-white) 12%,transparent)}}.focus\:border-white\/\[0\.22\]:focus{border-color:#ffffff38}@supports (color:color-mix(in lab,red,red)){.focus\:border-white\/\[0\.22\]:focus{border-color:color-mix(in oklab,var(--color-white) 22%,transparent)}}.focus\:border-white\/\[0\.25\]:focus{border-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.focus\:border-white\/\[0\.25\]:focus{border-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.focus-visible\:opacity-100:focus-visible{opacity:1}.focus-visible\:outline:focus-visible,.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-\[var\(--color-accent\)\]:focus-visible{outline-color:var(--color-accent)}.focus-visible\:outline-white\/30:focus-visible{outline-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.focus-visible\:outline-white\/30:focus-visible{outline-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.focus-visible\:outline-white\/40:focus-visible{outline-color:#fff6}@supports (color:color-mix(in lab,red,red)){.focus-visible\:outline-white\/40:focus-visible{outline-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.focus-visible\:outline-white\/50:focus-visible{outline-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.focus-visible\:outline-white\/50:focus-visible{outline-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\:scale-\[0\.99\]:active{scale:.99}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-60:disabled{opacity:.6}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:w-64{width:calc(var(--spacing) * 64)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}}@media(min-width:48rem){.md\:static{position:static}.md\:block{display:block}.md\:hidden{display:none}.md\:inline{display:inline}.md\:h-full{height:100%}.md\:max-h-none{max-height:none}.md\:w-64{width:calc(var(--spacing) * 64)}.md\:w-\[60px\]{width:60px}.md\:w-\[360px\]{width:360px}.md\:w-auto{width:auto}.md\:translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.md\:flex-row{flex-direction:row}.md\:justify-center{justify-content:center}.md\:p-7{padding:calc(var(--spacing) * 7)}.md\:px-0{padding-inline:calc(var(--spacing) * 0)}.md\:px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.md\:px-3{padding-inline:calc(var(--spacing) * 3)}.md\:py-2{padding-block:calc(var(--spacing) * 2)}}@media(min-width:64rem){.lg\:w-\[400px\]{width:400px}}@media(min-width:80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:96rem){.\32xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&_button\]\:\!px-2 button{padding-inline:calc(var(--spacing) * 2)!important}.\[\&_button\]\:\!py-1 button{padding-block:calc(var(--spacing) * 1)!important}.\[\&_button\]\:\!text-\[13px\] button{font-size:13px!important}.\[\&\>button\]\:\!border-white\/\[0\.06\]>button{border-color:#ffffff0f!important}@supports (color:color-mix(in lab,red,red)){.\[\&\>button\]\:\!border-white\/\[0\.06\]>button{border-color:color-mix(in oklab,var(--color-white) 6%,transparent)!important}}.\[\&\>button\]\:\!bg-\[\#111\]>button{background-color:#111!important}.\[\&\>button\]\:\!text-white\/30>button{color:#ffffff4d!important}@supports (color:color-mix(in lab,red,red)){.\[\&\>button\]\:\!text-white\/30>button{color:color-mix(in oklab,var(--color-white) 30%,transparent)!important}}.\[\&\>button\:hover\]\:\!bg-white\/\[0\.06\]>button:hover{background-color:#ffffff0f!important}@supports (color:color-mix(in lab,red,red)){.\[\&\>button\:hover\]\:\!bg-white\/\[0\.06\]>button:hover{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)!important}}}html{color-scheme:dark}body{background:var(--color-bg-base);color:var(--color-text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"ss01","cv11";margin:0}::selection{color:#fff;background:#6ee7d340}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#ffffff1a padding-box padding-box;border:2px solid #0000;border-radius:8px}::-webkit-scrollbar-thumb:hover{background:#fff3 padding-box padding-box;border:2px solid #0000}*{scrollbar-width:thin;scrollbar-color:#ffffff1a transparent}@keyframes fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes scale-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes pulse-dot{0%,to{opacity:.2}50%{opacity:.7}}@keyframes shimmer{0%{background-position:-1000px 0}to{background-position:1000px 0}}.animate-fade-in{animation:.18s cubic-bezier(.2,.8,.2,1) fade-in}.animate-scale-in{animation:.14s cubic-bezier(.2,.8,.2,1) scale-in}.animate-pulse-dot{animation:1.4s ease-in-out infinite pulse-dot}.skeleton{background:linear-gradient(90deg,#ffffff08,#ffffff12,#ffffff08) 0 0/1000px 100%;animation:2s linear infinite shimmer}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}input[type=range]{appearance:none;background:#ffffff1a;border-radius:999px;outline:none;height:3px;margin-top:6px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;cursor:pointer;background:#fff;border:none;border-radius:50%;width:14px;height:14px;transition:box-shadow .12s ease-out,transform .12s ease-out;box-shadow:0 1px 4px #0006}input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.1)}input[type=range]::-moz-range-thumb{cursor:pointer;background:#fff;border:none;border-radius:50%;width:14px;height:14px;transition:box-shadow .12s ease-out,transform .12s ease-out;box-shadow:0 1px 4px #0006}input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px var(--color-accent-soft),0 1px 4px #0006}input[type=range]:focus-visible::-moz-range-thumb{box-shadow:0 0 0 4px var(--color-accent-soft),0 1px 4px #0006}textarea{field-sizing:content}:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px;border-radius:6px}button:focus,a:focus,textarea:focus,input:focus,select:focus{outline:none}@media(pointer:coarse){button,a,[role=button]{min-height:36px}}.prose-venice{word-break:break-word}.prose-venice>:first-child{margin-top:0!important}.prose-venice>:last-child{margin-bottom:0!important}.prose-venice p{margin:.6em 0;line-height:1.7}.prose-venice p:first-child{margin-top:0}.prose-venice p:last-child{margin-bottom:0}.prose-venice h1,.prose-venice h2,.prose-venice h3,.prose-venice h4{color:#fffffff2;letter-spacing:-.012em;margin:1.3em 0 .4em;font-weight:600;line-height:1.3}.prose-venice h1{font-size:1.25em}.prose-venice h2{font-size:1.12em}.prose-venice h3{font-size:1em}.prose-venice strong{color:#fffffff2;font-weight:600}.prose-venice em{color:#ffffffc7}.prose-venice code{font-family:var(--font-mono);color:#ffffffe0;background:#ffffff0f;border-radius:4px;padding:.13em .4em;font-size:.86em}.prose-venice pre{background:#ffffff06;border:1px solid #ffffff12;border-radius:8px;margin:.8em 0;padding:1.9em 1em 1em;overflow-x:auto}.prose-venice pre code{color:#ffffffd1;tab-size:2;background:0 0;border-radius:0;padding:0;font-size:.85em;line-height:1.65}.prose-venice ul,.prose-venice ol{margin:.5em 0;padding-left:1.4em}.prose-venice ul{list-style-type:disc}.prose-venice ol{list-style-type:decimal}.prose-venice li{margin:.25em 0;line-height:1.65}.prose-venice li::marker{color:#ffffff59}.prose-venice blockquote{border-left:3px solid var(--color-accent);color:#ffffffa6;margin:.8em 0;padding-left:1em;font-style:italic}.prose-venice table{border-collapse:collapse;width:100%;margin:.8em 0;font-size:.9em}.prose-venice th,.prose-venice td{text-align:left;border:1px solid #ffffff14;padding:.5em .75em}.prose-venice th{color:#ffffffbf;text-transform:uppercase;letter-spacing:.04em;background:#ffffff0a;font-size:.85em;font-weight:600}.prose-venice a{color:var(--color-accent);text-underline-offset:2px;-webkit-text-decoration:underline #6ee7d366;text-decoration:underline #6ee7d366;transition:text-decoration-color .1s}.prose-venice a:hover{-webkit-text-decoration-color:var(--color-accent);text-decoration-color:var(--color-accent)}.prose-venice hr{border:none;border-top:1px solid #ffffff14;margin:1.2em 0}.prose-venice img{border-radius:8px;max-width:100%}@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-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-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-leading{syntax:"*";inherits:false}@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}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/ventures/havre/open/assets/index-CfrUZ43_.js b/ventures/havre/open/assets/index-CfrUZ43_.js new file mode 100644 index 0000000..79354a5 --- /dev/null +++ b/ventures/havre/open/assets/index-CfrUZ43_.js @@ -0,0 +1,52 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workflows-view-xQJlxU4f.js","assets/workflow-engine-ClbuiuAZ.js","assets/workflow-engine-BZV40eAE.css","assets/playground-view-COPXwfh8.js"])))=>i.map(i=>d[i]); +(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function u(s){if(s.ep)return;s.ep=!0;const c=a(s);fetch(s.href,c)}})();function nf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var uc={exports:{}},Ba={};var Tp;function N1(){if(Tp)return Ba;Tp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(u,s,c){var f=null;if(c!==void 0&&(f=""+c),s.key!==void 0&&(f=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:n,type:u,key:f,ref:s!==void 0?s:null,props:c}}return Ba.Fragment=l,Ba.jsx=a,Ba.jsxs=a,Ba}var Ap;function O1(){return Ap||(Ap=1,uc.exports=N1()),uc.exports}var p=O1(),sc={exports:{}},be={};var _p;function z1(){if(_p)return be;_p=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=b&&M[b]||M["@@iterator"],typeof M=="function"?M:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,T={};function C(M,G,E){this.props=M,this.context=G,this.refs=T,this.updater=E||k}C.prototype.isReactComponent={},C.prototype.setState=function(M,G){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,G,"setState")},C.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function H(){}H.prototype=C.prototype;function O(M,G,E){this.props=M,this.context=G,this.refs=T,this.updater=E||k}var X=O.prototype=new H;X.constructor=O,_(X,C.prototype),X.isPureReactComponent=!0;var J=Array.isArray;function R(){}var $={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function ie(M,G,E){var re=E.ref;return{$$typeof:n,type:M,key:G,ref:re!==void 0?re:null,props:E}}function U(M,G){return ie(M.type,G,M.props)}function le(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function Z(M){var G={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(E){return G[E]})}var me=/\/+/g;function se(M,G){return typeof M=="object"&&M!==null&&M.key!=null?Z(""+M.key):G.toString(36)}function K(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(R,R):(M.status="pending",M.then(function(G){M.status==="pending"&&(M.status="fulfilled",M.value=G)},function(G){M.status==="pending"&&(M.status="rejected",M.reason=G)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function D(M,G,E,re,ne){var ue=typeof M;(ue==="undefined"||ue==="boolean")&&(M=null);var xe=!1;if(M===null)xe=!0;else switch(ue){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(M.$$typeof){case n:case l:xe=!0;break;case x:return xe=M._init,D(xe(M._payload),G,E,re,ne)}}if(xe)return ne=ne(M),xe=re===""?"."+se(M,0):re,J(ne)?(E="",xe!=null&&(E=xe.replace(me,"$&/")+"/"),D(ne,G,E,"",function(Tt){return Tt})):ne!=null&&(le(ne)&&(ne=U(ne,E+(ne.key==null||M&&M.key===ne.key?"":(""+ne.key).replace(me,"$&/")+"/")+xe)),G.push(ne)),1;xe=0;var He=re===""?".":re+":";if(J(M))for(var Me=0;Me>>1,j=D[de];if(0>>1;des(E,oe))res(ne,E)?(D[de]=ne,D[re]=oe,de=re):(D[de]=E,D[G]=oe,de=G);else if(res(ne,oe))D[de]=ne,D[re]=oe,de=re;else break e}}return W}function s(D,W){var oe=D.sortIndex-W.sortIndex;return oe!==0?oe:D.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,d=f.now();n.unstable_now=function(){return f.now()-d}}var g=[],m=[],x=1,y=null,b=3,S=!1,k=!1,_=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function X(D){for(var W=a(m);W!==null;){if(W.callback===null)u(m);else if(W.startTime<=D)u(m),W.sortIndex=W.expirationTime,l(g,W);else break;W=a(m)}}function J(D){if(_=!1,X(D),!k)if(a(g)!==null)k=!0,R||(R=!0,Z());else{var W=a(m);W!==null&&K(J,W.startTime-D)}}var R=!1,$=-1,ee=5,ie=-1;function U(){return T?!0:!(n.unstable_now()-ieD&&U());){var de=y.callback;if(typeof de=="function"){y.callback=null,b=y.priorityLevel;var j=de(y.expirationTime<=D);if(D=n.unstable_now(),typeof j=="function"){y.callback=j,X(D),W=!0;break t}y===a(g)&&u(g),X(D)}else u(g);y=a(g)}if(y!==null)W=!0;else{var M=a(m);M!==null&&K(J,M.startTime-D),W=!1}}break e}finally{y=null,b=oe,S=!1}W=void 0}}finally{W?Z():R=!1}}}var Z;if(typeof O=="function")Z=function(){O(le)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,se=me.port2;me.port1.onmessage=le,Z=function(){se.postMessage(null)}}else Z=function(){C(le,0)};function K(D,W){$=C(function(){D(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(D){D.callback=null},n.unstable_forceFrameRate=function(D){0>D||125de?(D.sortIndex=oe,l(m,D),a(g)===null&&D===a(m)&&(_?(H($),$=-1):_=!0,K(J,oe-de))):(D.sortIndex=j,l(g,D),k||S||(k=!0,R||(R=!0,Z()))),D},n.unstable_shouldYield=U,n.unstable_wrapCallback=function(D){var W=b;return function(){var oe=b;b=W;try{return D.apply(this,arguments)}finally{b=oe}}}})(fc)),fc}var Op;function R1(){return Op||(Op=1,cc.exports=D1()),cc.exports}var hc={exports:{}},yt={};var zp;function L1(){if(zp)return yt;zp=1;var n=lf();function l(g){var m="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),hc.exports=L1(),hc.exports}var Rp;function B1(){if(Rp)return Ha;Rp=1;var n=R1(),l=lf(),a=U1();function u(e){var t="https://react.dev/errors/"+e;if(1j||(e.current=de[j],de[j]=null,j--)}function E(e,t){j++,de[j]=e.current,e.current=t}var re=M(null),ne=M(null),ue=M(null),xe=M(null);function He(e,t){switch(E(ue,t),E(ne,e),E(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jm(t),e=Pm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(re),E(re,e)}function Me(){G(re),G(ne),G(ue)}function Tt(e){e.memoizedState!==null&&E(xe,e);var t=re.current,i=Pm(t,e.type);t!==i&&(E(ne,e),E(re,i))}function sn(e){ne.current===e&&(G(re),G(ne)),xe.current===e&&(G(xe),Da._currentValue=oe)}var bt,Ji;function on(e){if(bt===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);bt=t&&t[1]||"",Ji=-1)":-1o||A[r]!==B[o]){var F=` +`+A[r].replace(" at new "," at ");return e.displayName&&F.includes("")&&(F=F.replace("",e.displayName)),F}while(1<=r&&0<=o);break}}}finally{ve=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?on(i):""}function tr(e,t){switch(e.tag){case 26:case 27:case 5:return on(e.type);case 16:return on("Lazy");case 13:return e.child!==t&&t!==null?on("Suspense Fallback"):on("Suspense");case 19:return on("SuspenseList");case 0:case 15:return gn(e.type,!1);case 11:return gn(e.type.render,!1);case 1:return gn(e.type,!0);case 31:return on("Activity");default:return""}}function nr(e){try{var t="",i=null;do t+=tr(e,i),i=e,e=e.return;while(e);return t}catch(r){return` +Error generating stack: `+r.message+` +`+r.stack}}var Pi=Object.prototype.hasOwnProperty,Wi=n.unstable_scheduleCallback,Il=n.unstable_cancelCallback,Yu=n.unstable_shouldYield,Iu=n.unstable_requestPaint,St=n.unstable_now,Xu=n.unstable_getCurrentPriorityLevel,Y=n.unstable_ImmediatePriority,ae=n.unstable_UserBlockingPriority,ye=n.unstable_NormalPriority,je=n.unstable_LowPriority,Be=n.unstable_IdlePriority,Bt=n.log,En=n.unstable_setDisableYieldValue,wt=null,ut=null;function At(e){if(typeof Bt=="function"&&En(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(wt,e)}catch{}}var Ye=Math.clz32?Math.clz32:yx,In=Math.log,cn=Math.LN2;function yx(e){return e>>>=0,e===0?32:31-(In(e)/cn|0)|0}var ir=256,lr=262144,ar=4194304;function wi(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&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rr(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var o=0,h=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var w=r&134217727;return w!==0?(r=w&~h,r!==0?o=wi(r):(v&=w,v!==0?o=wi(v):i||(i=w&~e,i!==0&&(o=wi(i))))):(w=r&~h,w!==0?o=wi(w):v!==0?o=wi(v):i||(i=r&~e,i!==0&&(o=wi(i)))),o===0?0:t!==0&&t!==o&&(t&h)===0&&(h=o&-o,i=t&-t,h>=i||h===32&&(i&4194048)!==0)?t:o}function Xl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nf(){var e=ar;return ar<<=1,(ar&62914560)===0&&(ar=4194304),e}function Ku(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Kl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vx(e,t,i,r,o,h){var v=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var w=e.entanglements,A=e.expirationTimes,B=e.hiddenUpdates;for(i=v&~i;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Cx=/[\n"\\]/g;function Zt(e){return e.replace(Cx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function es(e,t,i,r,o,h,v,w){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?ts(e,v,Kt(t)):i!=null?ts(e,v,Kt(i)):r!=null&&e.removeAttribute("value"),o==null&&h!=null&&(e.defaultChecked=!!h),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Kt(w):e.removeAttribute("name")}function Ff(e,t,i,r,o,h,v,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){$u(e);return}i=i!=null?""+Kt(i):"",t=t!=null?""+Kt(t):i,w||t===e.value||(e.value=t),e.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=w?e.checked:!!r,e.defaultChecked=!!r,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),$u(e)}function ts(e,t,i){t==="number"&&or(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function ll(e,t,i,r){if(e=e.options,t){t={};for(var o=0;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rs=!1;if(Tn)try{var Wl={};Object.defineProperty(Wl,"passive",{get:function(){rs=!0}}),window.addEventListener("test",Wl,Wl),window.removeEventListener("test",Wl,Wl)}catch{rs=!1}var Kn=null,us=null,fr=null;function Pf(){if(fr)return fr;var e,t=us,i=t.length,r,o="value"in Kn?Kn.value:Kn.textContent,h=o.length;for(e=0;e=ta),ih=" ",lh=!1;function ah(e,t){switch(e){case"keyup":return $x.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sl=!1;function t0(e,t){switch(e){case"compositionend":return rh(t);case"keypress":return t.which!==32?null:(lh=!0,ih);case"textInput":return e=t.data,e===ih&&lh?null:e;default:return null}}function n0(e,t){if(sl)return e==="compositionend"||!hs&&ah(e,t)?(e=Pf(),fr=us=Kn=null,sl=!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=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=mh(i)}}function gh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=or(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=or(e.document)}return t}function ps(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 c0=Tn&&"documentMode"in document&&11>=document.documentMode,ol=null,gs=null,aa=null,ys=!1;function xh(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ys||ol==null||ol!==or(r)||(r=ol,"selectionStart"in r&&ps(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),aa&&la(aa,r)||(aa=r,r=lu(gs,"onSelect"),0>=v,o-=v,yn=1<<32-Ye(t)+o|i<we?(Oe=fe,fe=null):Oe=fe.sibling;var Le=q(z,fe,L[we],I);if(Le===null){fe===null&&(fe=Oe);break}e&&fe&&Le.alternate===null&&t(z,fe),N=h(Le,N,we),Re===null?he=Le:Re.sibling=Le,Re=Le,fe=Oe}if(we===L.length)return i(z,fe),ze&&_n(z,we),he;if(fe===null){for(;wewe?(Oe=fe,fe=null):Oe=fe.sibling;var gi=q(z,fe,Le.value,I);if(gi===null){fe===null&&(fe=Oe);break}e&&fe&&gi.alternate===null&&t(z,fe),N=h(gi,N,we),Re===null?he=gi:Re.sibling=gi,Re=gi,fe=Oe}if(Le.done)return i(z,fe),ze&&_n(z,we),he;if(fe===null){for(;!Le.done;we++,Le=L.next())Le=P(z,Le.value,I),Le!==null&&(N=h(Le,N,we),Re===null?he=Le:Re.sibling=Le,Re=Le);return ze&&_n(z,we),he}for(fe=r(fe);!Le.done;we++,Le=L.next())Le=V(fe,z,we,Le.value,I),Le!==null&&(e&&Le.alternate!==null&&fe.delete(Le.key===null?we:Le.key),N=h(Le,N,we),Re===null?he=Le:Re.sibling=Le,Re=Le);return e&&fe.forEach(function(M1){return t(z,M1)}),ze&&_n(z,we),he}function Fe(z,N,L,I){if(typeof L=="object"&&L!==null&&L.type===_&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case S:e:{for(var he=L.key;N!==null;){if(N.key===he){if(he=L.type,he===_){if(N.tag===7){i(z,N.sibling),I=o(N,L.props.children),I.return=z,z=I;break e}}else if(N.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===ee&&zi(he)===N.type){i(z,N.sibling),I=o(N,L.props),fa(I,L),I.return=z,z=I;break e}i(z,N);break}else t(z,N);N=N.sibling}L.type===_?(I=Ai(L.props.children,z.mode,I,L.key),I.return=z,z=I):(I=Sr(L.type,L.key,L.props,null,z.mode,I),fa(I,L),I.return=z,z=I)}return v(z);case k:e:{for(he=L.key;N!==null;){if(N.key===he)if(N.tag===4&&N.stateNode.containerInfo===L.containerInfo&&N.stateNode.implementation===L.implementation){i(z,N.sibling),I=o(N,L.children||[]),I.return=z,z=I;break e}else{i(z,N);break}else t(z,N);N=N.sibling}I=Es(L,z.mode,I),I.return=z,z=I}return v(z);case ee:return L=zi(L),Fe(z,N,L,I)}if(K(L))return ce(z,N,L,I);if(Z(L)){if(he=Z(L),typeof he!="function")throw Error(u(150));return L=he.call(L),ge(z,N,L,I)}if(typeof L.then=="function")return Fe(z,N,Ar(L),I);if(L.$$typeof===O)return Fe(z,N,Er(z,L),I);_r(z,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,N!==null&&N.tag===6?(i(z,N.sibling),I=o(N,L),I.return=z,z=I):(i(z,N),I=ks(L,z.mode,I),I.return=z,z=I),v(z)):i(z,N)}return function(z,N,L,I){try{ca=0;var he=Fe(z,N,L,I);return bl=null,he}catch(fe){if(fe===vl||fe===jr)throw fe;var Re=qt(29,fe,null,z.mode);return Re.lanes=I,Re.return=z,Re}}}var Ri=Qh(!0),Vh=Qh(!1),$n=!1;function Ls(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Us(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 ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ti(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ue&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=br(e),Ch(e,null,i),t}return vr(e,r,t,i),br(e)}function ha(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,zf(e,i)}}function Bs(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var o=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var v={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?o=h=v:h=h.next=v,i=i.next}while(i!==null);h===null?o=h=t:h=h.next=t}else o=h=t;i={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:h,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Hs=!1;function da(){if(Hs){var e=xl;if(e!==null)throw e}}function ma(e,t,i,r){Hs=!1;var o=e.updateQueue;$n=!1;var h=o.firstBaseUpdate,v=o.lastBaseUpdate,w=o.shared.pending;if(w!==null){o.shared.pending=null;var A=w,B=A.next;A.next=null,v===null?h=B:v.next=B,v=A;var F=e.alternate;F!==null&&(F=F.updateQueue,w=F.lastBaseUpdate,w!==v&&(w===null?F.firstBaseUpdate=B:w.next=B,F.lastBaseUpdate=A))}if(h!==null){var P=o.baseState;v=0,F=B=A=null,w=h;do{var q=w.lane&-536870913,V=q!==w.lane;if(V?(Ne&q)===q:(r&q)===q){q!==0&&q===yl&&(Hs=!0),F!==null&&(F=F.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ce=e,ge=w;q=t;var Fe=i;switch(ge.tag){case 1:if(ce=ge.payload,typeof ce=="function"){P=ce.call(Fe,P,q);break e}P=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ge.payload,q=typeof ce=="function"?ce.call(Fe,P,q):ce,q==null)break e;P=y({},P,q);break e;case 2:$n=!0}}q=w.callback,q!==null&&(e.flags|=64,V&&(e.flags|=8192),V=o.callbacks,V===null?o.callbacks=[q]:V.push(q))}else V={lane:q,tag:w.tag,payload:w.payload,callback:w.callback,next:null},F===null?(B=F=V,A=P):F=F.next=V,v|=q;if(w=w.next,w===null){if(w=o.shared.pending,w===null)break;V=w,w=V.next,V.next=null,o.lastBaseUpdate=V,o.shared.pending=null}}while(!0);F===null&&(A=P),o.baseState=A,o.firstBaseUpdate=B,o.lastBaseUpdate=F,h===null&&(o.shared.lanes=0),ri|=v,e.lanes=v,e.memoizedState=P}}function Gh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Fh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;eh?h:8;var v=D.T,w={};D.T=w,lo(e,!1,t,i);try{var A=o(),B=D.S;if(B!==null&&B(w,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var F=v0(A,r);ya(e,t,F,Yt(e))}else ya(e,t,r,Yt(e))}catch(P){ya(e,t,{then:function(){},status:"rejected",reason:P},Yt())}finally{W.p=h,v!==null&&w.types!==null&&(v.types=w.types),D.T=v}}function C0(){}function no(e,t,i,r){if(e.tag!==5)throw Error(u(476));var o=wd(e).queue;Sd(e,o,t,oe,i===null?C0:function(){return kd(e),i(r)})}function wd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:oe},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function kd(e){var t=wd(e);t.next===null&&(t=e.alternate.memoizedState),ya(e,t.next.queue,{},Yt())}function io(){return mt(Da)}function Ed(){return tt().memoizedState}function Cd(){return tt().memoizedState}function j0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Yt();e=ei(i);var r=ti(t,e,i);r!==null&&(Rt(r,t,i),ha(r,t,i)),t={cache:Os()},e.payload=t;return}t=t.return}}function T0(e,t,i){var r=Yt();i={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Hr(e)?Td(t,i):(i=Ss(e,t,i,r),i!==null&&(Rt(i,e,r),Ad(i,t,r)))}function jd(e,t,i){var r=Yt();ya(e,t,i,r)}function ya(e,t,i,r){var o={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Hr(e))Td(t,o);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var v=t.lastRenderedState,w=h(v,i);if(o.hasEagerState=!0,o.eagerState=w,Ht(w,v))return vr(e,t,o,0),Ie===null&&xr(),!1}catch{}if(i=Ss(e,t,o,r),i!==null)return Rt(i,e,r),Ad(i,t,r),!0}return!1}function lo(e,t,i,r){if(r={lane:2,revertLane:Uo(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Hr(e)){if(t)throw Error(u(479))}else t=Ss(e,i,r,2),t!==null&&Rt(t,e,2)}function Hr(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function Td(e,t){wl=Or=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ad(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,zf(e,i)}}var xa={readContext:mt,use:Rr,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};xa.useEffectEvent=We;var _d={readContext:mt,use:Rr,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:hd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ur(4194308,4,gd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ur(4194308,4,e,t)},useInsertionEffect:function(e,t){Ur(4,2,e,t)},useMemo:function(e,t){var i=kt();t=t===void 0?null:t;var r=e();if(Li){At(!0);try{e()}finally{At(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=kt();if(i!==void 0){var o=i(t);if(Li){At(!0);try{i(t)}finally{At(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=T0.bind(null,Se,e),[r.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ps(e);var t=e.queue,i=jd.bind(null,Se,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:eo,useDeferredValue:function(e,t){var i=kt();return to(i,e,t)},useTransition:function(){var e=Ps(!1);return e=Sd.bind(null,Se,e.queue,!0,!1),kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Se,o=kt();if(ze){if(i===void 0)throw Error(u(407));i=i()}else{if(i=t(),Ie===null)throw Error(u(349));(Ne&127)!==0||Jh(r,t,i)}o.memoizedState=i;var h={value:i,getSnapshot:t};return o.queue=h,hd(Wh.bind(null,r,h,e),[e]),r.flags|=2048,El(9,{destroy:void 0},Ph.bind(null,r,h,i,t),null),i},useId:function(){var e=kt(),t=Ie.identifierPrefix;if(ze){var i=xn,r=yn;i=(r&~(1<<32-Ye(r)-1)).toString(32)+i,t="_"+t+"R_"+i,i=zr++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof r.is=="string"?v.createElement("select",{is:r.is}):v.createElement("select"),r.multiple?h.multiple=!0:r.size&&(h.size=r.size);break;default:h=typeof r.is=="string"?v.createElement(o,{is:r.is}):v.createElement(o)}}h[ht]=t,h[_t]=r;e:for(v=t.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===t)break e;for(;v.sibling===null;){if(v.return===null||v.return===t)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}t.stateNode=h;e:switch(gt(h,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Rn(t)}}return Je(t),vo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(u(166));if(e=ue.current,pl(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,o=dt,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[ht]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||Km(e.nodeValue,i)),e||Pn(t,!0)}else e=au(e).createTextNode(r),e[ht]=t,t.stateNode=e}return Je(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(r=pl(t),i!==null){if(e===null){if(!r)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[ht]=t}else _i(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else i=As(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Vt(t),t):(Vt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Je(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=pl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[ht]=t}else _i(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),o=!1}else o=As(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Vt(t),t):(Vt(t),null)}return Vt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=r!==null,e=e!==null&&e.memoizedState!==null,i&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==o&&(r.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Fr(t,t.updateQueue),Je(t),null);case 4:return Me(),e===null&&Qo(t.stateNode.containerInfo),Je(t),null;case 10:return Nn(t.type),Je(t),null;case 19:if(G(et),r=t.memoizedState,r===null)return Je(t),null;if(o=(t.flags&128)!==0,h=r.rendering,h===null)if(o)ba(r,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Nr(e),h!==null){for(t.flags|=128,ba(r,!1),e=h.updateQueue,t.updateQueue=e,Fr(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)jh(i,e),i=i.sibling;return E(et,et.current&1|2),ze&&_n(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&St()>Zr&&(t.flags|=128,o=!0,ba(r,!1),t.lanes=4194304)}else{if(!o)if(e=Nr(h),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Fr(t,e),ba(r,!0),r.tail===null&&r.tailMode==="hidden"&&!h.alternate&&!ze)return Je(t),null}else 2*St()-r.renderingStartTime>Zr&&i!==536870912&&(t.flags|=128,o=!0,ba(r,!1),t.lanes=4194304);r.isBackwards?(h.sibling=t.child,t.child=h):(e=r.last,e!==null?e.sibling=h:t.child=h,r.last=h)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=St(),e.sibling=null,i=et.current,E(et,o?i&1|2:i&1),ze&&_n(t,r.treeForkCount),e):(Je(t),null);case 22:case 23:return Vt(t),Qs(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),i=t.updateQueue,i!==null&&Fr(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&G(Oi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Nn(nt),Je(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function O0(e,t){switch(js(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(nt),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return sn(t),null;case 31:if(t.memoizedState!==null){if(Vt(t),t.alternate===null)throw Error(u(340));_i()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Vt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));_i()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(et),null;case 4:return Me(),null;case 10:return Nn(t.type),null;case 22:case 23:return Vt(t),Qs(),e!==null&&G(Oi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nn(nt),null;case 25:return null;default:return null}}function $d(e,t){switch(js(t),t.tag){case 3:Nn(nt),Me();break;case 26:case 27:case 5:sn(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Vt(t);break;case 13:Vt(t);break;case 19:G(et);break;case 10:Nn(t.type);break;case 22:case 23:Vt(t),Qs(),e!==null&&G(Oi);break;case 24:Nn(nt)}}function Sa(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&e)===e){r=void 0;var h=i.create,v=i.inst;r=h(),v.destroy=r}i=i.next}while(i!==o)}}catch(w){Qe(t,t.return,w)}}function li(e,t,i){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var h=o.next;r=h;do{if((r.tag&e)===e){var v=r.inst,w=v.destroy;if(w!==void 0){v.destroy=void 0,o=t;var A=i,B=w;try{B()}catch(F){Qe(o,A,F)}}}r=r.next}while(r!==h)}}catch(F){Qe(t,t.return,F)}}function em(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Fh(t,i)}catch(r){Qe(e,e.return,r)}}}function tm(e,t,i){i.props=Ui(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){Qe(e,t,r)}}function wa(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(o){Qe(e,t,o)}}function vn(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(o){Qe(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(o){Qe(e,t,o)}else i.current=null}function nm(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(o){Qe(e,e.return,o)}}function bo(e,t,i){try{var r=e.stateNode;e1(r,e.type,i,t),r[_t]=t}catch(o){Qe(e,e.return,o)}}function im(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fi(e.type)||e.tag===4}function So(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||im(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wo(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=jn));else if(r!==4&&(r===27&&fi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(wo(e,t,i),e=e.sibling;e!==null;)wo(e,t,i),e=e.sibling}function Yr(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&fi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Yr(e,t,i),e=e.sibling;e!==null;)Yr(e,t,i),e=e.sibling}function lm(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);gt(t,r,i),t[ht]=e,t[_t]=i}catch(h){Qe(e,e.return,h)}}var Ln=!1,at=!1,ko=!1,am=typeof WeakSet=="function"?WeakSet:Set,ft=null;function z0(e,t){if(e=e.containerInfo,Fo=hu,e=yh(e),ps(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var o=r.anchorOffset,h=r.focusNode;r=r.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var v=0,w=-1,A=-1,B=0,F=0,P=e,q=null;t:for(;;){for(var V;P!==i||o!==0&&P.nodeType!==3||(w=v+o),P!==h||r!==0&&P.nodeType!==3||(A=v+r),P.nodeType===3&&(v+=P.nodeValue.length),(V=P.firstChild)!==null;)q=P,P=V;for(;;){if(P===e)break t;if(q===i&&++B===o&&(w=v),q===h&&++F===r&&(A=v),(V=P.nextSibling)!==null)break;P=q,q=P.parentNode}P=V}i=w===-1||A===-1?null:{start:w,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for(Yo={focusedElem:e,selectionRange:i},hu=!1,ft=t;ft!==null;)if(t=ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ft=e;else for(;ft!==null;){switch(t=ft,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i title"))),gt(h,r,i),h[ht]=e,ct(h),r=h;break e;case"link":var v=fp("link","href",o).get(r+(i.href||""));if(v){for(var w=0;wFe&&(v=Fe,Fe=ge,ge=v);var z=ph(w,ge),N=ph(w,Fe);if(z&&N&&(V.rangeCount!==1||V.anchorNode!==z.node||V.anchorOffset!==z.offset||V.focusNode!==N.node||V.focusOffset!==N.offset)){var L=P.createRange();L.setStart(z.node,z.offset),V.removeAllRanges(),ge>Fe?(V.addRange(L),V.extend(N.node,N.offset)):(L.setEnd(N.node,N.offset),V.addRange(L))}}}}for(P=[],V=w;V=V.parentNode;)V.nodeType===1&&P.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;wi?32:i,D.T=null,i=Mo,Mo=null;var h=si,v=Qn;if(st=0,_l=si=null,Qn=0,(Ue&6)!==0)throw Error(u(331));var w=Ue;if(Ue|=4,gm(h.current),dm(h,h.current,v,i),Ue=w,Aa(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(wt,h)}catch{}return!0}finally{W.p=o,D.T=r,Dm(e,t)}}function Lm(e,t,i){t=Pt(i,t),t=so(e.stateNode,t,2),e=ti(e,t,2),e!==null&&(Kl(e,2),bn(e))}function Qe(e,t,i){if(e.tag===3)Lm(e,e,i);else for(;t!==null;){if(t.tag===3){Lm(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ui===null||!ui.has(r))){e=Pt(i,e),i=Ud(2),r=ti(t,i,2),r!==null&&(Bd(i,r,t,e),Kl(r,2),bn(r));break}}t=t.return}}function Do(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new L0;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(i)||(jo=!0,o.add(i),e=Q0.bind(null,e,t,i),t.then(e,e))}function Q0(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ie===e&&(Ne&i)===i&&($e===4||$e===3&&(Ne&62914560)===Ne&&300>St()-Kr?(Ue&2)===0&&Ml(e,0):To|=i,Al===Ne&&(Al=0)),bn(e)}function Um(e,t){t===0&&(t=Nf()),e=Ti(e,t),e!==null&&(Kl(e,t),bn(e))}function V0(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Um(e,i)}function G0(e,t){var i=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(u(314))}r!==null&&r.delete(t),Um(e,i)}function F0(e,t){return Wi(e,t)}var tu=null,Ol=null,Ro=!1,nu=!1,Lo=!1,ci=0;function bn(e){e!==Ol&&e.next===null&&(Ol===null?tu=Ol=e:Ol=Ol.next=e),nu=!0,Ro||(Ro=!0,I0())}function Aa(e,t){if(!Lo&&nu){Lo=!0;do for(var i=!1,r=tu;r!==null;){if(e!==0){var o=r.pendingLanes;if(o===0)var h=0;else{var v=r.suspendedLanes,w=r.pingedLanes;h=(1<<31-Ye(42|e)+1)-1,h&=o&~(v&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,Qm(r,h))}else h=Ne,h=rr(r,r===Ie?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(h&3)===0||Xl(r,h)||(i=!0,Qm(r,h));r=r.next}while(i);Lo=!1}}function Y0(){Bm()}function Bm(){nu=Ro=!1;var e=0;ci!==0&&n1()&&(e=ci);for(var t=St(),i=null,r=tu;r!==null;){var o=r.next,h=Hm(r,t);h===0?(r.next=null,i===null?tu=o:i.next=o,o===null&&(Ol=i)):(i=r,(e!==0||(h&3)!==0)&&(nu=!0)),r=o}st!==0&&st!==5||Aa(e),ci!==0&&(ci=0)}function Hm(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,h=e.pendingLanes&-62914561;0w)break;var F=A.transferSize,P=A.initiatorType;F&&Zm(P)&&(A=A.responseEnd,v+=F*(A"u"?null:document;function up(e,t,i){var r=zl;if(r&&typeof t=="string"&&t){var o=Zt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof i=="string"&&(o+='[crossorigin="'+i+'"]'),rp.has(o)||(rp.add(o),e={rel:e,crossOrigin:i,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),gt(t,"link",e),ct(t),r.head.appendChild(t)))}}function f1(e){Vn.D(e),up("dns-prefetch",e,null)}function h1(e,t){Vn.C(e,t),up("preconnect",e,t)}function d1(e,t,i){Vn.L(e,t,i);var r=zl;if(r&&e&&t){var o='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(o+='[imagesrcset="'+Zt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(o+='[imagesizes="'+Zt(i.imageSizes)+'"]')):o+='[href="'+Zt(e)+'"]';var h=o;switch(t){case"style":h=Dl(e);break;case"script":h=Rl(e)}ln.has(h)||(e=y({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),ln.set(h,e),r.querySelector(o)!==null||t==="style"&&r.querySelector(Oa(h))||t==="script"&&r.querySelector(za(h))||(t=r.createElement("link"),gt(t,"link",e),ct(t),r.head.appendChild(t)))}}function m1(e,t){Vn.m(e,t);var i=zl;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Zt(r)+'"][href="'+Zt(e)+'"]',h=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Rl(e)}if(!ln.has(h)&&(e=y({rel:"modulepreload",href:e},t),ln.set(h,e),i.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(za(h)))return}r=i.createElement("link"),gt(r,"link",e),ct(r),i.head.appendChild(r)}}}function p1(e,t,i){Vn.S(e,t,i);var r=zl;if(r&&e){var o=nl(r).hoistableStyles,h=Dl(e);t=t||"default";var v=o.get(h);if(!v){var w={loading:0,preload:null};if(v=r.querySelector(Oa(h)))w.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},i),(i=ln.get(h))&&Wo(e,i);var A=v=r.createElement("link");ct(A),gt(A,"link",e),A._p=new Promise(function(B,F){A.onload=B,A.onerror=F}),A.addEventListener("load",function(){w.loading|=1}),A.addEventListener("error",function(){w.loading|=2}),w.loading|=4,uu(v,t,r)}v={type:"stylesheet",instance:v,count:1,state:w},o.set(h,v)}}}function g1(e,t){Vn.X(e,t);var i=zl;if(i&&e){var r=nl(i).hoistableScripts,o=Rl(e),h=r.get(o);h||(h=i.querySelector(za(o)),h||(e=y({src:e,async:!0},t),(t=ln.get(o))&&$o(e,t),h=i.createElement("script"),ct(h),gt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(o,h))}}function y1(e,t){Vn.M(e,t);var i=zl;if(i&&e){var r=nl(i).hoistableScripts,o=Rl(e),h=r.get(o);h||(h=i.querySelector(za(o)),h||(e=y({src:e,async:!0,type:"module"},t),(t=ln.get(o))&&$o(e,t),h=i.createElement("script"),ct(h),gt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(o,h))}}function sp(e,t,i,r){var o=(o=ue.current)?ru(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Dl(i.href),i=nl(o).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Dl(i.href);var h=nl(o).hoistableStyles,v=h.get(e);if(v||(o=o.ownerDocument||o,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,v),(h=o.querySelector(Oa(e)))&&!h._p&&(v.instance=h,v.state.loading=5),ln.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},ln.set(e,i),h||x1(o,e,i,v.state))),t&&r===null)throw Error(u(528,""));return v}if(t&&r!==null)throw Error(u(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Rl(i),i=nl(o).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Dl(e){return'href="'+Zt(e)+'"'}function Oa(e){return'link[rel="stylesheet"]['+e+"]"}function op(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function x1(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),gt(t,"link",i),ct(t),e.head.appendChild(t))}function Rl(e){return'[src="'+Zt(e)+'"]'}function za(e){return"script[async]"+e}function cp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Zt(i.href)+'"]');if(r)return t.instance=r,ct(r),r;var o=y({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),ct(r),gt(r,"style",o),uu(r,i.precedence,e),t.instance=r;case"stylesheet":o=Dl(i.href);var h=e.querySelector(Oa(o));if(h)return t.state.loading|=4,t.instance=h,ct(h),h;r=op(i),(o=ln.get(o))&&Wo(r,o),h=(e.ownerDocument||e).createElement("link"),ct(h);var v=h;return v._p=new Promise(function(w,A){v.onload=w,v.onerror=A}),gt(h,"link",r),t.state.loading|=4,uu(h,i.precedence,e),t.instance=h;case"script":return h=Rl(i.src),(o=e.querySelector(za(h)))?(t.instance=o,ct(o),o):(r=i,(o=ln.get(h))&&(r=y({},i),$o(r,o)),e=e.ownerDocument||e,o=e.createElement("script"),ct(o),gt(o,"link",r),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,uu(r,i.precedence,e));return t.instance}function uu(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,h=o,v=0;v title"):null)}function v1(e,t,i){if(i===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 dp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function b1(e,t,i,r){if(i.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var o=Dl(r.href),h=t.querySelector(Oa(o));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ou.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=h,ct(h);return}h=t.ownerDocument||t,r=op(r),(o=ln.get(o))&&Wo(r,o),h=h.createElement("link"),ct(h);var v=h;v._p=new Promise(function(w,A){v.onload=w,v.onerror=A}),gt(h,"link",r),i.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ou.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var ec=0;function S1(e,t){return e.stylesheets&&e.count===0&&fu(e,e.stylesheets),0ec?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cu=null;function fu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cu=new Map,t.forEach(w1,e),cu=null,ou.call(e))}function w1(e,t){if(!(t.state.loading&4)){var i=cu.get(e);if(i)var r=i.get(null);else{i=new Map,cu.set(e,i);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),oc.exports=B1(),oc.exports}var q1=H1(),Gl=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(){}},Q1={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)},V1=class{#e=Q1;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,l){return this.#e.setTimeout(n,l)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,l){return this.#e.setInterval(n,l)}clearInterval(n){this.#e.clearInterval(n)}},Qi=new V1;function G1(n){setTimeout(n,0)}var Gi=typeof window>"u"||"Deno"in globalThis;function Et(){}function F1(n,l){return typeof n=="function"?n(l):n}function Bc(n){return typeof n=="number"&&n>=0&&n!==1/0}function Kg(n,l){return Math.max(n+(l||0)-Date.now(),0)}function vi(n,l){return typeof n=="function"?n(l):n}function an(n,l){return typeof n=="function"?n(l):n}function Up(n,l){const{type:a="all",exact:u,fetchStatus:s,predicate:c,queryKey:f,stale:d}=n;if(f){if(u){if(l.queryHash!==af(f,l.options))return!1}else if(!Ka(l.queryKey,f))return!1}if(a!=="all"){const g=l.isActive();if(a==="active"&&!g||a==="inactive"&&g)return!1}return!(typeof d=="boolean"&&l.isStale()!==d||s&&s!==l.state.fetchStatus||c&&!c(l))}function Bp(n,l){const{exact:a,status:u,predicate:s,mutationKey:c}=n;if(c){if(!l.options.mutationKey)return!1;if(a){if(Fi(l.options.mutationKey)!==Fi(c))return!1}else if(!Ka(l.options.mutationKey,c))return!1}return!(u&&l.state.status!==u||s&&!s(l))}function af(n,l){return(l?.queryKeyHashFn||Fi)(n)}function Fi(n){return JSON.stringify(n,(l,a)=>Hc(a)?Object.keys(a).sort().reduce((u,s)=>(u[s]=a[s],u),{}):a)}function Ka(n,l){return n===l?!0:typeof n!=typeof l?!1:n&&l&&typeof n=="object"&&typeof l=="object"?Object.keys(l).every(a=>Ka(n[a],l[a])):!1}var Y1=Object.prototype.hasOwnProperty;function Zg(n,l,a=0){if(n===l)return n;if(a>500)return l;const u=Hp(n)&&Hp(l);if(!u&&!(Hc(n)&&Hc(l)))return l;const c=(u?n:Object.keys(n)).length,f=u?l:Object.keys(l),d=f.length,g=u?new Array(d):{};let m=0;for(let x=0;x{Qi.setTimeout(l,n)})}function qc(n,l,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,l):a.structuralSharing!==!1?Zg(n,l):l}function X1(n,l,a=0){const u=[...n,l];return a&&u.length>a?u.slice(1):u}function K1(n,l,a=0){const u=[l,...n];return a&&u.length>a?u.slice(0,-1):u}var rf=Symbol();function Jg(n,l){return!n.queryFn&&l?.initialPromise?()=>l.initialPromise:!n.queryFn||n.queryFn===rf?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function uf(n,l){return typeof n=="function"?n(...l):!!n}function Z1(n,l,a){let u=!1,s;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(s??=l(),u||(u=!0,s.aborted?a():s.addEventListener("abort",a,{once:!0})),s)}),n}var J1=class extends Gl{#e;#t;#n;constructor(){super(),this.#n=n=>{if(!Gi&&window.addEventListener){const l=()=>n();return window.addEventListener("visibilitychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}}}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(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(l=>{l(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},sf=new J1;function Qc(){let n,l;const a=new Promise((s,c)=>{n=s,l=c});a.status="pending",a.catch(()=>{});function u(s){Object.assign(a,s),delete a.resolve,delete a.reject}return a.resolve=s=>{u({status:"fulfilled",value:s}),n(s)},a.reject=s=>{u({status:"rejected",reason:s}),l(s)},a}var P1=G1;function W1(){let n=[],l=0,a=d=>{d()},u=d=>{d()},s=P1;const c=d=>{l?n.push(d):s(()=>{a(d)})},f=()=>{const d=n;n=[],d.length&&s(()=>{u(()=>{d.forEach(g=>{a(g)})})})};return{batch:d=>{let g;l++;try{g=d()}finally{l--,l||f()}return g},batchCalls:d=>(...g)=>{c(()=>{d(...g)})},schedule:c,setNotifyFunction:d=>{a=d},setBatchNotifyFunction:d=>{u=d},setScheduler:d=>{s=d}}}var ot=W1(),$1=class extends Gl{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(!Gi&&window.addEventListener){const l=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",l),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(a=>{a(n)}))}isOnline(){return this.#e}},Nu=new $1;function ev(n){return Math.min(1e3*2**n,3e4)}function Pg(n){return(n??"online")==="online"?Nu.isOnline():!0}var Vc=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function Wg(n){let l=!1,a=0,u;const s=Qc(),c=()=>s.status!=="pending",f=_=>{if(!c()){const T=new Vc(_);b(T),n.onCancel?.(T)}},d=()=>{l=!0},g=()=>{l=!1},m=()=>sf.isFocused()&&(n.networkMode==="always"||Nu.isOnline())&&n.canRun(),x=()=>Pg(n.networkMode)&&n.canRun(),y=_=>{c()||(u?.(),s.resolve(_))},b=_=>{c()||(u?.(),s.reject(_))},S=()=>new Promise(_=>{u=T=>{(c()||m())&&_(T)},n.onPause?.()}).then(()=>{u=void 0,c()||n.onContinue?.()}),k=()=>{if(c())return;let _;const T=a===0?n.initialPromise:void 0;try{_=T??n.fn()}catch(C){_=Promise.reject(C)}Promise.resolve(_).then(y).catch(C=>{if(c())return;const H=n.retry??(Gi?0:3),O=n.retryDelay??ev,X=typeof O=="function"?O(a,C):O,J=H===!0||typeof H=="number"&&am()?void 0:S()).then(()=>{l?b(C):k()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(u?.(),s),cancelRetry:d,continueRetry:g,canStart:x,start:()=>(x()?k():S().then(k),s)}}var $g=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bc(this.gcTime)&&(this.#e=Qi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Gi?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Qi.clearTimeout(this.#e),this.#e=void 0)}},tv=class extends $g{#e;#t;#n;#l;#i;#r;#u;constructor(n){super(),this.#u=!1,this.#r=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#l=n.client,this.#n=this.#l.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#e=Vp(this.options),this.state=n.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(n){if(this.options={...this.#r,...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=Vp(this.options);l.data!==void 0&&(this.setState(Qp(l.data,l.dataUpdatedAt)),this.#e=l)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(n,l){const a=qc(this.state.data,n,this.options);return this.#a({data:a,type:"success",dataUpdatedAt:l?.updatedAt,manual:l?.manual}),a}setState(n,l){this.#a({type:"setState",state:n,setStateOptions:l})}cancel(n){const l=this.#i?.promise;return this.#i?.cancel(n),l?l.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(n=>an(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>vi(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:!Kg(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(l=>l.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(l=>l.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(l=>l!==n),this.observers.length||(this.#i&&(this.#u?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(n,l){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&l?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(n&&this.setOptions(n),!this.options.queryFn){const d=this.observers.find(g=>g.options.queryFn);d&&this.setOptions(d.options)}const a=new AbortController,u=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#u=!0,a.signal)})},s=()=>{const d=Jg(this.options,l),m=(()=>{const x={client:this.#l,queryKey:this.queryKey,meta:this.meta};return u(x),x})();return this.#u=!1,this.options.persister?this.options.persister(d,m,this):d(m)},f=(()=>{const d={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:s};return u(d),d})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#a({type:"fetch",meta:f.fetchOptions?.meta}),this.#i=Wg({initialPromise:l?.initialPromise,fn:f.fetchFn,onCancel:d=>{d instanceof Vc&&d.revert&&this.setState({...this.#t,fetchStatus:"idle"}),a.abort()},onFail:(d,g)=>{this.#a({type:"failed",failureCount:d,error:g})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const d=await this.#i.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#n.config.onSuccess?.(d,this),this.#n.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof Vc){if(d.silent)return this.#i.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#a({type:"error",error:d}),this.#n.config.onError?.(d,this),this.#n.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#a(n){const l=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,...ey(a.data,this.options),fetchMeta:n.meta??null};case"success":const u={...a,...Qp(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=n.manual?u:void 0,u;case"error":const s=n.error;return{...a,error:s,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=l(this.state),ot.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:n})})}};function ey(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Pg(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Qp(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vp(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,a=l!==void 0,u=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:a?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var nv=class extends Gl{constructor(n,l){super(),this.options=l,this.#e=n,this.#a=null,this.#u=Qc(),this.bindMethods(),this.setOptions(l)}#e;#t=void 0;#n=void 0;#l=void 0;#i;#r;#u;#a;#p;#h;#d;#o;#c;#s;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Gp(this.#t,this.options)?this.#f():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gc(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(n){const l=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 an(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),l._defaulted&&!Mu(this.options,l)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const u=this.hasListeners();u&&Fp(this.#t,a,this.options,l)&&this.#f(),this.updateResult(),u&&(this.#t!==a||an(this.options.enabled,this.#t)!==an(l.enabled,this.#t)||vi(this.options.staleTime,this.#t)!==vi(l.staleTime,this.#t))&&this.#g();const s=this.#y();u&&(this.#t!==a||an(this.options.enabled,this.#t)!==an(l.enabled,this.#t)||s!==this.#s)&&this.#x(s)}getOptimisticResult(n){const l=this.#e.getQueryCache().build(this.#e,n),a=this.createResult(l,n);return lv(this,a)&&(this.#l=a,this.#r=this.options,this.#i=this.#t.state),a}getCurrentResult(){return this.#l}trackResult(n,l){return new Proxy(n,{get:(a,u)=>(this.trackProp(u),l?.(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#u.status==="pending"&&this.#u.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,u))})}trackProp(n){this.#m.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const l=this.#e.defaultQueryOptions(n),a=this.#e.getQueryCache().build(this.#e,l);return a.fetch().then(()=>this.createResult(a,l))}fetch(n){return this.#f({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#l))}#f(n){this.#w();let l=this.#t.fetch(this.options,n);return n?.throwOnError||(l=l.catch(Et)),l}#g(){this.#b();const n=vi(this.options.staleTime,this.#t);if(Gi||this.#l.isStale||!Bc(n))return;const a=Kg(this.#l.dataUpdatedAt,n)+1;this.#o=Qi.setTimeout(()=>{this.#l.isStale||this.updateResult()},a)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#x(n){this.#S(),this.#s=n,!(Gi||an(this.options.enabled,this.#t)===!1||!Bc(this.#s)||this.#s===0)&&(this.#c=Qi.setInterval(()=>{(this.options.refetchIntervalInBackground||sf.isFocused())&&this.#f()},this.#s))}#v(){this.#g(),this.#x(this.#y())}#b(){this.#o&&(Qi.clearTimeout(this.#o),this.#o=void 0)}#S(){this.#c&&(Qi.clearInterval(this.#c),this.#c=void 0)}createResult(n,l){const a=this.#t,u=this.options,s=this.#l,c=this.#i,f=this.#r,g=n!==a?n.state:this.#n,{state:m}=n;let x={...m},y=!1,b;if(l._optimisticResults){const ee=this.hasListeners(),ie=!ee&&Gp(n,l),U=ee&&Fp(n,a,l,u);(ie||U)&&(x={...x,...ey(m.data,n.options)}),l._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:S,errorUpdatedAt:k,status:_}=x;b=x.data;let T=!1;if(l.placeholderData!==void 0&&b===void 0&&_==="pending"){let ee;s?.isPlaceholderData&&l.placeholderData===f?.placeholderData?(ee=s.data,T=!0):ee=typeof l.placeholderData=="function"?l.placeholderData(this.#d?.state.data,this.#d):l.placeholderData,ee!==void 0&&(_="success",b=qc(s?.data,ee,l),y=!0)}if(l.select&&b!==void 0&&!T)if(s&&b===c?.data&&l.select===this.#p)b=this.#h;else try{this.#p=l.select,b=l.select(b),b=qc(s?.data,b,l),this.#h=b,this.#a=null}catch(ee){this.#a=ee}this.#a&&(S=this.#a,b=this.#h,k=Date.now(),_="error");const C=x.fetchStatus==="fetching",H=_==="pending",O=_==="error",X=H&&C,J=b!==void 0,$={status:_,fetchStatus:x.fetchStatus,isPending:H,isSuccess:_==="success",isError:O,isInitialLoading:X,isLoading:X,data:b,dataUpdatedAt:x.dataUpdatedAt,error:S,errorUpdatedAt:k,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>g.dataUpdateCount||x.errorUpdateCount>g.errorUpdateCount,isFetching:C,isRefetching:C&&!H,isLoadingError:O&&!J,isPaused:x.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:O&&J,isStale:of(n,l),refetch:this.refetch,promise:this.#u,isEnabled:an(l.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const ee=$.data!==void 0,ie=$.status==="error"&&!ee,U=me=>{ie?me.reject($.error):ee&&me.resolve($.data)},le=()=>{const me=this.#u=$.promise=Qc();U(me)},Z=this.#u;switch(Z.status){case"pending":n.queryHash===a.queryHash&&U(Z);break;case"fulfilled":(ie||$.data!==Z.value)&&le();break;case"rejected":(!ie||$.error!==Z.reason)&&le();break}}return $}updateResult(){const n=this.#l,l=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#d=this.#t),Mu(l,n))return;this.#l=l;const a=()=>{if(!n)return!0;const{notifyOnChangeProps:u}=this.options,s=typeof u=="function"?u():u;if(s==="all"||!s&&!this.#m.size)return!0;const c=new Set(s??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#l).some(f=>{const d=f;return this.#l[d]!==n[d]&&c.has(d)})};this.#k({listeners:a()})}#w(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const l=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(l?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#k(n){ot.batch(()=>{n.listeners&&this.listeners.forEach(l=>{l(this.#l)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function iv(n,l){return an(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&l.retryOnMount===!1)}function Gp(n,l){return iv(n,l)||n.state.data!==void 0&&Gc(n,l,l.refetchOnMount)}function Gc(n,l,a){if(an(l.enabled,n)!==!1&&vi(l.staleTime,n)!=="static"){const u=typeof a=="function"?a(n):a;return u==="always"||u!==!1&&of(n,l)}return!1}function Fp(n,l,a,u){return(n!==l||an(u.enabled,n)===!1)&&(!a.suspense||n.state.status!=="error")&&of(n,a)}function of(n,l){return an(l.enabled,n)!==!1&&n.isStaleByTime(vi(l.staleTime,n))}function lv(n,l){return!Mu(n.getCurrentResult(),l)}function Yp(n){return{onFetch:(l,a)=>{const u=l.options,s=l.fetchOptions?.meta?.fetchMore?.direction,c=l.state.data?.pages||[],f=l.state.data?.pageParams||[];let d={pages:[],pageParams:[]},g=0;const m=async()=>{let x=!1;const y=k=>{Z1(k,()=>l.signal,()=>x=!0)},b=Jg(l.options,l.fetchOptions),S=async(k,_,T)=>{if(x)return Promise.reject();if(_==null&&k.pages.length)return Promise.resolve(k);const H=(()=>{const R={client:l.client,queryKey:l.queryKey,pageParam:_,direction:T?"backward":"forward",meta:l.options.meta};return y(R),R})(),O=await b(H),{maxPages:X}=l.options,J=T?K1:X1;return{pages:J(k.pages,O,X),pageParams:J(k.pageParams,_,X)}};if(s&&c.length){const k=s==="backward",_=k?av:Ip,T={pages:c,pageParams:f},C=_(u,T);d=await S(T,C,k)}else{const k=n??c.length;do{const _=g===0?f[0]??u.initialPageParam:Ip(u,d);if(g>0&&_==null)break;d=await S(d,_),g++}while(gl.options.persister?.(m,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},a):l.fetchFn=m}}}function Ip(n,{pages:l,pageParams:a}){const u=l.length-1;return l.length>0?n.getNextPageParam(l[u],l,a[u],a):void 0}function av(n,{pages:l,pageParams:a}){return l.length>0?n.getPreviousPageParam?.(l[0],l,a[0],a):void 0}var rv=class extends $g{#e;#t;#n;#l;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||ty(),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(l=>l!==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.#l?.continue()??this.execute(this.state.variables)}async execute(n){const l=()=>{this.#i({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Wg({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(c,f)=>{this.#i({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#i({type:"pause"})},onContinue:l,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const u=this.state.status==="pending",s=!this.#l.canStart();try{if(u)l();else{this.#i({type:"pending",variables:n,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,a);const f=await this.options.onMutate?.(n,a);f!==this.state.context&&this.#i({type:"pending",context:f,variables:n,isPaused:s})}const c=await this.#l.start();return await this.#n.config.onSuccess?.(c,n,this.state.context,this,a),await this.options.onSuccess?.(c,n,this.state.context,a),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(c,null,n,this.state.context,a),this.#i({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,n,this.state.context,this,a)}catch(f){Promise.reject(f)}try{await this.options.onError?.(c,n,this.state.context,a)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,a)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,c,n,this.state.context,a)}catch(f){Promise.reject(f)}throw this.#i({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#i(n){const l=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=l(this.state),ot.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function ty(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var uv=class extends Gl{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,l,a){const u=new rv({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(l),state:a});return this.add(u),u}add(n){this.#e.add(n);const l=bu(n);if(typeof l=="string"){const a=this.#t.get(l);a?a.push(n):this.#t.set(l,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const l=bu(n);if(typeof l=="string"){const a=this.#t.get(l);if(a)if(a.length>1){const u=a.indexOf(n);u!==-1&&a.splice(u,1)}else a[0]===n&&this.#t.delete(l)}}this.notify({type:"removed",mutation:n})}canRun(n){const l=bu(n);if(typeof l=="string"){const u=this.#t.get(l)?.find(s=>s.state.status==="pending");return!u||u===n}else return!0}runNext(n){const l=bu(n);return typeof l=="string"?this.#t.get(l)?.find(u=>u!==n&&u.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ot.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const l={exact:!0,...n};return this.getAll().find(a=>Bp(l,a))}findAll(n={}){return this.getAll().filter(l=>Bp(n,l))}notify(n){ot.batch(()=>{this.listeners.forEach(l=>{l(n)})})}resumePausedMutations(){const n=this.getAll().filter(l=>l.state.isPaused);return ot.batch(()=>Promise.all(n.map(l=>l.continue().catch(Et))))}};function bu(n){return n.options.scope?.id}var sv=class extends Gl{#e;#t=void 0;#n;#l;constructor(l,a){super(),this.#e=l,this.setOptions(a),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(l){const a=this.options;this.options=this.#e.defaultMutationOptions(l),Mu(this.options,a)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),a?.mutationKey&&this.options.mutationKey&&Fi(a.mutationKey)!==Fi(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(l){this.#i(),this.#r(l)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#r()}mutate(l,a){return this.#l=a,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(l)}#i(){const l=this.#n?.state??ty();this.#t={...l,isPending:l.status==="pending",isSuccess:l.status==="success",isError:l.status==="error",isIdle:l.status==="idle",mutate:this.mutate,reset:this.reset}}#r(l){ot.batch(()=>{if(this.#l&&this.hasListeners()){const a=this.#t.variables,u=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(l?.type==="success"){try{this.#l.onSuccess?.(l.data,a,u,s)}catch(c){Promise.reject(c)}try{this.#l.onSettled?.(l.data,null,a,u,s)}catch(c){Promise.reject(c)}}else if(l?.type==="error"){try{this.#l.onError?.(l.error,a,u,s)}catch(c){Promise.reject(c)}try{this.#l.onSettled?.(void 0,l.error,a,u,s)}catch(c){Promise.reject(c)}}}this.listeners.forEach(a=>{a(this.#t)})})}},ov=class extends Gl{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,l,a){const u=l.queryKey,s=l.queryHash??af(u,l);let c=this.get(s);return c||(c=new tv({client:n,queryKey:u,queryHash:s,options:n.defaultQueryOptions(l),state:a,defaultOptions:n.getQueryDefaults(u)}),this.add(c)),c}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const l=this.#e.get(n.queryHash);l&&(n.destroy(),l===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){ot.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const l={exact:!0,...n};return this.getAll().find(a=>Up(l,a))}findAll(n={}){const l=this.getAll();return Object.keys(n).length>0?l.filter(a=>Up(n,a)):l}notify(n){ot.batch(()=>{this.listeners.forEach(l=>{l(n)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},cv=class{#e;#t;#n;#l;#i;#r;#u;#a;constructor(n={}){this.#e=n.queryCache||new ov,this.#t=n.mutationCache||new uv,this.#n=n.defaultOptions||{},this.#l=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#u=sf.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Nu.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#u?.(),this.#u=void 0,this.#a?.(),this.#a=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 l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),a=this.#e.build(this,l),u=a.state.data;return u===void 0?this.fetchQuery(n):(n.revalidateIfStale&&a.isStaleByTime(vi(l.staleTime,a))&&this.prefetchQuery(l),Promise.resolve(u))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:l,state:a})=>{const u=a.data;return[l,u]})}setQueryData(n,l,a){const u=this.defaultQueryOptions({queryKey:n}),c=this.#e.get(u.queryHash)?.state.data,f=F1(l,c);if(f!==void 0)return this.#e.build(this,u).setData(f,{...a,manual:!0})}setQueriesData(n,l,a){return ot.batch(()=>this.#e.findAll(n).map(({queryKey:u})=>[u,this.setQueryData(u,l,a)]))}getQueryState(n){const l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state}removeQueries(n){const l=this.#e;ot.batch(()=>{l.findAll(n).forEach(a=>{l.remove(a)})})}resetQueries(n,l){const a=this.#e;return ot.batch(()=>(a.findAll(n).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...n},l)))}cancelQueries(n,l={}){const a={revert:!0,...l},u=ot.batch(()=>this.#e.findAll(n).map(s=>s.cancel(a)));return Promise.all(u).then(Et).catch(Et)}invalidateQueries(n,l={}){return ot.batch(()=>(this.#e.findAll(n).forEach(a=>{a.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},l)))}refetchQueries(n,l={}){const a={...l,cancelRefetch:l.cancelRefetch??!0},u=ot.batch(()=>this.#e.findAll(n).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let c=s.fetch(void 0,a);return a.throwOnError||(c=c.catch(Et)),s.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(u).then(Et)}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const a=this.#e.build(this,l);return a.isStaleByTime(vi(l.staleTime,a))?a.fetch(l):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Et).catch(Et)}fetchInfiniteQuery(n){return n.behavior=Yp(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Et).catch(Et)}ensureInfiniteQueryData(n){return n.behavior=Yp(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return Nu.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,l){this.#l.set(Fi(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...this.#l.values()],a={};return l.forEach(u=>{Ka(n,u.queryKey)&&Object.assign(a,u.defaultOptions)}),a}setMutationDefaults(n,l){this.#i.set(Fi(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...this.#i.values()],a={};return l.forEach(u=>{Ka(n,u.mutationKey)&&Object.assign(a,u.defaultOptions)}),a}defaultQueryOptions(n){if(n._defaulted)return n;const l={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=af(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===rf&&(l.enabled=!1),l}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()}},ny=Q.createContext(void 0),iy=n=>{const l=Q.useContext(ny);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},fv=({client:n,children:l})=>(Q.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),p.jsx(ny.Provider,{value:n,children:l})),ly=Q.createContext(!1),hv=()=>Q.useContext(ly);ly.Provider;function dv(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var mv=Q.createContext(dv()),pv=()=>Q.useContext(mv),gv=(n,l,a)=>{const u=a?.state.error&&typeof n.throwOnError=="function"?uf(n.throwOnError,[a.state.error,a]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||u)&&(l.isReset()||(n.retryOnMount=!1))},yv=n=>{Q.useEffect(()=>{n.clearReset()},[n])},xv=({result:n,errorResetBoundary:l,throwOnError:a,query:u,suspense:s})=>n.isError&&!l.isReset()&&!n.isFetching&&u&&(s&&n.data===void 0||uf(a,[n.error,u])),vv=n=>{if(n.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),u=n.staleTime;n.staleTime=typeof u=="function"?(...s)=>a(u(...s)):a(u),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},bv=(n,l)=>n.isLoading&&n.isFetching&&!l,Sv=(n,l)=>n?.suspense&&l.isPending,Xp=(n,l,a)=>l.fetchOptimistic(n).catch(()=>{a.clearReset()});function wv(n,l,a){const u=hv(),s=pv(),c=iy(),f=c.defaultQueryOptions(n);c.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const d=c.getQueryCache().get(f.queryHash);f._optimisticResults=u?"isRestoring":"optimistic",vv(f),gv(f,s,d),yv(s);const g=!c.getQueryCache().get(f.queryHash),[m]=Q.useState(()=>new l(c,f)),x=m.getOptimisticResult(f),y=!u&&n.subscribed!==!1;if(Q.useSyncExternalStore(Q.useCallback(b=>{const S=y?m.subscribe(ot.batchCalls(b)):Et;return m.updateResult(),S},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),Q.useEffect(()=>{m.setOptions(f)},[f,m]),Sv(f,x))throw Xp(f,m,s);if(xv({result:x,errorResetBoundary:s,throwOnError:f.throwOnError,query:d,suspense:f.suspense}))throw x.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(f,x),f.experimental_prefetchInRender&&!Gi&&bv(x,u)&&(g?Xp(f,m,s):d?.promise)?.catch(Et).finally(()=>{m.updateResult()}),f.notifyOnChangeProps?x:m.trackResult(x)}function ay(n,l){return wv(n,nv)}function Fn(n,l){const a=iy(),[u]=Q.useState(()=>new sv(a,n));Q.useEffect(()=>{u.setOptions(n)},[u,n]);const s=Q.useSyncExternalStore(Q.useCallback(f=>u.subscribe(ot.batchCalls(f)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c=Q.useCallback((f,d)=>{u.mutate(f,d).catch(Et)},[u]);if(s.error&&uf(u.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}const kv="modulepreload",Ev=function(n){return"/open/"+n},Kp={},ry=function(l,a,u){let s=Promise.resolve();if(a&&a.length>0){let g=function(m){return Promise.all(m.map(x=>Promise.resolve(x).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),d=f?.nonce||f?.getAttribute("nonce");s=g(a.map(m=>{if(m=Ev(m),m in Kp)return;Kp[m]=!0;const x=m.endsWith(".css"),y=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${y}`))return;const b=document.createElement("link");if(b.rel=x?"stylesheet":kv,x||(b.as="script"),b.crossOrigin="",b.href=m,d&&b.setAttribute("nonce",d),document.head.appendChild(b),x)return new Promise((S,k)=>{b.addEventListener("load",S),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(f){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=f,window.dispatchEvent(d),!d.defaultPrevented)throw f}return s.then(f=>{for(const d of f||[])d.status==="rejected"&&c(d.reason);return l().catch(c)})},Zp=n=>{let l;const a=new Set,u=(m,x)=>{const y=typeof m=="function"?m(l):m;if(!Object.is(y,l)){const b=l;l=x??(typeof y!="object"||y===null)?y:Object.assign({},l,y),a.forEach(S=>S(l,b))}},s=()=>l,d={setState:u,getState:s,getInitialState:()=>g,subscribe:m=>(a.add(m),()=>a.delete(m))},g=l=n(u,s,d);return d},Cv=(n=>n?Zp(n):Zp),jv=n=>n;function Tv(n,l=jv){const a=vu.useSyncExternalStore(n.subscribe,vu.useCallback(()=>l(n.getState()),[n,l]),vu.useCallback(()=>l(n.getInitialState()),[n,l]));return vu.useDebugValue(a),a}const Jp=n=>{const l=Cv(n),a=u=>Tv(l,u);return Object.assign(a,l),a},Bu=(n=>n?Jp(n):Jp);function cf(n,l){let a;try{a=n()}catch{return}return{getItem:s=>{var c;const f=g=>g===null?null:JSON.parse(g,void 0),d=(c=a.getItem(s))!=null?c:null;return d instanceof Promise?d.then(f):f(d)},setItem:(s,c)=>a.setItem(s,JSON.stringify(c,void 0)),removeItem:s=>a.removeItem(s)}}const Fc=n=>l=>{try{const a=n(l);return a instanceof Promise?a:{then(u){return Fc(u)(a)},catch(u){return this}}}catch(a){return{then(u){return this},catch(u){return Fc(u)(a)}}}},Av=(n,l)=>(a,u,s)=>{let c={storage:cf(()=>window.localStorage),partialize:T=>T,version:0,merge:(T,C)=>({...C,...T}),...l},f=!1,d=0;const g=new Set,m=new Set;let x=c.storage;if(!x)return n((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${c.name}', the given storage is currently unavailable.`),a(...T)},u,s);const y=()=>{const T=c.partialize({...u()});return x.setItem(c.name,{state:T,version:c.version})},b=s.setState;s.setState=(T,C)=>(b(T,C),y());const S=n((...T)=>(a(...T),y()),u,s);s.getInitialState=()=>S;let k;const _=()=>{var T,C;if(!x)return;const H=++d;f=!1,g.forEach(X=>{var J;return X((J=u())!=null?J:S)});const O=((C=c.onRehydrateStorage)==null?void 0:C.call(c,(T=u())!=null?T:S))||void 0;return Fc(x.getItem.bind(x))(c.name).then(X=>{if(X)if(typeof X.version=="number"&&X.version!==c.version){if(c.migrate){const J=c.migrate(X.state,X.version);return J instanceof Promise?J.then(R=>[!0,R]):[!0,J]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,X.state];return[!1,void 0]}).then(X=>{var J;if(H!==d)return;const[R,$]=X;if(k=c.merge($,(J=u())!=null?J:S),a(k,!0),R)return y()}).then(()=>{H===d&&(O?.(k,void 0),k=u(),f=!0,m.forEach(X=>X(k)))}).catch(X=>{H===d&&O?.(void 0,X)})};return s.persist={setOptions:T=>{c={...c,...T},T.storage&&(x=T.storage)},clearStorage:()=>{x?.removeItem(c.name)},getOptions:()=>c,rehydrate:()=>_(),hasHydrated:()=>f,onHydrate:T=>(g.add(T),()=>{g.delete(T)}),onFinishHydration:T=>(m.add(T),()=>{m.delete(T)})},c.skipHydration||_(),k||S},uy=Av;function sy(){return{getItem:n=>{try{return localStorage.getItem(n)}catch{return null}},setItem:(n,l)=>{try{localStorage.setItem(n,l)}catch(a){if(!_v(a)){console.warn("[storage] setItem failed",n,a);return}const u=Mv(l);if(u)try{localStorage.setItem(n,u);return}catch{}try{localStorage.removeItem(n)}catch{}console.warn(`[storage] quota exceeded for ${n}; cleared persisted state`)}},removeItem:n=>{try{localStorage.removeItem(n)}catch{}}}}function _v(n){return n instanceof DOMException?n.name==="QuotaExceededError"||n.code===22||n.code===1014:!1}function Mv(n){try{const l=JSON.parse(n);if(!l?.state)return null;const a=l.state;let u=!1;for(const s of["conversations","workflows","messages"]){const c=a[s];Array.isArray(c)&&c.length>5&&(a[s]=c.slice(0,Math.max(5,Math.floor(c.length/2))),u=!0)}return u?JSON.stringify(l):null}catch{return null}}const un=Bu()(uy(n=>({activeTab:"chat",setActiveTab:l=>n({activeTab:l}),sidebarOpen:!0,setSidebarOpen:l=>n({sidebarOpen:l}),toggleSidebar:()=>n(l=>({sidebarOpen:!l.sidebarOpen})),selectedModels:{},setSelectedModel:(l,a)=>n(u=>({selectedModels:{...u.selectedModels,[l]:a}})),playgroundAgentModel:"",setPlaygroundAgentModel:l=>n({playgroundAgentModel:l})}),{name:"venice-settings",version:1,storage:cf(()=>sy())}));function Ee(...n){return n.filter(Boolean).join(" ")}function Nv(){return crypto.randomUUID()}const Ct=Bu()(uy((n,l)=>({conversations:[],activeConversationId:null,isStreaming:!1,veniceParams:{include_venice_system_prompt:!1,enable_web_search:"off"},systemPrompt:"",temperature:.7,topP:1,maxTokens:4096,createConversation:a=>{const u=Nv(),s={id:u,title:"New Chat",messages:[],model:a,createdAt:Date.now()};return n(c=>({conversations:[s,...c.conversations],activeConversationId:u})),u},setActiveConversation:a=>n({activeConversationId:a}),deleteConversation:a=>n(u=>({conversations:u.conversations.filter(s=>s.id!==a),activeConversationId:u.activeConversationId===a?null:u.activeConversationId})),addMessage:(a,u)=>n(s=>({conversations:s.conversations.map(c=>{if(c.id!==a)return c;const f={...c,messages:[...c.messages,u]};return u.role==="user"&&c.messages.length===0&&typeof u.content=="string"&&(f.title=u.content.slice(0,50)||"New Chat"),f})})),appendToLastAssistant:(a,u)=>n(s=>({conversations:s.conversations.map(c=>{if(c.id!==a)return c;const f=[...c.messages],d=f[f.length-1];return d?.role==="assistant"&&typeof d.content=="string"&&(f[f.length-1]={...d,content:d.content+u}),{...c,messages:f}})})),appendReasoningToLastAssistant:(a,u)=>n(s=>({conversations:s.conversations.map(c=>{if(c.id!==a)return c;const f=[...c.messages],d=f[f.length-1];return d?.role==="assistant"&&(f[f.length-1]={...d,reasoning_content:(d.reasoning_content||"")+u}),{...c,messages:f}})})),deleteMessage:(a,u)=>n(s=>({conversations:s.conversations.map(c=>{if(c.id!==a)return c;const f=c.messages.filter((d,g)=>g!==u);return{...c,messages:f}})})),setStreaming:a=>n({isStreaming:a}),setVeniceParams:a=>n(u=>({veniceParams:{...u.veniceParams,...a}})),setSystemPrompt:a=>n({systemPrompt:a}),setTemperature:a=>n({temperature:a}),setTopP:a=>n({topP:a}),setMaxTokens:a=>n({maxTokens:a}),getActiveConversation:()=>{const{conversations:a,activeConversationId:u}=l();return a.find(s=>s.id===u)}}),{name:"venice-chat",version:2,storage:cf(()=>sy()),migrate:(n,l)=>{if(!n||typeof n!="object")return n;const a=n;return Array.isArray(a.conversations)&&(a.conversations=a.conversations.slice(0,50)),(!a.veniceParams||typeof a.veniceParams!="object")&&(a.veniceParams={include_venice_system_prompt:!1,enable_web_search:"off"}),l<2&&delete a.isStreaming,a},partialize:n=>({conversations:n.conversations.slice(0,50),activeConversationId:n.activeConversationId,veniceParams:n.veniceParams,systemPrompt:n.systemPrompt,temperature:n.temperature,topP:n.topP,maxTokens:n.maxTokens})})),xi="venice-auth",Tu="venice-auth-enc",Ov=25e4,dc=n=>btoa(String.fromCharCode(...new Uint8Array(n))),mc=n=>{const l=atob(n),a=new Uint8Array(new ArrayBuffer(l.length));for(let u=0;u{try{const n=sessionStorage.getItem(xi);if(n)return n;const l=localStorage.getItem(xi);if(l)try{const u=JSON.parse(l)?.state?.apiKey??null;return localStorage.removeItem(xi),u&&sessionStorage.setItem(xi,u),u}catch{localStorage.removeItem(xi)}return null}catch{return null}})(),Lv=(()=>{try{return localStorage.getItem(Tu)!==null}catch{return!1}})(),pn=Bu()(n=>({apiKey:Rv,hasEncrypted:Lv,setApiKey:async(l,a)=>{if(sessionStorage.setItem(xi,l),a){const u=await zv(l,a.passphrase);localStorage.setItem(Tu,JSON.stringify(u)),n({apiKey:l,hasEncrypted:!0})}else n({apiKey:l})},unlock:async l=>{const a=localStorage.getItem(Tu);if(!a)return!1;try{const u=await Dv(JSON.parse(a),l);return sessionStorage.setItem(xi,u),n({apiKey:u}),!0}catch{return!1}},clearApiKey:()=>{sessionStorage.removeItem(xi),localStorage.removeItem(Tu),n({apiKey:null,hasEncrypted:!1})}}));let Uv=0;const ql=Bu(n=>({toasts:[],push:({duration:l=4500,...a})=>{const u=++Uv;return n(s=>({toasts:[...s.toasts,{...a,id:u,duration:l}]})),l>0&&setTimeout(()=>{n(s=>({toasts:s.toasts.filter(c=>c.id!==u)}))},l),u},dismiss:l=>n(a=>({toasts:a.toasts.filter(u=>u.id!==l)}))})),Vi={info:(n,l)=>ql.getState().push({variant:"info",title:n,description:l}),success:(n,l)=>ql.getState().push({variant:"success",title:n,description:l}),error:(n,l,a)=>ql.getState().push({variant:"error",title:n,description:l,action:a,duration:6500}),fromError:(n,l="Something went wrong")=>{const a=n instanceof Error?n.message:typeof n=="string"?n:void 0;return ql.getState().push({variant:"error",title:l,description:a,duration:6500})}};function ff({className:n,size:l=24}){return p.jsx("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Ee("shrink-0",n),style:{width:l,height:l},children:p.jsxs("g",{fill:"white",children:[p.jsx("rect",{x:"6.2",y:"7.5",width:"1.6",height:"18",rx:"0.8",transform:"rotate(-42 6.2 7.5)"}),p.jsx("rect",{x:"24.2",y:"6.3",width:"1.6",height:"18",rx:"0.8",transform:"rotate(42 24.2 6.3)"}),p.jsx("polygon",{points:"7.2,8.8 3.8,7.2 4.5,5.5 8.5,7.2"}),p.jsx("polygon",{points:"24.8,8.8 28.2,7.2 27.5,5.5 23.5,7.2"}),p.jsx("rect",{x:"14.3",y:"14.3",width:"3.4",height:"3.4",rx:"0.4",transform:"rotate(45 16 16)"}),p.jsx("circle",{cx:"9.2",cy:"24.5",r:"4"}),p.jsx("circle",{cx:"9.2",cy:"24.5",r:"1.7",fill:"#0a0a0a"}),p.jsx("circle",{cx:"9.2",cy:"22.9",r:"0.9",fill:"#0a0a0a"}),p.jsx("circle",{cx:"9.2",cy:"26.1",r:"0.9",fill:"#0a0a0a"}),p.jsx("circle",{cx:"7.6",cy:"24.5",r:"0.9",fill:"#0a0a0a"}),p.jsx("circle",{cx:"10.8",cy:"24.5",r:"0.9",fill:"#0a0a0a"}),p.jsx("circle",{cx:"22.8",cy:"24.5",r:"4"}),p.jsx("circle",{cx:"22.8",cy:"24.5",r:"1.7",fill:"#0a0a0a"}),p.jsx("circle",{cx:"22.8",cy:"22.9",r:"0.9",fill:"#0a0a0a"}),p.jsx("circle",{cx:"22.8",cy:"26.1",r:"0.9",fill:"#0a0a0a"}),p.jsx("circle",{cx:"21.2",cy:"24.5",r:"0.9",fill:"#0a0a0a"}),p.jsx("circle",{cx:"24.4",cy:"24.5",r:"0.9",fill:"#0a0a0a"}),p.jsx("path",{d:"M16 5.5L12.5 8.5V12.5L16 10.5L19.5 12.5V8.5Z"})]})})}function Bv({className:n}){return p.jsx("span",{className:Ee("font-semibold tracking-[-0.02em] text-white/90",n),children:"OpenVenice"})}function Hv(){return p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})}function qv(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),p.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),p.jsx("polyline",{points:"21 15 16 10 5 21"})]})}function Qv(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3z"}),p.jsx("path",{d:"M19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8"})]})}function Vv(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("polygon",{points:"23 7 16 12 23 17 23 7"}),p.jsx("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2"})]})}function Gv(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"5.5",cy:"17.5",r:"2.5"}),p.jsx("circle",{cx:"17.5",cy:"15.5",r:"2.5"}),p.jsx("path",{d:"M8 17.5V5l12-2v12.5"})]})}function Fv(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("polyline",{points:"16 18 22 12 16 6"}),p.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function Yv(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"5",r:"2"}),p.jsx("circle",{cx:"6",cy:"19",r:"2"}),p.jsx("circle",{cx:"18",cy:"19",r:"2"}),p.jsx("path",{d:"M12 7v4M12 11l-6 6M12 11l6 6"})]})}function Iv(){return p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),p.jsx("path",{d:"M2 17l10 5 10-5M2 12l10 5 10-5"})]})}const Xv=[{label:"Conversation",items:[{id:"chat",label:"Chat",Icon:Hv}]},{label:"Generate",items:[{id:"image",label:"Image",Icon:qv},{id:"audio",label:"Audio",Icon:Qv},{id:"music",label:"Music",Icon:Gv},{id:"video",label:"Video",Icon:Vv},{id:"embeddings",label:"Embed",Icon:Fv}]},{label:"Build",items:[{id:"workflows",label:"Workflows",Icon:Yv},{id:"playground",label:"Playground",Icon:Iv}]}];function Kv({mobileOpen:n,onMobileClose:l}){const a=un(C=>C.activeTab),u=un(C=>C.setActiveTab),s=un(C=>C.sidebarOpen),c=Ct(C=>C.conversations),f=Ct(C=>C.activeConversationId),d=Ct(C=>C.setActiveConversation),g=Ct(C=>C.createConversation),m=Ct(C=>C.deleteConversation),x=un(C=>C.selectedModels.chat),[y,b]=Q.useState(""),S=Q.useMemo(()=>{const C=y.trim().toLowerCase();return C?c.filter(H=>H.title.toLowerCase().includes(C)):c},[c,y]),k=C=>{m(C.id),Vi.error("Conversation deleted",C.title||"Untitled",{label:"Undo",onClick:()=>Ct.setState(H=>({conversations:[C,...H.conversations]}))})},_=C=>{const H=Jv(C),O=new Blob([H],{type:"text/markdown"}),X=URL.createObjectURL(O),J=document.createElement("a");J.href=X,J.download=`${(C.title||"conversation").replace(/[^a-z0-9-_]+/gi,"-").toLowerCase()}.md`,document.body.appendChild(J),J.click(),J.remove(),setTimeout(()=>URL.revokeObjectURL(X),1e3)},T=s||n;return p.jsxs("aside",{"aria-label":"Primary navigation",className:Ee("flex flex-col h-full bg-[#0d0d11] border-r border-white/[0.05] transition-all duration-200 ease-out","fixed top-0 left-0 z-40 w-72 h-[100dvh] md:static md:h-full md:w-auto",n?"translate-x-0":"-translate-x-full md:translate-x-0",s?"md:w-64":"md:w-[60px]"),children:[p.jsxs("div",{className:Ee("flex items-center gap-2.5 h-14 shrink-0 border-b border-white/[0.04]",T?"px-4":"md:px-3 md:justify-center px-4"),children:[p.jsx(ff,{size:20}),T&&p.jsx(Bv,{className:"text-[15px] tracking-tight"}),p.jsx("button",{onClick:l,"aria-label":"Close menu",className:"md:hidden ml-auto p-1 text-white/45 hover:text-white/80 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:p.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),p.jsx("nav",{"aria-label":"Sections",className:"flex flex-col gap-3 py-3 overflow-y-auto",children:Xv.map(C=>p.jsxs("div",{className:Ee(T?"px-2":"md:px-1.5 px-2"),children:[T&&p.jsx("div",{className:"px-2 pb-1.5 text-[10.5px] uppercase tracking-[0.1em] text-white/30 font-semibold",children:C.label}),p.jsx("div",{className:"flex flex-col gap-px",children:C.items.map(({id:H,label:O,Icon:X})=>{const J=a===H;return p.jsxs("button",{onClick:()=>{u(H),l?.()},"aria-current":J?"page":void 0,title:T?void 0:O,className:Ee("relative flex items-center gap-2.5 rounded-lg text-[14px] transition-all duration-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] focus-visible:outline-offset-2",T?"px-2.5 py-2":"md:px-0 md:py-2 md:justify-center px-2.5 py-2",J?"bg-white/[0.06] text-white":"text-white/55 hover:text-white hover:bg-white/[0.03]"),children:[J&&p.jsx("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-4 rounded-full bg-[var(--color-accent)]"}),p.jsx(X,{}),T&&p.jsx("span",{className:"font-medium",children:O})]},H)})})]},C.label))}),T&&a==="chat"&&p.jsxs("div",{className:"flex flex-col flex-1 min-h-0 mt-1 border-t border-white/[0.04]",children:[p.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-1.5",children:[p.jsx("span",{className:"text-[10.5px] font-semibold text-white/40 uppercase tracking-[0.1em]",children:"History"}),p.jsx("button",{onClick:()=>g(x||"qwen3-next-80b"),"aria-label":"New chat",className:"text-white/55 hover:text-white transition-colors p-1 rounded-md hover:bg-white/[0.05] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",title:"New chat (⌘N)",children:p.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[p.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),p.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),c.length>5&&p.jsx("div",{className:"px-3 pb-2",children:p.jsx("input",{value:y,onChange:C=>b(C.target.value),placeholder:"Search…","aria-label":"Search conversations",className:"w-full bg-white/[0.04] border border-white/[0.06] rounded-md px-2.5 py-1 text-[13px] text-white/85 outline-none focus:border-white/[0.2] placeholder:text-white/30"})}),p.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-3",role:"list",children:S.length===0?p.jsx("div",{className:"px-2 py-6 text-[13px] text-white/30 text-center",children:y?"No matches":"No conversations yet"}):S.map(C=>p.jsx(Zv,{conv:C,isActive:C.id===f,onSelect:()=>d(C.id),onDelete:()=>k(C),onExport:()=>_(C)},C.id))})]}),!T&&p.jsx("div",{className:"hidden md:block flex-1"}),T&&p.jsx("div",{className:"px-3 py-2.5 border-t border-white/[0.04]",children:p.jsxs("div",{className:"text-[11px] text-white/35 space-y-0.5",children:[p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{children:"New chat"}),p.jsx("kbd",{className:"font-mono text-white/50",children:"⌘N"})]}),p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{children:"Switch tab"}),p.jsx("kbd",{className:"font-mono text-white/50",children:"⌘1-8"})]})]})})]})}function Zv({conv:n,isActive:l,onSelect:a,onDelete:u,onExport:s}){const[c,f]=Q.useState(!1);return p.jsxs("div",{role:"listitem",className:Ee("group relative flex items-center gap-1 px-2.5 py-1.5 rounded-md text-[13px] cursor-pointer transition-colors",l?"bg-white/[0.07] text-white":"text-white/65 hover:text-white hover:bg-white/[0.03]"),onClick:a,children:[p.jsx("span",{className:"truncate flex-1",children:n.title||"Untitled"}),p.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity",children:[p.jsx("button",{onClick:d=>{d.stopPropagation(),s()},"aria-label":`Export ${n.title}`,title:"Export as Markdown",className:"text-white/45 hover:text-white p-1 rounded focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--color-accent)]",children:p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"})})}),c?p.jsx("button",{onClick:d=>{d.stopPropagation(),u(),f(!1)},"aria-label":"Confirm delete",className:"text-rose-300 hover:text-rose-200 px-1.5 text-[11px] font-semibold rounded",children:"Delete?"}):p.jsx("button",{onClick:d=>{d.stopPropagation(),f(!0),setTimeout(()=>f(!1),2500)},"aria-label":`Delete ${n.title}`,title:"Delete",className:"text-white/45 hover:text-rose-300 p-1 rounded focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--color-accent)]",children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}function Jv(n){const l=[`# ${n.title}`,"",`_Model: ${n.model} · Created: ${new Date(n.createdAt).toISOString()}_`,""];for(const a of n.messages){l.push(`## ${a.role==="user"?"You":a.role==="assistant"?"Assistant":"System"}`);const u=typeof a.content=="string"?a.content:a.content.map(s=>s.type==="text"?s.text:s.type==="image_url"?`![image](${s.image_url?.url??""})`:"").join(` +`);l.push(u),l.push("")}return l.join(` +`)}const Pv="https://api.venice.ai/api/v1",Wv=new Set([408,425,429,500,502,503,504]),$v=2;class Ou extends Error{status;code;suggestedPrompt;constructor(l,a,u,s){super(l),this.name="VeniceAPIError",this.status=a,this.code=u,this.suggestedPrompt=s}}function eb(){const n=pn.getState().apiKey;if(!n)throw new Ou('API key not set. Click "API Key" in the header to connect.',401);return n}const Pp=n=>new Promise(l=>setTimeout(l,n));function Wp(n,l){if(l){const u=Number(l);if(Number.isFinite(u)&&u>0)return Math.min(u*1e3,3e4)}const a=500*2**n;return a+Math.random()*a*.25}async function tb(n){let l=`HTTP ${n.status}`,a,u;try{const s=await n.json();l=s.error?.message??l,a=s.error?.code,u=s.error?.suggested_prompt}catch{}return new Ou(l,n.status,a,u)}async function hf(n,l){const{stream:a,noAuth:u,retries:s=$v,...c}=l,f=new Headers(c.headers);u||f.set("Authorization",`Bearer ${eb()}`),c.body&&typeof c.body=="string"&&f.set("Content-Type","application/json");let d;for(let g=0;g<=s;g++)try{const m=await fetch(`${Pv}${n}`,{...c,headers:f});if(m.ok)return m;if(!Wv.has(m.status)||g===s)throw await tb(m);try{await m.arrayBuffer()}catch{}await Pp(Wp(g,m.headers.get("Retry-After")));continue}catch(m){if(d=m,m instanceof Ou||m instanceof DOMException&&m.name==="AbortError")throw m;if(g===s)break;await Pp(Wp(g))}throw d instanceof Error?d:new Ou("Network error",0)}async function Gn(n,l={}){const a=await hf(n,l);return l.stream?a.body:a.json()}async function nb(n,l,a={}){return(await hf(n,{method:"POST",body:l,signal:a.signal})).json()}async function Hu(n,l,a={}){return(await hf(n,{method:"POST",body:JSON.stringify(l),signal:a.signal})).blob()}function Ki(n){return ay({queryKey:["models",n],queryFn:()=>Gn(`/models${n?`?type=${n}`:""}`,{noAuth:!0}),staleTime:300*1e3,select:l=>l.data.filter(a=>!a.model_spec?.offline).sort((a,u)=>a.id.localeCompare(u.id))})}function ib(){const n=Ki("video"),l=[];if(n.data){const a=new Map;for(const u of n.data){const s=u.model_spec?.constraints;if(!s)continue;const c=u.model_spec?.name||u.id,f=c.toLowerCase();a.has(f)||a.set(f,{name:c,sets:u.model_spec?.model_sets||[]});const d=a.get(f);s.model_type==="text-to-video"?d.textModel=u:s.model_type==="image-to-video"&&(d.imageModel=u);const g=u.model_spec?.model_sets||[];for(const m of g)d.sets.includes(m)||d.sets.push(m)}l.push(...a.values())}return{...n,groups:l}}function bi({value:n,onChange:l,options:a,placeholder:u="Select...",searchable:s=!1,className:c}){const[f,d]=Q.useState(!1),[g,m]=Q.useState(""),x=Q.useRef(null),y=Q.useRef(null);Q.useEffect(()=>{const k=_=>{x.current&&!x.current.contains(_.target)&&d(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]),Q.useEffect(()=>{f&&s&&y.current?.focus()},[f,s]);const b=Q.useMemo(()=>g?a.filter(k=>k.label.toLowerCase().includes(g.toLowerCase())):a,[a,g]),S=a.find(k=>k.value===n)?.label||u;return p.jsxs("div",{ref:x,className:Ee("relative",c),children:[p.jsxs("button",{onClick:()=>{const k=!f;d(k),k||m("")},className:Ee("w-full flex items-center justify-between gap-2 bg-transparent border border-white/[0.06] rounded-md px-2.5 py-1.5 text-[15px] hover:border-white/[0.12] transition-colors outline-none",f&&"border-white/[0.15]"),children:[p.jsx("span",{className:Ee("truncate text-[15px]",n?"text-white/70":"text-white/20"),children:S}),p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",className:Ee("shrink-0 text-white/20 transition-transform duration-150",f&&"rotate-180"),children:p.jsx("path",{d:"M2.5 3.75L5 6.25L7.5 3.75"})})]}),f&&p.jsxs("div",{className:"absolute z-50 w-full mt-0.5 bg-[#0e0e0e] border border-white/[0.08] rounded-lg shadow-2xl shadow-black/50 animate-scale-in overflow-hidden",children:[s&&p.jsx("div",{className:"p-1 border-b border-white/[0.04]",children:p.jsx("input",{ref:y,value:g,onChange:k=>m(k.target.value),placeholder:"Search...",className:"w-full bg-white/[0.03] rounded px-2 py-1 text-[15px] text-white/70 outline-none placeholder:text-white/12"})}),p.jsx("div",{className:"max-h-60 overflow-y-auto p-0.5",children:b.length===0?p.jsx("div",{className:"px-2.5 py-2.5 text-[14px] text-white/15 text-center",children:"No results"}):b.map(k=>p.jsx("button",{onClick:()=>{l(k.value),d(!1)},className:Ee("w-full text-left px-3 py-[6px] text-[15px] rounded transition-colors",k.value===n?"bg-white/[0.07] text-white/80":"text-white/40 hover:bg-white/[0.04] hover:text-white/70"),children:k.label},k.value))})]})]})}function lb({className:n}){return p.jsxs("svg",{className:Ee("animate-spin h-3.5 w-3.5",n),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[p.jsx("circle",{className:"opacity-20",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p.jsx("path",{className:"opacity-80",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function Ce({children:n,htmlFor:l,hint:a}){return p.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[p.jsx("label",{htmlFor:l,className:"block text-[11.5px] font-semibold text-white/55 uppercase tracking-[0.08em]",children:n}),a&&p.jsx("span",{className:"text-[11px] text-white/35",children:a})]})}function wn({value:n,onChange:l,placeholder:a,rows:u=3,ariaLabel:s,maxLength:c,autoFocus:f}){return p.jsx("textarea",{value:n,onChange:d=>l(d.target.value),placeholder:a,rows:u,"aria-label":s??a,maxLength:c,autoFocus:f,className:"w-full bg-[#0d0d11] border border-white/[0.08] rounded-lg px-3 py-2.5 text-[15px] text-white/90 outline-none focus:border-white/[0.22] transition-colors resize-none placeholder:text-white/25 leading-relaxed"})}function Yi({onClick:n,disabled:l,loading:a,children:u,ariaLabel:s,size:c="md"}){const f=c==="sm"?"py-1.5 text-[13px]":c==="lg"?"py-2.5 text-[15px]":"py-2 text-[14px]";return p.jsx("button",{type:"button",onClick:n,disabled:l||a,"aria-label":s,"aria-busy":a||void 0,className:Ee("w-full rounded-lg font-medium transition-all duration-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] focus-visible:outline-offset-2",f,!l&&!a?"bg-white text-black hover:bg-white/90 active:scale-[0.99] shadow-sm":"bg-white/[0.06] text-white/30 cursor-not-allowed"),children:a?p.jsxs("span",{className:"flex items-center justify-center gap-2",children:[p.jsx(lb,{className:"text-white/45"})," Working…"]}):u})}function Au({options:n,value:l,onChange:a,ariaLabel:u}){return p.jsx("div",{role:"radiogroup","aria-label":u,className:"flex flex-wrap gap-1",children:n.map(s=>p.jsx("button",{type:"button",role:"radio","aria-checked":s.value===l,onClick:()=>a(s.value),className:Ee("text-[13px] font-medium px-2.5 py-1 rounded-md border transition-all duration-100 focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--color-accent)]",s.value===l?"border-white/15 bg-white/[0.08] text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.05)]":"border-white/[0.06] text-white/55 hover:text-white/85 hover:border-white/[0.14] hover:bg-white/[0.02]"),children:s.label},s.value))})}function Ii({children:n}){return p.jsxs("div",{role:"alert",className:"flex items-start gap-2 text-[13px] text-red-300/95 bg-red-500/[0.06] border border-red-500/20 rounded-lg px-3 py-2",children:[p.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"shrink-0 mt-px",children:[p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),p.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),p.jsx("span",{className:"leading-relaxed",children:n})]})}function zu({children:n}){return p.jsx("div",{className:"flex items-center justify-center flex-1 text-white/30 text-[14px]",children:n})}function ab({items:n,onPick:l,title:a="Try one of these"}){return p.jsxs("div",{className:"w-full max-w-md flex flex-col gap-2.5",children:[p.jsx("div",{className:"text-[11px] uppercase tracking-[0.08em] text-white/40 font-semibold",children:a}),p.jsx("div",{className:"flex flex-col gap-2",children:n.map(u=>p.jsx("button",{type:"button",onClick:()=>l(u),className:"group text-left px-3.5 py-3 rounded-xl border border-white/[0.06] bg-white/[0.015] hover:border-white/[0.16] hover:bg-white/[0.04] transition-all text-[13.5px] text-white/70 hover:text-white/90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] focus-visible:outline-offset-2",children:p.jsxs("span",{className:"flex items-start gap-2",children:[p.jsx("span",{className:"text-white/25 group-hover:text-[var(--color-accent)] transition-colors mt-px",children:"→"}),p.jsx("span",{className:"leading-relaxed",children:u})]})},u))})]})}function rb({tone:n="slate",pulsing:l}){const a=n==="emerald"?"bg-emerald-400":n==="amber"?"bg-amber-400":n==="rose"?"bg-rose-400":n==="teal"?"bg-[var(--color-accent)]":"bg-white/30";return p.jsx("span",{className:Ee("inline-block w-1.5 h-1.5 rounded-full",a,l&&"animate-pulse-dot")})}const ub={chat:"text",image:"image",audio:"tts",music:"music",video:"video",embeddings:"embedding"},sb={chat:"Chat",image:"Image",audio:"Audio",music:"Music",video:"Video",embeddings:"Embeddings",workflows:"Workflows",playground:"Playground"},ob={chat:"Conversational AI",image:"Generate images from text",audio:"Text-to-speech and transcription",music:"Generate music and sound",video:"Generate video clips",embeddings:"Vector representations of text",workflows:"Chain models visually",playground:"Build workflows by chatting"},cb=new Set(["video","workflows","playground"]);function fb({onOpenApiKey:n,onOpenMobileSidebar:l}){const{activeTab:a,selectedModels:u,setSelectedModel:s,toggleSidebar:c}=un(),f=pn(b=>b.apiKey),d=cb.has(a),g=ub[a]||"text",{data:m}=Ki(d?void 0:g),x=d?"":u[a]||m?.[0]?.id||"",y=d?[]:m?.map(b=>({value:b.id,label:b.model_spec?.name||b.id}))??[];return p.jsxs("header",{className:"flex items-center gap-3 h-14 px-3 border-b border-white/[0.05] bg-[#0a0a0c] shrink-0",children:[p.jsx("button",{onClick:()=>l?.(),"aria-label":"Open menu",className:"md:hidden text-white/55 hover:text-white transition-colors p-1.5 -ml-1 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:p.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",children:[p.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),p.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),p.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]})}),p.jsx("button",{onClick:c,"aria-label":"Toggle sidebar",className:"hidden md:block text-white/55 hover:text-white transition-colors p-1.5 -ml-1 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:p.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",children:p.jsx("path",{d:"M3 4h18M3 12h12M3 20h18"})})}),p.jsxs("div",{className:"flex flex-col min-w-0",children:[p.jsx("span",{className:"text-[14px] font-semibold text-white/95 leading-none",children:sb[a]}),p.jsx("span",{className:"text-[11px] text-white/40 mt-0.5 leading-none truncate hidden sm:block",children:ob[a]})]}),!d&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"w-px h-5 bg-white/[0.07] hidden sm:block","aria-hidden":!0}),p.jsx(bi,{value:x,onChange:b=>s(a,b),options:y,searchable:!0,placeholder:"Select model…",className:"w-44 sm:w-64"})]}),p.jsx("div",{className:"flex-1"}),p.jsxs("button",{onClick:n,"aria-label":f?"API key connected, manage":"Connect API key",className:"flex items-center gap-2 text-[13px] px-2.5 py-1.5 rounded-md border border-white/[0.08] hover:border-white/[0.2] transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] focus-visible:outline-offset-2",children:[p.jsx(rb,{tone:f?"teal":"slate",pulsing:!f}),p.jsx("span",{className:f?"text-white/85 font-medium":"text-white/65",children:f?"Connected":"Connect API key"})]})]})}const qa=8;function hb({open:n,onClose:l}){const{apiKey:a,hasEncrypted:u,setApiKey:s,unlock:c,clearApiKey:f}=pn(),[d,g]=Q.useState(""),[m,x]=Q.useState(""),[y,b]=Q.useState(!1),[S,k]=Q.useState(!1),[_,T]=Q.useState(null),[C,H]=Q.useState(!1);if(Q.useEffect(()=>{if(!n)return;const ee=ie=>{ie.key==="Escape"&&l()};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[n,l]),!n)return null;const O=u&&!a&&!C,X=y&&m.length>0&&m.length{if(d.trim()){if(y){if(!m){T("Passphrase required to remember this key.");return}if(m.length{if(!m)return;k(!0),T(null);const ee=await c(m);k(!1),ee?(Vi.success("Key unlocked"),l()):T("Wrong passphrase. Try again or use a different key.")},$="apikey-dialog-title";return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":$,children:[p.jsx("button",{"aria-label":"Close dialog",className:"absolute inset-0 bg-black/75 backdrop-blur-sm",onClick:l}),p.jsxs("div",{className:"relative bg-[#0e0e0e] border border-white/[0.1] rounded-xl p-6 w-full max-w-sm mx-4 animate-scale-in shadow-2xl shadow-black/60",onClick:ee=>ee.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[p.jsx(ff,{size:26}),p.jsxs("div",{children:[p.jsx("h2",{id:$,className:"text-[17px] font-semibold text-white/90",children:O?"Unlock saved key":"Connect to Venice"}),p.jsx("p",{className:"text-[13px] text-white/50",children:O?"Enter your passphrase to decrypt your saved key.":"Stored in this tab only by default. Encrypt to keep across sessions."})]})]}),O?p.jsxs("div",{children:[p.jsx("label",{htmlFor:"apikey-passphrase",className:"sr-only",children:"Passphrase"}),p.jsx("input",{id:"apikey-passphrase",type:"password",value:m,onChange:ee=>x(ee.target.value),placeholder:"Passphrase",className:"w-full bg-[#0a0a0a] border border-white/[0.1] rounded-lg px-3.5 py-2.5 text-[16px] text-white outline-none focus:border-white/[0.25] transition-colors placeholder:text-white/25",autoFocus:!0,autoComplete:"current-password",onKeyDown:ee=>{ee.key==="Enter"&&R()}})]}):p.jsxs(p.Fragment,{children:[p.jsx("label",{htmlFor:"apikey-input",className:"sr-only",children:"Venice API key"}),p.jsx("input",{id:"apikey-input",type:"password",value:d,onChange:ee=>g(ee.target.value),placeholder:"sk-...",className:"w-full bg-[#0a0a0a] border border-white/[0.1] rounded-lg px-3.5 py-2.5 text-[16px] text-white outline-none focus:border-white/[0.25] transition-colors font-mono placeholder:text-white/25",autoFocus:!0,autoComplete:"off",onKeyDown:ee=>{ee.key==="Enter"&&!y&&J()}}),p.jsxs("p",{className:"text-[13px] text-white/40 mt-2",children:["Get a key at"," ",p.jsx("a",{href:"https://venice.ai/settings/api",target:"_blank",rel:"noopener noreferrer",className:"text-white/65 hover:text-white underline underline-offset-2",children:"venice.ai/settings/api"}),"."]}),p.jsxs("label",{className:"flex items-center gap-2 mt-4 text-[14px] text-white/65 cursor-pointer select-none",children:[p.jsx("input",{type:"checkbox",checked:y,onChange:ee=>b(ee.target.checked),className:"accent-white"}),"Remember across sessions (encrypted with passphrase)"]}),y&&p.jsxs("div",{className:"mt-2",children:[p.jsx("label",{htmlFor:"apikey-new-passphrase",className:"sr-only",children:"Encryption passphrase"}),p.jsx("input",{id:"apikey-new-passphrase",type:"password",value:m,onChange:ee=>x(ee.target.value),placeholder:`Passphrase (min ${qa} chars)`,className:"w-full bg-[#0a0a0a] border border-white/[0.1] rounded-lg px-3.5 py-2.5 text-[16px] text-white outline-none focus:border-white/[0.25] transition-colors placeholder:text-white/25",autoComplete:"new-password",onKeyDown:ee=>{ee.key==="Enter"&&!X&&J()}}),X&&p.jsxs("p",{className:"text-[12px] text-yellow-300/85 mt-1",children:["Use at least ",qa," characters."]}),p.jsx("p",{className:"text-[12px] text-white/40 mt-1",children:"Encrypted with AES-GCM via PBKDF2 (250k iterations). We never see your passphrase or key."})]})]}),O&&p.jsx("button",{onClick:()=>{H(!0),T(null),x("")},className:"mt-3 text-[13px] text-white/55 hover:text-white/85 transition-colors underline underline-offset-2",children:"Use a different key"}),_&&p.jsx("p",{role:"alert",className:"text-[13px] text-red-300 mt-3",children:_}),p.jsxs("div",{className:"flex flex-wrap gap-2 mt-6 justify-end",children:[(a||u)&&p.jsx("button",{onClick:()=>{f(),g(""),x(""),b(!1),Vi.info("API key cleared")},className:"px-3 py-1.5 text-[14px] text-white/55 hover:text-red-300 transition-colors",children:"Disconnect"}),p.jsx("button",{onClick:l,className:"px-3 py-1.5 text-[14px] text-white/55 hover:text-white/85 transition-colors",children:"Cancel"}),p.jsx("button",{onClick:O?R:J,disabled:S||(O?!m:!d.trim()||X),"aria-busy":S||void 0,className:"px-4 py-1.5 text-[14px] font-medium bg-white text-black rounded-md hover:bg-white/90 transition-colors disabled:opacity-30 disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/40 focus-visible:outline-offset-2",children:S?"…":O?"Unlock":"Connect"})]})]})]})}async function*db(n,l={}){const a=n.getReader(),u=new TextDecoder("utf-8",{fatal:!1});let s="";const c=()=>{try{a.cancel()}catch{}};if(l.signal){if(l.signal.aborted){c(),a.releaseLock();return}l.signal.addEventListener("abort",c)}try{for(;!l.signal?.aborted;){const{done:f,value:d}=await a.read();if(f)break;s+=u.decode(d,{stream:!0});const m=s.replace(/\r\n/g,` +`).split(` + +`);s=m.pop()??"";for(const x of m){const y=[];for(const S of x.split(` +`))if(!(!S||S.startsWith(":"))&&S.startsWith("data:")){const k=S.slice(5);y.push(k.startsWith(" ")?k.slice(1):k)}if(y.length===0)continue;const b=y.join(` +`);if(b==="[DONE]")return;try{yield JSON.parse(b)}catch{}}}}finally{l.signal&&l.signal.removeEventListener("abort",c);try{a.releaseLock()}catch{}}}function mb(){const n=Q.useRef(null),{addMessage:l,appendToLastAssistant:a,appendReasoningToLastAssistant:u,deleteMessage:s,setStreaming:c,isStreaming:f,veniceParams:d,systemPrompt:g,temperature:m,topP:x,maxTokens:y,createConversation:b}=Ct(),S=Q.useCallback(async(C,H,O)=>{const X=Ct.getState().conversations.find(ee=>ee.id===C);if(!X)return;const J=X.messages.filter(ee=>typeof ee.content=="string"?ee.content!=="":!0);g.trim()&&J.unshift({role:"system",content:g.trim()});const $=await Gn("/chat/completions",{method:"POST",body:JSON.stringify({model:H,messages:J,stream:!0,temperature:m,top_p:x,max_tokens:y,venice_parameters:d}),stream:!0,signal:O.signal});for await(const ee of db($,{signal:O.signal})){const ie=ee.choices[0]?.delta;ie?.content&&a(C,ie.content),ie?.reasoning_content&&u(C,ie.reasoning_content)}},[a,u,d,g,m,x,y]),k=Q.useCallback(async(C,H,O)=>{let X=Ct.getState().activeConversationId;X||(X=b(H));let J;O&&O.length>0?J={role:"user",content:[{type:"text",text:C},...O.map(ee=>({type:"image_url",image_url:{url:ee}}))]}:J={role:"user",content:C},l(X,J),l(X,{role:"assistant",content:""}),c(!0);const R=new AbortController;n.current=R;try{await S(X,H,R)}catch($){if($ instanceof DOMException&&$.name==="AbortError")return;const ee=$ instanceof Error?$.message:"Unknown error";a(X,` + +[Error: ${ee}]`)}finally{c(!1),n.current=null}},[l,a,b,c,S]),_=Q.useCallback(async C=>{const H=Ct.getState().activeConversationId;if(!H)return;const O=Ct.getState().conversations.find(R=>R.id===H);if(!O)return;const X=O.messages.length-1;O.messages[X]?.role==="assistant"&&s(H,X),l(H,{role:"assistant",content:""}),c(!0);const J=new AbortController;n.current=J;try{await S(H,C,J)}catch(R){if(R instanceof DOMException&&R.name==="AbortError")return;const $=R instanceof Error?R.message:"Unknown error";a(H,` + +[Error: ${$}]`)}finally{c(!1),n.current=null}},[l,a,s,c,S]),T=Q.useCallback(()=>{n.current?.abort(),c(!1)},[c]);return{send:k,stop:T,regenerate:_,isStreaming:f}}function pb(n,l){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const gb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xb={};function $p(n,l){return(xb.jsx?yb:gb).test(n)}const vb=/[ \t\n\f\r]/g;function bb(n){return typeof n=="object"?n.type==="text"?eg(n.value):!1:eg(n)}function eg(n){return n.replace(vb,"")===""}class Pa{constructor(l,a,u){this.normal=a,this.property=l,u&&(this.space=u)}}Pa.prototype.normal={};Pa.prototype.property={};Pa.prototype.space=void 0;function cy(n,l){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new Pa(a,u,l)}function Yc(n){return n.toLowerCase()}class Ut{constructor(l,a){this.attribute=a,this.property=l}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let Sb=0;const ke=Zi(),rt=Zi(),Ic=Zi(),te=Zi(),Ke=Zi(),Ql=Zi(),It=Zi();function Zi(){return 2**++Sb}const Xc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:rt,commaOrSpaceSeparated:It,commaSeparated:Ql,number:te,overloadedBoolean:Ic,spaceSeparated:Ke},Symbol.toStringTag,{value:"Module"})),pc=Object.keys(Xc);class df extends Ut{constructor(l,a,u,s){let c=-1;if(super(l,a),tg(this,"space",s),typeof u=="number")for(;++c4&&a.slice(0,4)==="data"&&jb.test(l)){if(l.charAt(4)==="-"){const c=l.slice(5).replace(ng,_b);u="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=l.slice(4);if(!ng.test(c)){let f=c.replace(Cb,Ab);f.charAt(0)!=="-"&&(f="-"+f),l="data"+f}}s=df}return new s(u,l)}function Ab(n){return"-"+n.toLowerCase()}function _b(n){return n.charAt(1).toUpperCase()}const Mb=cy([fy,wb,my,py,gy],"html"),mf=cy([fy,kb,my,py,gy],"svg");function Nb(n){return n.join(" ").trim()}var Ul={},gc,ig;function Ob(){if(ig)return gc;ig=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,a=/^\s*/,u=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,d=/^\s+|\s+$/g,g=` +`,m="/",x="*",y="",b="comment",S="declaration";function k(T,C){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];C=C||{};var H=1,O=1;function X(se){var K=se.match(l);K&&(H+=K.length);var D=se.lastIndexOf(g);O=~D?se.length-D:O+se.length}function J(){var se={line:H,column:O};return function(K){return K.position=new R(se),ie(),K}}function R(se){this.start=se,this.end={line:H,column:O},this.source=C.source}R.prototype.content=T;function $(se){var K=new Error(C.source+":"+H+":"+O+": "+se);if(K.reason=se,K.filename=C.source,K.line=H,K.column=O,K.source=T,!C.silent)throw K}function ee(se){var K=se.exec(T);if(K){var D=K[0];return X(D),T=T.slice(D.length),K}}function ie(){ee(a)}function U(se){var K;for(se=se||[];K=le();)K!==!1&&se.push(K);return se}function le(){var se=J();if(!(m!=T.charAt(0)||x!=T.charAt(1))){for(var K=2;y!=T.charAt(K)&&(x!=T.charAt(K)||m!=T.charAt(K+1));)++K;if(K+=2,y===T.charAt(K-1))return $("End of comment missing");var D=T.slice(2,K-2);return O+=2,X(D),T=T.slice(K),O+=2,se({type:b,comment:D})}}function Z(){var se=J(),K=ee(u);if(K){if(le(),!ee(s))return $("property missing ':'");var D=ee(c),W=se({type:S,property:_(K[0].replace(n,y)),value:D?_(D[0].replace(n,y)):y});return ee(f),W}}function me(){var se=[];U(se);for(var K;K=Z();)K!==!1&&(se.push(K),U(se));return se}return ie(),me()}function _(T){return T?T.replace(d,y):y}return gc=k,gc}var lg;function zb(){if(lg)return Ul;lg=1;var n=Ul&&Ul.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.default=a;const l=n(Ob());function a(u,s){let c=null;if(!u||typeof u!="string")return c;const f=(0,l.default)(u),d=typeof s=="function";return f.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:x}=g;d?s(m,x,g):x&&(c=c||{},c[m]=x)}),c}return Ul}var Qa={},ag;function Db(){if(ag)return Qa;ag=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,a=/^[^-]+$/,u=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(m){return!m||a.test(m)||n.test(m)},f=function(m,x){return x.toUpperCase()},d=function(m,x){return"".concat(x,"-")},g=function(m,x){return x===void 0&&(x={}),c(m)?m:(m=m.toLowerCase(),x.reactCompat?m=m.replace(s,d):m=m.replace(u,d),m.replace(l,f))};return Qa.camelCase=g,Qa}var Va,rg;function Rb(){if(rg)return Va;rg=1;var n=Va&&Va.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},l=n(zb()),a=Db();function u(s,c){var f={};return!s||typeof s!="string"||(0,l.default)(s,function(d,g){d&&g&&(f[(0,a.camelCase)(d,c)]=g)}),f}return u.default=u,Va=u,Va}var Lb=Rb();const Ub=nf(Lb),yy=xy("end"),pf=xy("start");function xy(n){return l;function l(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function Bb(n){const l=pf(n),a=yy(n);if(l&&a)return{start:l,end:a}}function Ya(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ug(n.position):"start"in n||"end"in n?ug(n):"line"in n||"column"in n?Kc(n):""}function Kc(n){return sg(n&&n.line)+":"+sg(n&&n.column)}function ug(n){return Kc(n&&n.start)+"-"+Kc(n&&n.end)}function sg(n){return n&&typeof n=="number"?n:1}class vt extends Error{constructor(l,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",c={},f=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof l=="string"?s=l:!c.cause&&l&&(f=!0,s=l.message,c.cause=l),!c.ruleId&&!c.source&&typeof u=="string"){const g=u.indexOf(":");g===-1?c.ruleId=u:(c.source=u.slice(0,g),c.ruleId=u.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const d=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Ya(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=f&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const gf={}.hasOwnProperty,Hb=new Map,qb=/[A-Z]/g,Qb=new Set(["table","tbody","thead","tfoot","tr"]),Vb=new Set(["td","th"]),vy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gb(n,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=l.filePath||void 0;let u;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=Pb(a,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=Jb(a,l.jsx,l.jsxs)}const s={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:u,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?mf:Mb,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},c=by(s,n,void 0);return c&&typeof c!="string"?c:s.create(n,s.Fragment,{children:c||void 0},void 0)}function by(n,l,a){if(l.type==="element")return Fb(n,l,a);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return Yb(n,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return Xb(n,l,a);if(l.type==="mdxjsEsm")return Ib(n,l);if(l.type==="root")return Kb(n,l,a);if(l.type==="text")return Zb(n,l)}function Fb(n,l,a){const u=n.schema;let s=u;l.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=mf,n.schema=s),n.ancestors.push(l);const c=wy(n,l.tagName,!1),f=Wb(n,l);let d=xf(n,l);return Qb.has(l.tagName)&&(d=d.filter(function(g){return typeof g=="string"?!bb(g):!0})),Sy(n,f,c,l),yf(f,d),n.ancestors.pop(),n.schema=u,n.create(l,c,f,a)}function Yb(n,l){if(l.data&&l.data.estree&&n.evaluater){const u=l.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}Za(n,l.position)}function Ib(n,l){if(l.data&&l.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(l.data.estree);Za(n,l.position)}function Xb(n,l,a){const u=n.schema;let s=u;l.name==="svg"&&u.space==="html"&&(s=mf,n.schema=s),n.ancestors.push(l);const c=l.name===null?n.Fragment:wy(n,l.name,!0),f=$b(n,l),d=xf(n,l);return Sy(n,f,c,l),yf(f,d),n.ancestors.pop(),n.schema=u,n.create(l,c,f,a)}function Kb(n,l,a){const u={};return yf(u,xf(n,l)),n.create(l,n.Fragment,u,a)}function Zb(n,l){return l.value}function Sy(n,l,a,u){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(l.node=u)}function yf(n,l){if(l.length>0){const a=l.length>1?l:l[0];a&&(n.children=a)}}function Jb(n,l,a){return u;function u(s,c,f,d){const m=Array.isArray(f.children)?a:l;return d?m(c,f,d):m(c,f)}}function Pb(n,l){return a;function a(u,s,c,f){const d=Array.isArray(c.children),g=pf(u);return l(s,c,f,d,{columnNumber:g?g.column-1:void 0,fileName:n,lineNumber:g?g.line:void 0},void 0)}}function Wb(n,l){const a={};let u,s;for(s in l.properties)if(s!=="children"&&gf.call(l.properties,s)){const c=e2(n,s,l.properties[s]);if(c){const[f,d]=c;n.tableCellAlignToStyle&&f==="align"&&typeof d=="string"&&Vb.has(l.tagName)?u=d:a[f]=d}}if(u){const c=a.style||(a.style={});c[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function $b(n,l){const a={};for(const u of l.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const c=u.data.estree.body[0];c.type;const f=c.expression;f.type;const d=f.properties[0];d.type,Object.assign(a,n.evaluater.evaluateExpression(d.argument))}else Za(n,l.position);else{const s=u.name;let c;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const d=u.value.data.estree.body[0];d.type,c=n.evaluater.evaluateExpression(d.expression)}else Za(n,l.position);else c=u.value===null?!0:u.value;a[s]=c}return a}function xf(n,l){const a=[];let u=-1;const s=n.passKeys?new Map:Hb;for(;++us?0:s+l:l=l>s?s:l,a=a>0?a:0,u.length<1e4)f=Array.from(u),f.unshift(l,a),n.splice(...f);else for(a&&n.splice(l,a);c0?(Xt(n,n.length,0,l),n):l}const fg={}.hasOwnProperty;function Ey(n){const l={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function mn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jt=Si(/[A-Za-z]/),xt=Si(/[\dA-Za-z]/),o2=Si(/[#-'*+\--9=?A-Z^-~]/);function Du(n){return n!==null&&(n<32||n===127)}const Zc=Si(/\d/),c2=Si(/[\dA-Fa-f]/),f2=Si(/[!-/:-@[-`{-~]/);function pe(n){return n!==null&&n<-2}function Xe(n){return n!==null&&(n<0||n===32)}function _e(n){return n===-2||n===-1||n===32}const qu=Si(new RegExp("\\p{P}|\\p{S}","u")),Xi=Si(/\s/);function Si(n){return l;function l(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function Yl(n){const l=[];let a=-1,u=0,s=0;for(;++a55295&&c<57344){const d=n.charCodeAt(a+1);c<56320&&d>56319&&d<57344?(f=String.fromCharCode(c,d),s=1):f="�"}else f=String.fromCharCode(c);f&&(l.push(n.slice(u,a),encodeURIComponent(f)),u=a+s+1,f=""),s&&(a+=s,s=0)}return l.join("")+n.slice(u)}function De(n,l,a,u){const s=u?u-1:Number.POSITIVE_INFINITY;let c=0;return f;function f(g){return _e(g)?(n.enter(a),d(g)):l(g)}function d(g){return _e(g)&&c++f))return;const $=l.events.length;let ee=$,ie,U;for(;ee--;)if(l.events[ee][0]==="exit"&&l.events[ee][1].type==="chunkFlow"){if(ie){U=l.events[ee][1].end;break}ie=!0}for(C(u),R=$;RO;){const J=a[X];l.containerState=J[1],J[0].exit.call(l,n)}a.length=O}function H(){s.write([null]),c=void 0,s=void 0,l.containerState._closeFlow=void 0}}function g2(n,l,a){return De(n,n.attempt(this.parser.constructs.document,l,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vl(n){if(n===null||Xe(n)||Xi(n))return 1;if(qu(n))return 2}function Qu(n,l,a){const u=[];let s=-1;for(;++s1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1;const y={...n[u][1].end},b={...n[a][1].start};dg(y,-g),dg(b,g),f={type:g>1?"strongSequence":"emphasisSequence",start:y,end:{...n[u][1].end}},d={type:g>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:b},c={type:g>1?"strongText":"emphasisText",start:{...n[u][1].end},end:{...n[a][1].start}},s={type:g>1?"strong":"emphasis",start:{...f.start},end:{...d.end}},n[u][1].end={...f.start},n[a][1].start={...d.end},m=[],n[u][1].end.offset-n[u][1].start.offset&&(m=rn(m,[["enter",n[u][1],l],["exit",n[u][1],l]])),m=rn(m,[["enter",s,l],["enter",f,l],["exit",f,l],["enter",c,l]]),m=rn(m,Qu(l.parser.constructs.insideSpan.null,n.slice(u+1,a),l)),m=rn(m,[["exit",c,l],["enter",d,l],["exit",d,l],["exit",s,l]]),n[a][1].end.offset-n[a][1].start.offset?(x=2,m=rn(m,[["enter",n[a][1],l],["exit",n[a][1],l]])):x=0,Xt(n,u-1,a-u+3,m),a=u+m.length-x-2;break}}for(a=-1;++a0&&_e(R)?De(n,H,"linePrefix",c+1)(R):H(R)}function H(R){return R===null||pe(R)?n.check(mg,_,X)(R):(n.enter("codeFlowValue"),O(R))}function O(R){return R===null||pe(R)?(n.exit("codeFlowValue"),H(R)):(n.consume(R),O)}function X(R){return n.exit("codeFenced"),l(R)}function J(R,$,ee){let ie=0;return U;function U(K){return R.enter("lineEnding"),R.consume(K),R.exit("lineEnding"),le}function le(K){return R.enter("codeFencedFence"),_e(K)?De(R,Z,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):Z(K)}function Z(K){return K===d?(R.enter("codeFencedFenceSequence"),me(K)):ee(K)}function me(K){return K===d?(ie++,R.consume(K),me):ie>=f?(R.exit("codeFencedFenceSequence"),_e(K)?De(R,se,"whitespace")(K):se(K)):ee(K)}function se(K){return K===null||pe(K)?(R.exit("codeFencedFence"),$(K)):ee(K)}}}function A2(n,l,a){const u=this;return s;function s(f){return f===null?a(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),c)}function c(f){return u.parser.lazy[u.now().line]?a(f):l(f)}}const xc={name:"codeIndented",tokenize:M2},_2={partial:!0,tokenize:N2};function M2(n,l,a){const u=this;return s;function s(m){return n.enter("codeIndented"),De(n,c,"linePrefix",5)(m)}function c(m){const x=u.events[u.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?f(m):a(m)}function f(m){return m===null?g(m):pe(m)?n.attempt(_2,f,g)(m):(n.enter("codeFlowValue"),d(m))}function d(m){return m===null||pe(m)?(n.exit("codeFlowValue"),f(m)):(n.consume(m),d)}function g(m){return n.exit("codeIndented"),l(m)}}function N2(n,l,a){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?a(f):pe(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):De(n,c,"linePrefix",5)(f)}function c(f){const d=u.events[u.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(f):pe(f)?s(f):a(f)}}const O2={name:"codeText",previous:D2,resolve:z2,tokenize:R2};function z2(n){let l=n.length-4,a=3,u,s;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[l][1].type==="lineEnding"||n[l][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return lthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(l,a,u){const s=a||0;this.setCursor(Math.trunc(l));const c=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&Ga(this.left,u),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),Ga(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),Ga(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l=4?l(f):n.interrupt(u.parser.constructs.flow,a,l)(f)}}function My(n,l,a,u,s,c,f,d,g){const m=g||Number.POSITIVE_INFINITY;let x=0;return y;function y(C){return C===60?(n.enter(u),n.enter(s),n.enter(c),n.consume(C),n.exit(c),b):C===null||C===32||C===41||Du(C)?a(C):(n.enter(u),n.enter(f),n.enter(d),n.enter("chunkString",{contentType:"string"}),_(C))}function b(C){return C===62?(n.enter(c),n.consume(C),n.exit(c),n.exit(s),n.exit(u),l):(n.enter(d),n.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===62?(n.exit("chunkString"),n.exit(d),b(C)):C===null||C===60||pe(C)?a(C):(n.consume(C),C===92?k:S)}function k(C){return C===60||C===62||C===92?(n.consume(C),S):S(C)}function _(C){return!x&&(C===null||C===41||Xe(C))?(n.exit("chunkString"),n.exit(d),n.exit(f),n.exit(u),l(C)):x999||S===null||S===91||S===93&&!g||S===94&&!d&&"_hiddenFootnoteSupport"in f.parser.constructs?a(S):S===93?(n.exit(c),n.enter(s),n.consume(S),n.exit(s),n.exit(u),l):pe(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),x):(n.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===null||S===91||S===93||pe(S)||d++>999?(n.exit("chunkString"),x(S)):(n.consume(S),g||(g=!_e(S)),S===92?b:y)}function b(S){return S===91||S===92||S===93?(n.consume(S),d++,y):y(S)}}function Oy(n,l,a,u,s,c){let f;return d;function d(b){return b===34||b===39||b===40?(n.enter(u),n.enter(s),n.consume(b),n.exit(s),f=b===40?41:b,g):a(b)}function g(b){return b===f?(n.enter(s),n.consume(b),n.exit(s),n.exit(u),l):(n.enter(c),m(b))}function m(b){return b===f?(n.exit(c),g(f)):b===null?a(b):pe(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),De(n,m,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===f||b===null||pe(b)?(n.exit("chunkString"),m(b)):(n.consume(b),b===92?y:x)}function y(b){return b===f||b===92?(n.consume(b),x):x(b)}}function Ia(n,l){let a;return u;function u(s){return pe(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),a=!0,u):_e(s)?De(n,u,a?"linePrefix":"lineSuffix")(s):l(s)}}const G2={name:"definition",tokenize:Y2},F2={partial:!0,tokenize:I2};function Y2(n,l,a){const u=this;let s;return c;function c(S){return n.enter("definition"),f(S)}function f(S){return Ny.call(u,n,d,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function d(S){return s=mn(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),g):a(S)}function g(S){return Xe(S)?Ia(n,m)(S):m(S)}function m(S){return My(n,x,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function x(S){return n.attempt(F2,y,y)(S)}function y(S){return _e(S)?De(n,b,"whitespace")(S):b(S)}function b(S){return S===null||pe(S)?(n.exit("definition"),u.parser.defined.push(s),l(S)):a(S)}}function I2(n,l,a){return u;function u(d){return Xe(d)?Ia(n,s)(d):a(d)}function s(d){return Oy(n,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function c(d){return _e(d)?De(n,f,"whitespace")(d):f(d)}function f(d){return d===null||pe(d)?l(d):a(d)}}const X2={name:"hardBreakEscape",tokenize:K2};function K2(n,l,a){return u;function u(c){return n.enter("hardBreakEscape"),n.consume(c),s}function s(c){return pe(c)?(n.exit("hardBreakEscape"),l(c)):a(c)}}const Z2={name:"headingAtx",resolve:J2,tokenize:P2};function J2(n,l){let a=n.length-2,u=3,s,c;return n[u][1].type==="whitespace"&&(u+=2),a-2>u&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&n[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u&&(s={type:"atxHeadingText",start:n[u][1].start,end:n[a][1].end},c={type:"chunkText",start:n[u][1].start,end:n[a][1].end,contentType:"text"},Xt(n,u,a-u+1,[["enter",s,l],["enter",c,l],["exit",c,l],["exit",s,l]])),n}function P2(n,l,a){let u=0;return s;function s(x){return n.enter("atxHeading"),c(x)}function c(x){return n.enter("atxHeadingSequence"),f(x)}function f(x){return x===35&&u++<6?(n.consume(x),f):x===null||Xe(x)?(n.exit("atxHeadingSequence"),d(x)):a(x)}function d(x){return x===35?(n.enter("atxHeadingSequence"),g(x)):x===null||pe(x)?(n.exit("atxHeading"),l(x)):_e(x)?De(n,d,"whitespace")(x):(n.enter("atxHeadingText"),m(x))}function g(x){return x===35?(n.consume(x),g):(n.exit("atxHeadingSequence"),d(x))}function m(x){return x===null||x===35||Xe(x)?(n.exit("atxHeadingText"),d(x)):(n.consume(x),m)}}const W2=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],gg=["pre","script","style","textarea"],$2={concrete:!0,name:"htmlFlow",resolveTo:nS,tokenize:iS},eS={partial:!0,tokenize:aS},tS={partial:!0,tokenize:lS};function nS(n){let l=n.length;for(;l--&&!(n[l][0]==="enter"&&n[l][1].type==="htmlFlow"););return l>1&&n[l-2][1].type==="linePrefix"&&(n[l][1].start=n[l-2][1].start,n[l+1][1].start=n[l-2][1].start,n.splice(l-2,2)),n}function iS(n,l,a){const u=this;let s,c,f,d,g;return m;function m(E){return x(E)}function x(E){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(E),y}function y(E){return E===33?(n.consume(E),b):E===47?(n.consume(E),c=!0,_):E===63?(n.consume(E),s=3,u.interrupt?l:j):jt(E)?(n.consume(E),f=String.fromCharCode(E),T):a(E)}function b(E){return E===45?(n.consume(E),s=2,S):E===91?(n.consume(E),s=5,d=0,k):jt(E)?(n.consume(E),s=4,u.interrupt?l:j):a(E)}function S(E){return E===45?(n.consume(E),u.interrupt?l:j):a(E)}function k(E){const re="CDATA[";return E===re.charCodeAt(d++)?(n.consume(E),d===re.length?u.interrupt?l:Z:k):a(E)}function _(E){return jt(E)?(n.consume(E),f=String.fromCharCode(E),T):a(E)}function T(E){if(E===null||E===47||E===62||Xe(E)){const re=E===47,ne=f.toLowerCase();return!re&&!c&&gg.includes(ne)?(s=1,u.interrupt?l(E):Z(E)):W2.includes(f.toLowerCase())?(s=6,re?(n.consume(E),C):u.interrupt?l(E):Z(E)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(E):c?H(E):O(E))}return E===45||xt(E)?(n.consume(E),f+=String.fromCharCode(E),T):a(E)}function C(E){return E===62?(n.consume(E),u.interrupt?l:Z):a(E)}function H(E){return _e(E)?(n.consume(E),H):U(E)}function O(E){return E===47?(n.consume(E),U):E===58||E===95||jt(E)?(n.consume(E),X):_e(E)?(n.consume(E),O):U(E)}function X(E){return E===45||E===46||E===58||E===95||xt(E)?(n.consume(E),X):J(E)}function J(E){return E===61?(n.consume(E),R):_e(E)?(n.consume(E),J):O(E)}function R(E){return E===null||E===60||E===61||E===62||E===96?a(E):E===34||E===39?(n.consume(E),g=E,$):_e(E)?(n.consume(E),R):ee(E)}function $(E){return E===g?(n.consume(E),g=null,ie):E===null||pe(E)?a(E):(n.consume(E),$)}function ee(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Xe(E)?J(E):(n.consume(E),ee)}function ie(E){return E===47||E===62||_e(E)?O(E):a(E)}function U(E){return E===62?(n.consume(E),le):a(E)}function le(E){return E===null||pe(E)?Z(E):_e(E)?(n.consume(E),le):a(E)}function Z(E){return E===45&&s===2?(n.consume(E),D):E===60&&s===1?(n.consume(E),W):E===62&&s===4?(n.consume(E),M):E===63&&s===3?(n.consume(E),j):E===93&&s===5?(n.consume(E),de):pe(E)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(eS,G,me)(E)):E===null||pe(E)?(n.exit("htmlFlowData"),me(E)):(n.consume(E),Z)}function me(E){return n.check(tS,se,G)(E)}function se(E){return n.enter("lineEnding"),n.consume(E),n.exit("lineEnding"),K}function K(E){return E===null||pe(E)?me(E):(n.enter("htmlFlowData"),Z(E))}function D(E){return E===45?(n.consume(E),j):Z(E)}function W(E){return E===47?(n.consume(E),f="",oe):Z(E)}function oe(E){if(E===62){const re=f.toLowerCase();return gg.includes(re)?(n.consume(E),M):Z(E)}return jt(E)&&f.length<8?(n.consume(E),f+=String.fromCharCode(E),oe):Z(E)}function de(E){return E===93?(n.consume(E),j):Z(E)}function j(E){return E===62?(n.consume(E),M):E===45&&s===2?(n.consume(E),j):Z(E)}function M(E){return E===null||pe(E)?(n.exit("htmlFlowData"),G(E)):(n.consume(E),M)}function G(E){return n.exit("htmlFlow"),l(E)}}function lS(n,l,a){const u=this;return s;function s(f){return pe(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),c):a(f)}function c(f){return u.parser.lazy[u.now().line]?a(f):l(f)}}function aS(n,l,a){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(Wa,l,a)}}const rS={name:"htmlText",tokenize:uS};function uS(n,l,a){const u=this;let s,c,f;return d;function d(j){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(j),g}function g(j){return j===33?(n.consume(j),m):j===47?(n.consume(j),J):j===63?(n.consume(j),O):jt(j)?(n.consume(j),ee):a(j)}function m(j){return j===45?(n.consume(j),x):j===91?(n.consume(j),c=0,k):jt(j)?(n.consume(j),H):a(j)}function x(j){return j===45?(n.consume(j),S):a(j)}function y(j){return j===null?a(j):j===45?(n.consume(j),b):pe(j)?(f=y,W(j)):(n.consume(j),y)}function b(j){return j===45?(n.consume(j),S):y(j)}function S(j){return j===62?D(j):j===45?b(j):y(j)}function k(j){const M="CDATA[";return j===M.charCodeAt(c++)?(n.consume(j),c===M.length?_:k):a(j)}function _(j){return j===null?a(j):j===93?(n.consume(j),T):pe(j)?(f=_,W(j)):(n.consume(j),_)}function T(j){return j===93?(n.consume(j),C):_(j)}function C(j){return j===62?D(j):j===93?(n.consume(j),C):_(j)}function H(j){return j===null||j===62?D(j):pe(j)?(f=H,W(j)):(n.consume(j),H)}function O(j){return j===null?a(j):j===63?(n.consume(j),X):pe(j)?(f=O,W(j)):(n.consume(j),O)}function X(j){return j===62?D(j):O(j)}function J(j){return jt(j)?(n.consume(j),R):a(j)}function R(j){return j===45||xt(j)?(n.consume(j),R):$(j)}function $(j){return pe(j)?(f=$,W(j)):_e(j)?(n.consume(j),$):D(j)}function ee(j){return j===45||xt(j)?(n.consume(j),ee):j===47||j===62||Xe(j)?ie(j):a(j)}function ie(j){return j===47?(n.consume(j),D):j===58||j===95||jt(j)?(n.consume(j),U):pe(j)?(f=ie,W(j)):_e(j)?(n.consume(j),ie):D(j)}function U(j){return j===45||j===46||j===58||j===95||xt(j)?(n.consume(j),U):le(j)}function le(j){return j===61?(n.consume(j),Z):pe(j)?(f=le,W(j)):_e(j)?(n.consume(j),le):ie(j)}function Z(j){return j===null||j===60||j===61||j===62||j===96?a(j):j===34||j===39?(n.consume(j),s=j,me):pe(j)?(f=Z,W(j)):_e(j)?(n.consume(j),Z):(n.consume(j),se)}function me(j){return j===s?(n.consume(j),s=void 0,K):j===null?a(j):pe(j)?(f=me,W(j)):(n.consume(j),me)}function se(j){return j===null||j===34||j===39||j===60||j===61||j===96?a(j):j===47||j===62||Xe(j)?ie(j):(n.consume(j),se)}function K(j){return j===47||j===62||Xe(j)?ie(j):a(j)}function D(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),l):a(j)}function W(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),oe}function oe(j){return _e(j)?De(n,de,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):de(j)}function de(j){return n.enter("htmlTextData"),f(j)}}const Sf={name:"labelEnd",resolveAll:fS,resolveTo:hS,tokenize:dS},sS={tokenize:mS},oS={tokenize:pS},cS={tokenize:gS};function fS(n){let l=-1;const a=[];for(;++l=3&&(m===null||pe(m))?(n.exit("thematicBreak"),l(m)):a(m)}function g(m){return m===s?(n.consume(m),u++,g):(n.exit("thematicBreakSequence"),_e(m)?De(n,d,"whitespace")(m):d(m))}}const Lt={continuation:{tokenize:jS},exit:AS,name:"list",tokenize:CS},kS={partial:!0,tokenize:_S},ES={partial:!0,tokenize:TS};function CS(n,l,a){const u=this,s=u.events[u.events.length-1];let c=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return d;function d(S){const k=u.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!u.containerState.marker||S===u.containerState.marker:Zc(S)){if(u.containerState.type||(u.containerState.type=k,n.enter(k,{_container:!0})),k==="listUnordered")return n.enter("listItemPrefix"),S===42||S===45?n.check(_u,a,m)(S):m(S);if(!u.interrupt||S===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),g(S)}return a(S)}function g(S){return Zc(S)&&++f<10?(n.consume(S),g):(!u.interrupt||f<2)&&(u.containerState.marker?S===u.containerState.marker:S===41||S===46)?(n.exit("listItemValue"),m(S)):a(S)}function m(S){return n.enter("listItemMarker"),n.consume(S),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||S,n.check(Wa,u.interrupt?a:x,n.attempt(kS,b,y))}function x(S){return u.containerState.initialBlankLine=!0,c++,b(S)}function y(S){return _e(S)?(n.enter("listItemPrefixWhitespace"),n.consume(S),n.exit("listItemPrefixWhitespace"),b):a(S)}function b(S){return u.containerState.size=c+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,l(S)}}function jS(n,l,a){const u=this;return u.containerState._closeFlow=void 0,n.check(Wa,s,c);function s(d){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,De(n,l,"listItemIndent",u.containerState.size+1)(d)}function c(d){return u.containerState.furtherBlankLines||!_e(d)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(d)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(ES,l,f)(d))}function f(d){return u.containerState._closeFlow=!0,u.interrupt=void 0,De(n,n.attempt(Lt,l,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function TS(n,l,a){const u=this;return De(n,s,"listItemIndent",u.containerState.size+1);function s(c){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?l(c):a(c)}}function AS(n){n.exit(this.containerState.type)}function _S(n,l,a){const u=this;return De(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const f=u.events[u.events.length-1];return!_e(c)&&f&&f[1].type==="listItemPrefixWhitespace"?l(c):a(c)}}const yg={name:"setextUnderline",resolveTo:MS,tokenize:NS};function MS(n,l){let a=n.length,u,s,c;for(;a--;)if(n[a][0]==="enter"){if(n[a][1].type==="content"){u=a;break}n[a][1].type==="paragraph"&&(s=a)}else n[a][1].type==="content"&&n.splice(a,1),!c&&n[a][1].type==="definition"&&(c=a);const f={type:"setextHeading",start:{...n[u][1].start},end:{...n[n.length-1][1].end}};return n[s][1].type="setextHeadingText",c?(n.splice(s,0,["enter",f,l]),n.splice(c+1,0,["exit",n[u][1],l]),n[u][1].end={...n[c][1].end}):n[u][1]=f,n.push(["exit",f,l]),n}function NS(n,l,a){const u=this;let s;return c;function c(m){let x=u.events.length,y;for(;x--;)if(u.events[x][1].type!=="lineEnding"&&u.events[x][1].type!=="linePrefix"&&u.events[x][1].type!=="content"){y=u.events[x][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||y)?(n.enter("setextHeadingLine"),s=m,f(m)):a(m)}function f(m){return n.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===s?(n.consume(m),d):(n.exit("setextHeadingLineSequence"),_e(m)?De(n,g,"lineSuffix")(m):g(m))}function g(m){return m===null||pe(m)?(n.exit("setextHeadingLine"),l(m)):a(m)}}const OS={tokenize:zS};function zS(n){const l=this,a=n.attempt(Wa,u,n.attempt(this.parser.constructs.flowInitial,s,De(n,n.attempt(this.parser.constructs.flow,s,n.attempt(B2,s)),"linePrefix")));return a;function u(c){if(c===null){n.consume(c);return}return n.enter("lineEndingBlank"),n.consume(c),n.exit("lineEndingBlank"),l.currentConstruct=void 0,a}function s(c){if(c===null){n.consume(c);return}return n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),l.currentConstruct=void 0,a}}const DS={resolveAll:Dy()},RS=zy("string"),LS=zy("text");function zy(n){return{resolveAll:Dy(n==="text"?US:void 0),tokenize:l};function l(a){const u=this,s=this.parser.constructs[n],c=a.attempt(s,f,d);return f;function f(x){return m(x)?c(x):d(x)}function d(x){if(x===null){a.consume(x);return}return a.enter("data"),a.consume(x),g}function g(x){return m(x)?(a.exit("data"),c(x)):(a.consume(x),g)}function m(x){if(x===null)return!0;const y=s[x];let b=-1;if(y)for(;++b-1){const d=f[0];typeof d=="string"?f[0]=d.slice(u):f.shift()}c>0&&f.push(n[s].slice(0,c))}return f}function JS(n,l){let a=-1;const u=[];let s;for(;++a0){const Bt=ye.tokenStack[ye.tokenStack.length-1];(Bt[1]||vg).call(ye,void 0,Bt[0])}for(ae.position={start:yi(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:yi(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be0&&(u.className=["language-"+s[0]]);let c={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return l.meta&&(c.data={meta:l.meta}),n.patch(l,c),c=n.applyData(l,c),c={type:"element",tagName:"pre",properties:{},children:[c]},n.patch(l,c),c}function cw(n,l){const a={type:"element",tagName:"del",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function fw(n,l){const a={type:"element",tagName:"em",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function hw(n,l){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(l.identifier).toUpperCase(),s=Yl(u.toLowerCase()),c=n.footnoteOrder.indexOf(u);let f,d=n.footnoteCounts.get(u);d===void 0?(d=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=c+1,d+=1,n.footnoteCounts.set(u,d);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(l,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return n.patch(l,m),n.applyData(l,m)}function dw(n,l){const a={type:"element",tagName:"h"+l.depth,properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function mw(n,l){if(n.options.allowDangerousHtml){const a={type:"raw",value:l.value};return n.patch(l,a),n.applyData(l,a)}}function Uy(n,l){const a=l.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+u}];const s=n.all(l),c=s[0];c&&c.type==="text"?c.value="["+c.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function pw(n,l){const a=String(l.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Uy(n,l);const s={src:Yl(u.url||""),alt:l.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const c={type:"element",tagName:"img",properties:s,children:[]};return n.patch(l,c),n.applyData(l,c)}function gw(n,l){const a={src:Yl(l.url)};l.alt!==null&&l.alt!==void 0&&(a.alt=l.alt),l.title!==null&&l.title!==void 0&&(a.title=l.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(l,u),n.applyData(l,u)}function yw(n,l){const a={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};n.patch(l,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(l,u),n.applyData(l,u)}function xw(n,l){const a=String(l.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Uy(n,l);const s={href:Yl(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const c={type:"element",tagName:"a",properties:s,children:n.all(l)};return n.patch(l,c),n.applyData(l,c)}function vw(n,l){const a={href:Yl(l.url)};l.title!==null&&l.title!==void 0&&(a.title=l.title);const u={type:"element",tagName:"a",properties:a,children:n.all(l)};return n.patch(l,u),n.applyData(l,u)}function bw(n,l,a){const u=n.all(l),s=a?Sw(a):By(l),c={},f=[];if(typeof l.checked=="boolean"){const x=u[0];let y;x&&x.type==="element"&&x.tagName==="p"?y=x:(y={type:"element",tagName:"p",properties:{},children:[]},u.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let d=-1;for(;++d1}function ww(n,l){const a={},u=n.all(l);let s=-1;for(typeof l.start=="number"&&l.start!==1&&(a.start=l.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},d=pf(l.children[1]),g=yy(l.children[l.children.length-1]);d&&g&&(f.position={start:d,end:g}),s.push(f)}const c={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(l,c),n.applyData(l,c)}function Tw(n,l,a){const u=a?a.children:void 0,c=(u?u.indexOf(l):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,d=f?f.length:l.children.length;let g=-1;const m=[];for(;++g0,!0),u[0]),s=u.index+u[0].length,u=a.exec(l);return c.push(wg(l.slice(s),s>0,!1)),c.join("")}function wg(n,l,a){let u=0,s=n.length;if(l){let c=n.codePointAt(u);for(;c===bg||c===Sg;)u++,c=n.codePointAt(u)}if(a){let c=n.codePointAt(s-1);for(;c===bg||c===Sg;)s--,c=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function Mw(n,l){const a={type:"text",value:_w(String(l.value))};return n.patch(l,a),n.applyData(l,a)}function Nw(n,l){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(l,a),n.applyData(l,a)}const Ow={blockquote:uw,break:sw,code:ow,delete:cw,emphasis:fw,footnoteReference:hw,heading:dw,html:mw,imageReference:pw,image:gw,inlineCode:yw,linkReference:xw,link:vw,listItem:bw,list:ww,paragraph:kw,root:Ew,strong:Cw,table:jw,tableCell:Aw,tableRow:Tw,text:Mw,thematicBreak:Nw,toml:Su,yaml:Su,definition:Su,footnoteDefinition:Su};function Su(){}const Hy=-1,Vu=0,Xa=1,Ru=2,wf=3,kf=4,Ef=5,Cf=6,qy=7,Qy=8,kg=typeof self=="object"?self:globalThis,zw=(n,l)=>{const a=(s,c)=>(n.set(c,s),s),u=s=>{if(n.has(s))return n.get(s);const[c,f]=l[s];switch(c){case Vu:case Hy:return a(f,s);case Xa:{const d=a([],s);for(const g of f)d.push(u(g));return d}case Ru:{const d=a({},s);for(const[g,m]of f)d[u(g)]=u(m);return d}case wf:return a(new Date(f),s);case kf:{const{source:d,flags:g}=f;return a(new RegExp(d,g),s)}case Ef:{const d=a(new Map,s);for(const[g,m]of f)d.set(u(g),u(m));return d}case Cf:{const d=a(new Set,s);for(const g of f)d.add(u(g));return d}case qy:{const{name:d,message:g}=f;return a(new kg[d](g),s)}case Qy:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:d}=new Uint8Array(f);return a(new DataView(d),f)}}return a(new kg[c](f),s)};return u},Eg=n=>zw(new Map,n)(0),Bl="",{toString:Dw}={},{keys:Rw}=Object,Fa=n=>{const l=typeof n;if(l!=="object"||!n)return[Vu,l];const a=Dw.call(n).slice(8,-1);switch(a){case"Array":return[Xa,Bl];case"Object":return[Ru,Bl];case"Date":return[wf,Bl];case"RegExp":return[kf,Bl];case"Map":return[Ef,Bl];case"Set":return[Cf,Bl];case"DataView":return[Xa,a]}return a.includes("Array")?[Xa,a]:a.includes("Error")?[qy,a]:[Ru,a]},wu=([n,l])=>n===Vu&&(l==="function"||l==="symbol"),Lw=(n,l,a,u)=>{const s=(f,d)=>{const g=u.push(f)-1;return a.set(d,g),g},c=f=>{if(a.has(f))return a.get(f);let[d,g]=Fa(f);switch(d){case Vu:{let x=f;switch(g){case"bigint":d=Qy,x=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+g);x=null;break;case"undefined":return s([Hy],f)}return s([d,x],f)}case Xa:{if(g){let b=f;return g==="DataView"?b=new Uint8Array(f.buffer):g==="ArrayBuffer"&&(b=new Uint8Array(f)),s([g,[...b]],f)}const x=[],y=s([d,x],f);for(const b of f)x.push(c(b));return y}case Ru:{if(g)switch(g){case"BigInt":return s([g,f.toString()],f);case"Boolean":case"Number":case"String":return s([g,f.valueOf()],f)}if(l&&"toJSON"in f)return c(f.toJSON());const x=[],y=s([d,x],f);for(const b of Rw(f))(n||!wu(Fa(f[b])))&&x.push([c(b),c(f[b])]);return y}case wf:return s([d,f.toISOString()],f);case kf:{const{source:x,flags:y}=f;return s([d,{source:x,flags:y}],f)}case Ef:{const x=[],y=s([d,x],f);for(const[b,S]of f)(n||!(wu(Fa(b))||wu(Fa(S))))&&x.push([c(b),c(S)]);return y}case Cf:{const x=[],y=s([d,x],f);for(const b of f)(n||!wu(Fa(b)))&&x.push(c(b));return y}}const{message:m}=f;return s([d,{name:g,message:m}],f)};return c},Cg=(n,{json:l,lossy:a}={})=>{const u=[];return Lw(!(l||a),!!l,new Map,u)(n),u},Lu=typeof structuredClone=="function"?(n,l)=>l&&("json"in l||"lossy"in l)?Eg(Cg(n,l)):structuredClone(n):(n,l)=>Eg(Cg(n,l));function Uw(n,l){const a=[{type:"text",value:"↩"}];return l>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),a}function Bw(n,l){return"Back to reference "+(n+1)+(l>1?"-"+l:"")}function Hw(n){const l=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||Uw,u=n.options.footnoteBackLabel||Bw,s=n.options.footnoteLabel||"Footnotes",c=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let g=-1;for(;++g0&&k.push({type:"text",value:" "});let H=typeof a=="string"?a:a(g,S);typeof H=="string"&&(H={type:"text",value:H}),k.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(g,S),className:["data-footnote-backref"]},children:Array.isArray(H)?H:[H]})}const T=x[x.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const H=T.children[T.children.length-1];H&&H.type==="text"?H.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...k)}else x.push(...k);const C={type:"element",tagName:"li",properties:{id:l+"fn-"+b},children:n.wrap(x,!0)};n.patch(m,C),d.push(C)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Lu(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:n.wrap(d,!0)},{type:"text",value:` +`}]}}const Gu=(function(n){if(n==null)return Gw;if(typeof n=="function")return Fu(n);if(typeof n=="object")return Array.isArray(n)?qw(n):Qw(n);if(typeof n=="string")return Vw(n);throw new Error("Expected function, string, or object as test")});function qw(n){const l=[];let a=-1;for(;++a":""))+")"})}return b;function b(){let S=Vy,k,_,T;if((!l||c(g,m,x[x.length-1]||void 0))&&(S=Xw(a(g,x)),S[0]===Pc))return S;if("children"in g&&g.children){const C=g;if(C.children&&S[0]!==Iw)for(_=(u?C.children.length:-1)+f,T=x.concat(C);_>-1&&_0&&a.push({type:"text",value:` +`}),a}function jg(n){let l=0,a=n.charCodeAt(l);for(;a===9||a===32;)l++,a=n.charCodeAt(l);return n.slice(l)}function Tg(n,l){const a=Zw(n,l),u=a.one(n,void 0),s=Hw(a),c=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&c.children.push({type:"text",value:` +`},s),c}function ek(n,l){return n&&"run"in n?async function(a,u){const s=Tg(a,{file:u,...l});await n.run(s,u)}:function(a,u){return Tg(a,{file:u,...n||l})}}function Ag(n){if(n)throw n}var bc,_g;function tk(){if(_g)return bc;_g=1;var n=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):l.call(m)==="[object Array]"},c=function(m){if(!m||l.call(m)!=="[object Object]")return!1;var x=n.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&n.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!x&&!y)return!1;var b;for(b in m);return typeof b>"u"||n.call(m,b)},f=function(m,x){a&&x.name==="__proto__"?a(m,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):m[x.name]=x.newValue},d=function(m,x){if(x==="__proto__")if(n.call(m,x)){if(u)return u(m,x).value}else return;return m[x]};return bc=function g(){var m,x,y,b,S,k,_=arguments[0],T=1,C=arguments.length,H=!1;for(typeof _=="boolean"&&(H=_,_=arguments[1]||{},T=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});Tf.length;let g;d&&f.push(s);try{g=n.apply(this,f)}catch(m){const x=m;if(d&&a)throw x;return s(x)}d||(g&&g.then&&typeof g.then=="function"?g.then(c,s):g instanceof Error?s(g):c(g))}function s(f,...d){a||(a=!0,l(f,...d))}function c(f){s(null,f)}}const Sn={basename:ak,dirname:rk,extname:uk,join:sk,sep:"/"};function ak(n,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');$a(n);let a=0,u=-1,s=n.length,c;if(l===void 0||l.length===0||l.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(c){a=s+1;break}}else u<0&&(c=!0,u=s+1);return u<0?"":n.slice(a,u)}if(l===n)return"";let f=-1,d=l.length-1;for(;s--;)if(n.codePointAt(s)===47){if(c){a=s+1;break}}else f<0&&(c=!0,f=s+1),d>-1&&(n.codePointAt(s)===l.codePointAt(d--)?d<0&&(u=s):(d=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function rk(n){if($a(n),n.length===0)return".";let l=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){l=a;break}}else u||(u=!0);return l<0?n.codePointAt(0)===47?"/":".":l===1&&n.codePointAt(0)===47?"//":n.slice(0,l)}function uk(n){$a(n);let l=n.length,a=-1,u=0,s=-1,c=0,f;for(;l--;){const d=n.codePointAt(l);if(d===47){if(f){u=l+1;break}continue}a<0&&(f=!0,a=l+1),d===46?s<0?s=l:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||a<0||c===0||c===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function sk(...n){let l=-1,a;for(;++l0&&n.codePointAt(n.length-1)===47&&(a+="/"),l?"/"+a:a}function ck(n,l){let a="",u=0,s=-1,c=0,f=-1,d,g;for(;++f<=n.length;){if(f2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",u=0):(a=a.slice(0,g),u=a.length-1-a.lastIndexOf("/")),s=f,c=0;continue}}else if(a.length>0){a="",u=0,s=f,c=0;continue}}l&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,c=0}else d===46&&c>-1?c++:c=-1}return a}function $a(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const fk={cwd:hk};function hk(){return"/"}function ef(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function dk(n){if(typeof n=="string")n=new URL(n);else if(!ef(n)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(n.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return mk(n)}function mk(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const l=n.pathname;let a=-1;for(;++a0){let[S,...k]=x;const _=u[b][1];$c(_)&&$c(S)&&(S=Sc(!0,_,S)),u[b]=[m,S,...k]}}}}const xk=new Tf().freeze();function Cc(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function jc(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Tc(n,l){if(l)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ng(n){if(!$c(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Og(n,l,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+l+"` instead")}function ku(n){return vk(n)?n:new Fy(n)}function vk(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function bk(n){return typeof n=="string"||Sk(n)}function Sk(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const wk="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",zg=[],Dg={allowDangerousHtml:!0},kk=/^(https?|ircs?|mailto|xmpp)$/i,Ek=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ck(n){const l=jk(n),a=Tk(n);return Ak(l.runSync(l.parse(a),a),n)}function jk(n){const l=n.rehypePlugins||zg,a=n.remarkPlugins||zg,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Dg}:Dg;return xk().use(rw).use(a).use(ek,u).use(l)}function Tk(n){const l=n.children||"",a=new Fy;return typeof l=="string"&&(a.value=l),a}function Ak(n,l){const a=l.allowedElements,u=l.allowElement,s=l.components,c=l.disallowedElements,f=l.skipHtml,d=l.unwrapDisallowed,g=l.urlTransform||Yy;for(const x of Ek)Object.hasOwn(l,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+wk+x.id,void 0);return jf(n,m),Gb(n,{Fragment:p.Fragment,components:s,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function m(x,y,b){if(x.type==="raw"&&b&&typeof y=="number")return f?b.children.splice(y,1):b.children[y]={type:"text",value:x.value},y;if(x.type==="element"){let S;for(S in yc)if(Object.hasOwn(yc,S)&&Object.hasOwn(x.properties,S)){const k=x.properties[S],_=yc[S];(_===null||_.includes(x.tagName))&&(x.properties[S]=g(String(k||""),S,x))}}if(x.type==="element"){let S=a?!a.includes(x.tagName):c?c.includes(x.tagName):!1;if(!S&&u&&typeof y=="number"&&(S=!u(x,y,b)),S&&b&&typeof y=="number")return d&&x.children?b.children.splice(y,1,...x.children):b.children.splice(y,1),y}}}function Yy(n){const l=n.indexOf(":"),a=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return l===-1||s!==-1&&l>s||a!==-1&&l>a||u!==-1&&l>u||kk.test(n.slice(0,l))?n:""}function Rg(n,l){const a=String(n);if(typeof l!="string")throw new TypeError("Expected character");let u=0,s=a.indexOf(l);for(;s!==-1;)u++,s=a.indexOf(l,s+l.length);return u}function _k(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Mk(n,l,a){const s=Gu((a||{}).ignore||[]),c=Nk(l);let f=-1;for(;++f0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=X+1:(k!==X&&H.push({type:"text",value:m.value.slice(k,X)}),Array.isArray(R)?H.push(...R):R&&H.push(R),k=X+O[0].length,C=!0),!b.global)break;O=b.exec(m.value)}return C?(k?\]}]+$/.exec(n);if(!l)return[n,void 0];n=n.slice(0,l.index);let a=l[0],u=a.indexOf(")");const s=Rg(n,"(");let c=Rg(n,")");for(;u!==-1&&s>c;)n+=a.slice(0,u+1),a=a.slice(u+1),u=a.indexOf(")"),c++;return[n,a]}function Iy(n,l){const a=n.input.charCodeAt(n.index-1);return(n.index===0||Xi(a)||qu(a))&&(!l||a!==47)}Xy.peek=eE;function Ik(){this.buffer()}function Xk(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Kk(){this.buffer()}function Zk(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Jk(n){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=mn(this.sliceSerialize(n)).toLowerCase(),a.label=l}function Pk(n){this.exit(n)}function Wk(n){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=mn(this.sliceSerialize(n)).toLowerCase(),a.label=l}function $k(n){this.exit(n)}function eE(){return"["}function Xy(n,l,a,u){const s=a.createTracker(u);let c=s.move("[^");const f=a.enter("footnoteReference"),d=a.enter("reference");return c+=s.move(a.safe(a.associationId(n),{after:"]",before:c})),d(),f(),c+=s.move("]"),c}function tE(){return{enter:{gfmFootnoteCallString:Ik,gfmFootnoteCall:Xk,gfmFootnoteDefinitionLabelString:Kk,gfmFootnoteDefinition:Zk},exit:{gfmFootnoteCallString:Jk,gfmFootnoteCall:Pk,gfmFootnoteDefinitionLabelString:Wk,gfmFootnoteDefinition:$k}}}function nE(n){let l=!1;return n&&n.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:a,footnoteReference:Xy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(u,s,c,f){const d=c.createTracker(f);let g=d.move("[^");const m=c.enter("footnoteDefinition"),x=c.enter("label");return g+=d.move(c.safe(c.associationId(u),{before:g,after:"]"})),x(),g+=d.move("]:"),u.children&&u.children.length>0&&(d.shift(4),g+=d.move((l?` +`:" ")+c.indentLines(c.containerFlow(u,d.current()),l?Ky:iE))),m(),g}}function iE(n,l,a){return l===0?n:Ky(n,l,a)}function Ky(n,l,a){return(a?"":" ")+n}const lE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zy.peek=oE;function aE(){return{canContainEols:["delete"],enter:{strikethrough:uE},exit:{strikethrough:sE}}}function rE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:lE}],handlers:{delete:Zy}}}function uE(n){this.enter({type:"delete",children:[]},n)}function sE(n){this.exit(n)}function Zy(n,l,a,u){const s=a.createTracker(u),c=a.enter("strikethrough");let f=s.move("~~");return f+=a.containerPhrasing(n,{...s.current(),before:f,after:"~"}),f+=s.move("~~"),c(),f}function oE(){return"~"}function cE(n){return n.length}function fE(n,l){const a=l||{},u=(a.align||[]).concat(),s=a.stringLength||cE,c=[],f=[],d=[],g=[];let m=0,x=-1;for(;++xm&&(m=n[x].length);++Cg[C])&&(g[C]=O)}_.push(H)}f[x]=_,d[x]=T}let y=-1;if(typeof u=="object"&&"length"in u)for(;++yg[y]&&(g[y]=H),S[y]=H),b[y]=O}f.splice(1,0,b),d.splice(1,0,S),x=-1;const k=[];for(;++x "),c.shift(2);const f=a.indentLines(a.containerFlow(n,c.current()),mE);return s(),f}function mE(n,l,a){return">"+(a?"":" ")+n}function pE(n,l){return Ug(n,l.inConstruct,!0)&&!Ug(n,l.notInConstruct,!1)}function Ug(n,l,a){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return a;let u=-1;for(;++uf&&(f=c):c=1,s=u+l.length,u=a.indexOf(l,s);return f}function yE(n,l){return!!(l.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function xE(n){const l=n.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function vE(n,l,a,u){const s=xE(a),c=n.value||"",f=s==="`"?"GraveAccent":"Tilde";if(yE(n,a)){const y=a.enter("codeIndented"),b=a.indentLines(c,bE);return y(),b}const d=a.createTracker(u),g=s.repeat(Math.max(gE(c,s)+1,3)),m=a.enter("codeFenced");let x=d.move(g);if(n.lang){const y=a.enter(`codeFencedLang${f}`);x+=d.move(a.safe(n.lang,{before:x,after:" ",encode:["`"],...d.current()})),y()}if(n.lang&&n.meta){const y=a.enter(`codeFencedMeta${f}`);x+=d.move(" "),x+=d.move(a.safe(n.meta,{before:x,after:` +`,encode:["`"],...d.current()})),y()}return x+=d.move(` +`),c&&(x+=d.move(c+` +`)),x+=d.move(g),m(),x}function bE(n,l,a){return(a?"":" ")+n}function Af(n){const l=n.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function SE(n,l,a,u){const s=Af(a),c=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let d=a.enter("label");const g=a.createTracker(u);let m=g.move("[");return m+=g.move(a.safe(a.associationId(n),{before:m,after:"]",...g.current()})),m+=g.move("]: "),d(),!n.url||/[\0- \u007F]/.test(n.url)?(d=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(n.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(d=a.enter("destinationRaw"),m+=g.move(a.safe(n.url,{before:m,after:n.title?" ":` +`,...g.current()}))),d(),n.title&&(d=a.enter(`title${c}`),m+=g.move(" "+s),m+=g.move(a.safe(n.title,{before:m,after:s,...g.current()})),m+=g.move(s),d()),f(),m}function wE(n){const l=n.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function Ja(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Uu(n,l,a){const u=Vl(n),s=Vl(l);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jy.peek=kE;function Jy(n,l,a,u){const s=wE(a),c=a.enter("emphasis"),f=a.createTracker(u),d=f.move(s);let g=f.move(a.containerPhrasing(n,{after:s,before:d,...f.current()}));const m=g.charCodeAt(0),x=Uu(u.before.charCodeAt(u.before.length-1),m,s);x.inside&&(g=Ja(m)+g.slice(1));const y=g.charCodeAt(g.length-1),b=Uu(u.after.charCodeAt(0),y,s);b.inside&&(g=g.slice(0,-1)+Ja(y));const S=f.move(s);return c(),a.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},d+g+S}function kE(n,l,a){return a.options.emphasis||"*"}function EE(n,l){let a=!1;return jf(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,Pc}),!!((!n.depth||n.depth<3)&&vf(n)&&(l.options.setext||a))}function CE(n,l,a,u){const s=Math.max(Math.min(6,n.depth||1),1),c=a.createTracker(u);if(EE(n,a)){const x=a.enter("headingSetext"),y=a.enter("phrasing"),b=a.containerPhrasing(n,{...c.current(),before:` +`,after:` +`});return y(),x(),b+` +`+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(` +`))+1))}const f="#".repeat(s),d=a.enter("headingAtx"),g=a.enter("phrasing");c.move(f+" ");let m=a.containerPhrasing(n,{before:"# ",after:` +`,...c.current()});return/^[\t ]/.test(m)&&(m=Ja(m.charCodeAt(0))+m.slice(1)),m=m?f+" "+m:f,a.options.closeAtx&&(m+=" "+f),g(),d(),m}Py.peek=jE;function Py(n){return n.value||""}function jE(){return"<"}Wy.peek=TE;function Wy(n,l,a,u){const s=Af(a),c=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let d=a.enter("label");const g=a.createTracker(u);let m=g.move("![");return m+=g.move(a.safe(n.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),d(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(d=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(n.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(d=a.enter("destinationRaw"),m+=g.move(a.safe(n.url,{before:m,after:n.title?" ":")",...g.current()}))),d(),n.title&&(d=a.enter(`title${c}`),m+=g.move(" "+s),m+=g.move(a.safe(n.title,{before:m,after:s,...g.current()})),m+=g.move(s),d()),m+=g.move(")"),f(),m}function TE(){return"!"}$y.peek=AE;function $y(n,l,a,u){const s=n.referenceType,c=a.enter("imageReference");let f=a.enter("label");const d=a.createTracker(u);let g=d.move("![");const m=a.safe(n.alt,{before:g,after:"]",...d.current()});g+=d.move(m+"]["),f();const x=a.stack;a.stack=[],f=a.enter("reference");const y=a.safe(a.associationId(n),{before:g,after:"]",...d.current()});return f(),a.stack=x,c(),s==="full"||!m||m!==y?g+=d.move(y+"]"):s==="shortcut"?g=g.slice(0,-1):g+=d.move("]"),g}function AE(){return"!"}ex.peek=_E;function ex(n,l,a){let u=n.value||"",s="`",c=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++c\u007F]/.test(n.url))}nx.peek=ME;function nx(n,l,a,u){const s=Af(a),c=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);let d,g;if(tx(n,a)){const x=a.stack;a.stack=[],d=a.enter("autolink");let y=f.move("<");return y+=f.move(a.containerPhrasing(n,{before:y,after:">",...f.current()})),y+=f.move(">"),d(),a.stack=x,y}d=a.enter("link"),g=a.enter("label");let m=f.move("[");return m+=f.move(a.containerPhrasing(n,{before:m,after:"](",...f.current()})),m+=f.move("]("),g(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(g=a.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(a.safe(n.url,{before:m,after:">",...f.current()})),m+=f.move(">")):(g=a.enter("destinationRaw"),m+=f.move(a.safe(n.url,{before:m,after:n.title?" ":")",...f.current()}))),g(),n.title&&(g=a.enter(`title${c}`),m+=f.move(" "+s),m+=f.move(a.safe(n.title,{before:m,after:s,...f.current()})),m+=f.move(s),g()),m+=f.move(")"),d(),m}function ME(n,l,a){return tx(n,a)?"<":"["}ix.peek=NE;function ix(n,l,a,u){const s=n.referenceType,c=a.enter("linkReference");let f=a.enter("label");const d=a.createTracker(u);let g=d.move("[");const m=a.containerPhrasing(n,{before:g,after:"]",...d.current()});g+=d.move(m+"]["),f();const x=a.stack;a.stack=[],f=a.enter("reference");const y=a.safe(a.associationId(n),{before:g,after:"]",...d.current()});return f(),a.stack=x,c(),s==="full"||!m||m!==y?g+=d.move(y+"]"):s==="shortcut"?g=g.slice(0,-1):g+=d.move("]"),g}function NE(){return"["}function _f(n){const l=n.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function OE(n){const l=_f(n),a=n.options.bulletOther;if(!a)return l==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+a+"`) to be different");return a}function zE(n){const l=n.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function lx(n){const l=n.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function DE(n,l,a,u){const s=a.enter("list"),c=a.bulletCurrent;let f=n.ordered?zE(a):_f(a);const d=n.ordered?f==="."?")":".":OE(a);let g=l&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const x=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&x&&(!x.children||!x.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(g=!0),lx(a)===f&&x){let y=-1;for(;++y-1?l.start:1)+(a.options.incrementListMarker===!1?0:l.children.indexOf(n))+c);let f=c.length+1;(s==="tab"||s==="mixed"&&(l&&l.type==="list"&&l.spread||n.spread))&&(f=Math.ceil(f/4)*4);const d=a.createTracker(u);d.move(c+" ".repeat(f-c.length)),d.shift(f);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(n,d.current()),x);return g(),m;function x(y,b,S){return b?(S?"":" ".repeat(f))+y:(S?c:c+" ".repeat(f-c.length))+y}}function UE(n,l,a,u){const s=a.enter("paragraph"),c=a.enter("phrasing"),f=a.containerPhrasing(n,u);return c(),s(),f}const BE=Gu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function HE(n,l,a,u){return(n.children.some(function(f){return BE(f)})?a.containerPhrasing:a.containerFlow).call(a,n,u)}function qE(n){const l=n.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}ax.peek=QE;function ax(n,l,a,u){const s=qE(a),c=a.enter("strong"),f=a.createTracker(u),d=f.move(s+s);let g=f.move(a.containerPhrasing(n,{after:s,before:d,...f.current()}));const m=g.charCodeAt(0),x=Uu(u.before.charCodeAt(u.before.length-1),m,s);x.inside&&(g=Ja(m)+g.slice(1));const y=g.charCodeAt(g.length-1),b=Uu(u.after.charCodeAt(0),y,s);b.inside&&(g=g.slice(0,-1)+Ja(y));const S=f.move(s+s);return c(),a.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},d+g+S}function QE(n,l,a){return a.options.strong||"*"}function VE(n,l,a,u){return a.safe(n.value,u)}function GE(n){const l=n.options.ruleRepetition||3;if(l<3)throw new Error("Cannot serialize rules with repetition `"+l+"` for `options.ruleRepetition`, expected `3` or more");return l}function FE(n,l,a){const u=(lx(a)+(a.options.ruleSpaces?" ":"")).repeat(GE(a));return a.options.ruleSpaces?u.slice(0,-1):u}const rx={blockquote:dE,break:Bg,code:vE,definition:SE,emphasis:Jy,hardBreak:Bg,heading:CE,html:Py,image:Wy,imageReference:$y,inlineCode:ex,link:nx,linkReference:ix,list:DE,listItem:LE,paragraph:UE,root:HE,strong:ax,text:VE,thematicBreak:FE};function YE(){return{enter:{table:IE,tableData:Hg,tableHeader:Hg,tableRow:KE},exit:{codeText:ZE,table:XE,tableData:Nc,tableHeader:Nc,tableRow:Nc}}}function IE(n){const l=n._align;this.enter({type:"table",align:l.map(function(a){return a==="none"?null:a}),children:[]},n),this.data.inTable=!0}function XE(n){this.exit(n),this.data.inTable=void 0}function KE(n){this.enter({type:"tableRow",children:[]},n)}function Nc(n){this.exit(n)}function Hg(n){this.enter({type:"tableCell",children:[]},n)}function ZE(n){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,JE));const a=this.stack[this.stack.length-1];a.type,a.value=l,this.exit(n)}function JE(n,l){return l==="|"?l:n}function PE(n){const l=n||{},a=l.tableCellPadding,u=l.tablePipeAlign,s=l.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:f,tableCell:g,tableRow:d}};function f(S,k,_,T){return m(x(S,_,T),S.align)}function d(S,k,_,T){const C=y(S,_,T),H=m([C]);return H.slice(0,H.indexOf(` +`))}function g(S,k,_,T){const C=_.enter("tableCell"),H=_.enter("phrasing"),O=_.containerPhrasing(S,{...T,before:c,after:c});return H(),C(),O}function m(S,k){return fE(S,{align:k,alignDelimiters:u,padding:a,stringLength:s})}function x(S,k,_){const T=S.children;let C=-1;const H=[],O=k.enter("table");for(;++C0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const pC={tokenize:kC,partial:!0};function gC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:bC,continuation:{tokenize:SC},exit:wC}},text:{91:{name:"gfmFootnoteCall",tokenize:vC},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yC,resolveTo:xC}}}}function yC(n,l,a){const u=this;let s=u.events.length;const c=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const g=u.events[s][1];if(g.type==="labelImage"){f=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return d;function d(g){if(!f||!f._balanced)return a(g);const m=mn(u.sliceSerialize({start:f.end,end:u.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),l(g))}}function xC(n,l){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},d=[n[a+1],n[a+2],["enter",u,l],n[a+3],n[a+4],["enter",s,l],["exit",s,l],["enter",c,l],["enter",f,l],["exit",f,l],["exit",c,l],n[n.length-2],n[n.length-1],["exit",u,l]];return n.splice(a,n.length-a+1,...d),n}function vC(n,l,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let c=0,f;return d;function d(y){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(y),n.exit("gfmFootnoteCallLabelMarker"),g}function g(y){return y!==94?a(y):(n.enter("gfmFootnoteCallMarker"),n.consume(y),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",m)}function m(y){if(c>999||y===93&&!f||y===null||y===91||Xe(y))return a(y);if(y===93){n.exit("chunkString");const b=n.exit("gfmFootnoteCallString");return s.includes(mn(u.sliceSerialize(b)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(y),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),l):a(y)}return Xe(y)||(f=!0),c++,n.consume(y),y===92?x:m}function x(y){return y===91||y===92||y===93?(n.consume(y),c++,m):m(y)}}function bC(n,l,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let c,f=0,d;return g;function g(k){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(k){return k===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",x):a(k)}function x(k){if(f>999||k===93&&!d||k===null||k===91||Xe(k))return a(k);if(k===93){n.exit("chunkString");const _=n.exit("gfmFootnoteDefinitionLabelString");return c=mn(u.sliceSerialize(_)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),b}return Xe(k)||(d=!0),f++,n.consume(k),k===92?y:x}function y(k){return k===91||k===92||k===93?(n.consume(k),f++,x):x(k)}function b(k){return k===58?(n.enter("definitionMarker"),n.consume(k),n.exit("definitionMarker"),s.includes(c)||s.push(c),De(n,S,"gfmFootnoteDefinitionWhitespace")):a(k)}function S(k){return l(k)}}function SC(n,l,a){return n.check(Wa,l,n.attempt(pC,l,a))}function wC(n){n.exit("gfmFootnoteDefinition")}function kC(n,l,a){const u=this;return De(n,s,"gfmFootnoteDefinitionIndent",5);function s(c){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?l(c):a(c)}}function EC(n){let a=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:c,resolveAll:s};return a==null&&(a=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,d){let g=-1;for(;++g1?g(k):(f.consume(k),y++,S);if(y<2&&!a)return g(k);const T=f.exit("strikethroughSequenceTemporary"),C=Vl(k);return T._open=!C||C===2&&!!_,T._close=!_||_===2&&!!C,d(k)}}}class CC{constructor(){this.map=[]}add(l,a,u){jC(this,l,a,u)}consume(l){if(this.map.sort(function(c,f){return c[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(l.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),l.length=this.map[a][0];u.push(l.slice()),l.length=0;let s=u.pop();for(;s;){for(const c of s)l.push(c);s=u.pop()}this.map.length=0}}function jC(n,l,a,u){let s=0;if(!(a===0&&u.length===0)){for(;s-1;){const se=u.events[le][1].type;if(se==="lineEnding"||se==="linePrefix")le--;else break}const Z=le>-1?u.events[le][1].type:null,me=Z==="tableHead"||Z==="tableRow"?R:g;return me===R&&u.parser.lazy[u.now().line]?a(U):me(U)}function g(U){return n.enter("tableHead"),n.enter("tableRow"),m(U)}function m(U){return U===124||(f=!0,c+=1),x(U)}function x(U){return U===null?a(U):pe(U)?c>1?(c=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(U),n.exit("lineEnding"),S):a(U):_e(U)?De(n,x,"whitespace")(U):(c+=1,f&&(f=!1,s+=1),U===124?(n.enter("tableCellDivider"),n.consume(U),n.exit("tableCellDivider"),f=!0,x):(n.enter("data"),y(U)))}function y(U){return U===null||U===124||Xe(U)?(n.exit("data"),x(U)):(n.consume(U),U===92?b:y)}function b(U){return U===92||U===124?(n.consume(U),y):y(U)}function S(U){return u.interrupt=!1,u.parser.lazy[u.now().line]?a(U):(n.enter("tableDelimiterRow"),f=!1,_e(U)?De(n,k,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):k(U))}function k(U){return U===45||U===58?T(U):U===124?(f=!0,n.enter("tableCellDivider"),n.consume(U),n.exit("tableCellDivider"),_):J(U)}function _(U){return _e(U)?De(n,T,"whitespace")(U):T(U)}function T(U){return U===58?(c+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(U),n.exit("tableDelimiterMarker"),C):U===45?(c+=1,C(U)):U===null||pe(U)?X(U):J(U)}function C(U){return U===45?(n.enter("tableDelimiterFiller"),H(U)):J(U)}function H(U){return U===45?(n.consume(U),H):U===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(U),n.exit("tableDelimiterMarker"),O):(n.exit("tableDelimiterFiller"),O(U))}function O(U){return _e(U)?De(n,X,"whitespace")(U):X(U)}function X(U){return U===124?k(U):U===null||pe(U)?!f||s!==c?J(U):(n.exit("tableDelimiterRow"),n.exit("tableHead"),l(U)):J(U)}function J(U){return a(U)}function R(U){return n.enter("tableRow"),$(U)}function $(U){return U===124?(n.enter("tableCellDivider"),n.consume(U),n.exit("tableCellDivider"),$):U===null||pe(U)?(n.exit("tableRow"),l(U)):_e(U)?De(n,$,"whitespace")(U):(n.enter("data"),ee(U))}function ee(U){return U===null||U===124||Xe(U)?(n.exit("data"),$(U)):(n.consume(U),U===92?ie:ee)}function ie(U){return U===92||U===124?(n.consume(U),ee):ee(U)}}function MC(n,l){let a=-1,u=!0,s=0,c=[0,0,0,0],f=[0,0,0,0],d=!1,g=0,m,x,y;const b=new CC;for(;++aa[2]+1){const k=a[2]+1,_=a[3]-a[2]-1;n.add(k,_,[])}}n.add(a[3]+1,0,[["exit",y,l]])}return s!==void 0&&(c.end=Object.assign({},Hl(l.events,s)),n.add(s,0,[["exit",c,l]]),c=void 0),c}function Qg(n,l,a,u,s){const c=[],f=Hl(l.events,a);s&&(s.end=Object.assign({},f),c.push(["exit",s,l])),u.end=Object.assign({},f),c.push(["exit",u,l]),n.add(a+1,0,c)}function Hl(n,l){const a=n[l],u=a[0]==="enter"?"start":"end";return a[1][u]}const NC={name:"tasklistCheck",tokenize:zC};function OC(){return{text:{91:NC}}}function zC(n,l,a){const u=this;return s;function s(g){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?a(g):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(g),n.exit("taskListCheckMarker"),c)}function c(g){return Xe(g)?(n.enter("taskListCheckValueUnchecked"),n.consume(g),n.exit("taskListCheckValueUnchecked"),f):g===88||g===120?(n.enter("taskListCheckValueChecked"),n.consume(g),n.exit("taskListCheckValueChecked"),f):a(g)}function f(g){return g===93?(n.enter("taskListCheckMarker"),n.consume(g),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),d):a(g)}function d(g){return pe(g)?l(g):_e(g)?n.check({tokenize:DC},l,a)(g):a(g)}}function DC(n,l,a){return De(n,u,"whitespace");function u(s){return s===null?a(s):l(s)}}function RC(n){return Ey([rC(),gC(),EC(n),AC(),OC()])}const LC={};function UC(n){const l=this,a=n||LC,u=l.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),c=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(RC(a)),c.push(nC()),f.push(iC(a))}const BC=/^(https?:|mailto:|#|\/|\.)/i;function HC(n,l){if(!n)return"";const a=Yy(n);return a&&(l==="src"&&a.startsWith("data:image/")||BC.test(a))?a:""}function qC({children:n,className:l,...a}){const u=/language-(\w+)/.exec(l||""),s=u?u[1]:"",c=String(n).replace(/\n$/,""),[f,d]=Q.useState(!1);return!l&&!String(n).includes(` +`)?p.jsx("code",{className:l,...a,children:n}):p.jsxs("div",{className:"relative group/code",children:[s&&p.jsx("div",{className:"absolute top-0 left-0 px-3 py-1.5 text-[13px] text-white/15 font-mono uppercase tracking-wider select-none",children:s}),p.jsx("button",{onClick:()=>{navigator.clipboard.writeText(c),d(!0),setTimeout(()=>d(!1),1500)},className:"absolute top-1.5 right-1.5 px-2 py-1 text-[13px] font-medium text-white/15 hover:text-white/40 bg-white/[0.03] hover:bg-white/[0.06] rounded-md transition-all opacity-0 group-hover/code:opacity-100",children:f?"Copied":"Copy"}),p.jsx("code",{className:l,...a,children:n})]})}function QC(n){if(typeof n=="string")return{text:n,images:[]};let l="";const a=[];for(const u of n)u.type==="text"&&u.text&&(l+=u.text),u.type==="image_url"&&u.image_url?.url&&a.push(u.image_url.url);return{text:l,images:a}}function VC({message:n,onCopy:l,onDelete:a,onRegenerate:u}){const[s,c]=Q.useState(!1),[f,d]=Q.useState(!1),[g,m]=Q.useState(!1),x=n.role==="user",{text:y,images:b}=QC(n.content),S=()=>{navigator.clipboard.writeText(y),d(!0),l(),setTimeout(()=>d(!1),1500)},k=p.jsxs("div",{className:`flex items-center gap-0.5 h-6 transition-opacity duration-150 ${s?"opacity-100":"opacity-0"}`,children:[p.jsx(Oc,{label:f?"Copied":"Copy",onClick:S,children:f?p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M20 6L9 17l-5-5"})}):p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),p.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})}),!x&&u&&p.jsx(Oc,{label:"Regenerate",onClick:u,children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M1 4v6h6"}),p.jsx("path",{d:"M3.51 15a9 9 0 102.13-9.36L1 10"})]})}),p.jsx(Oc,{label:"Delete",onClick:a,children:p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})})})]});return x?p.jsx("div",{className:"flex justify-end",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:p.jsxs("div",{className:"flex items-end gap-1.5 max-w-[78%]",children:[k,p.jsxs("div",{className:"bg-white/[0.07] border border-white/[0.05] rounded-2xl rounded-br-md px-4 py-2.5 shadow-sm",children:[b.length>0&&p.jsx("div",{className:"flex gap-1.5 mb-2",children:b.map((_,T)=>p.jsx("img",{src:_,alt:`Attachment ${T+1}`,className:"h-24 rounded-lg border border-white/[0.06]"},T))}),p.jsx("div",{className:"text-white/95 text-[15.5px] leading-relaxed whitespace-pre-wrap break-words",children:y})]})]})}):p.jsxs("div",{className:"flex gap-3",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[p.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-white/95 to-white/75 flex items-center justify-center shrink-0 mt-0.5 shadow-sm",children:p.jsx("svg",{viewBox:"0 0 32 32",width:"14",height:"14",fill:"none",children:p.jsxs("g",{fill:"#0a0a0c",children:[p.jsx("rect",{x:"6.2",y:"7.5",width:"1.6",height:"18",rx:"0.8",transform:"rotate(-42 6.2 7.5)"}),p.jsx("rect",{x:"24.2",y:"6.3",width:"1.6",height:"18",rx:"0.8",transform:"rotate(42 24.2 6.3)"}),p.jsx("polygon",{points:"7.2,8.8 3.8,7.2 4.5,5.5 8.5,7.2"}),p.jsx("polygon",{points:"24.8,8.8 28.2,7.2 27.5,5.5 23.5,7.2"}),p.jsx("rect",{x:"14.3",y:"14.3",width:"3.4",height:"3.4",rx:"0.4",transform:"rotate(45 16 16)"}),p.jsx("circle",{cx:"9.2",cy:"24.5",r:"4"}),p.jsx("circle",{cx:"9.2",cy:"24.5",r:"1.7",fill:"#fff"}),p.jsx("circle",{cx:"22.8",cy:"24.5",r:"4"}),p.jsx("circle",{cx:"22.8",cy:"24.5",r:"1.7",fill:"#fff"}),p.jsx("path",{d:"M16 5.5L12.5 8.5V12.5L16 10.5L19.5 12.5V8.5Z"})]})})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[n.reasoning_content&&p.jsxs("div",{className:"mb-2",children:[p.jsxs("button",{onClick:()=>m(!g),className:"flex items-center gap-1.5 text-[14px] text-white/20 hover:text-white/35 transition-colors mb-1",children:[p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",className:Ee("transition-transform duration-150",g&&"rotate-90"),children:p.jsx("path",{d:"M3.5 2L6.5 5L3.5 8"})}),"Thinking"]}),g&&p.jsx("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded-lg px-3 py-2 text-[15px] text-white/30 leading-relaxed whitespace-pre-wrap animate-fade-in max-h-60 overflow-y-auto",children:n.reasoning_content})]}),y?p.jsx("div",{className:"prose-venice text-[15.5px] leading-relaxed text-white/85",children:p.jsx(Ck,{remarkPlugins:[UC],urlTransform:HC,components:{code:qC,a:({href:_,children:T,...C})=>p.jsx("a",{...C,href:_,target:"_blank",rel:"noopener noreferrer ugc",children:T})},children:y})}):p.jsxs("span",{className:"inline-flex gap-1.5 py-1.5",children:[p.jsx("span",{className:"w-1 h-1 rounded-full bg-white/25 animate-pulse-dot"}),p.jsx("span",{className:"w-1 h-1 rounded-full bg-white/25 animate-pulse-dot",style:{animationDelay:"0.2s"}}),p.jsx("span",{className:"w-1 h-1 rounded-full bg-white/25 animate-pulse-dot",style:{animationDelay:"0.4s"}})]}),p.jsx("div",{className:"mt-0.5",children:k})]})]})}function Oc({label:n,onClick:l,children:a}){return p.jsx("button",{onClick:l,title:n,className:"p-1 text-white/15 hover:text-white/40 transition-colors rounded-md hover:bg-white/[0.04]",children:a})}function GC({onSend:n,onStop:l,isStreaming:a,disabled:u}){const[s,c]=Q.useState(""),[f,d]=Q.useState([]),[g,m]=Q.useState(!1),x=Q.useRef(null),y=Q.useRef(null);Q.useEffect(()=>{x.current?.focus()},[]);const b=()=>{const k=s.trim();!k||u||(n(k,f.length>0?f:void 0),c(""),d([]),x.current&&(x.current.style.height="auto"))},S=k=>{k&&Array.from(k).forEach(_=>{const T=new FileReader;T.onload=()=>d(C=>[...C,T.result]),T.readAsDataURL(_)})};return p.jsx("div",{className:"px-4 sm:px-6 pb-5 pt-2",children:p.jsxs("div",{className:"w-full max-w-[860px] mx-auto",children:[f.length>0&&p.jsx("div",{className:"flex gap-2 mb-2 overflow-x-auto pb-1",children:f.map((k,_)=>p.jsxs("div",{className:"relative group shrink-0",children:[p.jsx("img",{src:k,alt:`Attachment ${_+1}`,className:"h-16 w-16 object-cover rounded-lg border border-white/[0.08]"}),p.jsx("button",{onClick:()=>d(T=>T.filter((C,H)=>H!==_)),"aria-label":`Remove attachment ${_+1}`,className:"absolute -top-1.5 -right-1.5 w-5 h-5 bg-black/85 hover:bg-black border border-white/15 rounded-full flex items-center justify-center text-white/70 hover:text-white transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/50",children:p.jsxs("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},_))}),p.jsxs("div",{className:Ee("relative bg-[#0e0e12] border rounded-2xl overflow-hidden transition-all shadow-lg shadow-black/30","focus-within:border-white/[0.22] focus-within:shadow-xl focus-within:shadow-black/40",g?"border-[var(--color-accent)] bg-[var(--color-accent-soft)]":"border-white/[0.08]"),onDragOver:k=>{k.preventDefault(),k.stopPropagation(),m(!0)},onDragLeave:k=>{k.preventDefault(),k.stopPropagation(),m(!1)},onDrop:k=>{k.preventDefault(),k.stopPropagation(),m(!1),S(k.dataTransfer.files)},children:[p.jsx("textarea",{ref:x,value:s,onChange:k=>c(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),b())},onPaste:k=>{const _=k.clipboardData?.items;if(_){for(const T of _)if(T.type.startsWith("image/")){const C=T.getAsFile();if(C){const H=new FileReader;H.onload=()=>d(O=>[...O,H.result]),H.readAsDataURL(C)}}}},placeholder:u?"Connect an API key to start…":g?"Drop image to attach":"Ask anything — Enter to send, Shift+Enter for newline",rows:1,"aria-label":"Message input",className:"w-full bg-transparent px-5 pt-4 pb-1 text-[16px] text-white outline-none resize-none max-h-48 placeholder:text-white/30 leading-relaxed",disabled:u}),p.jsxs("div",{className:"flex items-center justify-between px-3 pb-2.5",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("input",{ref:y,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:k=>S(k.target.files)}),p.jsx("button",{onClick:()=>y.current?.click(),disabled:u,"aria-label":"Attach image",className:"flex items-center gap-1.5 px-2 py-1.5 text-white/50 hover:text-white text-[13px] transition-colors rounded-lg hover:bg-white/[0.05] disabled:opacity-40 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",title:"Attach image (or drag/paste)",children:p.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})})})]}),a?p.jsxs("button",{onClick:l,"aria-label":"Stop generating",className:"flex items-center gap-1.5 px-3 py-1.5 text-[13px] font-medium text-white/85 bg-white/[0.08] hover:bg-white/[0.14] border border-white/[0.12] rounded-lg transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:[p.jsx("svg",{width:"9",height:"9",viewBox:"0 0 8 8",fill:"currentColor",children:p.jsx("rect",{width:"8",height:"8",rx:"1"})}),"Stop"]}):p.jsx("button",{onClick:b,disabled:!s.trim()||u,"aria-label":"Send message",className:Ee("w-10 h-10 flex items-center justify-center rounded-xl transition-all duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] focus-visible:outline-offset-2",s.trim()&&!u?"bg-white text-black hover:bg-white/95 active:scale-95 shadow-sm":"bg-white/[0.06] text-white/25"),children:p.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})})})]})]})]})})}function Vg(){const{veniceParams:n,setVeniceParams:l,systemPrompt:a,setSystemPrompt:u,temperature:s,setTemperature:c,topP:f,setTopP:d,maxTokens:g,setMaxTokens:m}=Ct(),[x,y]=Q.useState(!1);return p.jsxs("div",{className:"px-4 py-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(FC,{value:n.enable_web_search||"off",onChange:b=>l({enable_web_search:b})}),p.jsx(Gg,{label:"Citations",active:n.enable_web_citations===!0,onClick:()=>l({enable_web_citations:!n.enable_web_citations})}),p.jsx(Gg,{label:"Search in stream",active:n.include_search_results_in_stream===!0,onClick:()=>l({include_search_results_in_stream:!n.include_search_results_in_stream})}),p.jsx("div",{className:"ml-auto",children:p.jsxs("button",{onClick:()=>y(!x),className:Ee("flex items-center gap-1 text-[13px] font-medium px-2 py-[2px] rounded-full transition-colors duration-100",x?"bg-white/90 text-black":"bg-white/[0.03] text-white/18 hover:text-white/35 hover:bg-white/[0.05]"),children:[p.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"12",r:"3"}),p.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 112.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9c.26.604.852.997 1.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]}),"Settings"]})})]}),x&&p.jsxs("div",{className:"mt-2.5 pb-1 flex flex-col gap-2.5",children:[p.jsxs("div",{children:[p.jsx("label",{className:"text-[13px] text-white/15 font-medium mb-1 block uppercase tracking-[0.08em]",children:"System Prompt"}),p.jsx("textarea",{value:a,onChange:b=>u(b.target.value),placeholder:"You are a helpful assistant...",rows:2,className:"w-full bg-white/[0.02] border border-white/[0.05] rounded-lg px-3 py-2 text-[15px] text-white/50 outline-none resize-none placeholder:text-white/8 focus:border-white/[0.1] transition-colors"})]}),p.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[p.jsx(zc,{label:"Temperature",value:s,onChange:c,min:0,max:2,step:.1}),p.jsx(zc,{label:"Top P",value:f,onChange:d,min:0,max:1,step:.05}),p.jsx(zc,{label:"Max Tokens",value:g,onChange:m,min:256,max:32768,step:256,format:b=>b>=1e3?`${(b/1e3).toFixed(b%1e3===0?0:1)}k`:String(b)})]}),p.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[p.jsx(Rc,{label:"Venice system prompt",active:n.include_venice_system_prompt!==!1,onChange:b=>l({include_venice_system_prompt:b})}),p.jsx(Rc,{label:"Disable thinking",active:n.disable_thinking===!0,onChange:b=>l({disable_thinking:b})}),p.jsx(Rc,{label:"Strip thinking",active:n.strip_thinking_response===!0,onChange:b=>l({strip_thinking_response:b})})]})]})]})}function zc({label:n,value:l,onChange:a,min:u,max:s,step:c,format:f}){const d=f?f(l):String(l);return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[p.jsx("label",{className:"text-[12px] text-white/15 font-medium uppercase tracking-[0.08em]",children:n}),p.jsx("span",{className:"text-[12px] text-white/25 font-mono",children:d})]}),p.jsx("input",{type:"range",min:u,max:s,step:c,value:l,onChange:g=>a(Number(g.target.value)),className:"w-full"})]})}function Gg({label:n,active:l,onClick:a}){return p.jsx("button",{onClick:a,className:Ee("text-[13px] font-medium px-2 py-[2px] rounded-full transition-colors duration-100",l?"bg-white/90 text-black":"bg-white/[0.03] text-white/18 hover:text-white/35 hover:bg-white/[0.05]"),children:n})}const Dc=["off","on","auto"];function FC({value:n,onChange:l}){const a=Dc.indexOf(n),u=()=>l(Dc[(a+1)%Dc.length]),s=`Search: ${n}`,c=n!=="off";return p.jsx("button",{onClick:u,className:Ee("text-[13px] font-medium px-2 py-[2px] rounded-full transition-colors duration-100",c?"bg-white/90 text-black":"bg-white/[0.03] text-white/18 hover:text-white/35 hover:bg-white/[0.05]"),children:s})}function Rc({label:n,active:l,onChange:a}){return p.jsxs("button",{onClick:()=>a(!l),className:"flex items-center gap-2 text-[14px] text-white/30 hover:text-white/50 transition-colors",children:[p.jsx("div",{className:Ee("w-6 h-3.5 rounded-full transition-colors duration-150 relative",l?"bg-white/80":"bg-white/[0.08]"),children:p.jsx("div",{className:Ee("absolute top-0.5 w-2.5 h-2.5 rounded-full transition-all duration-150",l?"left-3 bg-black":"left-0.5 bg-white/30")})}),n]})}const YC=["Explain how RSA encryption works using a metaphor a 10-year-old could grasp.","Draft a polite but firm email asking my landlord to fix the heating.","Compare REST and GraphQL — when does each shine?","Brainstorm five novel side-project ideas using LLMs and a Raspberry Pi."];function IC(){const n=Ct(_=>_.deleteMessage),l=Ct(_=>{const T=_.activeConversationId;return T?_.conversations.find(C=>C.id===T):void 0}),a=pn(_=>_.apiKey),u=un(_=>_.selectedModels.chat),{data:s}=Ki("text"),c=u||s?.[0]?.id||"llama-3.3-70b",{send:f,stop:d,regenerate:g,isStreaming:m}=mb(),x=Q.useRef(null),y=l?.messages.length??0,b=l?.messages[y-1]?.content,S=typeof b=="string"?b.length:0,k=`${y}-${Math.floor(S/200)}`;return Q.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth",block:"end"})},[k]),p.jsxs("div",{className:"flex flex-col h-full",children:[p.jsx("div",{className:"flex-1 overflow-y-auto",children:!l||l.messages.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-6 gap-6",children:[p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx(ff,{size:32,className:"opacity-80"}),p.jsx("div",{className:"text-[20px] font-semibold text-white/85",children:"How can I help today?"}),p.jsx("p",{className:"text-[14px] text-white/45 max-w-sm",children:a?"Pick a model in the header above, then start a conversation. Streaming, web search, and citations are all built in.":"Connect a Venice API key from the header above to get started."})]}),a&&p.jsxs("div",{className:"w-full max-w-md flex flex-col gap-2",children:[p.jsx("div",{className:"text-[12px] uppercase tracking-[0.08em] text-white/35 font-medium text-left",children:"Try one of these"}),p.jsx("div",{className:"flex flex-col gap-1.5",children:YC.map(_=>p.jsx("button",{type:"button",onClick:()=>f(_,c),className:"text-left px-3 py-2.5 rounded-lg border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.14] hover:bg-white/[0.04] transition-all text-[14px] text-white/65 focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/40",children:_},_))})]}),p.jsx(Vg,{})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"border-b border-white/[0.04]",children:p.jsx(Vg,{})}),p.jsxs("div",{className:"w-full max-w-[960px] mx-auto py-5 px-4 sm:px-5 flex flex-col gap-5",children:[l.messages.map((_,T)=>p.jsx(VC,{message:_,index:T,onCopy:()=>{},onDelete:()=>{l&&n(l.id,T)},onRegenerate:_.role==="assistant"&&T===l.messages.length-1?()=>g(c):void 0},T)),p.jsx("div",{ref:x})]})]})}),p.jsx(GC,{onSend:(_,T)=>f(_,c,T),onStop:d,isStreaming:m,disabled:!a})]})}function XC(){return ay({queryKey:["image-styles"],queryFn:()=>Gn("/image/styles",{noAuth:!0}),staleTime:600*1e3,select:n=>n.data})}function KC(){return Fn({mutationFn:n=>Gn("/image/generate",{method:"POST",body:JSON.stringify(n)})})}function er({controls:n,output:l,history:a,className:u}){return p.jsxs("div",{className:Ee("flex flex-col md:flex-row h-full bg-[#0a0a0c]",u),children:[p.jsxs("aside",{className:"md:w-[360px] lg:w-[400px] shrink-0 border-r border-white/[0.05] flex flex-col bg-[#0c0c10] max-h-[55vh] md:max-h-none",children:[p.jsx("div",{className:"p-5 flex flex-col gap-4 overflow-y-auto",children:n}),a&&p.jsx("div",{className:"border-t border-white/[0.05] flex-1 min-h-0 overflow-y-auto p-3",children:a})]}),p.jsx("main",{className:"flex-1 min-w-0 overflow-y-auto p-5 md:p-7",children:l})]})}const ZC=["A serene mountain lake at golden hour, low fog over the water, painterly","Macro photo of a dewdrop on a spider web, sunrise lighting","Cyberpunk street market at night, neon signs reflecting in puddles","Children's book illustration of a fox reading a book under a mushroom"];function Lc(n){return n.startsWith("data:")?n:n.startsWith("/9j/")?`data:image/jpeg;base64,${n}`:n.startsWith("iVBOR")?`data:image/png;base64,${n}`:n.startsWith("UklGR")?`data:image/webp;base64,${n}`:`data:image/png;base64,${n}`}const JC=[{value:"0",label:"512"},{value:"1",label:"768"},{value:"2",label:"1024"},{value:"3",label:"1280"}],PC=[{w:512,h:512},{w:768,h:768},{w:1024,h:1024},{w:1280,h:1280}];function WC(){const n=pn(ne=>ne.apiKey),l=un(ne=>ne.selectedModels.image),{data:a}=Ki("image"),{data:u}=XC(),s=l||a?.[0]?.id||"z-image-turbo",f=a?.find(ne=>ne.id===s)?.model_spec?.constraints,d=f?.aspectRatios&&f.aspectRatios.length>0,g=f?.resolutions&&f.resolutions.length>0,m=f?.steps?.max||50,x=f?.steps?.default||20,y=f?.promptCharacterLimit||4096,[b,S]=Q.useState(""),[k,_]=Q.useState(""),[T,C]=Q.useState("2"),[H,O]=Q.useState(""),[X,J]=Q.useState(""),[R,$]=Q.useState(""),[ee,ie]=Q.useState(x),[U,le]=Q.useState(1),[Z]=Q.useState(!0),[me,se]=Q.useState([]),[K,D]=Q.useState(null),W=Q.useMemo(()=>d?[{value:"",label:"Auto"},...f.aspectRatios.map(ne=>({value:ne,label:ne}))]:[],[f,d]),oe=Q.useMemo(()=>g?f.resolutions.map(ne=>({value:ne,label:ne})):[],[f,g]),de=(ne,ue)=>{const xe=document.createElement("a");xe.href=Lc(ne),xe.download=`venice-image${ue!==void 0?`-${ue+1}`:""}.png`,xe.click()},j=KC(),M=[{value:"",label:"None"},...u?.map(ne=>({value:ne,label:ne}))??[]],G=()=>{if(!b.trim())return;const ne=PC[Number(T)],ue={prompt:b.trim(),negative_prompt:k.trim()||void 0,model:s,style_preset:R||void 0,variants:U,hide_watermark:Z,steps:ee};d&&H?ue.aspect_ratio=H:d||(ue.width=ne.w,ue.height=ne.h),g&&X&&(ue.resolution=X),j.mutate(ue,{onSuccess:xe=>{const He=xe.images.map(Me=>typeof Me=="string"?Me:Me.b64_json);se(Me=>[...He,...Me])}})},E=p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(Ce,{hint:`${b.length}/${y}`,children:"Prompt"}),p.jsx(wn,{value:b,onChange:S,placeholder:"A serene mountain landscape at golden hour…"})]}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Negative prompt"}),p.jsx(wn,{value:k,onChange:_,placeholder:"blurry, low quality…",rows:2})]}),d?p.jsxs("div",{children:[p.jsx(Ce,{children:"Aspect Ratio"}),p.jsx(Au,{options:W,value:H,onChange:O})]}):p.jsxs("div",{children:[p.jsx(Ce,{children:"Size"}),p.jsx(Au,{options:JC,value:T,onChange:C})]}),g&&p.jsxs("div",{children:[p.jsx(Ce,{children:"Resolution"}),p.jsx(Au,{options:oe,value:X||oe[0]?.value||"",onChange:J})]}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Style"}),p.jsx(bi,{value:R,onChange:$,options:M,searchable:!0,placeholder:"None"})]}),p.jsxs("div",{children:[p.jsx(Ce,{hint:String(ee),children:"Steps"}),p.jsx("input",{type:"range",min:1,max:m,value:ee,onChange:ne=>ie(Number(ne.target.value)),className:"w-full"})]}),p.jsxs("div",{children:[p.jsx(Ce,{hint:String(U),children:"Variants"}),p.jsx("input",{type:"range",min:1,max:4,value:U,onChange:ne=>le(Number(ne.target.value)),className:"w-full"})]}),p.jsx(Yi,{onClick:G,disabled:!b.trim()||!n,loading:j.isPending,size:"lg",children:j.isPending?"Generating…":"Generate"}),j.error&&p.jsx(Ii,{children:j.error.message})]}),re=p.jsxs(p.Fragment,{children:[K&&p.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/95 backdrop-blur-sm animate-fade-in",onClick:()=>D(null),children:p.jsxs("div",{className:"relative",onClick:ne=>ne.stopPropagation(),children:[p.jsx("img",{src:Lc(K),alt:"Generated",className:"max-w-[90vw] max-h-[90vh] rounded-xl shadow-2xl"}),p.jsxs("div",{className:"absolute top-3 right-3 flex gap-1.5",children:[p.jsx("button",{onClick:()=>de(K),"aria-label":"Download",className:"p-2 bg-black/60 hover:bg-black/80 rounded-lg text-white/70 hover:text-white transition-colors backdrop-blur-sm",children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"})})}),p.jsx("button",{onClick:()=>D(null),"aria-label":"Close",className:"p-2 bg-black/60 hover:bg-black/80 rounded-lg text-white/70 hover:text-white transition-colors backdrop-blur-sm",children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]})}),me.length===0?p.jsx("div",{className:"flex items-center justify-center h-full",children:j.isPending?p.jsxs("div",{className:"flex flex-col items-center gap-3",role:"status","aria-live":"polite",children:[p.jsx("div",{className:"w-8 h-8 border-2 border-white/[0.08] border-t-[var(--color-accent)] rounded-full animate-spin"}),p.jsx("span",{className:"text-[13px] text-white/55",children:"Generating…"})]}):p.jsx(ab,{items:ZC,onPick:S})}):p.jsxs("div",{className:"grid grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4",children:[j.isPending&&Array.from({length:U}).map((ne,ue)=>p.jsx("div",{className:"aspect-square rounded-xl skeleton"},`skel-${ue}`)),me.map((ne,ue)=>p.jsxs("div",{className:"relative group",children:[p.jsx("img",{src:Lc(ne),alt:`Generated ${ue+1}`,className:"w-full rounded-xl cursor-pointer border border-white/[0.05] hover:border-white/[0.18] transition-all duration-200",onClick:()=>D(ne)}),p.jsx("button",{onClick:xe=>{xe.stopPropagation(),de(ne,ue)},"aria-label":"Download",className:"absolute top-2 right-2 p-1.5 bg-black/60 hover:bg-black/85 rounded-lg text-white/70 hover:text-white opacity-0 group-hover:opacity-100 transition-all backdrop-blur-sm",title:"Download",children:p.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},ue))]})]});return p.jsx(er,{controls:E,output:re})}function $C(){return Fn({mutationFn:n=>Hu("/image/edit",n)})}function e5(){return Fn({mutationFn:n=>Hu("/image/upscale",n)})}function t5(){return Fn({mutationFn:n=>Hu("/image/background-remove",{image:n})})}function px(){const[n,l]=Q.useState(null),a=Q.useRef(null),u=Q.useCallback(c=>{if(a.current&&(URL.revokeObjectURL(a.current),a.current=null),c){const f=URL.createObjectURL(c);a.current=f,l(f)}else l(null)},[]),s=Q.useCallback(()=>u(null),[u]);return Q.useEffect(()=>()=>{a.current&&(URL.revokeObjectURL(a.current),a.current=null)},[]),[n,u,s]}const n5=[{value:"qwen-edit",label:"Qwen Edit"},{value:"qwen-image-2-edit",label:"Qwen Image 2 Edit"},{value:"qwen-image-2-pro-edit",label:"Qwen Image 2 Pro Edit"},{value:"flux-2-max-edit",label:"Flux 2 Max Edit"},{value:"gpt-image-1-5-edit",label:"GPT Image 1.5 Edit"},{value:"grok-imagine-edit",label:"Grok Imagine Edit"},{value:"nano-banana-2-edit",label:"Nano Banana 2 Edit"},{value:"nano-banana-pro-edit",label:"Nano Banana Pro Edit"},{value:"seedream-v4-edit",label:"Seedream V4 Edit"},{value:"seedream-v5-lite-edit",label:"Seedream V5 Lite Edit"}];function i5(){const n=pn(K=>K.apiKey),[l,a]=Q.useState("edit"),[u,s]=Q.useState(null),[c,f]=Q.useState(""),[d,g,m]=px(),x=Q.useRef(null),[y,b]=Q.useState(""),[S,k]=Q.useState("qwen-edit"),[_,T]=Q.useState(2),[C,H]=Q.useState(!1),[O,X]=Q.useState(.5),[J,R]=Q.useState(""),$=$C(),ee=e5(),ie=t5(),U=K=>{const D=new FileReader;D.onload=()=>{s(D.result),f(K.name),m()},D.readAsDataURL(K)},le=()=>{if(!u)return;m();const K={onSuccess:D=>g(D),onError:D=>Vi.fromError(D,"Image tool failed")};l==="edit"?$.mutate({image:u,prompt:y.trim(),modelId:S},K):l==="upscale"?ee.mutate({image:u,scale:_,enhance:C,enhanceCreativity:C?O:void 0,enhancePrompt:C&&J.trim()?J.trim():void 0},K):ie.mutate(u,K)},Z=$.isPending||ee.isPending||ie.isPending,me=$.error||ee.error||ie.error,se=()=>{if(!d)return;const K=document.createElement("a");K.href=d,K.download=`venice-${l}-result.png`,K.click()};return p.jsxs("div",{className:"flex h-full",children:[p.jsxs("div",{className:"w-96 border-r border-white/[0.06] p-6 flex flex-col gap-4 overflow-y-auto shrink-0",children:[p.jsx("div",{className:"flex gap-px bg-white/[0.02] rounded-lg p-0.5 border border-white/[0.04]",children:[["edit","Edit"],["upscale","Upscale"],["remove-bg","Remove BG"]].map(([K,D])=>p.jsx("button",{onClick:()=>{a(K),m()},className:Ee("flex-1 px-2 py-2.5 text-[14px] font-medium rounded-[7px] transition-all duration-150",l===K?"bg-white text-black":"text-white/25 hover:text-white/45"),children:D},K))}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Source image"}),u?p.jsxs("div",{className:"relative group",children:[p.jsx("img",{src:u,alt:"Source",className:"w-full rounded-lg border border-white/[0.06]"}),p.jsx("button",{onClick:()=>{s(null),f(""),m()},"aria-label":"Remove image",className:"absolute top-1.5 right-1.5 p-1 bg-black/60 rounded-md text-white/60 hover:text-white opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-all focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/40",children:p.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),p.jsx("span",{className:"text-[13px] text-white/15 mt-1 block truncate",children:c})]}):p.jsxs("button",{type:"button",onClick:()=>x.current?.click(),className:"w-full border border-dashed border-white/[0.08] hover:border-white/[0.15] rounded-lg py-8 text-center transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/30 focus-visible:outline-offset-2",children:[p.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:K=>{K.target.files?.[0]&&U(K.target.files[0])}}),p.jsx("p",{className:"text-[14px] text-white/40",children:"Click to upload image"})]})]}),l==="edit"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(Ce,{children:"Edit prompt"}),p.jsx(wn,{value:y,onChange:b,placeholder:"Change the background to a sunset beach...",rows:3})]}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Model"}),p.jsx(bi,{value:S,onChange:k,options:n5,searchable:!0})]})]}),l==="upscale"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx(Ce,{children:"Scale"}),p.jsxs("span",{className:"text-[13px] text-white/30 font-mono",children:[_,"x"]})]}),p.jsx("input",{type:"range",min:1,max:4,step:1,value:_,onChange:K=>T(Number(K.target.value)),className:"w-full"})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Ce,{children:"Enhance"}),p.jsx("button",{onClick:()=>H(!C),className:Ee("w-8 h-[18px] rounded-full transition-colors relative",C?"bg-white":"bg-white/[0.08]"),children:p.jsx("div",{className:Ee("absolute top-[2px] w-[14px] h-[14px] rounded-full transition-all",C?"left-[16px] bg-black":"left-[2px] bg-white/30")})})]}),C&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx(Ce,{children:"Creativity"}),p.jsx("span",{className:"text-[13px] text-white/30 font-mono",children:O.toFixed(2)})]}),p.jsx("input",{type:"range",min:0,max:1,step:.05,value:O,onChange:K=>X(Number(K.target.value)),className:"w-full"})]}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Enhance prompt"}),p.jsx(wn,{value:J,onChange:R,placeholder:"Make it more vibrant...",rows:2})]})]})]}),p.jsx(Yi,{onClick:le,disabled:!u||!n||Z||l==="edit"&&!y.trim(),loading:Z,children:l==="edit"?"Edit Image":l==="upscale"?"Upscale Image":"Remove Background"}),me&&p.jsx(Ii,{children:me.message})]}),p.jsx("div",{className:"flex-1 p-6 overflow-y-auto flex flex-col min-w-0",children:d?p.jsxs("div",{className:"animate-fade-in flex flex-col gap-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Ce,{children:"Result"}),p.jsxs("button",{onClick:se,className:"text-[14px] text-white/20 hover:text-white/40 transition-colors flex items-center gap-1.5",children:[p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Download"]})]}),p.jsx("img",{src:d,alt:"Result",className:Ee("w-full rounded-lg border border-white/[0.04]",l==="remove-bg"&&"bg-[repeating-conic-gradient(#1a1a1a_0%_25%,#111_0%_50%)_0_0/20px_20px]")})]}):p.jsx(zu,{children:l==="edit"?"Edited image appears here":l==="upscale"?"Upscaled image appears here":"Result appears here"})})]})}function l5(){const[n,l]=Q.useState("generate");return p.jsxs("div",{className:"flex flex-col h-full",children:[p.jsx("div",{className:"flex items-center gap-1 px-4 py-2.5 border-b border-white/[0.04]",children:["generate","tools"].map(a=>p.jsx("button",{onClick:()=>l(a),className:Ee("text-[14px] font-medium px-2.5 py-[3px] rounded-full transition-all duration-150",n===a?"bg-white text-black":"bg-white/[0.03] text-white/20 hover:text-white/40 hover:bg-white/[0.05]"),children:a==="generate"?"Generate":"Edit / Upscale / BG Remove"},a))}),p.jsx("div",{className:"flex-1 min-h-0",children:n==="generate"?p.jsx(WC,{}):p.jsx(i5,{})})]})}function a5(){return Fn({mutationFn:n=>Hu("/audio/speech",n)})}function r5(){return Fn({mutationFn:n=>{const l=new FormData;return l.append("file",n),l.append("model","whisper-large-v3"),nb("/audio/transcriptions",l)}})}const u5=["Welcome to OpenVenice. The future of voice is here, and it speaks every language.","In a quiet town nestled between two mountains, a small library held a very old book.","Did you know? A single octopus has nine brains — one central, plus one in each arm."],s5=["af_alloy","af_aoede","af_bella","af_heart","af_jessica","af_kore","af_nicole","af_nova","af_river","af_sarah","af_sky","am_adam","am_echo","am_eric","am_fable","am_liam","am_michael","am_onyx","bf_alice","bf_emma","bf_isabella","bf_lily","bm_daniel","bm_fable","bm_george","bm_lewis","zf_xiaobei","zf_xiaoni","zf_xiaoxuan","zf_xiaoyan","zf_xiaoyi","zm_yunjian","zm_yunxi","zm_yunxia","zm_yunyang","jf_alpha","jf_gongitsune","jf_nezumi","jf_tebukuro","jm_kumo","ff_siwis","hf_alpha","hf_beta","hm_omega","hm_psi","if_sara","im_nicola","pf_dora","pm_alex","pm_santa","ef_dora","em_alex","em_santa"],o5=["mp3","opus","aac","flac","wav"];function c5(){const n=pn(Z=>Z.apiKey),l=un(Z=>Z.selectedModels.audio),{data:a}=Ki("tts"),u=l||a?.[0]?.id||"tts-kokoro",[s,c]=Q.useState("tts"),[f,d]=Q.useState(""),[g,m]=Q.useState("af_heart"),[x,y]=Q.useState(1),[b,S]=Q.useState("mp3"),[k,_]=px(),[T,C]=Q.useState(null),[H,O]=Q.useState(""),X=Q.useRef(null),J=a5(),R=r5(),$=s5.map(Z=>{const me=Z.slice(0,2),K={af:{flag:"🇺🇸",gender:"F",lang:"American English (Female)"},am:{flag:"🇺🇸",gender:"M",lang:"American English (Male)"},bf:{flag:"🇬🇧",gender:"F",lang:"British English (Female)"},bm:{flag:"🇬🇧",gender:"M",lang:"British English (Male)"},zf:{flag:"🇨🇳",gender:"F",lang:"Mandarin (Female)"},zm:{flag:"🇨🇳",gender:"M",lang:"Mandarin (Male)"},jf:{flag:"🇯🇵",gender:"F",lang:"Japanese (Female)"},jm:{flag:"🇯🇵",gender:"M",lang:"Japanese (Male)"},ff:{flag:"🇫🇷",gender:"F",lang:"French (Female)"},hf:{flag:"🇮🇳",gender:"F",lang:"Hindi (Female)"},hm:{flag:"🇮🇳",gender:"M",lang:"Hindi (Male)"},if:{flag:"🇮🇹",gender:"F",lang:"Italian (Female)"},im:{flag:"🇮🇹",gender:"M",lang:"Italian (Male)"},pf:{flag:"🇧🇷",gender:"F",lang:"Portuguese (Female)"},pm:{flag:"🇧🇷",gender:"M",lang:"Portuguese (Male)"},ef:{flag:"🇪🇸",gender:"F",lang:"Spanish (Female)"},em:{flag:"🇪🇸",gender:"M",lang:"Spanish (Male)"}}[me],D=Z.slice(3),W=K?`${K.flag} ${K.gender} · ${D} (${K.lang})`:Z;return{value:Z,label:W}}),ee=o5.map(Z=>({value:Z,label:Z.toUpperCase()})),ie=()=>{f.trim()&&J.mutate({model:u,input:f.trim(),voice:g,speed:x,response_format:b},{onSuccess:Z=>_(Z),onError:Z=>Vi.fromError(Z,"TTS failed")})},U=p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"flex gap-px bg-white/[0.03] rounded-lg p-0.5 border border-white/[0.05]",children:["tts","transcribe"].map(Z=>p.jsx("button",{onClick:()=>c(Z),className:Ee("flex-1 px-3 py-2 text-[13px] font-medium rounded-[7px] transition-all duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",s===Z?"bg-white text-black shadow-sm":"text-white/55 hover:text-white/85"),children:Z==="tts"?"Text to Speech":"Transcribe"},Z))}),s==="tts"?p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(Ce,{hint:`${f.length}/4096`,children:"Text"}),p.jsx(wn,{value:f,onChange:d,placeholder:"Enter text to convert to speech…",rows:5})]}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Voice"}),p.jsx(bi,{value:g,onChange:m,options:$,searchable:!0})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p.jsxs("div",{children:[p.jsx(Ce,{children:"Format"}),p.jsx(bi,{value:b,onChange:S,options:ee})]}),p.jsxs("div",{children:[p.jsx(Ce,{hint:`${x}×`,children:"Speed"}),p.jsx("input",{type:"range",min:.25,max:4,step:.25,value:x,onChange:Z=>y(Number(Z.target.value)),className:"w-full"})]})]}),p.jsx(Yi,{onClick:ie,disabled:!f.trim()||!n,loading:J.isPending,size:"lg",children:"Generate Speech"}),J.error&&p.jsx(Ii,{children:J.error.message})]}):p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button",onClick:()=>X.current?.click(),className:"w-full border border-dashed border-white/[0.1] hover:border-white/[0.22] hover:bg-white/[0.02] rounded-xl p-8 text-center transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:[p.jsx("input",{ref:X,type:"file",accept:"audio/*",className:"hidden",onChange:Z=>C(Z.target.files?.[0]??null)}),p.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",className:"mx-auto mb-2 text-white/40",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),p.jsx("p",{className:"text-[14px] text-white/65",children:T?T.name:"Click to select audio file"})]}),p.jsx(Yi,{onClick:()=>{T&&R.mutate(T,{onSuccess:Z=>O(Z.text),onError:Z=>Vi.fromError(Z,"Transcription failed")})},disabled:!T||!n,loading:R.isPending,size:"lg",children:"Transcribe"}),R.error&&p.jsx(Ii,{children:R.error.message})]})]}),le=p.jsx("div",{className:"flex flex-col min-h-full",children:s==="tts"?k?p.jsxs("div",{className:"flex flex-col gap-4 animate-fade-in",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Ce,{children:"Output"}),p.jsxs("a",{href:k,download:`venice-speech.${b}`,className:"text-[14px] text-white/20 hover:text-white/40 transition-colors flex items-center gap-1.5",children:[p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Download"]})]}),p.jsx("audio",{controls:!0,src:k,className:"w-full"}),p.jsx("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded-lg p-4",children:p.jsx("p",{className:"text-[15px] text-white/30 leading-relaxed",children:f})})]}):f?p.jsx(zu,{children:"Press Generate to synthesize speech"}):p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsxs("div",{className:"max-w-md w-full flex flex-col gap-2",children:[p.jsx("div",{className:"text-[12px] uppercase tracking-[0.08em] text-white/35 font-medium text-left",children:"Try one of these"}),u5.map(Z=>p.jsx("button",{type:"button",onClick:()=>d(Z),className:"text-left px-3 py-2.5 rounded-lg border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.14] hover:bg-white/[0.04] transition-all text-[14px] text-white/65 focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/40",children:Z},Z))]})}):H?p.jsxs("div",{className:"flex flex-col gap-3 animate-fade-in",children:[p.jsx(Ce,{children:"Transcript"}),p.jsx("div",{className:"bg-[#111114] border border-white/[0.06] rounded-xl p-6 text-[15px] text-white/85 whitespace-pre-wrap leading-relaxed",children:H})]}):p.jsx(zu,{children:"Transcript appears here"})});return p.jsx(er,{controls:U,output:le})}const f5=3e3,Fg=120;function h5(){const[n,l]=Q.useState("idle"),[a,u]=Q.useState(null),[s,c]=Q.useState(null),[f,d]=Q.useState(0),g=Q.useRef(void 0),m=Q.useRef(void 0),x=Q.useRef(null),y=Q.useRef(null),b=Q.useRef(0),S=Q.useRef(!1),k=Q.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=void 0),m.current&&(clearInterval(m.current),m.current=void 0)},[]);Q.useEffect(()=>()=>k(),[k]);const _=Q.useCallback(()=>{b.current=0,y.current=Date.now(),d(0),m.current=setInterval(()=>{y.current&&d(Date.now()-y.current)},1e3),g.current=setInterval(async()=>{if(!S.current){if(b.current+=1,b.current>Fg){k(),c("Generation took too long. Cancel and try again."),l("failed");return}try{const O=await Gn("/audio/retrieve",{method:"POST",body:JSON.stringify({id:x.current})}),X=O.status.toLowerCase();l(X),X==="completed"&&O.audio_url?(u(O.audio_url),k()):X==="failed"&&(c(O.error??"Music generation failed"),k())}catch(O){b.current>=Fg&&(c(O instanceof Error?O.message:"Polling failed"),k())}}},f5)},[k]),T=Fn({mutationFn:O=>Gn("/audio/queue",{method:"POST",body:JSON.stringify(O)}),onSuccess:O=>{S.current=!1,x.current=O.queue_id,l("queued"),u(null),c(null),_()},onError:O=>{c(O instanceof Error?O.message:"Queue failed"),l("failed")}}),C=Q.useCallback(()=>{S.current=!0,k(),l("idle"),c(null),x.current=null,y.current=null,d(0)},[k]),H=Q.useCallback(()=>{C(),u(null)},[C]);return{queue:T.mutate,isQueueing:T.isPending,status:n,audioUrl:a,error:s,elapsedMs:f,cancel:C,reset:H}}const Yg={"ace-step-1.5":{lyrics:!0,instrumental:!0,voice:!1,duration:!0},"elevenlabs-music":{lyrics:!0,instrumental:!0,voice:!0,duration:!1},"minimax-music-2.0":{lyrics:!0,instrumental:!0,voice:!1,duration:!1},"stable-audio-2.5":{lyrics:!1,instrumental:!1,voice:!1,duration:!0},"elevenlabs-sound-effects":{lyrics:!1,instrumental:!1,voice:!1,duration:!0},"mmaudio-v2":{lyrics:!1,instrumental:!1,voice:!1,duration:!0}};function d5(n){const l=Object.keys(Yg).find(a=>n.toLowerCase().includes(a));return l?Yg[l]:{lyrics:!1,instrumental:!1,voice:!1,duration:!0}}function m5(){const n=pn(ie=>ie.apiKey),l=un(ie=>ie.selectedModels.music),{data:a}=Ki("music"),u=l||a?.[0]?.id||"",s=d5(u),[c,f]=Q.useState(""),[d,g]=Q.useState(""),[m,x]=Q.useState(30),[y,b]=Q.useState(!1),{queue:S,isQueueing:k,status:_,audioUrl:T,error:C,reset:H,cancel:O,elapsedMs:X}=h5(),J=_==="queued"||_==="processing",R=()=>{if(!c.trim())return;const ie={model:u,prompt:c.trim()};s.lyrics&&d.trim()&&(ie.lyrics_prompt=d.trim()),s.duration&&(ie.duration_seconds=m),s.instrumental&&y&&(ie.force_instrumental=!0),S(ie)},$=p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(Ce,{children:"Prompt"}),p.jsx(wn,{value:c,onChange:f,placeholder:"An upbeat electronic track with a driving bassline and ethereal synths…",rows:4})]}),s.lyrics&&p.jsxs("div",{children:[p.jsx(Ce,{children:"Lyrics"}),p.jsx(wn,{value:d,onChange:g,placeholder:"Optional lyrics or vocal direction…",rows:3})]}),s.duration&&p.jsxs("div",{children:[p.jsx(Ce,{hint:`${m}s`,children:"Duration"}),p.jsx("input",{type:"range",min:5,max:120,step:5,value:m,onChange:ie=>x(Number(ie.target.value)),className:"w-full"})]}),s.instrumental&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Ce,{children:"Instrumental only"}),p.jsx("button",{onClick:()=>b(!y),"aria-pressed":y,className:Ee("w-9 h-5 rounded-full transition-colors relative",y?"bg-[var(--color-accent)]":"bg-white/[0.1]"),children:p.jsx("div",{className:Ee("absolute top-[2px] w-[16px] h-[16px] rounded-full bg-white transition-all",y?"left-[20px]":"left-[2px]")})})]}),p.jsxs("div",{className:"flex flex-wrap gap-1",children:[s.lyrics&&p.jsx(Cu,{children:"Lyrics"}),s.instrumental&&p.jsx(Cu,{children:"Instrumental"}),s.voice&&p.jsx(Cu,{children:"Voice"}),s.duration&&p.jsx(Cu,{children:"Custom Duration"})]}),p.jsx(Yi,{onClick:R,disabled:!c.trim()||!n||k||J,loading:k||J,size:"lg",children:J?_==="queued"?"Queued…":"Generating…":"Generate Music"}),C&&p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx(Ii,{children:C}),p.jsx("button",{onClick:H,className:"text-[13px] text-white/55 hover:text-white underline underline-offset-2 shrink-0 transition-colors",children:"Reset"})]})]}),ee=p.jsx("div",{className:"flex flex-col h-full",children:T?p.jsxs("div",{className:"animate-fade-in flex flex-col gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Ce,{children:"Output"}),p.jsxs("a",{href:T,download:"venice-music.mp3",target:"_blank",rel:"noopener noreferrer",className:"text-[14px] text-white/20 hover:text-white/40 transition-colors flex items-center gap-1.5",children:[p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Download"]})]}),p.jsx("audio",{controls:!0,src:T,className:"w-full"}),p.jsxs("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded-lg p-4",children:[p.jsx("p",{className:"text-[15px] text-white/30 leading-relaxed",children:c}),d&&p.jsx("p",{className:"text-[14px] text-white/15 mt-2 italic",children:d})]}),p.jsx("button",{onClick:H,className:"self-start text-[14px] text-white/15 hover:text-white/35 transition-colors",children:"Generate another"})]}):p.jsx("div",{className:"flex items-center justify-center flex-1 text-white/30 text-[15px]",children:J?p.jsxs("div",{className:"flex flex-col items-center gap-3",role:"status","aria-live":"polite",children:[p.jsx("div",{className:"w-7 h-7 border border-white/[0.08] border-t-white/40 rounded-full animate-spin"}),p.jsxs("span",{className:"text-white/55 text-center",children:[_==="queued"?"Queued — waiting for a slot":"Composing your track",X>0&&p.jsxs("span",{className:"block text-[12px] text-white/30 font-mono mt-1",children:[g5(X)," · typically 20s–90s"]})]}),p.jsx("button",{onClick:O,className:"text-[13px] text-white/35 hover:text-white/65 underline underline-offset-2 transition-colors",children:"Cancel"})]}):c?p.jsx("span",{children:"Press Generate to create your track"}):p.jsxs("div",{className:"max-w-md w-full flex flex-col gap-2",children:[p.jsx("div",{className:"text-[12px] uppercase tracking-[0.08em] text-white/35 font-medium text-left",children:"Try one of these"}),p5.map(ie=>p.jsx("button",{type:"button",onClick:()=>f(ie),className:"text-left px-3 py-2.5 rounded-lg border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.14] hover:bg-white/[0.04] transition-all text-[14px] text-white/65 focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/40",children:ie},ie))]})})});return p.jsx(er,{controls:$,output:ee})}const p5=["Lo-fi hip-hop beat with vinyl crackle and rain — 80 bpm, mellow","Cinematic orchestral build — slow strings rising into triumphant brass","Synthwave with retro arpeggios, warm pads, gated reverb drums — 105 bpm","Acoustic folk fingerpicking, soft female vocals, intimate room sound"];function g5(n){const l=Math.floor(n/1e3),a=Math.floor(l/60);return a>0?`${a}m ${l%60}s`:`${l}s`}function Cu({children:n}){return p.jsx("span",{className:"text-[12px] text-white/55 bg-white/[0.04] border border-white/[0.06] rounded px-1.5 py-0.5",children:n})}const y5=3e3,Ig=200;function x5(){const[n,l]=Q.useState("idle"),[a,u]=Q.useState(null),[s,c]=Q.useState(null),[f,d]=Q.useState(0),g=Q.useRef(void 0),m=Q.useRef(void 0),x=Q.useRef(null),y=Q.useRef(null),b=Q.useRef(0),S=Q.useRef(!1),k=Q.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=void 0),m.current&&(clearInterval(m.current),m.current=void 0)},[]);Q.useEffect(()=>()=>k(),[k]);const _=Q.useCallback(()=>{b.current=0,y.current=Date.now(),d(0),m.current=setInterval(()=>{y.current&&d(Date.now()-y.current)},1e3),g.current=setInterval(async()=>{if(!S.current){if(b.current+=1,b.current>Ig){k(),c("Generation took too long. Cancel and try again, or check your Venice dashboard."),l("failed");return}try{const O=await Gn("/video/retrieve",{method:"POST",body:JSON.stringify({id:x.current})});l(O.status),O.status==="completed"&&O.video_url?(u(O.video_url),k()):O.status==="failed"&&(c(O.error??"Video generation failed"),k())}catch(O){b.current>=Ig&&(c(O instanceof Error?O.message:"Polling failed"),k())}}},y5)},[k]),T=Fn({mutationFn:O=>Gn("/video/queue",{method:"POST",body:JSON.stringify(O)}),onSuccess:O=>{S.current=!1,x.current=O.queue_id||O.id||"",l("queued"),u(null),c(null),_()},onError:O=>{c(O instanceof Error?O.message:"Queue failed"),l("failed")}}),C=Q.useCallback(()=>{S.current=!0,k(),l("idle"),c(null),x.current=null,y.current=null,d(0)},[k]),H=Q.useCallback(()=>{C(),u(null)},[C]);return{queue:T.mutate,isQueueing:T.isPending,status:n,videoUrl:a,error:s,elapsedMs:f,cancel:C,reset:H}}function v5(){const n=pn(ve=>ve.apiKey),{groups:l,isLoading:a}=ib(),[u,s]=Q.useState(""),[c,f]=Q.useState("text"),[d,g]=Q.useState(""),[m,x]=Q.useState(""),[y,b]=Q.useState(""),[S,k]=Q.useState(""),[_,T]=Q.useState(""),[C,H]=Q.useState(null),[O,X]=Q.useState(""),[J,R]=Q.useState(!0),$=Q.useRef(null),{queue:ee,isQueueing:ie,status:U,videoUrl:le,error:Z,reset:me,cancel:se,elapsedMs:K}=x5(),D=U==="queued"||U==="processing",W=Q.useMemo(()=>!u&&l.length>0?l[0]:l.find(ve=>ve.name===u),[l,u]),oe=c==="image"?W?.imageModel:W?.textModel,de=oe?.model_spec?.constraints,j=W?.name||"",M=!!W?.imageModel,G=!!W?.textModel,E=Q.useMemo(()=>(de?.durations||[]).map(ve=>({value:ve,label:ve})),[de]),re=Q.useMemo(()=>(de?.resolutions||[]).map(ve=>({value:ve,label:ve})),[de]),ne=Q.useMemo(()=>(de?.aspect_ratios||[]).map(ve=>({value:ve,label:ve})),[de]),ue=E.some(ve=>ve.value===y)?y:E[0]?.value||"",xe=re.some(ve=>ve.value===S)?S:re[0]?.value||"",He=ne.some(ve=>ve.value===_)?_:ne[0]?.value||"",Me=Q.useMemo(()=>l.map(ve=>({value:ve.name,label:ve.name})),[l]),Tt=ve=>{const gn=new FileReader;gn.onload=()=>{H(gn.result),X(ve.name)},gn.readAsDataURL(ve)},sn=()=>{if(!d.trim()||!oe)return;const ve={model:oe.id,prompt:d.trim(),negative_prompt:m.trim()||void 0,duration:ue||void 0,resolution:xe||void 0,aspect_ratio:He||void 0};c==="image"&&C&&(ve.image_url=C),de?.audio&&de.audio_configurable&&(ve.audio=J),ee(ve)},bt=[];W&&(W.sets.includes("uncensored")&&bt.push("Uncensored"),W.sets.includes("open_source")&&bt.push("Open Source"),W.sets.includes("photorealistic")&&bt.push("Photorealistic"),W.sets.includes("cinematic")&&bt.push("Cinematic"),W.sets.includes("fast")&&bt.push("Fast"),de?.audio&&bt.push("Audio"),de?.audio_input&&bt.push("Audio Input"));const Ji=p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(Ce,{children:"Model"}),p.jsx(bi,{value:j,onChange:ve=>{s(ve),b(""),k(""),T("")},options:Me,searchable:!0,placeholder:a?"Loading...":"Select model..."})]}),(G||M)&&p.jsxs("div",{className:"flex gap-px bg-white/[0.02] rounded-lg p-0.5 border border-white/[0.04]",children:[G&&p.jsx("button",{onClick:()=>f("text"),className:Ee("flex-1 px-3 py-2.5 text-[15px] font-medium rounded-[7px] transition-all duration-150",c==="text"?"bg-white text-black":"text-white/25 hover:text-white/45"),children:"Text to Video"}),M&&p.jsx("button",{onClick:()=>f("image"),className:Ee("flex-1 px-3 py-2.5 text-[15px] font-medium rounded-[7px] transition-all duration-150",c==="image"?"bg-white text-black":"text-white/25 hover:text-white/45"),children:"Image to Video"})]}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Prompt"}),p.jsx(wn,{value:d,onChange:g,placeholder:"A cinematic drone shot over misty mountains at sunrise...",rows:4})]}),p.jsxs("div",{children:[p.jsx(Ce,{children:"Negative prompt"}),p.jsx(wn,{value:m,onChange:x,placeholder:"low quality, blurry...",rows:2})]}),c==="image"&&p.jsxs("div",{children:[p.jsx(Ce,{children:"Reference image"}),C?p.jsxs("div",{className:"relative group",children:[p.jsx("img",{src:C,alt:"Reference",className:"w-full rounded-lg border border-white/[0.06]"}),p.jsx("button",{onClick:()=>{H(null),X("")},className:"absolute top-1.5 right-1.5 p-1 bg-black/60 rounded-md text-white/50 hover:text-white opacity-0 group-hover:opacity-100 transition-all",children:p.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),p.jsx("span",{className:"text-[16px] text-white/15 mt-1 block truncate",children:O})]}):p.jsxs("div",{onClick:()=>$.current?.click(),className:"border border-dashed border-white/[0.08] hover:border-white/[0.15] rounded-lg py-5 text-center cursor-pointer transition-colors",children:[p.jsx("input",{ref:$,type:"file",accept:"image/*",className:"hidden",onChange:ve=>{ve.target.files?.[0]&&Tt(ve.target.files[0])}}),p.jsx("p",{className:"text-[14px] text-white/15",children:"Click to add image"})]})]}),E.length>0&&p.jsxs("div",{children:[p.jsx(Ce,{children:"Duration"}),E.length<=5?p.jsx(Au,{options:E,value:ue,onChange:b}):p.jsx(S5,{options:E.map(ve=>ve.value),value:ue,onChange:b})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[re.length>0&&p.jsxs("div",{children:[p.jsx(Ce,{children:"Resolution"}),p.jsx(bi,{value:xe,onChange:k,options:re})]}),ne.length>0&&p.jsxs("div",{children:[p.jsx(Ce,{children:"Aspect"}),p.jsx(bi,{value:He,onChange:T,options:ne})]})]}),de?.audio&&de.audio_configurable&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Ce,{children:"Generate audio"}),p.jsx("button",{onClick:()=>R(!J),className:Ee("w-8 h-[18px] rounded-full transition-colors relative",J?"bg-white":"bg-white/[0.08]"),children:p.jsx("div",{className:Ee("absolute top-[2px] w-[14px] h-[14px] rounded-full transition-all",J?"left-[16px] bg-black":"left-[2px] bg-white/30")})})]}),bt.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1",children:bt.map(ve=>p.jsx("span",{className:"text-[16px] text-white/20 bg-white/[0.03] border border-white/[0.04] rounded px-1.5 py-0.5",children:ve},ve))}),p.jsx(Yi,{onClick:sn,disabled:!d.trim()||!n||!oe||ie||D||c==="image"&&!C,loading:ie||D,children:D?U==="queued"?"Queued...":"Processing...":"Generate Video"}),Z&&p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx(Ii,{children:Z}),p.jsx("button",{onClick:me,className:"text-[13px] text-white/55 hover:text-white underline underline-offset-2 shrink-0 transition-colors",children:"Reset"})]})]}),on=p.jsx("div",{className:"flex flex-col h-full",children:le?p.jsxs("div",{className:"animate-fade-in flex flex-col gap-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(Ce,{children:"Output"}),p.jsxs("a",{href:le,download:"venice-video.mp4",target:"_blank",rel:"noopener noreferrer",className:"text-[14px] text-white/20 hover:text-white/40 transition-colors flex items-center gap-1.5",children:[p.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Download"]})]}),p.jsx("video",{controls:!0,src:le,className:"w-full rounded-lg bg-black border border-white/[0.04]"}),p.jsx("button",{onClick:me,className:"self-start text-[14px] text-white/15 hover:text-white/35 transition-colors",children:"Generate another"})]}):p.jsx("div",{className:"flex items-center justify-center flex-1 text-white/30 text-[15px]",children:D?p.jsxs("div",{className:"flex flex-col items-center gap-3",role:"status","aria-live":"polite",children:[p.jsx("div",{className:"w-7 h-7 border border-white/[0.08] border-t-white/40 rounded-full animate-spin"}),p.jsxs("span",{className:"text-white/55 text-center",children:[U==="queued"?"Queued — waiting for a slot":"Generating your video",K>0&&p.jsxs("span",{className:"block text-[12px] text-white/30 font-mono mt-1",children:[b5(K)," · typically 30s–2min"]})]}),p.jsx("button",{onClick:se,className:"text-[13px] text-white/35 hover:text-white/65 underline underline-offset-2 transition-colors",children:"Cancel"})]}):p.jsxs("div",{className:"flex flex-col items-center gap-2",children:[p.jsx("span",{children:"Generated videos appear here"}),p.jsx("span",{className:"text-[12px] text-white/35",children:"Average generation time: 30s–2min"})]})})});return p.jsx(er,{controls:Ji,output:on})}function b5(n){const l=Math.floor(n/1e3),a=Math.floor(l/60);return a>0?`${a}m ${l%60}s`:`${l}s`}function S5({options:n,value:l,onChange:a}){const u=n.indexOf(l),s=u>=0?u:0;return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-[16px] text-white/30 font-mono",children:n[s]}),p.jsxs("span",{className:"text-[16px] text-white/15",children:[n[0]," — ",n[n.length-1]]})]}),p.jsx("input",{type:"range",min:0,max:n.length-1,value:s,onChange:c=>a(n[Number(c.target.value)]),className:"w-full"})]})}function w5(){return Fn({mutationFn:n=>Gn("/embeddings",{method:"POST",body:JSON.stringify(n)})})}const ju=100;function k5(){const n=pn(T=>T.apiKey),l=un(T=>T.selectedModels.embeddings),{data:a}=Ki("embedding"),u=l||a?.[0]?.id||"bge-m3",[s,c]=Q.useState(""),[f,d]=Q.useState(!1),g=w5(),m=g.data,x=m?.data[0]?.embedding,y=x?.length??0,b=f?x:x?.slice(0,ju),S=()=>{x&&navigator.clipboard.writeText(JSON.stringify(x))},k=p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx(Ce,{children:"Input text"}),p.jsx(wn,{value:s,onChange:c,placeholder:"Enter text to embed…",rows:6})]}),p.jsx(Yi,{onClick:()=>{g.mutate({model:u,input:s.trim()}),d(!1)},disabled:!s.trim()||!n,loading:g.isPending,size:"lg",children:"Generate Embeddings"}),g.error&&p.jsx(Ii,{children:g.error.message})]}),_=p.jsx("div",{className:"flex flex-col h-full",children:!m&&!s?p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsxs("div",{className:"max-w-md w-full flex flex-col gap-2",children:[p.jsx("div",{className:"text-[12px] uppercase tracking-[0.08em] text-white/35 font-medium text-left",children:"Try one of these"}),["The quick brown fox jumps over the lazy dog.","Embeddings turn text into a vector you can search by meaning.","San Francisco is a city in northern California known for its fog and bridges."].map(T=>p.jsx("button",{type:"button",onClick:()=>c(T),className:"text-left px-3 py-2.5 rounded-lg border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.14] hover:bg-white/[0.04] transition-all text-[14px] text-white/65 focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/40",children:T},T))]})}):m?p.jsxs("div",{className:"animate-fade-in flex flex-col gap-4",children:[p.jsxs("div",{className:"flex items-center gap-6 text-[14px]",children:[p.jsx(Uc,{label:"Model",value:m.model}),p.jsx(Uc,{label:"Dimensions",value:String(y)}),p.jsx(Uc,{label:"Tokens",value:String(m.usage.prompt_tokens)})]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[p.jsxs(Ce,{children:["Vector (",y," dimensions)"]}),p.jsx("button",{onClick:S,className:"text-[13px] text-white/20 hover:text-white/40 transition-colors",children:"Copy"})]}),p.jsx("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded-lg p-4 max-h-[calc(100vh-240px)] overflow-y-auto",children:p.jsxs("code",{className:"text-[14px] text-white/35 font-mono break-all leading-loose",children:["[",b?.map((T,C)=>p.jsxs("span",{children:[p.jsx("span",{className:"text-white/50",children:T.toFixed(6)}),Cju&&p.jsx("span",{className:"text-white/15",children:", ..."}),"]"]})}),y>ju&&p.jsx("button",{onClick:()=>d(!f),className:"text-[13px] text-white/20 hover:text-white/40 mt-2 transition-colors",children:f?`Show first ${ju}`:`Show all ${y} values`})]})]}):p.jsx(zu,{children:"Embedding vectors appear here"})});return p.jsx(er,{controls:k,output:_})}function Uc({label:n,value:l}){return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-white/20",children:n}),p.jsx("span",{className:"text-white/55 bg-white/[0.03] border border-white/[0.04] rounded px-2 py-0.5 font-mono text-[13px]",children:l})]})}class gx extends Q.Component{state={error:null};static getDerivedStateFromError(l){return{error:l}}componentDidCatch(l,a){this.props.onError&&this.props.onError(l,a),console.error("[OpenVenice ErrorBoundary]",l,a)}reset=()=>this.setState({error:null});render(){return this.state.error?this.props.fallback?this.props.fallback({error:this.state.error,reset:this.reset}):p.jsx(E5,{error:this.state.error,reset:this.reset}):this.props.children}}function E5({error:n,reset:l}){return p.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6 text-center",role:"alert",children:p.jsxs("div",{className:"max-w-md",children:[p.jsx("div",{className:"text-[20px] font-semibold text-white/85 mb-2",children:"Something went wrong"}),p.jsx("p",{className:"text-[14px] text-white/40 mb-4",children:"The app hit an unexpected error and couldn't render this view. Your work is safe — refresh to recover."}),p.jsxs("details",{className:"mb-5 text-left",children:[p.jsx("summary",{className:"text-[13px] text-white/30 cursor-pointer hover:text-white/55",children:"Show details"}),p.jsxs("pre",{className:"mt-2 text-[12px] text-red-300/70 bg-white/[0.03] border border-white/[0.06] rounded-lg p-3 overflow-auto max-h-40 whitespace-pre-wrap break-words",children:[n.message,n.stack?` + +${n.stack}`:""]})]}),p.jsxs("div",{className:"flex gap-2 justify-center",children:[p.jsx("button",{onClick:l,className:"px-4 py-2 text-[14px] font-medium bg-white text-black rounded-md hover:bg-white/90 transition-colors",children:"Try again"}),p.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-[14px] font-medium border border-white/[0.1] text-white/60 hover:text-white/80 hover:border-white/[0.2] rounded-md transition-colors",children:"Reload page"})]})]})})}const C5={info:"border-white/[0.08] bg-[#111]",success:"border-green-500/30 bg-green-500/[0.06]",error:"border-red-500/30 bg-red-500/[0.06]"},j5={info:"text-white/75",success:"text-green-200/85",error:"text-red-200/85"};function T5(){const n=ql(a=>a.toasts),l=ql(a=>a.dismiss);return n.length===0?null:p.jsx("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm pointer-events-none",role:"region","aria-live":"polite","aria-label":"Notifications",children:n.map(a=>p.jsx("div",{role:a.variant==="error"?"alert":"status",className:Ee("pointer-events-auto rounded-lg border px-3.5 py-2.5 shadow-xl shadow-black/60 backdrop-blur-md animate-scale-in",C5[a.variant]),children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:Ee("text-[13.5px] font-medium",j5[a.variant]),children:a.title}),a.description&&p.jsx("div",{className:"text-[12.5px] text-white/45 mt-0.5 leading-relaxed break-words",children:a.description}),a.action&&p.jsx("button",{onClick:()=>{a.action?.onClick(),l(a.id)},className:"mt-1.5 text-[12.5px] font-medium text-white/70 hover:text-white underline underline-offset-2",children:a.action.label})]}),p.jsx("button",{onClick:()=>l(a.id),"aria-label":"Dismiss notification",className:"text-white/25 hover:text-white/60 transition-colors p-0.5 -m-0.5 shrink-0 rounded focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/30",children:p.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[p.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})},a.id))})}const A5=Q.lazy(()=>ry(()=>import("./workflows-view-xQJlxU4f.js"),__vite__mapDeps([0,1,2])).then(n=>({default:n.WorkflowsView})));function _5(){return p.jsx(Q.Suspense,{fallback:p.jsx("div",{className:"flex items-center justify-center h-full text-[12px] text-white/30",children:"Loading workflows…"}),children:p.jsx(A5,{})})}const M5=Q.lazy(()=>ry(()=>import("./playground-view-COPXwfh8.js"),__vite__mapDeps([3,1,2])).then(n=>({default:n.PlaygroundView})));function N5(){return p.jsx(Q.Suspense,{fallback:p.jsx("div",{className:"flex items-center justify-center h-full text-[12px] text-white/30",children:"Loading playground…"}),children:p.jsx(M5,{})})}const O5={chat:IC,image:l5,audio:c5,music:m5,video:v5,embeddings:k5,workflows:_5,playground:N5},Xg=["chat","image","audio","music","video","embeddings","workflows","playground"];function z5(){const n=pn(g=>g.hasEncrypted&&!g.apiKey),[l,a]=Q.useState(n),[u,s]=Q.useState(!1),c=un(g=>g.activeTab),f=un(g=>g.setActiveTab),d=O5[c];return Q.useEffect(()=>{const g=m=>{if(!(m.metaKey||m.ctrlKey))return;if(m.key==="n"){m.preventDefault(),f("chat"),s(!1),Ct.getState().setActiveConversation(null);return}const y=parseInt(m.key,10);if(y>=1&&y<=Xg.length){m.preventDefault(),f(Xg[y-1]),s(!1);return}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[f]),p.jsxs("div",{className:"flex h-[100dvh] w-screen overflow-hidden",children:[u&&p.jsx("button",{"aria-label":"Close menu",className:"md:hidden fixed inset-0 z-30 bg-black/60 backdrop-blur-sm animate-fade-in",onClick:()=>s(!1)}),p.jsx(Kv,{mobileOpen:u,onMobileClose:()=>s(!1)}),p.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[p.jsx(fb,{onOpenApiKey:()=>a(!0),onOpenMobileSidebar:()=>s(!0)}),p.jsx("main",{className:"flex-1 min-h-0 overflow-hidden",children:p.jsx(gx,{children:p.jsx(d,{})},c)})]}),p.jsx(hb,{open:l,onClose:()=>a(!1)}),p.jsx(T5,{})]})}const D5=new cv({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});window.addEventListener("unhandledrejection",n=>{console.error("[unhandledrejection]",n.reason)});q1.createRoot(document.getElementById("root")).render(p.jsx(Q.StrictMode,{children:p.jsx(gx,{children:p.jsx(fv,{client:D5,children:p.jsx(z5,{})})})}));export{un as A,lf as B,nf as C,U1 as D,Hu as E,nv as Q,vu as R,bi as S,Gl as a,Zg as b,Ee as c,iy as d,hv as e,pv as f,Nv as g,vv as h,gv as i,p as j,yv as k,Et as l,Sv as m,ot as n,Xp as o,xv as p,Bu as q,Q as r,Mu as s,Vi as t,Ki as u,uy as v,cf as w,sy as x,Gn as y,pn as z}; diff --git a/ventures/havre/open/assets/playground-view-COPXwfh8.js b/ventures/havre/open/assets/playground-view-COPXwfh8.js new file mode 100644 index 0000000..b0ec5cc --- /dev/null +++ b/ventures/havre/open/assets/playground-view-COPXwfh8.js @@ -0,0 +1,84 @@ +import{a as ne,n as V,s as re,b as oe,Q as Z,d as ie,e as ae,f as le,r as b,h as ce,i as de,k as ue,l as pe,m as B,o as he,p as me,q as fe,v as ge,w as xe,x as we,y as F,u as be,g as U,z as ye,A as D,j as r,c as R,t as Q}from"./index-CfrUZ43_.js";import{g as ve,N as C,h as ke,H as J,P as z,R as je,b as Ne,c as Se,a as _e,i as Re,B as $e,e as Oe,C as Te,u as L,v as Ce,f as Ee}from"./workflow-engine-ClbuiuAZ.js";function H(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function Pe(e,t,n){const s=e.slice(0);return s[t]=n,s}var Me=class extends ne{#n;#e;#r;#o;#t;#s;#i;#a;#l;#c=[];constructor(e,t,n){super(),this.#n=e,this.#o=n,this.#r=[],this.#t=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(e=>{e.subscribe(t=>{this.#h(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#o=t,V.batch(()=>{const n=this.#t,s=this.#p(this.#r);s.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const o=s.map(p=>p.observer),i=o.map(p=>p.getCurrentResult()),a=n.length!==o.length,l=o.some((p,h)=>p!==n[h]),d=a||l,x=d?!0:i.some((p,h)=>{const w=this.#e[h];return!w||!re(p,w)});!d&&!x||(d&&(this.#c=s,this.#t=o),this.#e=i,this.hasListeners()&&(d&&(H(n,o).forEach(p=>{p.destroy()}),H(o,n).forEach(p=>{p.subscribe(h=>{this.#h(p,h)})})),this.#m()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(e=>e.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(e,t){const n=this.#p(e),s=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=n.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>this.#u(i??s,t,o),()=>this.#d(s,n)]}#d(e,t){return t.map((n,s)=>{const o=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?o:n.observer.trackResult(o,i=>{t.forEach(a=>{a.observer.trackProp(i)})})})}#u(e,t,n){if(t){const s=this.#l,o=n!==void 0&&s!==void 0&&(s.length!==n.length||n.some((i,a)=>i!==s[a]));return(!this.#s||this.#e!==this.#a||o||t!==this.#i)&&(this.#i=t,this.#a=this.#e,n!==void 0&&(this.#l=n),this.#s=oe(this.#s,t(e))),this.#s}return e}#p(e){const t=new Map;this.#t.forEach(s=>{const o=s.options.queryHash;if(!o)return;const i=t.get(o);i?i.push(s):t.set(o,[s])});const n=[];return e.forEach(s=>{const o=this.#n.defaultQueryOptions(s),a=t.get(o.queryHash)?.shift()??new Z(this.#n,o);n.push({defaultedQueryOptions:o,observer:a})}),n}#h(e,t){const n=this.#t.indexOf(e);n!==-1&&(this.#e=Pe(this.#e,n,t),this.#m())}#m(){if(this.hasListeners()){const e=this.#s,t=this.#d(this.#e,this.#c),n=this.#u(t,this.#o?.combine);e!==n&&V.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}};function Ae({queries:e,...t},n){const s=ie(),o=ae(),i=le(),a=b.useMemo(()=>e.map(m=>{const u=s.defaultQueryOptions(m);return u._optimisticResults=o?"isRestoring":"optimistic",u}),[e,s,o]);a.forEach(m=>{ce(m);const u=s.getQueryCache().get(m.queryHash);de(m,i,u)}),ue(i);const[l]=b.useState(()=>new Me(s,a,t)),[d,x,p]=l.getOptimisticResult(a,t.combine),h=!o&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(m=>h?l.subscribe(V.batchCalls(m)):pe,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(a,t)},[a,t,l]);const y=d.some((m,u)=>B(a[u],m))?d.flatMap((m,u)=>{const g=a[u];if(g&&B(g,m)){const N=new Z(s,g);return he(g,N,i)}return[]}):[];if(y.length>0)throw Promise.all(y);const $=d.find((m,u)=>{const g=a[u];return g&&me({result:m,errorResetBoundary:i,throwOnError:g.throwOnError,query:s.getQueryCache().get(g.queryHash),suspense:g.suspense})});if($?.error)throw $.error;return x(p())}const S=fe()(ge((e,t)=>({messages:[],draft:{nodes:[],edges:[]},linkedWorkflowId:null,isThinking:!1,runResults:{},isRunning:!1,addMessage:n=>e(s=>({messages:[...s.messages,n]})),updateMessage:(n,s)=>e(o=>({messages:o.messages.map(i=>i.id===n?{...i,...s}:i)})),setThinking:n=>e({isThinking:n}),applyAgentPatches:n=>{const{nodes:s,edges:o}=t().draft,i=ve({nodes:s,edges:o},n);return e({draft:{nodes:i.nodes,edges:i.edges},runResults:{}}),i},resetDraft:()=>e({draft:{nodes:[],edges:[]},runResults:{},linkedWorkflowId:null}),clearConversation:()=>e({messages:[],draft:{nodes:[],edges:[]},runResults:{},linkedWorkflowId:null}),setRunResults:n=>e({runResults:n}),updateRunNode:(n,s)=>e(o=>({runResults:{...o.runResults,[n]:{...o.runResults[n],...s}}})),setIsRunning:n=>e({isRunning:n}),clearResults:()=>e({runResults:{}}),loadWorkflow:(n,s,o)=>e({draft:{nodes:s,edges:o},linkedWorkflowId:n,runResults:{},messages:[]}),unlinkWorkflow:()=>e({linkedWorkflowId:null})}),{name:"venice-playground",version:1,storage:xe(()=>we()),partialize:e=>({messages:e.messages.slice(-40),draft:e.draft,linkedWorkflowId:e.linkedWorkflowId})})),We=["text","image","tts","music","video"];function q(e){return e?e.data.filter(t=>!t.model_spec?.offline).map(t=>t.id).sort():[]}function qe(){const e=Ae({queries:We.map(s=>({queryKey:["models",s],queryFn:()=>F(`/models?type=${s}`,{noAuth:!0}),staleTime:3e5}))}),t={text:q(e[0].data),image:q(e[1].data),tts:q(e[2].data),music:q(e[3].data),video:q(e[4].data)},n=e.some(s=>s.isLoading);return{catalog:t,isLoading:n}}const Ie=["function_calling_default","most_intelligent","default"],Le=new Set(["qwen3-next-80b","zai-org-glm-4.7","mistral-small-3-2-24b-instruct"]);function De(e){if((e.model_spec?.traits??[]).some(s=>Ie.includes(s))||Le.has(e.id))return 0;const n=e.model_spec?.capabilities??{};return n.supportsResponseSchema&&n.supportsFunctionCalling?n.supportsReasoning?2:1:n.supportsResponseSchema||n.supportsFunctionCalling?2:3}function ee(){const{data:e,isLoading:t}=be("text");return{models:b.useMemo(()=>e?e.filter(s=>!s.model_spec?.offline).map(s=>{const o=s.model_spec?.capabilities??{},i=s.model_spec?.traits??[],a=De(s);return{id:s.id,name:s.model_spec?.name||s.id,capabilities:o,traits:i,contextTokens:s.model_spec?.availableContextTokens,recommended:a===0,tier:a,reasoning:o.supportsReasoning===!0,uncensored:i.includes("most_uncensored")}}).sort((s,o)=>s.tier!==o.tier?s.tier-o.tier:s.name.localeCompare(o.name)):[],[e]),isLoading:t}}const Ve=new Set(["add_node","remove_node","set_params","move_node","connect","disconnect","clear"]),te="qwen3-next-80b";function Ue(){return Object.values(C).map(e=>{const t=e.params.map(n=>{const s=[`${n.name}: ${n.type}${n.required?" (required)":""}`];return n.default!==void 0&&n.default!==""&&s.push(`default=${JSON.stringify(n.default)}`),n.enumValues&&s.push(`one of [${n.enumValues.filter(Boolean).join(", ")}]`),(n.min!==void 0||n.max!==void 0)&&s.push(`range ${n.min??"-"}..${n.max??"-"}`),` - ${s.join(" — ")}`}).join(` +`);return`- ${e.type} (${e.label}) | input=${e.input} output=${e.output} + ${e.description}${t?` + params: +${t}`:""}`}).join(` + +`)}function Fe(e){if(!e)return"";const t=[];return e.text.length&&t.push(`chat: ${e.text.join(", ")}`),e.image.length&&t.push(`imageGen: ${e.image.join(", ")}`),e.tts.length&&t.push(`tts: ${e.tts.join(", ")}`),e.music.length&&t.push(`music: ${e.music.join(", ")}`),e.video.length&&t.push(`video: ${e.video.join(", ")}`),t.length===0?"":` + +Available models per node type (use ONLY these ids; pick the one that best matches the user's intent or use the default if no preference): +${t.map(n=>`- ${n}`).join(` +`)}`}const Be=`You are a workflow designer for OpenVenice. You help the user author visual workflows that chain Venice AI models. + +You have these node types available: + +${Ue()} + +You respond by emitting patches to mutate the current draft workflow. Each patch is one of: +- {"op":"add_node","nodeType":"","id":"optional_id","params":{...}} — add a new node +- {"op":"set_params","id":"","params":{...}} — update a node's params +- {"op":"connect","source":"","target":""} — connect two nodes +- {"op":"disconnect","id":""} — remove an edge +- {"op":"remove_node","id":""} — remove a node +- {"op":"clear"} — remove all nodes and edges + +RULES: +1. Every response MUST be a single valid JSON object, nothing before or after. Do not wrap in markdown fences. +2. Schema: {"say": string, "patches": Array}. +3. "say" is a short (1–3 sentences) narration of what you just did or a question to the user. +4. When building a new workflow from scratch, start with {"op":"clear"} then add nodes top-to-bottom and connect them. +5. Always assign explicit ids when adding multiple nodes in one turn so you can reference them in connect patches. +6. Workflows need at least one textInput (or a generation node with a self-contained prompt) and an output node at the end. +7. Use {{input}} inside a node's prompt to place upstream text precisely, or leave prompt empty to append input after. +8. Keep to the param names and enum values listed above. Omit params to accept defaults. +9. If the user just asks a question, respond with a "say" and an empty "patches" array. +10. Do not narrate patches you aren't emitting. Do not produce commentary outside the JSON. + +Example response: +{"say":"I built a pipeline that researches a topic, summarizes it, and narrates the summary.","patches":[{"op":"clear"},{"op":"add_node","nodeType":"textInput","id":"in","params":{"inputText":"Quantum computing progress in 2025"}},{"op":"add_node","nodeType":"chat","id":"research","params":{"prompt":"Research this topic thoroughly.","webSearch":"on"}},{"op":"add_node","nodeType":"chat","id":"summary","params":{"prompt":"Summarize into 5 bullet points.","temperature":0.3}},{"op":"add_node","nodeType":"tts","id":"narrate","params":{"voice":"af_sky"}},{"op":"add_node","nodeType":"output","id":"out"},{"op":"connect","source":"in","target":"research"},{"op":"connect","source":"research","target":"summary"},{"op":"connect","source":"summary","target":"narrate"},{"op":"connect","source":"narrate","target":"out"}]}`;function Qe(e){return Be+Fe(e)}function Je(e){if(e.nodes.length===0)return"Current draft is empty.";const t=e.nodes.map(s=>{const o=[],i=s.data;for(const a of C[s.data.nodeType]?.params??[]){const l=i[a.name];if(l!==void 0&&l!==""&&l!==null){const d=typeof l=="string"?l.length>60?l.slice(0,60)+"…":l:JSON.stringify(l);o.push(`${a.name}=${d}`)}}return` - ${s.id} [${s.data.nodeType}] ${o.join(" ")}`}),n=e.edges.map(s=>` - ${s.id}: ${s.source} → ${s.target}`);return`Current draft: +Nodes: +${t.join(` +`)} +Edges: +${n.join(` +`)||" (none)"}`}function ze(e){const t=e.trim(),n=t.match(/```(?:json)?\s*([\s\S]*?)```/);if(n)return n[1].trim();const s=t.indexOf("{"),o=t.lastIndexOf("}");return s!==-1&&o!==-1&&o>s?t.slice(s,o+1):t}function He(e){if(!e||typeof e!="object")return!1;const t=e;if(typeof t.op!="string"||!Ve.has(t.op))return!1;switch(t.op){case"clear":return!0;case"add_node":return typeof t.nodeType=="string"&&t.nodeType in C;case"remove_node":case"disconnect":return typeof t.id=="string"&&t.id.length>0;case"set_params":return typeof t.id=="string"&&t.id.length>0&&typeof t.params=="object"&&t.params!==null;case"move_node":return typeof t.id=="string"&&typeof t.position=="object"&&t.position!==null;case"connect":return typeof t.source=="string"&&typeof t.target=="string"&&t.source!==t.target}return!1}function Ye(e,t){const n=C[e];if(!n)return{};const s=new Set(["model","prompt",...n.params.map(i=>i.name)]),o={};for(const[i,a]of Object.entries(t))s.has(i)&&(o[i]=a);return o}function Y(e){const t=ze(e);let n;try{n=JSON.parse(t)}catch{return{say:"",patches:[],invalidPatches:0}}const s=typeof n.say=="string"?n.say:"",o=Array.isArray(n.patches)?n.patches:[],i=[];let a=0;for(const l of o){if(!He(l)){a++;continue}l.op==="add_node"&&l.params?i.push({...l,params:Ye(l.nodeType,l.params)}):(l.op,i.push(l))}return{say:s,patches:i,invalidPatches:a}}async function K(e){const t={model:e.model,messages:e.messages,temperature:e.temperature,max_tokens:4096};return e.useResponseFormat&&(t.response_format={type:"json_object"}),(await F("/chat/completions",{method:"POST",body:JSON.stringify(t),signal:e.signal})).choices[0]?.message?.content??""}async function Ke({userMessage:e,draft:t,history:n,catalog:s,model:o,capabilities:i,signal:a}){const l=o,d=i?.supportsResponseSchema===!0,x=[{role:"system",content:Qe(s)},...n.map(w=>({role:w.role,content:w.content})),{role:"user",content:`${Je(t)} + +User: ${e} + +Reply with a single JSON object: {"say": "...", "patches": [...]}. No prose, no markdown fences.`}],p=await K({model:l,messages:x,temperature:.3,useResponseFormat:d,signal:a}),h=Y(p);if(h.patches.length===0&&!h.say&&p.length>0){const w=[...x,{role:"assistant",content:p},{role:"user",content:'That was not valid JSON. Reply again with ONLY a single JSON object matching {"say": string, "patches": Patch[]}. No commentary, no fences.'}];try{const y=await K({model:l,messages:w,temperature:0,useResponseFormat:d,signal:a});return Y(y)}catch{}}return h}const Ge=Object.keys(C),Xe=[{type:"function",function:{name:"clear",description:"Remove all nodes and edges. Use when starting a fresh workflow.",parameters:{type:"object",properties:{},additionalProperties:!1}}},{type:"function",function:{name:"add_node",description:'Add a node to the canvas. Returns the assigned id (use it for connect calls). For "params": include only the fields you want to set; defaults apply otherwise. Use {{input}} inside any prompt field to inject upstream text.',parameters:{type:"object",properties:{node_type:{type:"string",enum:Ge,description:"The kind of node to add."},id:{type:"string",description:"Optional explicit id. If omitted, a uuid is generated. Use this id in subsequent connect/set_params calls."},params:{type:"object",description:"Node-specific params (model, prompt, temperature, etc). See system prompt for the full schema per node type.",additionalProperties:!0}},required:["node_type"],additionalProperties:!1}}},{type:"function",function:{name:"connect",description:"Connect two nodes (data flows from source to target).",parameters:{type:"object",properties:{source:{type:"string",description:"Source node id."},target:{type:"string",description:"Target node id."}},required:["source","target"],additionalProperties:!1}}},{type:"function",function:{name:"set_params",description:"Update params on an existing node. Merged with current params.",parameters:{type:"object",properties:{id:{type:"string"},params:{type:"object",additionalProperties:!0}},required:["id","params"],additionalProperties:!1}}},{type:"function",function:{name:"remove_node",description:"Remove a node and all its connected edges.",parameters:{type:"object",properties:{id:{type:"string"}},required:["id"],additionalProperties:!1}}},{type:"function",function:{name:"pick_model",description:"Get a recommended model id for a node type, optionally biased by preference. Use this BEFORE add_node if unsure which id to use — you will get back an id you can pass directly.",parameters:{type:"object",properties:{node_type:{type:"string",enum:["chat","imageGen","tts","music","video"]},prefer:{type:"string",enum:["fast","best","web","reasoning","uncensored"],description:"'fast' = cheap & quick (default), 'best' = highest quality, 'web' = native web search, 'reasoning' = chain-of-thought, 'uncensored' = no refusals."}},required:["node_type"],additionalProperties:!1}}},{type:"function",function:{name:"ask_user",description:'Pause the build to ask the user a clarifying question (e.g., "Vertical (9:16) or square (1:1)?"). The build will resume on their reply.',parameters:{type:"object",properties:{question:{type:"string"}},required:["question"],additionalProperties:!1}}},{type:"function",function:{name:"done",description:"Signal the workflow is complete. Provide a one-sentence summary of what you built for the user.",parameters:{type:"object",properties:{summary:{type:"string"}},required:["summary"],additionalProperties:!1}}}];function Ze(){return Object.values(C).map(e=>{const t=e.params.map(n=>{const s=[`${n.name}: ${n.type}${n.required?" (required)":""}`];return n.default!==void 0&&n.default!==""&&s.push(`default=${JSON.stringify(n.default)}`),n.enumValues&&s.push(`one of [${n.enumValues.filter(Boolean).join(", ")}]`),(n.min!==void 0||n.max!==void 0)&&s.push(`range ${n.min??"-"}..${n.max??"-"}`),` - ${s.join(" — ")}`}).join(` +`);return`- ${e.type} (${e.label}) | input=${e.input} output=${e.output} + ${e.description}${t?` + params: +${t}`:""}`}).join(` + +`)}const et=`You are a workflow designer for OpenVenice. You build visual workflows that chain Venice AI models by calling tools. + +Available node types: + +${Ze()} + +How you work: +1. Use the provided tools — never reply with prose-only when actions are needed. +2. For a fresh build, call clear() first, then add_node(...) for each step, then connect(source, target) edges, then done(summary). +3. Always assign explicit ids when adding nodes (e.g., id="research", "script", "video"), so you can reference them in connect/set_params calls. +4. **Templates**: Inside any prompt/inputText field, use {{input}} to inject the concatenated text from upstream parents. There is no {{node_id}} syntax — referencing other nodes by name does NOT work. Each node only sees {{input}} = its parents' outputs joined. +5. **No placeholder content**: write inputText fields with realistic example content the user will likely keep, not "Enter the topic here". +6. **Model ids must come from the live Venice catalog** — DO NOT guess names like "suno-v3" or "runway-gen-2". When in doubt, call pick_model({node_type, prefer}) FIRST and use its returned id. add_node will reject unknown model ids and tell you to call pick_model. +7. **Cost & speed**: prefer fast cheap chat models (qwen3-next-80b, mistral-small-3-2-24b-instruct, zai-org-glm-4.7). Only escalate to claude-opus or qwen-thinking when the task explicitly demands top reasoning. Use pick_model with prefer="fast" by default, "best" for premium quality, "web" for native search, "reasoning" for analysis-heavy tasks. +8. **Web search**: only useful on chat nodes whose model has supportsWebSearch. pick_model({node_type:"chat", prefer:"web"}) returns a good one. +9. **For social-video / reel requests**: canonical shape is textInput → chat(research, web) → chat(script) → video (9:16, 1080p, 5-10s) → output. For music: add a SEPARATE branch (textInput → music → output) — DO NOT connect music nodes to video nodes; they can't compose into a single AV file from this engine. Each modality gets its own output. +10. If the request is ambiguous (which platform? which style?), call ask_user with one specific question. +11. End every successful build with done(summary). + +Workflows must terminate at an output node (or the user won't see results). Multiple branches with their own outputs are fine and encouraged for multi-modal results.`,G=16;function tt(e){if(e.nodes.length===0)return"Current draft is empty.";const t=e.nodes.map(s=>` - ${s.id} [${s.data.nodeType}]`).join(` +`),n=e.edges.map(s=>` - ${s.source} → ${s.target}`).join(` +`)||" (none)";return`Current draft: +Nodes: +${t} +Edges: +${n}`}function st(e,t,n){const s=n.catalog;return s?e==="chat"?s.text.includes(t):e==="imageGen"?s.image.includes(t):e==="tts"?s.tts.includes(t):e==="music"?s.music.includes(t):e==="video"?s.video.includes(t):!0:!0}function nt(e,t,n){const s=n.catalog;if(!s)return;if(e==="chat"){const i=n.agentModels??[];if(i.length===0)return s.text[0];const a=i.map(l=>{let d=0;const x=l.capabilities;return t==="web"&&(d+=x.supportsWebSearch?100:0),t==="reasoning"&&(d+=x.supportsReasoning?100:0),t==="uncensored"&&(d+=l.uncensored?100:0),t==="best"&&(l.traits.includes("most_intelligent")&&(d+=80),l.contextTokens&&l.contextTokens>=2e5&&(d+=20)),(t==="fast"||!t)&&(x.supportsReasoning&&(d-=30),l.traits.includes("function_calling_default")&&(d+=50),l.recommended&&(d+=30)),x.supportsResponseSchema&&(d+=10),d-=l.tier*5,{id:l.id,score:d}});return a.sort((l,d)=>d.score-l.score),a[0]?.id}return(e==="imageGen"?s.image:e==="tts"?s.tts:e==="music"?s.music:e==="video"?s.video:[])[0]}function rt(e){if(!e)return{};try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}function ot(e,t,n){try{switch(e){case"clear":return n.applyPatch({op:"clear"}),{ok:!0};case"add_node":{const s=t.node_type;if(!s||!(s in C))return{error:`Unknown node_type: ${String(s)}`};const o=typeof t.id=="string"&&t.id||U(),i=typeof t.params=="object"&&t.params!==null?t.params:{},a=i.model;if(typeof a=="string"&&a.length>0&&!st(s,a,n))return{error:`Unknown model '${a}' for ${s}. Call pick_model({node_type:'${s==="chat"?"chat":s}'}) to get a valid id, then retry add_node with that id.`};const l=C[s],d=new Set(["model","prompt",...l.params.map(h=>h.name)]),x={};for(const[h,w]of Object.entries(i))d.has(h)&&(x[h]=w);for(const h of l.params)if(h.enumValues&&x[h.name]!==void 0){const w=x[h.name];if(typeof w=="boolean"){x[h.name]=w?h.enumValues.includes("on")?"on":h.enumValues[0]:h.enumValues.includes("off")?"off":"";continue}if(typeof w!="string"||!h.enumValues.includes(w))return{error:`Invalid value for ${s}.${h.name}: ${JSON.stringify(w)}. Must be one of [${h.enumValues.filter(Boolean).join(", ")}].`}}const p=n.applyPatch({op:"add_node",nodeType:s,id:o,params:x});return"error"in p?{error:p.error}:{ok:!0,id:p.id??o}}case"connect":{const s=String(t.source??""),o=String(t.target??"");if(!s||!o)return{error:"Both source and target are required."};const i=n.applyPatch({op:"connect",source:s,target:o});return"error"in i?{error:i.error}:{ok:!0,edge_id:i.edge_id}}case"set_params":{const s=String(t.id??""),o=typeof t.params=="object"&&t.params!==null?t.params:{},i=n.applyPatch({op:"set_params",id:s,params:o});return"error"in i?{error:i.error}:{ok:!0}}case"remove_node":{const s=String(t.id??""),o=n.applyPatch({op:"remove_node",id:s});return"error"in o?{error:o.error}:{ok:!0}}case"pick_model":{const s=String(t.node_type??""),o=typeof t.prefer=="string"?t.prefer:void 0,i=nt(s,o,n);return i?{ok:!0,model:i}:{error:`No model available for ${s}`}}case"ask_user":return{ok:!0,message:String(t.question??"")};case"done":return{ok:!0,message:String(t.summary??"Done.")}}return{error:`Unknown tool: ${e}`}}catch(s){return{error:s instanceof Error?s.message:"Tool failed"}}}async function it(e){const t=[{role:"system",content:et},...e.history.map(o=>o.role==="user"?{role:"user",content:o.content}:{role:"assistant",content:o.content}),{role:"user",content:`${tt(e.draft)} + +User request: ${e.userMessage}`}];let n=0,s=!1;for(let o=0;of.apiKey!==null),d=D(f=>f.playgroundAgentModel)||te,{catalog:x}=qe(),{models:p}=ee(),h=p.find(f=>f.id===d)?.capabilities,[w,y]=b.useState(""),[$,m]=b.useState(null),u=b.useRef(null),g=b.useRef(null);b.useEffect(()=>{u.current?.scrollTo({top:u.current.scrollHeight,behavior:"smooth"})},[e,n]);const N=async f=>{const T=f.trim();if(!T||n)return;if(!l){m("Connect your Venice API key first.");return}m(null),y("");const P={id:U(),role:"user",content:T},E={id:U(),role:"assistant",content:"",pending:!0,activity:[]};s(P),s(E),i(!0),g.current?.abort();const A=new AbortController;g.current=A;const I=e.filter(O=>!O.pending&&!O.error).slice(-10).map(O=>({role:O.role,content:O.content}));try{if(h?.supportsFunctionCalling===!0){const k=[],W=await it({userMessage:T,draft:t,history:I,catalog:x,agentModels:p,model:d,capabilities:h,signal:A.signal,applyPatch:c=>{try{const j=S.getState().draft,v=ke({nodes:j.nodes,edges:j.edges},c);return S.setState({draft:{nodes:v.nodes,edges:v.edges}}),{ok:!0,id:v.addedNodeId,edge_id:v.addedEdgeId}}catch(j){return{error:j instanceof Error?j.message:"Patch failed"}}},onStep:c=>{k.push(lt(c)),o(E.id,{activity:[...k]})}});o(E.id,{content:W.say||"Done.",activity:k,pending:!1})}else{const k=await Ke({userMessage:T,draft:t,history:I,catalog:x,model:d,capabilities:h,signal:A.signal});let W;try{k.patches.length>0&&a(k.patches)}catch(v){W=v instanceof Error?v.message:"Failed to apply patches"}const c=k.invalidPatches>0?` (${k.invalidPatches} invalid patch${k.invalidPatches===1?"":"es"} ignored)`:"",j=k.patches.length===0&&!k.say?"The agent returned an unparseable response. Try a different model from the picker above, or simplify the request.":k.say||(k.patches.length>0?"Updated the workflow.":"");o(E.id,{content:j+c,patches:k.patches,error:W,pending:!1})}}catch(O){if(A.signal.aborted)o(E.id,{content:"",error:"Cancelled",pending:!1});else{const k=O instanceof Error?O.message:"Agent request failed";o(E.id,{content:"",error:k,pending:!1})}}finally{i(!1),g.current=null}},_=()=>{g.current?.abort()};return r.jsxs("div",{className:"flex flex-col h-full bg-[#0c0c10]",children:[r.jsx("div",{ref:u,className:"flex-1 overflow-y-auto px-4 py-4",children:e.length===0?r.jsxs("div",{className:"flex flex-col gap-3 pt-8",children:[r.jsx("div",{className:"text-[15px] text-white/85 font-semibold mb-1",children:"What should I build?"}),r.jsx("div",{className:"text-[13px] text-white/45 mb-4",children:"Describe a workflow in plain language. I'll assemble it on the canvas in real time."}),r.jsx("div",{className:"flex flex-col gap-2",children:at.map(f=>r.jsx("button",{onClick:()=>N(f),className:"text-left px-3 py-2.5 rounded-lg border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.16] hover:bg-white/[0.04] transition-all text-[13px] text-white/65 hover:text-white/85 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] focus-visible:outline-offset-2",children:f},f))})]}):r.jsx("div",{className:"flex flex-col gap-3",children:e.map(f=>r.jsxs("div",{className:R("flex flex-col gap-1.5",f.role==="user"?"items-end":"items-start"),children:[r.jsx("div",{className:R("max-w-[88%] px-3.5 py-2 rounded-xl text-[13.5px] leading-relaxed whitespace-pre-wrap",f.role==="user"?"bg-white/[0.09] text-white border border-white/[0.05]":"bg-white/[0.04] border border-white/[0.07] text-white/85"),children:f.pending&&(!f.activity||f.activity.length===0)?r.jsxs("span",{className:"text-white/45 inline-flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block w-3 h-3 border-2 border-white/20 border-t-[var(--color-accent)] rounded-full animate-spin"}),"Thinking…"]}):f.error?r.jsx("span",{className:"text-red-300/95",children:f.error}):f.content||r.jsx("span",{className:"text-white/35 italic",children:"(no message)"})}),f.activity&&f.activity.length>0&&r.jsxs("div",{className:"max-w-[88%] flex flex-col gap-px text-[11.5px] font-mono text-white/45 px-1",children:[f.activity.map((T,P)=>r.jsxs("div",{className:R("flex items-center gap-1.5",!T.ok&&"text-rose-300/85"),children:[r.jsx("span",{className:"text-white/30",children:"·"}),r.jsx("span",{children:T.summary})]},P)),f.pending&&r.jsxs("div",{className:"flex items-center gap-1.5 text-white/35",children:[r.jsx("span",{className:"inline-block w-2 h-2 border border-white/20 border-t-[var(--color-accent)] rounded-full animate-spin"}),r.jsx("span",{children:"Working…"})]})]}),f.patches&&f.patches.length>0&&!f.activity?.length&&r.jsxs("div",{className:"max-w-[88%] px-3 py-1 text-[11px] text-white/40 font-mono tracking-wide",children:[f.patches.length," patch",f.patches.length===1?"":"es"," applied"]})]},f.id))})}),r.jsxs("div",{className:"shrink-0 border-t border-white/[0.06] p-3",children:[$&&r.jsx("div",{className:"mb-2 text-[13px] text-red-300/95",children:$}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsx("textarea",{value:w,onChange:f=>y(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),N(w))},placeholder:n?"Agent is working…":"Describe a workflow or change…",rows:2,disabled:n,className:"flex-1 bg-white/[0.03] border border-white/[0.08] rounded-lg px-3 py-2 text-[13.5px] text-white/90 outline-none resize-none placeholder:text-white/30 focus:border-white/[0.2] disabled:opacity-60"}),n?r.jsx("button",{onClick:_,className:"shrink-0 px-3 py-2 text-[13px] text-white/85 hover:text-white border border-white/[0.12] hover:bg-white/[0.05] rounded-lg transition-colors",children:"Stop"}):r.jsx("button",{onClick:()=>N(w),disabled:!w.trim(),className:"shrink-0 px-4 py-2 text-[13px] font-medium bg-white text-black rounded-lg hover:bg-white/90 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:"Send"})]})]})]})}const dt={textInput:"border-blue-500/30",chat:"border-purple-500/30",imageGen:"border-pink-500/30",tts:"border-green-500/30",music:"border-yellow-500/30",video:"border-orange-500/30",output:"border-white/20"};function ut({id:e,data:t}){const n=C[t.nodeType],s=dt[t.nodeType]??"border-white/20",o=n?.input!=="none",i=n?.output!=="none",a=S(u=>u.runResults[e]),l=(()=>{if(t.nodeType==="textInput")return t.inputText?.trim()||void 0;if(t.nodeType!=="output")return t.prompt?.trim()||void 0})(),d=[];t.model&&d.push(t.model),t.nodeType==="chat"&&t.webSearch&&t.webSearch!=="off"&&d.push(`web:${t.webSearch}`),t.nodeType==="imageGen"&&(t.width&&t.height&&d.push(`${t.width}×${t.height}`),t.steps&&d.push(`${t.steps} steps`)),t.nodeType==="music"&&t.duration&&d.push(`${t.duration}s`),t.nodeType==="video"&&t.videoAspectRatio&&d.push(t.videoAspectRatio),t.nodeType==="tts"&&t.voice&&d.push(t.voice);const x=a?.status==="running"?"ring-2 ring-white/20 animate-pulse":a?.status==="done"?"ring-2 ring-green-500/30":a?.status==="error"?"ring-2 ring-red-500/30":"",p=a?.output,h=a?.outputKind,w=h==="image"||p?.startsWith("[image:"),y=h==="audio"||p?.startsWith("[audio:"),$=h==="video"||p?.startsWith("[video:"),m=(()=>{if(p)return p.startsWith("[image:")||p.startsWith("[audio:")||p.startsWith("[video:")?p.slice(7,-1):p})();return r.jsxs("div",{className:R("rounded-xl border-2 bg-[#111] shadow-xl min-w-[240px] max-w-[280px]",s,x),children:[o&&r.jsx(J,{type:"target",position:z.Top,className:"!w-3 !h-3 !bg-white/30 !border-2 !border-[#111]"}),r.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5 border-b border-white/[0.06]",children:[r.jsx("span",{className:"text-[13.5px] font-medium text-white/60",children:n?.label??t.nodeType}),a?.status==="running"&&r.jsx("span",{className:"ml-auto text-[11px] text-white/30",children:"Running…"}),a?.status==="done"&&r.jsx("span",{className:"ml-auto text-[11px] text-green-400/50",children:"Done"}),a?.status==="error"&&r.jsx("span",{className:"ml-auto text-[11px] text-red-400/60",children:"Error"}),!a?.status&&d.length>0&&r.jsx("span",{className:"ml-auto text-[11px] text-white/25 truncate max-w-[140px]",title:d.join(" · "),children:d.join(" · ")})]}),l&&!a?.status&&r.jsx("div",{className:"px-3.5 py-2.5",children:r.jsx("p",{className:"text-[12.5px] text-white/50 leading-relaxed line-clamp-3 whitespace-pre-wrap",children:l})}),a?.status==="error"&&r.jsx("div",{className:"px-3.5 py-2.5",children:r.jsx("p",{className:"text-[12.5px] text-red-400/70 leading-relaxed whitespace-pre-wrap",children:a.error})}),a?.status==="done"&&m&&r.jsx("div",{className:"px-3.5 py-2.5",children:w?r.jsx("img",{src:m,alt:"",className:"w-full rounded border border-white/[0.06]"}):y?r.jsx("audio",{src:m,controls:!0,className:"w-full h-8"}):$?r.jsx("video",{src:m,controls:!0,className:"w-full rounded border border-white/[0.06]"}):r.jsx("p",{className:"text-[12.5px] text-white/55 leading-relaxed line-clamp-6 whitespace-pre-wrap",children:m})}),i&&r.jsx(J,{type:"source",position:z.Bottom,className:"!w-3 !h-3 !bg-white/30 !border-2 !border-[#111]"})]})}const pt=b.memo(ut),ht={venice:pt};function mt({nodes:e,edges:t}){const[n,s]=Ne(e),[o,i]=Se(t),{fitView:a}=_e();b.useEffect(()=>{s(e)},[e,s]),b.useEffect(()=>{i(t)},[t,i]),b.useEffect(()=>{const d=setTimeout(()=>a({duration:300,padding:.2}),50);return()=>clearTimeout(d)},[e.length,t.length,a]);const l=b.useMemo(()=>ht,[]);return r.jsxs(Re,{nodes:n,edges:o,nodeTypes:l,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},className:"bg-[#080808]",defaultEdgeOptions:{animated:!0,style:{stroke:"rgba(255,255,255,0.1)",strokeWidth:2}},children:[r.jsx($e,{variant:Oe.Dots,gap:20,size:1,color:"rgba(255,255,255,0.03)"}),r.jsx(Te,{showInteractive:!1,className:"!bg-[#111] !border-white/[0.06] !shadow-xl [&>button]:!bg-[#111] [&>button]:!border-white/[0.06] [&>button]:!text-white/30 [&>button:hover]:!bg-white/[0.06]"})]})}function ft({nodes:e,edges:t}){return e.length===0?r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsxs("div",{className:"text-center max-w-sm",children:[r.jsx("p",{className:"text-[14px] text-white/20 mb-2",children:"No workflow yet"}),r.jsx("p",{className:"text-[13px] text-white/10",children:"Tell the agent what you want to build — it will assemble the pipeline here in real time."})]})}):r.jsx(je,{children:r.jsx(mt,{nodes:e,edges:t})})}function gt({value:e,onChange:t}){const{models:n,isLoading:s}=ee(),[o,i]=b.useState(!1),[a,l]=b.useState(""),[d,x]=b.useState(!1),p=b.useRef(null);b.useEffect(()=>{const m=u=>{p.current&&!p.current.contains(u.target)&&i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const h=b.useMemo(()=>{const m=d?n:n.filter(g=>g.tier<=2);if(!a)return m;const u=a.toLowerCase();return m.filter(g=>g.id.toLowerCase().includes(u)||g.name.toLowerCase().includes(u))},[n,a,d]),w=b.useMemo(()=>{const m=[{label:"Recommended for agents",items:[]},{label:"Capable",items:[]},{label:"Other",items:[]}];for(const u of h)u.tier===0?m[0].items.push(u):u.tier===1||u.tier===2?m[1].items.push(u):m[2].items.push(u);return m.filter(u=>u.items.length>0)},[h]),y=n.find(m=>m.id===e),$=s?"Loading…":y?.name||e||"Pick agent model";return r.jsxs("div",{ref:p,className:"relative w-56 shrink-0",children:[r.jsxs("button",{type:"button",onClick:()=>i(!o),className:R("w-full flex items-center justify-between gap-2 bg-white/[0.03] border border-white/[0.08] rounded-md px-2.5 py-1.5 text-[13px] hover:border-white/[0.18] transition-colors text-left",o&&"border-white/[0.25]"),"aria-haspopup":"listbox","aria-expanded":o,children:[r.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[r.jsx("span",{className:"truncate text-white/85",children:$}),y?.recommended&&r.jsx("span",{className:"shrink-0 text-[10px] px-1 py-px rounded bg-emerald-400/15 text-emerald-300 font-medium uppercase tracking-wider",children:"Rec"})]}),r.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",className:R("shrink-0 text-white/40 transition-transform duration-150",o&&"rotate-180"),children:r.jsx("path",{d:"M2.5 3.75L5 6.25L7.5 3.75"})})]}),o&&r.jsxs("div",{className:"absolute top-full right-0 mt-1 w-[340px] z-50 bg-[#101015] border border-white/[0.1] rounded-lg shadow-2xl shadow-black/70 animate-scale-in overflow-hidden",children:[r.jsxs("div",{className:"px-2 py-2 border-b border-white/[0.06] flex items-center gap-2",children:[r.jsx("input",{autoFocus:!0,value:a,onChange:m=>l(m.target.value),placeholder:"Search models…",className:"flex-1 bg-white/[0.03] border border-white/[0.06] rounded px-2 py-1 text-[13px] text-white/85 outline-none focus:border-white/[0.2] placeholder:text-white/30"}),r.jsx("button",{onClick:()=>x(!d),className:R("text-[11px] px-1.5 py-1 rounded border transition-colors",d?"bg-white/[0.08] border-white/[0.15] text-white/85":"border-white/[0.08] text-white/45 hover:text-white/70"),title:d?"Showing all models":"Showing only schema-capable models",children:d?"All":"Capable"})]}),r.jsxs("div",{className:"max-h-[380px] overflow-y-auto py-1",children:[w.length===0&&r.jsx("div",{className:"px-3 py-6 text-center text-[13px] text-white/30",children:"No matches"}),w.map(m=>r.jsxs("div",{children:[r.jsx("div",{className:"px-3 pt-2 pb-1 text-[10.5px] uppercase tracking-[0.08em] text-white/30 font-medium",children:m.label}),m.items.map(u=>r.jsxs("button",{onClick:()=>{t(u.id),i(!1),l("")},className:R("w-full text-left px-3 py-2 hover:bg-white/[0.04] transition-colors",u.id===e&&"bg-white/[0.06]"),children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[13px] text-white/90 font-medium truncate flex-1",children:u.name}),u.id===e&&r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-400 shrink-0",children:r.jsx("path",{d:"M20 6L9 17l-5-5"})})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[u.recommended&&r.jsx(M,{tone:"emerald",children:"Recommended"}),u.capabilities.supportsResponseSchema&&r.jsx(M,{tone:"sky",children:"JSON"}),u.capabilities.supportsFunctionCalling&&r.jsx(M,{tone:"violet",children:"Tools"}),u.reasoning&&r.jsx(M,{tone:"amber",children:"Reasoning"}),u.capabilities.supportsVision&&r.jsx(M,{tone:"pink",children:"Vision"}),u.capabilities.supportsWebSearch&&r.jsx(M,{tone:"slate",children:"Web"}),u.uncensored&&r.jsx(M,{tone:"rose",children:"Uncensored"})]}),r.jsxs("div",{className:"text-[11px] text-white/35 mt-1 font-mono truncate",children:[u.id,u.contextTokens?` · ${xt(u.contextTokens)} ctx`:""]})]},u.id))]},m.label))]})]})]})}const X={emerald:"bg-emerald-400/15 text-emerald-300",sky:"bg-sky-400/15 text-sky-300",violet:"bg-violet-400/15 text-violet-300",amber:"bg-amber-400/15 text-amber-300",pink:"bg-pink-400/15 text-pink-300",slate:"bg-white/[0.06] text-white/55",rose:"bg-rose-400/15 text-rose-300"};function M({children:e,tone:t="slate"}){return r.jsx("span",{className:R("text-[10px] px-1.5 py-px rounded font-medium uppercase tracking-wider",X[t]??X.slate),children:e})}function xt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function yt(){const e=S(c=>c.draft),t=S(c=>c.isRunning),n=S(c=>c.linkedWorkflowId),s=S(c=>c.loadWorkflow),o=S(c=>c.unlinkWorkflow),i=S(c=>c.clearConversation),a=S(c=>c.resetDraft),l=L(c=>c.workflows),d=L(c=>c.createWorkflow),x=L(c=>c.updateWorkflow),p=L(c=>c.setActiveWorkflow),h=D(c=>c.setActiveTab),w=D(c=>c.playgroundAgentModel),y=D(c=>c.setPlaygroundAgentModel),$=w||te,[m,u]=b.useState(null),g=l.find(c=>c.id===n),N=Ce(e),_=e.nodes.length>0,f=_&&N.errors.length===0&&!t,T=async()=>{if(!f)return;const c=S.getState();c.clearResults(),c.setIsRunning(!0);const j={};for(const v of e.nodes)j[v.id]={nodeId:v.id,status:"pending",output:void 0,error:void 0};c.setRunResults(j);try{await Ee(e.nodes,e.edges,{onUpdate:(v,se)=>c.updateRunNode(v,se)}),Q.success("Workflow completed")}catch(v){Q.fromError(v,"Workflow failed")}finally{S.getState().setIsRunning(!1)}},P=c=>{const j=`Playground — ${new Date().toLocaleString()}`,v=d(j);return x(v,{nodes:e.nodes,edges:e.edges}),v},E=()=>{_&&(g?(x(g.id,{nodes:e.nodes,edges:e.edges}),u(`Updated "${g.name}"`)):(P(),u("Saved to Workflows")),setTimeout(()=>u(null),2e3))},A=()=>{if(!_)return;const c=P();u("Saved as new workflow"),setTimeout(()=>u(null),2e3),s(c,e.nodes,e.edges)},I=()=>{if(!_)return;let c=g?.id;g?x(g.id,{nodes:e.nodes,edges:e.edges}):c=P(),c&&p(c),h("workflows")},O=c=>{const j=l.find(v=>v.id===c);j&&s(j.id,j.nodes,j.edges)},k=()=>{o()},W=()=>{confirm("Clear the current conversation and canvas?")&&i()};return r.jsxs("div",{className:"flex h-full",children:[r.jsxs("div",{className:"w-[420px] shrink-0 border-r border-white/[0.06] flex flex-col",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 h-11 border-b border-white/[0.06] bg-[#0a0a0a] shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:"text-[14px] font-medium text-white/65 shrink-0",children:"Playground"}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded bg-white/[0.06] text-white/45 uppercase tracking-wider shrink-0",children:"Agent"})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 min-w-0",children:[r.jsx(gt,{value:$,onChange:y}),r.jsx("button",{onClick:W,className:"text-[12px] text-white/45 hover:text-white/80 transition-colors px-1.5 py-1 rounded focus-visible:outline focus-visible:outline-1 focus-visible:outline-white/40",title:"Clear conversation",children:"Clear"})]})]}),r.jsx("div",{className:"flex-1 min-h-0",children:r.jsx(ct,{})})]}),r.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 h-11 border-b border-white/[0.06] bg-[#0a0a0a] shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[g?r.jsxs("div",{className:"flex items-center gap-1 min-w-0 px-2 py-0.5 rounded bg-white/[0.04] border border-white/[0.06]",children:[r.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"text-white/35 shrink-0",children:r.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 113 3L7 19l-4 1 1-4 12.5-12.5z"})}),r.jsx("span",{className:"text-[12.5px] text-white/65 truncate max-w-[180px]",title:g.name,children:g.name}),r.jsx("button",{onClick:k,className:"text-white/25 hover:text-white/60 transition-colors p-0.5 -mr-1 shrink-0",title:"Unlink",children:r.jsxs("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}):l.length>0?r.jsxs("select",{value:"",onChange:c=>c.target.value&&O(c.target.value),className:"bg-white/[0.03] border border-white/[0.06] rounded px-2 py-1 text-[12px] text-white/45 outline-none hover:border-white/[0.12] max-w-[200px]",children:[r.jsx("option",{value:"",children:"Edit saved workflow…"}),l.map(c=>r.jsx("option",{value:c.id,children:c.name},c.id))]}):null,r.jsxs("span",{className:"text-[12px] text-white/30 font-mono shrink-0",children:[e.nodes.length,"n · ",e.edges.length,"e"]}),N.errors.length>0&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400/80 shrink-0",title:N.errors.map(c=>c.message).join(` +`)}),N.errors.length===0&&N.warnings.length>0&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-400/70 shrink-0",title:N.warnings.map(c=>c.message).join(` +`)}),m&&r.jsx("span",{className:"text-[12px] text-green-400/70 truncate",children:m})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[r.jsx("button",{onClick:a,disabled:!_||t,className:"text-white/25 hover:text-white/55 transition-colors p-1.5 disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset canvas",children:r.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"})})}),r.jsx("button",{onClick:T,disabled:!f,className:R("flex items-center gap-1.5 text-[13px] font-medium px-2.5 py-1 rounded-md transition-colors",f?"bg-green-500/20 text-green-300 border border-green-500/30 hover:bg-green-500/30":"bg-white/[0.05] text-white/25 border border-white/[0.06] cursor-not-allowed"),title:N.errors.length>0?N.errors.map(c=>c.message).join(` +`):"Run the workflow inline",children:t?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-2.5 h-2.5 border-2 border-green-300/60 border-t-transparent rounded-full animate-spin"}),r.jsx("span",{className:"hidden sm:inline",children:"Running…"})]}):r.jsxs(r.Fragment,{children:[r.jsx("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),"Run"]})}),r.jsx("button",{onClick:E,disabled:!_||t,className:R("text-[13px] px-2.5 py-1 rounded-md border border-white/[0.08] transition-colors",_&&!t?"text-white/60 hover:border-white/[0.15] hover:text-white/85":"text-white/20 opacity-40 cursor-not-allowed"),title:g?`Update "${g.name}"`:"Save as new workflow",children:g?"Update":"Save"}),g&&r.jsx("button",{onClick:A,disabled:!_||t,className:"text-white/35 hover:text-white/65 transition-colors p-1.5 disabled:opacity-30 disabled:cursor-not-allowed",title:"Save as a new workflow",children:r.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2"}),r.jsx("path",{d:"M7 21h12a2 2 0 002-2V9"})]})}),r.jsxs("button",{onClick:I,disabled:!_||t,className:R("flex items-center gap-1.5 text-[13px] font-medium px-2.5 py-1 rounded-md transition-colors",_&&!t?"bg-white text-black hover:bg-white/90":"bg-white/[0.05] text-white/30 cursor-not-allowed"),title:"Open in Workflows tab",children:[r.jsx("span",{className:"hidden md:inline",children:"Open in Workflows"}),r.jsx("span",{className:"md:hidden",children:"Open"}),r.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:r.jsx("path",{d:"M7 17L17 7M7 7h10v10"})})]})]})]}),r.jsx("div",{className:"flex-1 min-h-0",children:r.jsx(ft,{nodes:e.nodes,edges:e.edges})})]})]})}export{yt as PlaygroundView}; diff --git a/ventures/havre/open/assets/workflow-engine-BZV40eAE.css b/ventures/havre/open/assets/workflow-engine-BZV40eAE.css new file mode 100644 index 0000000..093f5cd --- /dev/null +++ b/ventures/havre/open/assets/workflow-engine-BZV40eAE.css @@ -0,0 +1 @@ +.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))} diff --git a/ventures/havre/open/assets/workflow-engine-ClbuiuAZ.js b/ventures/havre/open/assets/workflow-engine-ClbuiuAZ.js new file mode 100644 index 0000000..3d7602e --- /dev/null +++ b/ventures/havre/open/assets/workflow-engine-ClbuiuAZ.js @@ -0,0 +1,11 @@ +import{B as Ir,C as ba,R as _a,D as Ea,r as D,j as A,g as An,q as Sa,v as Na,w as Ca,x as Ma,y as it,E as ka}from"./index-CfrUZ43_.js";function ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n{}};function Jt(){for(var e=0,t=arguments.length,n={},o;e=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}zt.prototype=Jt.prototype={constructor:zt,on:function(e,t){var n=this._,o=Aa(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i0)for(var n=new Array(r),o=0,r,i;o=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),vo.hasOwnProperty(t)?{space:vo[t],local:e}:e}function Pa(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$n&&t.documentElement.namespaceURI===$n?t.createElement(e):t.createElementNS(n,e)}}function Ta(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ar(e){var t=en(e);return(t.local?Ta:Pa)(t)}function Da(){}function Xn(e){return e==null?Da:function(){return this.querySelector(e)}}function Ra(e){typeof e!="function"&&(e=Xn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r=p&&(p=b+1);!(S=w[p])&&++p=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function sc(e){e||(e=ac);function t(l,f){return l&&f?e(l.__data__,f.__data__):!l-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;it?1:e>=t?0:NaN}function cc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uc(){return Array.from(this)}function lc(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?bc:typeof t=="function"?Ec:_c)(e,t,n??"")):Xe(this.node(),e)}function Xe(e,t){return e.style.getPropertyValue(t)||Rr(e).getComputedStyle(e,null).getPropertyValue(t)}function Nc(e){return function(){delete this[e]}}function Cc(e,t){return function(){this[e]=t}}function Mc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function kc(e,t){return arguments.length>1?this.each((t==null?Nc:typeof t=="function"?Mc:Cc)(e,t)):this.node()[e]}function zr(e){return e.trim().split(/^|\s+/)}function Yn(e){return e.classList||new Hr(e)}function Hr(e){this._node=e,this._names=zr(e.getAttribute("class")||"")}Hr.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Lr(e,t){for(var n=Yn(e),o=-1,r=t.length;++o=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function nu(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n()=>e;function Pn(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Pn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function fu(e){return!e.ctrlKey&&!e.button}function hu(){return this.parentNode}function pu(e,t){return t??{x:e.x,y:e.y}}function gu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wr(){var e=fu,t=hu,n=pu,o=gu,r={},i=Jt("start","drag","end"),s=0,a,c,u,d,l=0;function f(x){x.on("mousedown.drag",h).filter(o).on("touchstart.drag",w).on("touchmove.drag",y,du).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(x,S){if(!(d||!e.call(this,x,S))){var _=p(this,t.call(this,x,S),x,S,"mouse");_&&(ce(x.view).on("mousemove.drag",g,lt).on("mouseup.drag",m,lt),Fr(x.view),gn(x),u=!1,a=x.clientX,c=x.clientY,_("start",x))}}function g(x){if(Fe(x),!u){var S=x.clientX-a,_=x.clientY-c;u=S*S+_*_>l}r.mouse("drag",x)}function m(x){ce(x.view).on("mousemove.drag mouseup.drag",null),jr(x.view,u),Fe(x),r.mouse("end",x)}function w(x,S){if(e.call(this,x,S)){var _=x.changedTouches,N=t.call(this,x,S),P=_.length,T,V;for(T=0;T>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Mt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Mt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=yu.exec(e))?new ae(t[1],t[2],t[3],1):(t=xu.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wu.exec(e))?Mt(t[1],t[2],t[3],t[4]):(t=vu.exec(e))?Mt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bu.exec(e))?Mo(t[1],t[2]/100,t[3]/100,1):(t=_u.exec(e))?Mo(t[1],t[2]/100,t[3]/100,t[4]):bo.hasOwnProperty(e)?So(bo[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function So(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function Mt(e,t,n,o){return o<=0&&(e=t=n=NaN),new ae(e,t,n,o)}function Nu(e){return e instanceof vt||(e=De(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function Tn(e,t,n,o){return arguments.length===1?Nu(e):new ae(e,t,n,o??1)}function ae(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Zn(ae,Tn,Xr(vt,{brighter(e){return e=e==null?Ft:Math.pow(Ft,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?dt:Math.pow(dt,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Pe(this.r),Pe(this.g),Pe(this.b),jt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:No,formatHex:No,formatHex8:Cu,formatRgb:Co,toString:Co}));function No(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}`}function Cu(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}${$e((isNaN(this.opacity)?1:this.opacity)*255)}`}function Co(){const e=jt(this.opacity);return`${e===1?"rgb(":"rgba("}${Pe(this.r)}, ${Pe(this.g)}, ${Pe(this.b)}${e===1?")":`, ${e})`}`}function jt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $e(e){return e=Pe(e),(e<16?"0":"")+e.toString(16)}function Mo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new de(e,t,n,o)}function Yr(e){if(e instanceof de)return new de(e.h,e.s,e.l,e.opacity);if(e instanceof vt||(e=De(e)),!e)return new de;if(e instanceof de)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,c=(i+r)/2;return a?(t===i?s=(n-o)/a+(n0&&c<1?0:s,new de(s,a,c,e.opacity)}function Mu(e,t,n,o){return arguments.length===1?Yr(e):new de(e,t,n,o??1)}function de(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Zn(de,Mu,Xr(vt,{brighter(e){return e=e==null?Ft:Math.pow(Ft,e),new de(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?dt:Math.pow(dt,e),new de(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ae(mn(e>=240?e-240:e+120,r,o),mn(e,r,o),mn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new de(ko(this.h),kt(this.s),kt(this.l),jt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=jt(this.opacity);return`${e===1?"hsl(":"hsla("}${ko(this.h)}, ${kt(this.s)*100}%, ${kt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ko(e){return e=(e||0)%360,e<0?e+360:e}function kt(e){return Math.max(0,Math.min(1,e||0))}function mn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const qn=e=>()=>e;function ku(e,t){return function(n){return e+n*t}}function Iu(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Au(e){return(e=+e)==1?Zr:function(t,n){return n-t?Iu(t,n,e):qn(isNaN(t)?n:t)}}function Zr(e,t){var n=t-e;return n?ku(e,n):qn(isNaN(e)?t:e)}const Wt=(function e(t){var n=Au(t);function o(r,i){var s=n((r=Tn(r)).r,(i=Tn(i)).r),a=n(r.g,i.g),c=n(r.b,i.b),u=Zr(r.opacity,i.opacity);return function(d){return r.r=s(d),r.g=a(d),r.b=c(d),r.opacity=u(d),r+""}}return o.gamma=e,o})(1);function $u(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;rn&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,c.push({i:s,x:ge(o,r)})),n=yn.lastIndex;return n180?d+=360:d-u>180&&(u+=360),f.push({i:l.push(r(l)+"rotate(",null,o)-2,x:ge(u,d)})):d&&l.push(r(l)+"rotate("+d+o)}function a(u,d,l,f){u!==d?f.push({i:l.push(r(l)+"skewX(",null,o)-2,x:ge(u,d)}):d&&l.push(r(l)+"skewX("+d+o)}function c(u,d,l,f,h,g){if(u!==l||d!==f){var m=h.push(r(h)+"scale(",null,",",null,")");g.push({i:m-4,x:ge(u,l)},{i:m-2,x:ge(d,f)})}else(l!==1||f!==1)&&h.push(r(h)+"scale("+l+","+f+")")}return function(u,d){var l=[],f=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,l,f),s(u.rotate,d.rotate,l,f),a(u.skewX,d.skewX,l,f),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,l,f),u=d=null,function(h){for(var g=-1,m=f.length,w;++g=0&&e._call.call(void 0,t),e=e._next;--Ye}function $o(){Re=(Yt=ht.now())+tn,Ye=st=0;try{Yu()}finally{Ye=0,qu(),Re=0}}function Zu(){var e=ht.now(),t=e-Yt;t>Kr&&(tn-=t,Yt=e)}function qu(){for(var e,t=Xt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Xt=n);at=e,zn(o)}function zn(e){if(!Ye){st&&(st=clearTimeout(st));var t=e-Re;t>24?(e<1/0&&(st=setTimeout($o,e-ht.now()-tn)),nt&&(nt=clearInterval(nt))):(nt||(Yt=ht.now(),nt=setInterval(Zu,Kr)),Ye=1,Qr($o))}}function Po(e,t,n){var o=new Zt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Gu=Jt("start","end","cancel","interrupt"),Uu=[],ei=0,To=1,Hn=2,Lt=3,Do=4,Ln=5,Ot=6;function nn(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ku(e,n,{name:t,index:o,group:r,on:Gu,tween:Uu,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ei})}function Un(e,t){var n=pe(e,t);if(n.state>ei)throw new Error("too late; already scheduled");return n}function xe(e,t){var n=pe(e,t);if(n.state>Lt)throw new Error("too late; already running");return n}function pe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ku(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Jr(i,0,n.time);function i(u){n.state=To,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,l,f,h;if(n.state!==To)return c();for(d in o)if(h=o[d],h.name===n.name){if(h.state===Lt)return Po(s);h.state===Do?(h.state=Ot,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[d]):+dHn&&o.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Ml(e,t,n){var o,r,i=Cl(t)?Un:xe;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function kl(e,t){var n=this._id;return arguments.length<2?pe(this.node(),n).on.on(e):this.each(Ml(n,e,t))}function Il(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Al(){return this.on("end.remove",Il(this._id))}function $l(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Xn(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s()=>e;function nd(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function be(e,t,n){this.k=e,this.x=t,this.y=n}be.prototype={constructor:be,scale:function(e){return e===1?this:new be(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new be(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var on=new be(1,0,0);ri.prototype=be.prototype;function ri(e){for(;!e.__zoom;)if(!(e=e.parentNode))return on;return e.__zoom}function xn(e){e.stopImmediatePropagation()}function ot(e){e.preventDefault(),e.stopImmediatePropagation()}function od(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rd(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ro(){return this.__zoom||on}function id(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sd(){return navigator.maxTouchPoints||"ontouchstart"in this}function ad(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function ii(){var e=od,t=rd,n=ad,o=id,r=sd,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Ht,u=Jt("start","zoom","end"),d,l,f,h=500,g=150,m=0,w=10;function y(v){v.property("__zoom",Ro).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(v,C,E,k){var M=v.selection?v.selection():v;M.property("__zoom",Ro),v!==M?S(v,C,E,k):M.interrupt().each(function(){_(this,arguments).event(k).start().zoom(null,typeof C=="function"?C.apply(this,arguments):C).end()})},y.scaleBy=function(v,C,E,k){y.scaleTo(v,function(){var M=this.__zoom.k,$=typeof C=="function"?C.apply(this,arguments):C;return M*$},E,k)},y.scaleTo=function(v,C,E,k){y.transform(v,function(){var M=t.apply(this,arguments),$=this.__zoom,z=E==null?x(M):typeof E=="function"?E.apply(this,arguments):E,O=$.invert(z),L=typeof C=="function"?C.apply(this,arguments):C;return n(p(b($,L),z,O),M,s)},E,k)},y.translateBy=function(v,C,E,k){y.transform(v,function(){return n(this.__zoom.translate(typeof C=="function"?C.apply(this,arguments):C,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,k)},y.translateTo=function(v,C,E,k,M){y.transform(v,function(){var $=t.apply(this,arguments),z=this.__zoom,O=k==null?x($):typeof k=="function"?k.apply(this,arguments):k;return n(on.translate(O[0],O[1]).scale(z.k).translate(typeof C=="function"?-C.apply(this,arguments):-C,typeof E=="function"?-E.apply(this,arguments):-E),$,s)},k,M)};function b(v,C){return C=Math.max(i[0],Math.min(i[1],C)),C===v.k?v:new be(C,v.x,v.y)}function p(v,C,E){var k=C[0]-E[0]*v.k,M=C[1]-E[1]*v.k;return k===v.x&&M===v.y?v:new be(v.k,k,M)}function x(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function S(v,C,E,k){v.on("start.zoom",function(){_(this,arguments).event(k).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(k).end()}).tween("zoom",function(){var M=this,$=arguments,z=_(M,$).event(k),O=t.apply(M,$),L=E==null?x(O):typeof E=="function"?E.apply(M,$):E,j=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),F=M.__zoom,Z=typeof C=="function"?C.apply(M,$):C,U=c(F.invert(L).concat(j/F.k),Z.invert(L).concat(j/Z.k));return function(Y){if(Y===1)Y=Z;else{var B=U(Y),W=j/B[2];Y=new be(W,L[0]-B[0]*W,L[1]-B[1]*W)}z.zoom(null,Y)}})}function _(v,C,E){return!E&&v.__zooming||new N(v,C)}function N(v,C){this.that=v,this.args=C,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,C),this.taps=0}N.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,C){return this.mouse&&v!=="mouse"&&(this.mouse[1]=C.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=C.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=C.invert(this.touch1[0])),this.that.__zoom=C,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var C=ce(this.that).datum();u.call(v,this.that,new nd(v,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),C)}};function P(v,...C){if(!e.apply(this,arguments))return;var E=_(this,C).event(v),k=this.__zoom,M=Math.max(i[0],Math.min(i[1],k.k*Math.pow(2,o.apply(this,arguments)))),$=le(v);if(E.wheel)(E.mouse[0][0]!==$[0]||E.mouse[0][1]!==$[1])&&(E.mouse[1]=k.invert(E.mouse[0]=$)),clearTimeout(E.wheel);else{if(k.k===M)return;E.mouse=[$,k.invert($)],Vt(this),E.start()}ot(v),E.wheel=setTimeout(z,g),E.zoom("mouse",n(p(b(k,M),E.mouse[0],E.mouse[1]),E.extent,s));function z(){E.wheel=null,E.end()}}function T(v,...C){if(f||!e.apply(this,arguments))return;var E=v.currentTarget,k=_(this,C,!0).event(v),M=ce(v.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",j,!0),$=le(v,E),z=v.clientX,O=v.clientY;Fr(v.view),xn(v),k.mouse=[$,this.__zoom.invert($)],Vt(this),k.start();function L(F){if(ot(F),!k.moved){var Z=F.clientX-z,U=F.clientY-O;k.moved=Z*Z+U*U>m}k.event(F).zoom("mouse",n(p(k.that.__zoom,k.mouse[0]=le(F,E),k.mouse[1]),k.extent,s))}function j(F){M.on("mousemove.zoom mouseup.zoom",null),jr(F.view,k.moved),ot(F),k.event(F).end()}}function V(v,...C){if(e.apply(this,arguments)){var E=this.__zoom,k=le(v.changedTouches?v.changedTouches[0]:v,this),M=E.invert(k),$=E.k*(v.shiftKey?.5:2),z=n(p(b(E,$),k,M),t.apply(this,C),s);ot(v),a>0?ce(this).transition().duration(a).call(S,z,k,v):ce(this).call(y.transform,z,k,v)}}function I(v,...C){if(e.apply(this,arguments)){var E=v.touches,k=E.length,M=_(this,C,v.changedTouches.length===k).event(v),$,z,O,L;for(xn(v),z=0;z"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},pt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],si=["Enter"," ","Escape"],ai={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var Te;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Te||(Te={}));var gt;(function(e){e.Partial="partial",e.Full="full"})(gt||(gt={}));const ci={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Me;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Me||(Me={}));var qt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(qt||(qt={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const zo={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function ui(e){return e===null?null:e?"valid":"invalid"}const li=e=>"id"in e&&"source"in e&&"target"in e,cd=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Qn=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),bt=(e,t=[0,0])=>{const{width:n,height:o}=Ee(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},ud=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):Qn(r)?r:t.nodeLookup.get(r.id));const a=s?Gt(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return rn(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return sn(n)},_t=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=rn(n,Gt(r)),o=!0)}),o?sn(n):{x:0,y:0,width:0,height:0}},Jn=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...St(t,[n,o,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:l=!0,hidden:f=!1}=u;if(s&&!l||f)continue;const h=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,m=mt(a,Ge(u)),w=(h??0)*(g??0),y=i&&m>0;(!u.internals.handleBounds||y||m>=w||u.dragging)&&c.push(u)}return c},ld=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function dd(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function fd({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=dd(e,s),c=_t(a),u=eo(c,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(u,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function di({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??o;let l=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",ye.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(l=[[c,u],[c+h,u+g]])}else a&&Ue(s.extent)&&(l=[[s.extent[0][0]+c,s.extent[0][1]+u],[s.extent[1][0]+c,s.extent[1][1]+u]]);const f=Ue(l)?ze(t,l,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ye.error015()),{position:{x:f.x-c+(s.measured.width??0)*d[0],y:f.y-u+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function hd({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),g=!h&&f.parentId&&s.find(m=>m.id===f.parentId);(h||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),c=o.filter(f=>f.deletable!==!1),d=ld(s,c);for(const f of c)a.has(f.id)&&!d.find(g=>g.id===f.id)&&d.push(f);if(!r)return{edges:d,nodes:s};const l=await r({nodes:s,edges:d});return typeof l=="boolean"?l?{edges:d,nodes:s}:{edges:[],nodes:[]}:l}const qe=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ze=(e={x:0,y:0},t,n)=>({x:qe(e.x,t[0][0],t[1][0]-(n?.width??0)),y:qe(e.y,t[0][1],t[1][1]-(n?.height??0))});function fi(e,t,n){const{width:o,height:r}=Ee(n),{x:i,y:s}=n.internals.positionAbsolute;return ze(e,[[i,s],[i+o,s+r]],t)}const Ho=(e,t,n)=>en?-qe(Math.abs(e-n),1,t)/t:0,hi=(e,t,n=15,o=40)=>{const r=Ho(e.x,o,t.width-o)*n,i=Ho(e.y,o,t.height-o)*n;return[r,i]},rn=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),On=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),sn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),Ge=(e,t=[0,0])=>{const{x:n,y:o}=Qn(e)?e.internals.positionAbsolute:bt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Gt=(e,t=[0,0])=>{const{x:n,y:o}=Qn(e)?e.internals.positionAbsolute:bt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},pi=(e,t)=>sn(rn(On(e),On(t))),mt=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Lo=e=>fe(e.width)&&fe(e.height)&&fe(e.x)&&fe(e.y),fe=e=>!isNaN(e)&&isFinite(e),pd=(e,t)=>{},Et=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),St=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?Et(a,s):a},Ut=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Oe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function gd(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Oe(e,n),r=Oe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Oe(e.top??e.y??0,n),r=Oe(e.bottom??e.y??0,n),i=Oe(e.left??e.x??0,t),s=Oe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function md(e,t,n,o,r,i){const{x:s,y:a}=Ut(e,[t,n,o]),{x:c,y:u}=Ut({x:e.x+e.width,y:e.y+e.height},[t,n,o]),d=r-c,l=i-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(l)}}const eo=(e,t,n,o,r,i)=>{const s=gd(i,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,u=Math.min(a,c),d=qe(u,o,r),l=e.x+e.width/2,f=e.y+e.height/2,h=t/2-l*d,g=n/2-f*d,m=md(e,h,g,d,t,n),w={left:Math.min(m.left-s.left,0),top:Math.min(m.top-s.top,0),right:Math.min(m.right-s.right,0),bottom:Math.min(m.bottom-s.bottom,0)};return{x:h-w.left+w.right,y:g-w.top+w.bottom,zoom:d}},yt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ue(e){return e!=null&&e!=="parent"}function Ee(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function gi(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function mi(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Oo(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yd(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function xd(e){return{...ai,...e||{}}}function ut(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=he(e),a=St({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:c,y:u}=n?Et(a,t):a;return{xSnapped:c,ySnapped:u,...a}}const to=e=>({width:e.offsetWidth,height:e.offsetHeight}),yi=e=>e?.getRootNode?.()||window?.document,wd=["INPUT","SELECT","TEXTAREA"];function xi(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:wd.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const wi=e=>"clientX"in e,he=(e,t)=>{const n=wi(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Vo=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...to(s)}})};function vi({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+r*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+o*.125,d=Math.abs(c-e),l=Math.abs(u-t);return[c,u,d,l]}function $t(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Bo({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case X.Left:return[t-$t(t-o,i),n];case X.Right:return[t+$t(o-t,i),n];case X.Top:return[t,n-$t(n-r,i)];case X.Bottom:return[t,n+$t(r-n,i)]}}function bi({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,curvature:s=.25}){const[a,c]=Bo({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[u,d]=Bo({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[l,f,h,g]=vi({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${c} ${u},${d} ${o},${r}`,l,f,h,g]}function _i({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n0}const _d=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,Ed=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Sd=(e,t,n={})=>{if(!e.source||!e.target)return t;const o=n.getEdgeId||_d;let r;return li(e)?r={...e}:r={...e,id:o(e)},Ed(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function Ei({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=_i({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Fo={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},Nd=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Cd({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:o=X.Top,center:r,offset:i,stepPosition:s}){const a=Fo[t],c=Fo[o],u={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},l=Nd({source:u,sourcePosition:t,target:d}),f=l.x!==0?"x":"y",h=l[f];let g=[],m,w;const y={x:0,y:0},b={x:0,y:0},[,,p,x]=_i({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*c[f]===-1){f==="x"?(m=r.x??u.x+(d.x-u.x)*s,w=r.y??(u.y+d.y)/2):(m=r.x??(u.x+d.x)/2,w=r.y??u.y+(d.y-u.y)*s);const _=[{x:m,y:u.y},{x:m,y:d.y}],N=[{x:u.x,y:w},{x:d.x,y:w}];a[f]===h?g=f==="x"?_:N:g=f==="x"?N:_}else{const _=[{x:u.x,y:d.y}],N=[{x:d.x,y:u.y}];if(f==="x"?g=a.x===h?N:_:g=a.y===h?_:N,t===o){const R=Math.abs(e[f]-n[f]);if(R<=i){const H=Math.min(i-1,i-R);a[f]===h?y[f]=(u[f]>e[f]?-1:1)*H:b[f]=(d[f]>n[f]?-1:1)*H}}if(t!==o){const R=f==="x"?"y":"x",H=a[f]===c[R],v=u[R]>d[R],C=u[R]=I?(m=(P.x+T.x)/2,w=g[0].y):(m=g[0].x,w=(P.y+T.y)/2)}return[[e,{x:u.x+y.x,y:u.y+y.y},...g,{x:d.x+b.x,y:d.y+b.y},n],m,w,p,x]}function Md(e,t,n,o){const r=Math.min(jo(e,t)/2,jo(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x{let x="";return p>0&&pn.id===t):e[0])||null}function Bn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function Id(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=Bn(c,t);i.has(u)||(s.push({id:u,color:c.color||n,...c}),i.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Si=1e3,Ad=10,no={nodeOrigin:[0,0],nodeExtent:pt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},$d={...no,checkEquality:!0};function oo(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Pd(e,t,n){const o=oo(no,n);for(const r of e.values())if(r.parentId)io(r,e,t,o);else{const i=bt(r,o.nodeOrigin),s=Ue(r.extent)?r.extent:o.nodeExtent,a=ze(i,s,Ee(r));r.internals.positionAbsolute=a}}function Td(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function ro(e){return e==="manual"}function Fn(e,t,n,o={}){const r=oo($d,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!ro(r.zIndexMode)?Si:0;let c=e.length>0;t.clear(),n.clear();for(const u of e){let d=s.get(u.id);if(r.checkEquality&&u===d?.internals.userNode)t.set(u.id,d);else{const l=bt(u,r.nodeOrigin),f=Ue(u.extent)?u.extent:r.nodeExtent,h=ze(l,f,Ee(u));d={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:h,handleBounds:Td(u,d),z:Ni(u,a,r.zIndexMode),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(c=!1),u.parentId&&io(d,t,n,o,i)}return c}function Dd(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function io(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:c}=oo(no,o),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Dd(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*Ad),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const l=i&&!ro(c)?Si:0,{x:f,y:h,z:g}=Rd(e,d,s,a,l,c),{positionAbsolute:m}=e.internals,w=f!==m.x||h!==m.y;(w||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:f,y:h}:m,z:g}})}function Ni(e,t,n){const o=fe(e.zIndex)?e.zIndex:0;return ro(n)?o:o+(e.selected?t:0)}function Rd(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,c=Ee(e),u=bt(e,n),d=Ue(e.extent)?ze(u,e.extent,c):u;let l=ze({x:s+d.x,y:a+d.y},o,c);e.extent==="parent"&&(l=fi(l,c,t));const f=Ni(e,r,i),h=t.internals.z??0;return{x:l.x,y:l.y,z:h>=f?h+1:f}}function so(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const c=i.get(s.parentId)?.expandedRect??Ge(a),u=pi(c,s.rect);i.set(s.parentId,{expandedRect:u,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},c)=>{const u=a.internals.positionAbsolute,d=Ee(a),l=a.origin??o,f=s.x0||h>0||w||y)&&(r.push({id:c,type:"position",position:{x:a.position.x-f+w,y:a.position.y-h+y}}),n.get(c)?.forEach(b=>{e.some(p=>p.id===b.id)||r.push({id:b.id,type:"position",position:{x:b.position.x+f,y:b.position.y+h}})})),(d.width0){const h=so(f,t,n,r);u.push(...h)}return{changes:u,updatedInternals:c}}async function Hd({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Zo(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const c=o.get(s)||new Map;if(o.set(s,c.set(n,t)),i){s=`${r}-${e}-${i}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Ci(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,c={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},u=`${r}-${s}--${i}-${a}`,d=`${i}-${a}--${r}-${s}`;Zo("source",c,d,e,r,s),Zo("target",c,u,e,i,a),t.set(o.id,o)}}function Mi(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Mi(n,t):!1}function qo(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function Ld(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Mi(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function wn({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const c=n.get(s)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function Od({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=Et(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Vd({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,c=!1,u={x:0,y:0},d=null,l=!1,f=null,h=!1,g=!1,m=null;function w({noDragClassName:b,handleSelector:p,domNode:x,isSelectable:S,nodeId:_,nodeClickDistance:N=0}){f=ce(x);function P({x:R,y:H}){const{nodeLookup:v,nodeExtent:C,snapGrid:E,snapToGrid:k,nodeOrigin:M,onNodeDrag:$,onSelectionDrag:z,onError:O,updateNodePositions:L}=t();i={x:R,y:H};let j=!1;const F=a.size>1,Z=F&&C?On(_t(a)):null,U=F&&k?Od({dragItems:a,snapGrid:E,x:R,y:H}):null;for(const[Y,B]of a){if(!v.has(Y))continue;let W={x:R-B.distance.x,y:H-B.distance.y};k&&(W=U?{x:Math.round(W.x+U.x),y:Math.round(W.y+U.y)}:Et(W,E));let Q=null;if(F&&C&&!B.extent&&Z){const{positionAbsolute:G}=B.internals,ee=G.x-Z.x+C[0][0],ne=G.x+B.measured.width-Z.x2+C[1][0],te=G.y-Z.y+C[0][1],se=G.y+B.measured.height-Z.y2+C[1][1];Q=[[ee,te],[ne,se]]}const{position:K,positionAbsolute:q}=di({nodeId:Y,nextPosition:W,nodeLookup:v,nodeExtent:Q||C,nodeOrigin:M,onError:O});j=j||B.position.x!==K.x||B.position.y!==K.y,B.position=K,B.internals.positionAbsolute=q}if(g=g||j,!!j&&(L(a,!0),m&&(o||$||!_&&z))){const[Y,B]=wn({nodeId:_,dragItems:a,nodeLookup:v});o?.(m,a,Y,B),$?.(m,Y,B),_||z?.(m,B)}}async function T(){if(!d)return;const{transform:R,panBy:H,autoPanSpeed:v,autoPanOnNodeDrag:C}=t();if(!C){c=!1,cancelAnimationFrame(s);return}const[E,k]=hi(u,d,v);(E!==0||k!==0)&&(i.x=(i.x??0)-E/R[2],i.y=(i.y??0)-k/R[2],await H({x:E,y:k})&&P(i)),s=requestAnimationFrame(T)}function V(R){const{nodeLookup:H,multiSelectionActive:v,nodesDraggable:C,transform:E,snapGrid:k,snapToGrid:M,selectNodesOnDrag:$,onNodeDragStart:z,onSelectionDragStart:O,unselectNodesAndEdges:L}=t();l=!0,(!$||!S)&&!v&&_&&(H.get(_)?.selected||L()),S&&$&&_&&e?.(_);const j=ut(R.sourceEvent,{transform:E,snapGrid:k,snapToGrid:M,containerBounds:d});if(i=j,a=Ld(H,C,j,_),a.size>0&&(n||z||!_&&O)){const[F,Z]=wn({nodeId:_,dragItems:a,nodeLookup:H});n?.(R.sourceEvent,a,F,Z),z?.(R.sourceEvent,F,Z),_||O?.(R.sourceEvent,Z)}}const I=Wr().clickDistance(N).on("start",R=>{const{domNode:H,nodeDragThreshold:v,transform:C,snapGrid:E,snapToGrid:k}=t();d=H?.getBoundingClientRect()||null,h=!1,g=!1,m=R.sourceEvent,v===0&&V(R),i=ut(R.sourceEvent,{transform:C,snapGrid:E,snapToGrid:k,containerBounds:d}),u=he(R.sourceEvent,d)}).on("drag",R=>{const{autoPanOnNodeDrag:H,transform:v,snapGrid:C,snapToGrid:E,nodeDragThreshold:k,nodeLookup:M}=t(),$=ut(R.sourceEvent,{transform:v,snapGrid:C,snapToGrid:E,containerBounds:d});if(m=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||_&&!M.has(_))&&(h=!0),!h){if(!c&&H&&l&&(c=!0,T()),!l){const z=he(R.sourceEvent,d),O=z.x-u.x,L=z.y-u.y;Math.sqrt(O*O+L*L)>k&&V(R)}(i.x!==$.xSnapped||i.y!==$.ySnapped)&&a&&l&&(u=he(R.sourceEvent,d),P($))}}).on("end",R=>{if(!(!l||h)&&(c=!1,l=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:H,updateNodePositions:v,onNodeDragStop:C,onSelectionDragStop:E}=t();if(g&&(v(a,!1),g=!1),r||C||!_&&E){const[k,M]=wn({nodeId:_,dragItems:a,nodeLookup:H,dragging:!1});r?.(R.sourceEvent,a,k,M),C?.(R.sourceEvent,k,M),_||E?.(R.sourceEvent,M)}}}).filter(R=>{const H=R.target;return!R.button&&(!b||!qo(H,`.${b}`,x))&&(!p||qo(H,p,x))});f.call(I)}function y(){f?.on(".drag",null)}return{update:w,destroy:y}}function Bd(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())mt(r,Ge(i))>0&&o.push(i);return o}const Fd=250;function jd(e,t,n,o){let r=[],i=1/0;const s=Bd(e,n,t+Fd);for(const a of s){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const u of c){if(o.nodeId===u.nodeId&&o.type===u.type&&o.id===u.id)continue;const{x:d,y:l}=He(a,u,u.position,!0),f=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(l-e.y,2));f>t||(f1){const a=o.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function ki(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],c=(n?a?.find(u=>u.id===n):a?.[0])??null;return c&&i?{...c,...He(s,c,c.position,!0)}:c}function Ii(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Wd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ai=()=>!0;function Xd(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:l,panBy:f,cancelConnection:h,onConnectStart:g,onConnect:m,onConnectEnd:w,isValidConnection:y=Ai,onReconnectEnd:b,updateConnection:p,getTransform:x,getFromHandle:S,autoPanSpeed:_,dragThreshold:N=1,handleDomNode:P}){const T=yi(e.target);let V=0,I;const{x:R,y:H}=he(e),v=Ii(i,P),C=a?.getBoundingClientRect();let E=!1;if(!C||!v)return;const k=ki(r,v,o,c,t);if(!k)return;let M=he(e,C),$=!1,z=null,O=!1,L=null;function j(){if(!d||!C)return;const[K,q]=hi(M,C,_);f({x:K,y:q}),V=requestAnimationFrame(j)}const F={...k,nodeId:r,type:v,position:k.position},Z=c.get(r);let Y={inProgress:!0,isValid:null,from:He(Z,F,X.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:Z,to:M,toHandle:null,toPosition:zo[F.position],toNode:null,pointer:M};function B(){E=!0,p(Y),g?.(e,{nodeId:r,handleId:o,handleType:v})}N===0&&B();function W(K){if(!E){const{x:se,y:Se}=he(K),we=se-R,Ie=Se-H;if(!(we*we+Ie*Ie>N*N))return;B()}if(!S()||!F){Q(K);return}const q=x();M=he(K,C),I=jd(St(M,q,!1,[1,1]),n,c,F),$||(j(),$=!0);const G=$i(K,{handle:I,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:y,doc:T,lib:u,flowId:l,nodeLookup:c});L=G.handleDomNode,z=G.connection,O=Wd(!!I,G.isValid);const ee=c.get(r),ne=ee?He(ee,F,X.Left,!0):Y.from,te={...Y,from:ne,isValid:O,to:G.toHandle&&O?Ut({x:G.toHandle.x,y:G.toHandle.y},q):M,toHandle:G.toHandle,toPosition:O&&G.toHandle?G.toHandle.position:zo[F.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:M};p(te),Y=te}function Q(K){if(!("touches"in K&&K.touches.length>0)){if(E){(I||L)&&z&&O&&m?.(z);const{inProgress:q,...G}=Y,ee={...G,toPosition:Y.toHandle?Y.toPosition:null};w?.(K,ee),i&&b?.(K,ee)}h(),cancelAnimationFrame(V),$=!1,O=!1,z=null,L=null,T.removeEventListener("mousemove",W),T.removeEventListener("mouseup",Q),T.removeEventListener("touchmove",W),T.removeEventListener("touchend",Q)}}T.addEventListener("mousemove",W),T.addEventListener("mouseup",Q),T.addEventListener("touchmove",W),T.addEventListener("touchend",Q)}function $i(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:u=Ai,nodeLookup:d}){const l=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:g}=he(e),m=s.elementFromPoint(h,g),w=m?.classList.contains(`${a}-flow__handle`)?m:f,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=Ii(void 0,w),p=w.getAttribute("data-nodeid"),x=w.getAttribute("data-handleid"),S=w.classList.contains("connectable"),_=w.classList.contains("connectableend");if(!p||!b)return y;const N={source:l?p:o,sourceHandle:l?x:r,target:l?o:p,targetHandle:l?r:x};y.connection=N;const T=S&&_&&(n===Ze.Strict?l&&b==="source"||!l&&b==="target":p!==o||x!==r);y.isValid=T&&u(N),y.toHandle=ki(p,b,x,d,n,!0)}return y}const jn={onPointerDown:Xd,isValid:$i};function Yd({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ce(e);function i({translateExtent:a,width:c,height:u,zoomStep:d=1,pannable:l=!0,zoomable:f=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const x=n(),S=p.sourceEvent.ctrlKey&&yt()?10:1,_=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*d,N=x[2]*Math.pow(2,_*S);t.scaleTo(N)};let m=[0,0];const w=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(m=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},y=p=>{const x=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const S=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],_=[S[0]-m[0],S[1]-m[1]];m=S;const N=o()*Math.max(x[2],Math.log(x[2]))*(h?-1:1),P={x:x[0]-_[0]*N,y:x[1]-_[1]*N},T=[[0,0],[c,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:x[2]},T,a)},b=ii().on("start",w).on("zoom",l?y:null).on("zoom.wheel",f?g:null);r.call(b,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:le}}const an=e=>({x:e.x,y:e.y,zoom:e.k}),vn=({x:e,y:t,zoom:n})=>on.translate(e,t).scale(n),Ve=(e,t)=>e.target.closest(`.${t}`),Pi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Zd=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,bn=(e,t=0,n=Zd,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Ti=e=>{const t=e.ctrlKey&&yt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function qd({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Ve(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const l=n.property("__zoom").k||1;if(d.ctrlKey&&s){const w=le(d),y=Ti(d),b=l*Math.pow(2,y);o.scaleTo(n,b,w,d);return}const f=d.deltaMode===1?20:1;let h=r===Te.Vertical?0:d.deltaX*f,g=r===Te.Horizontal?0:d.deltaY*f;!yt()&&d.shiftKey&&r!==Te.Vertical&&(h=d.deltaY*f,g=0),o.translateBy(n,-(h/l)*i,-(g/l)*i,{internal:!0});const m=an(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(d,m),e.panScrollTimeout=setTimeout(()=>{u?.(d,m),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(d,m))}}function Gd({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Ve(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Ud({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=an(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function Kd({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Pi(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,an(i.transform))}}function Qd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Pi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=an(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Jd({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:c,lib:u,connectionInProgress:d}){return l=>{const f=e||t,h=n&&l.ctrlKey,g=l.type==="wheel";if(l.button===1&&l.type==="mousedown"&&(Ve(l,`${u}-flow__node`)||Ve(l,`${u}-flow__edge`)))return!0;if(!o&&!f&&!r&&!i&&!n||s||d&&!g||Ve(l,a)&&g||Ve(l,c)&&(!g||r&&g&&!e)||!n&&l.ctrlKey&&g)return!1;if(!n&&l.type==="touchstart"&&l.touches?.length>1)return l.preventDefault(),!1;if(!f&&!r&&!h&&g||!o&&(l.type==="mousedown"||l.type==="touchstart")||Array.isArray(o)&&!o.includes(l.button)&&l.type==="mousedown")return!1;const m=Array.isArray(o)&&o.includes(l.button)||!l.button||l.button<=1;return(!l.ctrlKey||g)&&m}}function ef({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),l=ii().scaleExtent([t,n]).translateExtent(o),f=ce(e).call(l);b({x:r.x,y:r.y,zoom:qe(r.zoom,t,n)},[[0,0],[d.width,d.height]],o);const h=f.on("wheel.zoom"),g=f.on("dblclick.zoom");l.wheelDelta(Ti);function m(I,R){return f?new Promise(H=>{l?.interpolate(R?.interpolate==="linear"?ct:Ht).transform(bn(f,R?.duration,R?.ease,()=>H(!0)),I)}):Promise.resolve(!1)}function w({noWheelClassName:I,noPanClassName:R,onPaneContextMenu:H,userSelectionActive:v,panOnScroll:C,panOnDrag:E,panOnScrollMode:k,panOnScrollSpeed:M,preventScrolling:$,zoomOnPinch:z,zoomOnScroll:O,zoomOnDoubleClick:L,zoomActivationKeyPressed:j,lib:F,onTransformChange:Z,connectionInProgress:U,paneClickDistance:Y,selectionOnDrag:B}){v&&!u.isZoomingOrPanning&&y();const W=C&&!j&&!v;l.clickDistance(B?1/0:!fe(Y)||Y<0?0:Y);const Q=W?qd({zoomPanValues:u,noWheelClassName:I,d3Selection:f,d3Zoom:l,panOnScrollMode:k,panOnScrollSpeed:M,zoomOnPinch:z,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Gd({noWheelClassName:I,preventScrolling:$,d3ZoomHandler:h});if(f.on("wheel.zoom",Q,{passive:!1}),!v){const q=Ud({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:s});l.on("start",q);const G=Kd({zoomPanValues:u,panOnDrag:E,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:Z});l.on("zoom",G);const ee=Qd({zoomPanValues:u,panOnDrag:E,panOnScroll:C,onPaneContextMenu:H,onPanZoomEnd:a,onDraggingChange:c});l.on("end",ee)}const K=Jd({zoomActivationKeyPressed:j,panOnDrag:E,zoomOnScroll:O,panOnScroll:C,zoomOnDoubleClick:L,zoomOnPinch:z,userSelectionActive:v,noPanClassName:R,noWheelClassName:I,lib:F,connectionInProgress:U});l.filter(K),L?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function y(){l.on("zoom",null)}async function b(I,R,H){const v=vn(I),C=l?.constrain()(v,R,H);return C&&await m(C),new Promise(E=>E(C))}async function p(I,R){const H=vn(I);return await m(H,R),new Promise(v=>v(H))}function x(I){if(f){const R=vn(I),H=f.property("__zoom");(H.k!==I.zoom||H.x!==I.x||H.y!==I.y)&&l?.transform(f,R,null,{sync:!0})}}function S(){const I=f?ri(f.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function _(I,R){return f?new Promise(H=>{l?.interpolate(R?.interpolate==="linear"?ct:Ht).scaleTo(bn(f,R?.duration,R?.ease,()=>H(!0)),I)}):Promise.resolve(!1)}function N(I,R){return f?new Promise(H=>{l?.interpolate(R?.interpolate==="linear"?ct:Ht).scaleBy(bn(f,R?.duration,R?.ease,()=>H(!0)),I)}):Promise.resolve(!1)}function P(I){l?.scaleExtent(I)}function T(I){l?.translateExtent(I)}function V(I){const R=!fe(I)||I<0?0:I;l?.clickDistance(R)}return{update:w,destroy:y,setViewport:p,setViewportConstrained:b,getViewport:S,scaleTo:_,scaleBy:N,setScaleExtent:P,setTranslateExtent:T,syncViewport:x,setClickDistance:V}}var Ke;(function(e){e.Line="line",e.Handle="handle"})(Ke||(Ke={}));function tf({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function Go(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ne(e,t){return Math.max(0,t-e)}function Ce(e,t){return Math.max(0,e-t)}function Pt(e,t,n){return Math.max(0,t-e,e-n)}function Uo(e,t){return e?!t:t}function nf(e,t,n,o,r,i,s,a){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:l}=t,f=d&&l,{xSnapped:h,ySnapped:g}=n,{minWidth:m,maxWidth:w,minHeight:y,maxHeight:b}=o,{x:p,y:x,width:S,height:_,aspectRatio:N}=e;let P=Math.floor(d?h-e.pointerX:0),T=Math.floor(l?g-e.pointerY:0);const V=S+(c?-P:P),I=_+(u?-T:T),R=-i[0]*S,H=-i[1]*_;let v=Pt(V,m,w),C=Pt(I,y,b);if(s){let M=0,$=0;c&&P<0?M=Ne(p+P+R,s[0][0]):!c&&P>0&&(M=Ce(p+V+R,s[1][0])),u&&T<0?$=Ne(x+T+H,s[0][1]):!u&&T>0&&($=Ce(x+I+H,s[1][1])),v=Math.max(v,M),C=Math.max(C,$)}if(a){let M=0,$=0;c&&P>0?M=Ce(p+P,a[0][0]):!c&&P<0&&(M=Ne(p+V,a[1][0])),u&&T>0?$=Ce(x+T,a[0][1]):!u&&T<0&&($=Ne(x+I,a[1][1])),v=Math.max(v,M),C=Math.max(C,$)}if(r){if(d){const M=Pt(V/N,y,b)*N;if(v=Math.max(v,M),s){let $=0;!c&&!u||c&&!u&&f?$=Ce(x+H+V/N,s[1][1])*N:$=Ne(x+H+(c?P:-P)/N,s[0][1])*N,v=Math.max(v,$)}if(a){let $=0;!c&&!u||c&&!u&&f?$=Ne(x+V/N,a[1][1])*N:$=Ce(x+(c?P:-P)/N,a[0][1])*N,v=Math.max(v,$)}}if(l){const M=Pt(I*N,m,w)/N;if(C=Math.max(C,M),s){let $=0;!c&&!u||u&&!c&&f?$=Ce(p+I*N+R,s[1][0])/N:$=Ne(p+(u?T:-T)*N+R,s[0][0])/N,C=Math.max(C,$)}if(a){let $=0;!c&&!u||u&&!c&&f?$=Ne(p+I*N,a[1][0])/N:$=Ce(p+(u?T:-T)*N,a[0][0])/N,C=Math.max(C,$)}}}T=T+(T<0?C:-C),P=P+(P<0?v:-v),r&&(f?V>I*N?T=(Uo(c,u)?-P:P)/N:P=(Uo(c,u)?-T:T)*N:d?(T=P/N,u=c):(P=T*N,c=u));const E=c?p+P:p,k=u?x+T:x;return{width:S+(c?-P:P),height:_+(u?-T:T),x:i[0]*P*(c?-1:1)+E,y:i[1]*T*(u?-1:1)+k}}const Di={width:0,height:0,x:0,y:0},of={...Di,pointerX:0,pointerY:0,aspectRatio:1};function rf(e){return[[0,0],[e.measured.width,e.measured.height]]}function sf(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,c=n[1]*s;return[[o-a,r-c],[o+i-a,r+s-c]]}function af({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ce(e);let s={controlDirection:Go("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:d,keepAspectRatio:l,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:m,shouldResize:w}){let y={...Di},b={...of};s={boundaries:d,resizeDirection:f,keepAspectRatio:l,controlDirection:Go(u)};let p,x=null,S=[],_,N,P,T=!1;const V=Wr().on("start",I=>{const{nodeLookup:R,transform:H,snapGrid:v,snapToGrid:C,nodeOrigin:E,paneDomNode:k}=n();if(p=R.get(t),!p)return;x=k?.getBoundingClientRect()??null;const{xSnapped:M,ySnapped:$}=ut(I.sourceEvent,{transform:H,snapGrid:v,snapToGrid:C,containerBounds:x});y={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},b={...y,pointerX:M,pointerY:$,aspectRatio:y.width/y.height},_=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(_=R.get(p.parentId),N=_&&p.extent==="parent"?rf(_):void 0),S=[],P=void 0;for(const[z,O]of R)if(O.parentId===t&&(S.push({id:z,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const L=sf(O,p,O.origin??E);P?P=[[Math.min(L[0][0],P[0][0]),Math.min(L[0][1],P[0][1])],[Math.max(L[1][0],P[1][0]),Math.max(L[1][1],P[1][1])]]:P=L}h?.(I,{...y})}).on("drag",I=>{const{transform:R,snapGrid:H,snapToGrid:v,nodeOrigin:C}=n(),E=ut(I.sourceEvent,{transform:R,snapGrid:H,snapToGrid:v,containerBounds:x}),k=[];if(!p)return;const{x:M,y:$,width:z,height:O}=y,L={},j=p.origin??C,{width:F,height:Z,x:U,y:Y}=nf(b,s.controlDirection,E,s.boundaries,s.keepAspectRatio,j,N,P),B=F!==z,W=Z!==O,Q=U!==M&&B,K=Y!==$&&W;if(!Q&&!K&&!B&&!W)return;if((Q||K||j[0]===1||j[1]===1)&&(L.x=Q?U:y.x,L.y=K?Y:y.y,y.x=L.x,y.y=L.y,S.length>0)){const ne=U-M,te=Y-$;for(const se of S)se.position={x:se.position.x-ne+j[0]*(F-z),y:se.position.y-te+j[1]*(Z-O)},k.push(se)}if((B||W)&&(L.width=B&&(!s.resizeDirection||s.resizeDirection==="horizontal")?F:y.width,L.height=W&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:y.height,y.width=L.width,y.height=L.height),_&&p.expandParent){const ne=j[0]*(L.width??0);L.x&&L.x{T&&(m?.(I,{...y}),r?.({...y}),T=!1)});i.call(V)}function c(){i.on(".drag",null)}return{update:a,destroy:c}}var _n={exports:{}},En={},Sn={exports:{}},Nn={};var Ko;function cf(){if(Ko)return Nn;Ko=1;var e=Ir();function t(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(l,f){var h=f(),g=o({inst:{value:h,getSnapshot:f}}),m=g[0].inst,w=g[1];return i(function(){m.value=h,m.getSnapshot=f,c(m)&&w({inst:m})},[l,h,f]),r(function(){return c(m)&&w({inst:m}),l(function(){c(m)&&w({inst:m})})},[l]),s(h),h}function c(l){var f=l.getSnapshot;l=l.value;try{var h=f();return!n(l,h)}catch{return!0}}function u(l,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Nn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Nn}var Qo;function uf(){return Qo||(Qo=1,Sn.exports=cf()),Sn.exports}var Jo;function lf(){if(Jo)return En;Jo=1;var e=Ir(),t=uf();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return En.useSyncExternalStoreWithSelector=function(u,d,l,f,h){var g=i(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=a(function(){function y(_){if(!b){if(b=!0,p=_,_=f(_),h!==void 0&&m.hasValue){var N=m.value;if(h(N,_))return x=N}return x=_}if(N=x,o(p,_))return N;var P=f(_);return h!==void 0&&h(N,P)?(p=_,N):(p=_,x=P)}var b=!1,p,x,S=l===void 0?null:l;return[function(){return y(d())},S===null?void 0:function(){return y(S())}]},[d,l,f,h]);var w=r(u,g[0],g[1]);return s(function(){m.hasValue=!0,m.value=w},[w]),c(w),w},En}var er;function df(){return er||(er=1,_n.exports=lf()),_n.exports}var ff=df();const hf=ba(ff),pf={},tr=e=>{let t;const n=new Set,o=(d,l)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=l??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,h))}},r=()=>t,c={setState:o,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(pf?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(o,r,c);return c},gf=e=>e?tr(e):tr,{useDebugValue:mf}=_a,{useSyncExternalStoreWithSelector:yf}=hf,xf=e=>e;function Ri(e,t=xf,n){const o=yf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return mf(o),o}const nr=(e,t)=>{const n=gf(e),o=(r,i=t)=>Ri(n,r,i);return Object.assign(o,n),o},wf=(e,t)=>e?nr(e,t):nr;function oe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}Ea();const cn=D.createContext(null),vf=cn.Provider,zi=ye.error001();function J(e,t){const n=D.useContext(cn);if(n===null)throw new Error(zi);return Ri(n,e,t)}function re(){const e=D.useContext(cn);if(e===null)throw new Error(zi);return D.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const or={display:"none"},bf={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Hi="react-flow__node-desc",Li="react-flow__edge-desc",_f="react-flow__aria-live",Ef=e=>e.ariaLiveMessage,Sf=e=>e.ariaLabelConfig;function Nf({rfId:e}){const t=J(Ef);return A.jsx("div",{id:`${_f}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:bf,children:t})}function Cf({rfId:e,disableKeyboardA11y:t}){const n=J(Sf);return A.jsxs(A.Fragment,{children:[A.jsx("div",{id:`${Hi}-${e}`,style:or,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),A.jsx("div",{id:`${Li}-${e}`,style:or,children:n["edge.a11yDescription.default"]}),!t&&A.jsx(Nf,{rfId:e})]})}const un=D.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return A.jsx("div",{className:ie(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});un.displayName="Panel";function Mf({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:A.jsx(un,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:A.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const kf=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Tt=e=>e.id;function If(e,t){return oe(e.selectedNodes.map(Tt),t.selectedNodes.map(Tt))&&oe(e.selectedEdges.map(Tt),t.selectedEdges.map(Tt))}function Af({onSelectionChange:e}){const t=re(),{selectedNodes:n,selectedEdges:o}=J(kf,If);return D.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const $f=e=>!!e.onSelectionChangeHandlers;function Pf({onSelectionChange:e}){const t=J($f);return e||t?A.jsx(Af,{onSelectionChange:e}):null}const Oi=[0,0],Tf={x:0,y:0,zoom:1},Df=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],rr=[...Df,"rfId"],Rf=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ir={translateExtent:pt,nodeOrigin:Oi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function zf(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:c}=J(Rf,oe),u=re();D.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=ir,a()}),[]);const d=D.useRef(ir);return D.useEffect(()=>{for(const l of rr){const f=e[l],h=d.current[l];f!==h&&(typeof e[l]>"u"||(l==="nodes"?t(f):l==="edges"?n(f):l==="minZoom"?o(f):l==="maxZoom"?r(f):l==="translateExtent"?i(f):l==="nodeExtent"?s(f):l==="ariaLabelConfig"?u.setState({ariaLabelConfig:xd(f)}):l==="fitView"?u.setState({fitViewQueued:f}):l==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[l]:f})))}d.current=e},rr.map(l=>e[l])),null}function sr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Hf(e){const[t,n]=D.useState(e==="system"?null:e);return D.useEffect(()=>{if(e!=="system"){n(e);return}const o=sr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:sr()?.matches?"dark":"light"}const ar=typeof document<"u"?document:null;function xt(e=null,t={target:ar,actInsideInputWithModifier:!0}){const[n,o]=D.useState(!1),r=D.useRef(!1),i=D.useRef(new Set([])),[s,a]=D.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(l=>typeof l=="string").map(l=>l.replace("+",` +`).replace(` + +`,` ++`).split(` +`)),d=u.reduce((l,f)=>l.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return D.useEffect(()=>{const c=t?.target??ar,u=t?.actInsideInputWithModifier??!0;if(e!==null){const d=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!u)&&xi(h))return!1;const m=ur(h.code,a);if(i.current.add(h[m]),cr(s,i.current,!1)){const w=h.composedPath?.()?.[0]||h.target,y=w?.nodeName==="BUTTON"||w?.nodeName==="A";t.preventDefault!==!1&&(r.current||!y)&&h.preventDefault(),o(!0)}},l=h=>{const g=ur(h.code,a);cr(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),o(!1)};return c?.addEventListener("keydown",d),c?.addEventListener("keyup",l),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c?.removeEventListener("keydown",d),c?.removeEventListener("keyup",l),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function cr(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function ur(e,t){return t.includes(e)?"code":"key"}const Lf=()=>{const e=re();return D.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),c=eo(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:c}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-c},d=n.snapGrid??r,l=n.snapToGrid??i;return St(u,o,l,d)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=Ut(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function Vi(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const c of s)Of(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Of(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Bi(e,t){return Vi(e,t)}function Fi(e,t){return Vi(e,t)}function Ae(e,t){return{id:e,type:"select",selected:t}}function Be(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(Ae(i.id,s)))}return o}function lr({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function dr(e){return{id:e.id,type:"remove"}}const fr=e=>cd(e),Vf=e=>li(e);function ji(e){return D.forwardRef(e)}const Bf=typeof window<"u"?D.useLayoutEffect:D.useEffect;function hr(e){const[t,n]=D.useState(BigInt(0)),[o]=D.useState(()=>Ff(()=>n(r=>r+BigInt(1))));return Bf(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function Ff(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Wi=D.createContext(null);function jf({children:e}){const t=re(),n=D.useCallback(a=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:l,nodeLookup:f,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let m=c;for(const y of a)m=typeof y=="function"?y(m):y;let w=lr({items:m,lookup:f});for(const y of g.values())w=y(w);d&&u(m),w.length>0?l?.(w):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:p}=t.getState();y&&p(b)})},[]),o=hr(n),r=D.useCallback(a=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:l,edgeLookup:f}=t.getState();let h=c;for(const g of a)h=typeof g=="function"?g(h):g;d?u(h):l&&l(lr({items:h,lookup:f}))},[]),i=hr(r),s=D.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return A.jsx(Wi.Provider,{value:s,children:e})}function Wf(){const e=D.useContext(Wi);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Xf=e=>!!e.panZoom;function ao(){const e=Lf(),t=re(),n=Wf(),o=J(Xf),r=D.useMemo(()=>{const i=l=>t.getState().nodeLookup.get(l),s=l=>{n.nodeQueue.push(l)},a=l=>{n.edgeQueue.push(l)},c=l=>{const{nodeLookup:f,nodeOrigin:h}=t.getState(),g=fr(l)?l:f.get(l.id),m=g.parentId?mi(g.position,g.measured,g.parentId,f,h):g.position,w={...g,position:m,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return Ge(w)},u=(l,f,h={replace:!1})=>{s(g=>g.map(m=>{if(m.id===l){const w=typeof f=="function"?f(m):f;return h.replace&&fr(w)?w:{...m,...w}}return m}))},d=(l,f,h={replace:!1})=>{a(g=>g.map(m=>{if(m.id===l){const w=typeof f=="function"?f(m):f;return h.replace&&Vf(w)?w:{...m,...w}}return m}))};return{getNodes:()=>t.getState().nodes.map(l=>({...l})),getNode:l=>i(l)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:l=[]}=t.getState();return l.map(f=>({...f}))},getEdge:l=>t.getState().edgeLookup.get(l),setNodes:s,setEdges:a,addNodes:l=>{const f=Array.isArray(l)?l:[l];n.nodeQueue.push(h=>[...h,...f])},addEdges:l=>{const f=Array.isArray(l)?l:[l];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:l=[],edges:f=[],transform:h}=t.getState(),[g,m,w]=h;return{nodes:l.map(y=>({...y})),edges:f.map(y=>({...y})),viewport:{x:g,y:m,zoom:w}}},deleteElements:async({nodes:l=[],edges:f=[]})=>{const{nodes:h,edges:g,onNodesDelete:m,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:p,onBeforeDelete:x}=t.getState(),{nodes:S,edges:_}=await hd({nodesToRemove:l,edgesToRemove:f,nodes:h,edges:g,onBeforeDelete:x}),N=_.length>0,P=S.length>0;if(N){const T=_.map(dr);w?.(_),b(T)}if(P){const T=S.map(dr);m?.(S),y(T)}return(P||N)&&p?.({nodes:S,edges:_}),{deletedNodes:S,deletedEdges:_}},getIntersectingNodes:(l,f=!0,h)=>{const g=Lo(l),m=g?l:c(l),w=h!==void 0;return m?(h||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!g&&(y.id===l.id||!b.internals.positionAbsolute))return!1;const p=Ge(w?y:b),x=mt(p,m);return f&&x>0||x>=p.width*p.height||x>=m.width*m.height}):[]},isNodeIntersecting:(l,f,h=!0)=>{const m=Lo(l)?l:c(l);if(!m)return!1;const w=mt(m,f);return h&&w>0||w>=f.width*f.height||w>=m.width*m.height},updateNode:u,updateNodeData:(l,f,h={replace:!1})=>{u(l,g=>{const m=typeof f=="function"?f(g):f;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},updateEdge:d,updateEdgeData:(l,f,h={replace:!1})=>{d(l,g=>{const m=typeof f=="function"?f(g):f;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},getNodesBounds:l=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return ud(l,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:l,id:f,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${l}${f?`-${f}`:""}`)?.values()??[]),getNodeConnections:({type:l,handleId:f,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${l?f?`-${l}-${f}`:`-${l}`:""}`)?.values()??[]),fitView:async l=>{const f=t.getState().fitViewResolver??yd();return t.setState({fitViewQueued:!0,fitViewOptions:l,fitViewResolver:f}),n.nodeQueue.push(h=>[...h]),f.promise}}},[]);return D.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const pr=e=>e.selected,Yf=typeof window<"u"?window:void 0;function Zf({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=re(),{deleteElements:o}=ao(),r=xt(e,{actInsideInputWithModifier:!1}),i=xt(t,{target:Yf});D.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(pr),edges:s.filter(pr)}),n.setState({nodesSelectionActive:!1})}},[r]),D.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function qf(e){const t=re();D.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=to(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",ye.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const ln={position:"absolute",width:"100%",height:"100%",top:0,left:0},Gf=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Uf({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Te.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:l,zoomActivationKeyCode:f,preventScrolling:h=!0,children:g,noWheelClassName:m,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:p,selectionOnDrag:x}){const S=re(),_=D.useRef(null),{userSelectionActive:N,lib:P,connectionInProgress:T}=J(Gf,oe),V=xt(f),I=D.useRef();qf(_);const R=D.useCallback(H=>{y?.({x:H[0],y:H[1],zoom:H[2]}),b||S.setState({transform:H})},[y,b]);return D.useEffect(()=>{if(_.current){I.current=ef({domNode:_.current,minZoom:d,maxZoom:l,translateExtent:u,viewport:c,onDraggingChange:E=>S.setState(k=>k.paneDragging===E?k:{paneDragging:E}),onPanZoomStart:(E,k)=>{const{onViewportChangeStart:M,onMoveStart:$}=S.getState();$?.(E,k),M?.(k)},onPanZoom:(E,k)=>{const{onViewportChange:M,onMove:$}=S.getState();$?.(E,k),M?.(k)},onPanZoomEnd:(E,k)=>{const{onViewportChangeEnd:M,onMoveEnd:$}=S.getState();$?.(E,k),M?.(k)}});const{x:H,y:v,zoom:C}=I.current.getViewport();return S.setState({panZoom:I.current,transform:[H,v,C],domNode:_.current.closest(".react-flow")}),()=>{I.current?.destroy()}}},[]),D.useEffect(()=>{I.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:V,preventScrolling:h,noPanClassName:w,userSelectionActive:N,noWheelClassName:m,lib:P,onTransformChange:R,connectionInProgress:T,selectionOnDrag:x,paneClickDistance:p})},[e,t,n,o,r,i,s,a,V,h,w,N,m,P,R,T,x,p]),A.jsx("div",{className:"react-flow__renderer",ref:_,style:ln,children:g})}const Kf=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Qf(){const{userSelectionActive:e,userSelectionRect:t}=J(Kf,oe);return e&&t?A.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Cn=(e,t)=>n=>{n.target===t.current&&e?.(n)},Jf=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function eh({isSelecting:e,selectionKeyPressed:t,selectionMode:n=gt.Full,panOnDrag:o,paneClickDistance:r,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:a,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:l,onPaneMouseMove:f,onPaneMouseLeave:h,children:g}){const m=re(),{userSelectionActive:w,elementsSelectable:y,dragging:b,connectionInProgress:p}=J(Jf,oe),x=y&&(e||w),S=D.useRef(null),_=D.useRef(),N=D.useRef(new Set),P=D.useRef(new Set),T=D.useRef(!1),V=M=>{if(T.current||p){T.current=!1;return}c?.(M),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},I=M=>{if(Array.isArray(o)&&o?.includes(2)){M.preventDefault();return}u?.(M)},R=d?M=>d(M):void 0,H=M=>{T.current&&(M.stopPropagation(),T.current=!1)},v=M=>{const{domNode:$}=m.getState();if(_.current=$?.getBoundingClientRect(),!_.current)return;const z=M.target===S.current;if(!z&&!!M.target.closest(".nokey")||!e||!(i&&z||t)||M.button!==0||!M.isPrimary)return;M.target?.setPointerCapture?.(M.pointerId),T.current=!1;const{x:j,y:F}=he(M.nativeEvent,_.current);m.setState({userSelectionRect:{width:0,height:0,startX:j,startY:F,x:j,y:F}}),z||(M.stopPropagation(),M.preventDefault())},C=M=>{const{userSelectionRect:$,transform:z,nodeLookup:O,edgeLookup:L,connectionLookup:j,triggerNodeChanges:F,triggerEdgeChanges:Z,defaultEdgeOptions:U,resetSelectedElements:Y}=m.getState();if(!_.current||!$)return;const{x:B,y:W}=he(M.nativeEvent,_.current),{startX:Q,startY:K}=$;if(!T.current){const te=t?0:r;if(Math.hypot(B-Q,W-K)<=te)return;Y(),s?.(M)}T.current=!0;const q={startX:Q,startY:K,x:Bte.id)),P.current=new Set;const ne=U?.selectable??!0;for(const te of N.current){const se=j.get(te);if(se)for(const{edgeId:Se}of se.values()){const we=L.get(Se);we&&(we.selectable??ne)&&P.current.add(Se)}}if(!Oo(G,N.current)){const te=Be(O,N.current,!0);F(te)}if(!Oo(ee,P.current)){const te=Be(L,P.current);Z(te)}m.setState({userSelectionRect:q,userSelectionActive:!0,nodesSelectionActive:!1})},E=M=>{M.button===0&&(M.target?.releasePointerCapture?.(M.pointerId),!w&&M.target===S.current&&m.getState().userSelectionRect&&V?.(M),m.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(a?.(M),m.setState({nodesSelectionActive:N.current.size>0})))},k=o===!0||Array.isArray(o)&&o.includes(0);return A.jsxs("div",{className:ie(["react-flow__pane",{draggable:k,dragging:b,selection:e}]),onClick:x?void 0:Cn(V,S),onContextMenu:Cn(I,S),onWheel:Cn(R,S),onPointerEnter:x?void 0:l,onPointerMove:x?C:f,onPointerUp:x?E:void 0,onPointerDownCapture:x?v:void 0,onClickCapture:x?H:void 0,onPointerLeave:h,ref:S,style:ln,children:[g,A.jsx(Qf,{})]})}function Wn({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:c}=t.getState(),u=a.get(e);if(!u){c?.("012",ye.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function Xi({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=re(),[c,u]=D.useState(!1),d=D.useRef();return D.useEffect(()=>{d.current=Vd({getStoreItems:()=>a.getState(),onNodeMouseDown:l=>{Wn({id:l,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),D.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s}),()=>{d.current?.destroy()}},[n,o,t,i,e,r,s]),c}const th=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Yi(){const e=re();return D.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),l=new Map,f=th(s),h=r?i[0]:5,g=r?i[1]:5,m=n.direction.x*h*n.factor,w=n.direction.y*g*n.factor;for(const[,y]of u){if(!f(y))continue;let b={x:y.internals.positionAbsolute.x+m,y:y.internals.positionAbsolute.y+w};r&&(b=Et(b,i));const{position:p,positionAbsolute:x}=di({nodeId:y.id,nextPosition:b,nodeLookup:u,nodeExtent:o,nodeOrigin:d,onError:a});y.position=p,y.internals.positionAbsolute=x,l.set(y.id,y)}c(l)},[])}const co=D.createContext(null),nh=co.Provider;co.Consumer;const Zi=()=>D.useContext(co),oh=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rh=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:c,isValid:u}=s,d=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:d,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===Ze.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:d&&u}};function ih({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:c,className:u,onMouseDown:d,onTouchStart:l,...f},h){const g=s||null,m=e==="target",w=re(),y=Zi(),{connectOnClick:b,noPanClassName:p,rfId:x}=J(oh,oe),{connectingFrom:S,connectingTo:_,clickConnecting:N,isPossibleEndHandle:P,connectionInProcess:T,clickConnectionInProcess:V,valid:I}=J(rh(y,g,e),oe);y||w.getState().onError?.("010",ye.error010());const R=C=>{const{defaultEdgeOptions:E,onConnect:k,hasDefaultEdges:M}=w.getState(),$={...E,...C};if(M){const{edges:z,setEdges:O}=w.getState();O(Sd($,z))}k?.($),a?.($)},H=C=>{if(!y)return;const E=wi(C.nativeEvent);if(r&&(E&&C.button===0||!E)){const k=w.getState();jn.onPointerDown(C.nativeEvent,{handleDomNode:C.currentTarget,autoPanOnConnect:k.autoPanOnConnect,connectionMode:k.connectionMode,connectionRadius:k.connectionRadius,domNode:k.domNode,nodeLookup:k.nodeLookup,lib:k.lib,isTarget:m,handleId:g,nodeId:y,flowId:k.rfId,panBy:k.panBy,cancelConnection:k.cancelConnection,onConnectStart:k.onConnectStart,onConnectEnd:(...M)=>w.getState().onConnectEnd?.(...M),updateConnection:k.updateConnection,onConnect:R,isValidConnection:n||((...M)=>w.getState().isValidConnection?.(...M)??!0),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:k.autoPanSpeed,dragThreshold:k.connectionDragThreshold})}E?d?.(C):l?.(C)},v=C=>{const{onClickConnectStart:E,onClickConnectEnd:k,connectionClickStartHandle:M,connectionMode:$,isValidConnection:z,lib:O,rfId:L,nodeLookup:j,connection:F}=w.getState();if(!y||!M&&!r)return;if(!M){E?.(C.nativeEvent,{nodeId:y,handleId:g,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const Z=yi(C.target),U=n||z,{connection:Y,isValid:B}=jn.isValid(C.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:$,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:U,flowId:L,doc:Z,lib:O,nodeLookup:j});B&&Y&&R(Y);const W=structuredClone(F);delete W.inProgress,W.toPosition=W.toHandle?W.toHandle.position:null,k?.(C,W),w.setState({connectionClickStartHandle:null})};return A.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${x}-${y}-${g}-${e}`,className:ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,u,{source:!m,target:m,connectable:o,connectablestart:r,connectableend:i,clickconnecting:N,connectingfrom:S,connectingto:_,valid:I,connectionindicator:o&&(!T||P)&&(T||V?i:r)}]),onMouseDown:H,onTouchStart:H,onClick:b?v:void 0,ref:h,...f,children:c})}const Kt=D.memo(ji(ih));function sh({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return A.jsxs(A.Fragment,{children:[e?.label,A.jsx(Kt,{type:"source",position:n,isConnectable:t})]})}function ah({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:o=X.Bottom}){return A.jsxs(A.Fragment,{children:[A.jsx(Kt,{type:"target",position:n,isConnectable:t}),e?.label,A.jsx(Kt,{type:"source",position:o,isConnectable:t})]})}function ch(){return null}function uh({data:e,isConnectable:t,targetPosition:n=X.Top}){return A.jsxs(A.Fragment,{children:[A.jsx(Kt,{type:"target",position:n,isConnectable:t}),e?.label]})}const Qt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},gr={input:sh,default:ah,output:uh,group:ch};function lh(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const dh=e=>{const{width:t,height:n,x:o,y:r}=_t(e.nodeLookup,{filter:i=>!!i.selected});return{width:fe(t)?t:null,height:fe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function fh({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=re(),{width:r,height:i,transformString:s,userSelectionActive:a}=J(dh,oe),c=Yi(),u=D.useRef(null);D.useEffect(()=>{n||u.current?.focus({preventScroll:!0})},[n]);const d=!a&&r!==null&&i!==null;if(Xi({nodeRef:u,disabled:!d}),!d)return null;const l=e?h=>{const g=o.getState().nodes.filter(m=>m.selected);e(h,g)}:void 0,f=h=>{Object.prototype.hasOwnProperty.call(Qt,h.key)&&(h.preventDefault(),c({direction:Qt[h.key],factor:h.shiftKey?4:1}))};return A.jsx("div",{className:ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:A.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:l,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:r,height:i}})})}const mr=typeof window<"u"?window:void 0,hh=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function qi({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:l,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:m,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:x,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:P,defaultViewport:T,translateExtent:V,minZoom:I,maxZoom:R,preventScrolling:H,onSelectionContextMenu:v,noWheelClassName:C,noPanClassName:E,disableKeyboardA11y:k,onViewportChange:M,isControlledViewport:$}){const{nodesSelectionActive:z,userSelectionActive:O}=J(hh,oe),L=xt(u,{target:mr}),j=xt(m,{target:mr}),F=j||P,Z=j||x,U=d&&F!==!0,Y=L||O||U;return Zf({deleteKeyCode:c,multiSelectionKeyCode:g}),A.jsx(Uf,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:Z,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:!L&&F,defaultViewport:T,translateExtent:V,minZoom:I,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:H,noWheelClassName:C,noPanClassName:E,onViewportChange:M,isControlledViewport:$,paneClickDistance:a,selectionOnDrag:U,children:A.jsxs(eh,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:F,isSelecting:!!Y,selectionMode:l,selectionKeyPressed:L,paneClickDistance:a,selectionOnDrag:U,children:[e,z&&A.jsx(fh,{onSelectionContextMenu:v,noPanClassName:E,disableKeyboardA11y:k})]})})}qi.displayName="FlowRenderer";const ph=D.memo(qi),gh=e=>t=>e?Jn(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function mh(e){return J(D.useCallback(gh(e),[e]),oe)}const yh=e=>e.updateNodeInternals;function xh(){const e=J(yh),[t]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return D.useEffect(()=>()=>{t?.disconnect()},[t]),t}function wh({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=re(),i=D.useRef(null),s=D.useRef(null),a=D.useRef(e.sourcePosition),c=D.useRef(e.targetPosition),u=D.useRef(t),d=n&&!!e.internals.handleBounds;return D.useEffect(()=>{i.current&&!e.hidden&&(!d||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[d,e.hidden]),D.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),D.useEffect(()=>{if(i.current){const l=u.current!==t,f=a.current!==e.sourcePosition,h=c.current!==e.targetPosition;(l||f||h)&&(u.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function vh({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:l,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:g,rfId:m,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:p,internals:x,isParent:S}=J(B=>{const W=B.nodeLookup.get(e),Q=B.parentLookup.has(e);return{node:W,internals:W.internals,isParent:Q}},oe);let _=p.type||"default",N=w?.[_]||gr[_];N===void 0&&(b?.("003",ye.error003(_)),_="default",N=w?.default||gr.default);const P=!!(p.draggable||a&&typeof p.draggable>"u"),T=!!(p.selectable||c&&typeof p.selectable>"u"),V=!!(p.connectable||u&&typeof p.connectable>"u"),I=!!(p.focusable||d&&typeof p.focusable>"u"),R=re(),H=gi(p),v=wh({node:p,nodeType:_,hasDimensions:H,resizeObserver:l}),C=Xi({nodeRef:v,disabled:p.hidden||!P,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:y}),E=Yi();if(p.hidden)return null;const k=Ee(p),M=lh(p),$=T||P||t||n||o||r,z=n?B=>n(B,{...x.userNode}):void 0,O=o?B=>o(B,{...x.userNode}):void 0,L=r?B=>r(B,{...x.userNode}):void 0,j=i?B=>i(B,{...x.userNode}):void 0,F=s?B=>s(B,{...x.userNode}):void 0,Z=B=>{const{selectNodesOnDrag:W,nodeDragThreshold:Q}=R.getState();T&&(!W||!P||Q>0)&&Wn({id:e,store:R,nodeRef:v}),t&&t(B,{...x.userNode})},U=B=>{if(!(xi(B.nativeEvent)||g)){if(si.includes(B.key)&&T){const W=B.key==="Escape";Wn({id:e,store:R,unselect:W,nodeRef:v})}else if(P&&p.selected&&Object.prototype.hasOwnProperty.call(Qt,B.key)){B.preventDefault();const{ariaLabelConfig:W}=R.getState();R.setState({ariaLiveMessage:W["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),E({direction:Qt[B.key],factor:B.shiftKey?4:1})}}},Y=()=>{if(g||!v.current?.matches(":focus-visible"))return;const{transform:B,width:W,height:Q,autoPanOnNodeFocus:K,setCenter:q}=R.getState();if(!K)return;Jn(new Map([[e,p]]),{x:0,y:0,width:W,height:Q},B,!0).length>0||q(p.position.x+k.width/2,p.position.y+k.height/2,{zoom:B[2]})};return A.jsx("div",{className:ie(["react-flow__node",`react-flow__node-${_}`,{[h]:P},p.className,{selected:p.selected,selectable:T,parent:S,draggable:P,dragging:C}]),ref:v,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:H?"visible":"hidden",...p.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:O,onMouseLeave:L,onContextMenu:j,onClick:Z,onDoubleClick:F,onKeyDown:I?U:void 0,tabIndex:I?0:void 0,onFocus:I?Y:void 0,role:p.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Hi}-${m}`,"aria-label":p.ariaLabel,...p.domAttributes,children:A.jsx(nh,{value:e,children:A.jsx(N,{id:e,data:p.data,type:_,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:p.selected??!1,selectable:T,draggable:P,deletable:p.deletable??!0,isConnectable:V,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:C,dragHandle:p.dragHandle,zIndex:x.z,parentId:p.parentId,...k})})})}var bh=D.memo(vh);const _h=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Gi(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:i}=J(_h,oe),s=mh(e.onlyRenderVisibleElements),a=xh();return A.jsx("div",{className:"react-flow__nodes",style:ln,children:s.map(c=>A.jsx(bh,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}Gi.displayName="NodeRenderer";const Eh=D.memo(Gi);function Sh(e){return J(D.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&bd({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),oe)}const Nh=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return A.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Ch=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return A.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},yr={[qt.Arrow]:Nh,[qt.ArrowClosed]:Ch};function Mh(e){const t=re();return D.useMemo(()=>Object.prototype.hasOwnProperty.call(yr,e)?yr[e]:(t.getState().onError?.("009",ye.error009(e)),null),[e])}const kh=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const c=Mh(t);return c?A.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:A.jsx(c,{color:n,strokeWidth:s})}):null},Ui=({defaultColor:e,rfId:t})=>{const n=J(i=>i.edges),o=J(i=>i.defaultEdgeOptions),r=D.useMemo(()=>Id(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?A.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:A.jsx("defs",{children:r.map(i=>A.jsx(kh,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Ui.displayName="MarkerDefinitions";var Ih=D.memo(Ui);function Ki({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:c,className:u,...d}){const[l,f]=D.useState({x:1,y:0,width:0,height:0}),h=ie(["react-flow__edge-textwrapper",u]),g=D.useRef(null);return D.useEffect(()=>{if(g.current){const m=g.current.getBBox();f({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),n?A.jsxs("g",{transform:`translate(${e-l.width/2} ${t-l.height/2})`,className:h,visibility:l.width?"visible":"hidden",...d,children:[r&&A.jsx("rect",{width:l.width+2*s[0],x:-s[0],y:-s[1],height:l.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),A.jsx("text",{className:"react-flow__edge-text",y:l.height/2,dy:"0.3em",ref:g,style:o,children:n}),c]}):null}Ki.displayName="EdgeText";const Ah=D.memo(Ki);function dn({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return A.jsxs(A.Fragment,{children:[A.jsx("path",{...d,d:e,fill:"none",className:ie(["react-flow__edge-path",d.className])}),u?A.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,o&&fe(t)&&fe(n)?A.jsx(Ah,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function xr({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===X.Left||e===X.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Qi({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top}){const[s,a]=xr({pos:n,x1:e,y1:t,x2:o,y2:r}),[c,u]=xr({pos:i,x1:o,y1:r,x2:e,y2:t}),[d,l,f,h]=vi({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${a} ${c},${u} ${o},${r}`,d,l,f,h]}function Ji(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:w,interactionWidth:y})=>{const[b,p,x]=Qi({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),S=e.isInternal?void 0:t;return A.jsx(dn,{id:S,path:b,labelX:p,labelY:x,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:w,interactionWidth:y})})}const $h=Ji({isInternal:!1}),es=Ji({isInternal:!0});$h.displayName="SimpleBezierEdge";es.displayName="SimpleBezierEdgeInternal";function ts(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:l,style:f,sourcePosition:h=X.Bottom,targetPosition:g=X.Top,markerEnd:m,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[p,x,S]=Vn({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:y?.borderRadius,offset:y?.offset,stepPosition:y?.stepPosition}),_=e.isInternal?void 0:t;return A.jsx(dn,{id:_,path:p,labelX:x,labelY:S,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:l,style:f,markerEnd:m,markerStart:w,interactionWidth:b})})}const ns=ts({isInternal:!1}),os=ts({isInternal:!0});ns.displayName="SmoothStepEdge";os.displayName="SmoothStepEdgeInternal";function rs(e){return D.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return A.jsx(ns,{...n,id:o,pathOptions:D.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const Ph=rs({isInternal:!1}),is=rs({isInternal:!0});Ph.displayName="StepEdge";is.displayName="StepEdgeInternal";function ss(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:l,style:f,markerEnd:h,markerStart:g,interactionWidth:m})=>{const[w,y,b]=Ei({sourceX:n,sourceY:o,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return A.jsx(dn,{id:p,path:w,labelX:y,labelY:b,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:l,style:f,markerEnd:h,markerStart:g,interactionWidth:m})})}const Th=ss({isInternal:!1}),as=ss({isInternal:!0});Th.displayName="StraightEdge";as.displayName="StraightEdgeInternal";function cs(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=X.Bottom,targetPosition:a=X.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[p,x,S]=bi({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:y?.curvature}),_=e.isInternal?void 0:t;return A.jsx(dn,{id:_,path:p,labelX:x,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:w,interactionWidth:b})})}const Dh=cs({isInternal:!1}),us=cs({isInternal:!0});Dh.displayName="BezierEdge";us.displayName="BezierEdgeInternal";const wr={default:us,straight:as,step:is,smoothstep:os,simplebezier:es},vr={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Rh=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,zh=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,br="react-flow__edgeupdater";function _r({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return A.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:ie([br,`${br}-${a}`]),cx:Rh(t,o,e),cy:zh(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function Hh({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:l,setReconnecting:f,setUpdateHover:h}){const g=re(),m=(x,S)=>{if(x.button!==0)return;const{autoPanOnConnect:_,domNode:N,connectionMode:P,connectionRadius:T,lib:V,onConnectStart:I,cancelConnection:R,nodeLookup:H,rfId:v,panBy:C,updateConnection:E}=g.getState(),k=S.type==="target",M=(O,L)=>{f(!1),l?.(O,n,S.type,L)},$=O=>u?.(n,O),z=(O,L)=>{f(!0),d?.(x,n,S.type),I?.(O,L)};jn.onPointerDown(x.nativeEvent,{autoPanOnConnect:_,connectionMode:P,connectionRadius:T,domNode:N,handleId:S.id,nodeId:S.nodeId,nodeLookup:H,isTarget:k,edgeUpdaterType:S.type,lib:V,flowId:v,cancelConnection:R,panBy:C,isValidConnection:(...O)=>g.getState().isValidConnection?.(...O)??!0,onConnect:$,onConnectStart:z,onConnectEnd:(...O)=>g.getState().onConnectEnd?.(...O),onReconnectEnd:M,updateConnection:E,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:x.currentTarget})},w=x=>m(x,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=x=>m(x,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>h(!0),p=()=>h(!1);return A.jsxs(A.Fragment,{children:[(e===!0||e==="source")&&A.jsx(_r,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&A.jsx(_r,{position:c,centerX:i,centerY:s,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:p,type:"target"})]})}function Lh({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:l,onReconnectStart:f,onReconnectEnd:h,rfId:g,edgeTypes:m,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let p=J(q=>q.edgeLookup.get(e));const x=J(q=>q.defaultEdgeOptions);p=x?{...x,...p}:p;let S=p.type||"default",_=m?.[S]||wr[S];_===void 0&&(y?.("011",ye.error011(S)),S="default",_=m?.default||wr.default);const N=!!(p.focusable||t&&typeof p.focusable>"u"),P=typeof l<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),T=!!(p.selectable||o&&typeof p.selectable>"u"),V=D.useRef(null),[I,R]=D.useState(!1),[H,v]=D.useState(!1),C=re(),{zIndex:E,sourceX:k,sourceY:M,targetX:$,targetY:z,sourcePosition:O,targetPosition:L}=J(D.useCallback(q=>{const G=q.nodeLookup.get(p.source),ee=q.nodeLookup.get(p.target);if(!G||!ee)return{zIndex:p.zIndex,...vr};const ne=kd({id:e,sourceNode:G,targetNode:ee,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:q.connectionMode,onError:y});return{zIndex:vd({selected:p.selected,zIndex:p.zIndex,sourceNode:G,targetNode:ee,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode}),...ne||vr}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),oe),j=D.useMemo(()=>p.markerStart?`url('#${Bn(p.markerStart,g)}')`:void 0,[p.markerStart,g]),F=D.useMemo(()=>p.markerEnd?`url('#${Bn(p.markerEnd,g)}')`:void 0,[p.markerEnd,g]);if(p.hidden||k===null||M===null||$===null||z===null)return null;const Z=q=>{const{addSelectedEdges:G,unselectNodesAndEdges:ee,multiSelectionActive:ne}=C.getState();T&&(C.setState({nodesSelectionActive:!1}),p.selected&&ne?(ee({nodes:[],edges:[p]}),V.current?.blur()):G([e])),r&&r(q,p)},U=i?q=>{i(q,{...p})}:void 0,Y=s?q=>{s(q,{...p})}:void 0,B=a?q=>{a(q,{...p})}:void 0,W=c?q=>{c(q,{...p})}:void 0,Q=u?q=>{u(q,{...p})}:void 0,K=q=>{if(!b&&si.includes(q.key)&&T){const{unselectNodesAndEdges:G,addSelectedEdges:ee}=C.getState();q.key==="Escape"?(V.current?.blur(),G({edges:[p]})):ee([e])}};return A.jsx("svg",{style:{zIndex:E},children:A.jsxs("g",{className:ie(["react-flow__edge",`react-flow__edge-${S}`,p.className,w,{selected:p.selected,animated:p.animated,inactive:!T&&!r,updating:I,selectable:T}]),onClick:Z,onDoubleClick:U,onContextMenu:Y,onMouseEnter:B,onMouseMove:W,onMouseLeave:Q,onKeyDown:N?K:void 0,tabIndex:N?0:void 0,role:p.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":N?`${Li}-${g}`:void 0,ref:V,...p.domAttributes,children:[!H&&A.jsx(_,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:T,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:k,sourceY:M,targetX:$,targetY:z,sourcePosition:O,targetPosition:L,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:j,markerEnd:F,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),P&&A.jsx(Hh,{edge:p,isReconnectable:P,reconnectRadius:d,onReconnect:l,onReconnectStart:f,onReconnectEnd:h,sourceX:k,sourceY:M,targetX:$,targetY:z,sourcePosition:O,targetPosition:L,setUpdateHover:R,setReconnecting:v})]})})}var Oh=D.memo(Lh);const Vh=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ls({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:l,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:m}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:p}=J(Vh,oe),x=Sh(t);return A.jsxs("div",{className:"react-flow__edges",children:[A.jsx(Ih,{defaultColor:e,rfId:n}),x.map(S=>A.jsx(Oh,{id:S,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:l,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:p,edgeTypes:o,disableKeyboardA11y:m},S))]})}ls.displayName="EdgeRenderer";const Bh=D.memo(ls),Fh=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jh({children:e}){const t=J(Fh);return A.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Wh(e){const t=ao(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Xh=e=>e.panZoom?.syncViewport;function Yh(e){const t=J(Xh),n=re();return D.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Zh(e){return e.connection.inProgress?{...e.connection,to:St(e.connection.to,e.transform)}:{...e.connection}}function qh(e){return Zh}function Gh(e){const t=qh();return J(t,oe)}const Uh=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Kh({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:c}=J(Uh,oe);return!(i&&r&&c)?null:A.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:A.jsx("g",{className:ie(["react-flow__connection",ui(a)]),children:A.jsx(ds,{style:t,type:n,CustomComponent:o,isValid:a})})})}const ds=({style:e,type:t=Me.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:c,to:u,toNode:d,toHandle:l,toPosition:f,pointer:h}=Gh();if(!r)return;if(n)return A.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:f,connectionStatus:ui(o),toNode:d,toHandle:l,pointer:h});let g="";const m={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Me.Bezier:[g]=bi(m);break;case Me.SimpleBezier:[g]=Qi(m);break;case Me.Step:[g]=Vn({...m,borderRadius:0});break;case Me.SmoothStep:[g]=Vn(m);break;default:[g]=Ei(m)}return A.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};ds.displayName="ConnectionLine";const Qh={};function Er(e=Qh){D.useRef(e),re(),D.useEffect(()=>{},[e])}function Jh(){re(),D.useRef(!1),D.useEffect(()=>{},[])}function fs({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:l,onSelectionStart:f,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:m,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:p,selectionMode:x,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:N,deleteKeyCode:P,onlyRenderVisibleElements:T,elementsSelectable:V,defaultViewport:I,translateExtent:R,minZoom:H,maxZoom:v,preventScrolling:C,defaultMarkerColor:E,zoomOnScroll:k,zoomOnPinch:M,panOnScroll:$,panOnScrollSpeed:z,panOnScrollMode:O,zoomOnDoubleClick:L,panOnDrag:j,onPaneClick:F,onPaneMouseEnter:Z,onPaneMouseMove:U,onPaneMouseLeave:Y,onPaneScroll:B,onPaneContextMenu:W,paneClickDistance:Q,nodeClickDistance:K,onEdgeContextMenu:q,onEdgeMouseEnter:G,onEdgeMouseMove:ee,onEdgeMouseLeave:ne,reconnectRadius:te,onReconnect:se,onReconnectStart:Se,onReconnectEnd:we,noDragClassName:Ie,noWheelClassName:Qe,noPanClassName:Je,disableKeyboardA11y:et,nodeExtent:fn,rfId:Nt,viewport:Le,onViewportChange:tt}){return Er(e),Er(t),Jh(),Wh(n),Yh(Le),A.jsx(ph,{onPaneClick:F,onPaneMouseEnter:Z,onPaneMouseMove:U,onPaneMouseLeave:Y,onPaneContextMenu:W,onPaneScroll:B,paneClickDistance:Q,deleteKeyCode:P,selectionKeyCode:b,selectionOnDrag:p,selectionMode:x,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:N,elementsSelectable:V,zoomOnScroll:k,zoomOnPinch:M,zoomOnDoubleClick:L,panOnScroll:$,panOnScrollSpeed:z,panOnScrollMode:O,panOnDrag:j,defaultViewport:I,translateExtent:R,minZoom:H,maxZoom:v,onSelectionContextMenu:l,preventScrolling:C,noDragClassName:Ie,noWheelClassName:Qe,noPanClassName:Je,disableKeyboardA11y:et,onViewportChange:tt,isControlledViewport:!!Le,children:A.jsxs(jh,{children:[A.jsx(Bh,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:se,onReconnectStart:Se,onReconnectEnd:we,onlyRenderVisibleElements:T,onEdgeContextMenu:q,onEdgeMouseEnter:G,onEdgeMouseMove:ee,onEdgeMouseLeave:ne,reconnectRadius:te,defaultMarkerColor:E,noPanClassName:Je,disableKeyboardA11y:et,rfId:Nt}),A.jsx(Kh,{style:m,type:g,component:w,containerStyle:y}),A.jsx("div",{className:"react-flow__edgelabel-renderer"}),A.jsx(Eh,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:K,onlyRenderVisibleElements:T,noPanClassName:Je,noDragClassName:Ie,disableKeyboardA11y:et,nodeExtent:fn,rfId:Nt}),A.jsx("div",{className:"react-flow__viewport-portal"})]})})}fs.displayName="GraphView";const ep=D.memo(fs),Sr=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:l,zIndexMode:f="basic"}={})=>{const h=new Map,g=new Map,m=new Map,w=new Map,y=o??t??[],b=n??e??[],p=d??[0,0],x=l??pt;Ci(m,w,y);const S=Fn(b,h,g,{nodeOrigin:p,nodeExtent:x,zIndexMode:f});let _=[0,0,1];if(s&&r&&i){const N=_t(h,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:P,y:T,zoom:V}=eo(N,r,i,c,u,a?.padding??.1);_=[P,T,V]}return{rfId:"1",width:r??0,height:i??0,transform:_,nodes:b,nodesInitialized:S,nodeLookup:h,parentLookup:g,edges:y,edgeLookup:w,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:pt,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ze.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...ci},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:pd,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ai,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},tp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:l,zIndexMode:f})=>wf((h,g)=>{async function m(){const{nodeLookup:w,panZoom:y,fitViewOptions:b,fitViewResolver:p,width:x,height:S,minZoom:_,maxZoom:N}=g();y&&(await fd({nodes:w,width:x,height:S,panZoom:y,minZoom:_,maxZoom:N},b),p?.resolve(!0),h({fitViewResolver:null}))}return{...Sr({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:l,defaultNodes:n,defaultEdges:o,zIndexMode:f}),setNodes:w=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:p,elevateNodesOnSelect:x,fitViewQueued:S,zIndexMode:_}=g(),N=Fn(w,y,b,{nodeOrigin:p,nodeExtent:l,elevateNodesOnSelect:x,checkEquality:!0,zIndexMode:_});S&&N?(m(),h({nodes:w,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:w,nodesInitialized:N})},setEdges:w=>{const{connectionLookup:y,edgeLookup:b}=g();Ci(y,b,w),h({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:b}=g();b(w),h({hasDefaultNodes:!0})}if(y){const{setEdges:b}=g();b(y),h({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:p,domNode:x,nodeOrigin:S,nodeExtent:_,debug:N,fitViewQueued:P,zIndexMode:T}=g(),{changes:V,updatedInternals:I}=zd(w,b,p,x,S,_,T);I&&(Pd(b,p,{nodeOrigin:S,nodeExtent:_,zIndexMode:T}),P?(m(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),V?.length>0&&(N&&console.log("React Flow: trigger node changes",V),y?.(V)))},updateNodePositions:(w,y=!1)=>{const b=[];let p=[];const{nodeLookup:x,triggerNodeChanges:S,connection:_,updateConnection:N,onNodesChangeMiddlewareMap:P}=g();for(const[T,V]of w){const I=x.get(T),R=!!(I?.expandParent&&I?.parentId&&V?.position),H={id:T,type:"position",position:R?{x:Math.max(0,V.position.x),y:Math.max(0,V.position.y)}:V.position,dragging:y};if(I&&_.inProgress&&_.fromNode.id===I.id){const v=He(I,_.fromHandle,X.Left,!0);N({..._,from:v})}R&&I.parentId&&b.push({id:T,parentId:I.parentId,rect:{...V.internals.positionAbsolute,width:V.measured.width??0,height:V.measured.height??0}}),p.push(H)}if(b.length>0){const{parentLookup:T,nodeOrigin:V}=g(),I=so(b,x,T,V);p.push(...I)}for(const T of P.values())p=T(p);S(p)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:b,nodes:p,hasDefaultNodes:x,debug:S}=g();if(w?.length){if(x){const _=Bi(w,p);b(_)}S&&console.log("React Flow: trigger node changes",w),y?.(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:b,edges:p,hasDefaultEdges:x,debug:S}=g();if(w?.length){if(x){const _=Fi(w,p);b(_)}S&&console.log("React Flow: trigger edge changes",w),y?.(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:p,triggerNodeChanges:x,triggerEdgeChanges:S}=g();if(y){const _=w.map(N=>Ae(N,!0));x(_);return}x(Be(p,new Set([...w]),!0)),S(Be(b))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:p,triggerNodeChanges:x,triggerEdgeChanges:S}=g();if(y){const _=w.map(N=>Ae(N,!0));S(_);return}S(Be(b,new Set([...w]))),x(Be(p,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:b,nodes:p,nodeLookup:x,triggerNodeChanges:S,triggerEdgeChanges:_}=g(),N=w||p,P=y||b,T=[];for(const I of N){if(!I.selected)continue;const R=x.get(I.id);R&&(R.selected=!1),T.push(Ae(I.id,!1))}const V=[];for(const I of P)I.selected&&V.push(Ae(I.id,!1));S(T),_(V)},setMinZoom:w=>{const{panZoom:y,maxZoom:b}=g();y?.setScaleExtent([w,b]),h({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:b}=g();y?.setScaleExtent([b,w]),h({maxZoom:w})},setTranslateExtent:w=>{g().panZoom?.setTranslateExtent(w),h({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:p,elementsSelectable:x}=g();if(!x)return;const S=y.reduce((N,P)=>P.selected?[...N,Ae(P.id,!1)]:N,[]),_=w.reduce((N,P)=>P.selected?[...N,Ae(P.id,!1)]:N,[]);b(S),p(_)},setNodeExtent:w=>{const{nodes:y,nodeLookup:b,parentLookup:p,nodeOrigin:x,elevateNodesOnSelect:S,nodeExtent:_,zIndexMode:N}=g();w[0][0]===_[0][0]&&w[0][1]===_[0][1]&&w[1][0]===_[1][0]&&w[1][1]===_[1][1]||(Fn(y,b,p,{nodeOrigin:x,nodeExtent:w,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:N}),h({nodeExtent:w}))},panBy:w=>{const{transform:y,width:b,height:p,panZoom:x,translateExtent:S}=g();return Hd({delta:w,panZoom:x,transform:y,translateExtent:S,width:b,height:p})},setCenter:async(w,y,b)=>{const{width:p,height:x,maxZoom:S,panZoom:_}=g();if(!_)return Promise.resolve(!1);const N=typeof b?.zoom<"u"?b.zoom:S;return await _.setViewport({x:p/2-w*N,y:x/2-y*N,zoom:N},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...ci}})},updateConnection:w=>{h({connection:w})},reset:()=>h({...Sr()})}},Object.is);function np({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:l,zIndexMode:f,children:h}){const[g]=D.useState(()=>tp({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:c,nodeOrigin:d,nodeExtent:l,zIndexMode:f}));return A.jsx(vf,{value:g,children:A.jsx(jf,{children:h})})}function op({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:l,nodeExtent:f,zIndexMode:h}){return D.useContext(cn)?A.jsx(A.Fragment,{children:e}):A.jsx(np,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:l,nodeExtent:f,zIndexMode:h,children:e})}const rp={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ip({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:l,onMoveEnd:f,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:N,onNodeDrag:P,onNodeDragStop:T,onNodesDelete:V,onEdgesDelete:I,onDelete:R,onSelectionChange:H,onSelectionDragStart:v,onSelectionDrag:C,onSelectionDragStop:E,onSelectionContextMenu:k,onSelectionStart:M,onSelectionEnd:$,onBeforeDelete:z,connectionMode:O,connectionLineType:L=Me.Bezier,connectionLineStyle:j,connectionLineComponent:F,connectionLineContainerStyle:Z,deleteKeyCode:U="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:B=!1,selectionMode:W=gt.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:K=yt()?"Meta":"Control",zoomActivationKeyCode:q=yt()?"Meta":"Control",snapToGrid:G,snapGrid:ee,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:te,nodesDraggable:se,autoPanOnNodeFocus:Se,nodesConnectable:we,nodesFocusable:Ie,nodeOrigin:Qe=Oi,edgesFocusable:Je,edgesReconnectable:et,elementsSelectable:fn=!0,defaultViewport:Nt=Tf,minZoom:Le=.5,maxZoom:tt=2,translateExtent:uo=pt,preventScrolling:xs=!0,nodeExtent:hn,defaultMarkerColor:ws="#b1b1b7",zoomOnScroll:vs=!0,zoomOnPinch:bs=!0,panOnScroll:_s=!1,panOnScrollSpeed:Es=.5,panOnScrollMode:Ss=Te.Free,zoomOnDoubleClick:Ns=!0,panOnDrag:Cs=!0,onPaneClick:Ms,onPaneMouseEnter:ks,onPaneMouseMove:Is,onPaneMouseLeave:As,onPaneScroll:$s,onPaneContextMenu:Ps,paneClickDistance:Ts=1,nodeClickDistance:Ds=0,children:Rs,onReconnect:zs,onReconnectStart:Hs,onReconnectEnd:Ls,onEdgeContextMenu:Os,onEdgeDoubleClick:Vs,onEdgeMouseEnter:Bs,onEdgeMouseMove:Fs,onEdgeMouseLeave:js,reconnectRadius:Ws=10,onNodesChange:Xs,onEdgesChange:Ys,noDragClassName:Zs="nodrag",noWheelClassName:qs="nowheel",noPanClassName:lo="nopan",fitView:fo,fitViewOptions:ho,connectOnClick:Gs,attributionPosition:Us,proOptions:Ks,defaultEdgeOptions:Qs,elevateNodesOnSelect:Js=!0,elevateEdgesOnSelect:ea=!1,disableKeyboardA11y:po=!1,autoPanOnConnect:ta,autoPanOnNodeDrag:na,autoPanSpeed:oa,connectionRadius:ra,isValidConnection:ia,onError:sa,style:aa,id:go,nodeDragThreshold:ca,connectionDragThreshold:ua,viewport:la,onViewportChange:da,width:fa,height:ha,colorMode:pa="light",debug:ga,onScroll:mo,ariaLabelConfig:ma,zIndexMode:yo="basic",...ya},xa){const pn=go||"1",wa=Hf(pa),va=D.useCallback(xo=>{xo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),mo?.(xo)},[mo]);return A.jsx("div",{"data-testid":"rf__wrapper",...ya,onScroll:va,style:{...aa,...rp},ref:xa,className:ie(["react-flow",r,wa]),id:go,role:"application",children:A.jsxs(op,{nodes:e,edges:t,width:fa,height:ha,fitView:fo,fitViewOptions:ho,minZoom:Le,maxZoom:tt,nodeOrigin:Qe,nodeExtent:hn,zIndexMode:yo,children:[A.jsx(ep,{onInit:u,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:L,connectionLineStyle:j,connectionLineComponent:F,connectionLineContainerStyle:Z,selectionKeyCode:Y,selectionOnDrag:B,selectionMode:W,deleteKeyCode:U,multiSelectionKeyCode:K,panActivationKeyCode:Q,zoomActivationKeyCode:q,onlyRenderVisibleElements:ne,defaultViewport:Nt,translateExtent:uo,minZoom:Le,maxZoom:tt,preventScrolling:xs,zoomOnScroll:vs,zoomOnPinch:bs,zoomOnDoubleClick:Ns,panOnScroll:_s,panOnScrollSpeed:Es,panOnScrollMode:Ss,panOnDrag:Cs,onPaneClick:Ms,onPaneMouseEnter:ks,onPaneMouseMove:Is,onPaneMouseLeave:As,onPaneScroll:$s,onPaneContextMenu:Ps,paneClickDistance:Ts,nodeClickDistance:Ds,onSelectionContextMenu:k,onSelectionStart:M,onSelectionEnd:$,onReconnect:zs,onReconnectStart:Hs,onReconnectEnd:Ls,onEdgeContextMenu:Os,onEdgeDoubleClick:Vs,onEdgeMouseEnter:Bs,onEdgeMouseMove:Fs,onEdgeMouseLeave:js,reconnectRadius:Ws,defaultMarkerColor:ws,noDragClassName:Zs,noWheelClassName:qs,noPanClassName:lo,rfId:pn,disableKeyboardA11y:po,nodeExtent:hn,viewport:la,onViewportChange:da}),A.jsx(zf,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:se,autoPanOnNodeFocus:Se,nodesConnectable:we,nodesFocusable:Ie,edgesFocusable:Je,edgesReconnectable:et,elementsSelectable:fn,elevateNodesOnSelect:Js,elevateEdgesOnSelect:ea,minZoom:Le,maxZoom:tt,nodeExtent:hn,onNodesChange:Xs,onEdgesChange:Ys,snapToGrid:G,snapGrid:ee,connectionMode:O,translateExtent:uo,connectOnClick:Gs,defaultEdgeOptions:Qs,fitView:fo,fitViewOptions:ho,onNodesDelete:V,onEdgesDelete:I,onDelete:R,onNodeDragStart:N,onNodeDrag:P,onNodeDragStop:T,onSelectionDrag:C,onSelectionDragStart:v,onSelectionDragStop:E,onMove:d,onMoveStart:l,onMoveEnd:f,noPanClassName:lo,nodeOrigin:Qe,rfId:pn,autoPanOnConnect:ta,autoPanOnNodeDrag:na,autoPanSpeed:oa,onError:sa,connectionRadius:ra,isValidConnection:ia,selectNodesOnDrag:te,nodeDragThreshold:ca,connectionDragThreshold:ua,onBeforeDelete:z,debug:ga,ariaLabelConfig:ma,zIndexMode:yo}),A.jsx(Pf,{onSelectionChange:H}),Rs,A.jsx(Mf,{proOptions:Ks,position:Us}),A.jsx(Cf,{rfId:pn,disableKeyboardA11y:po})]})})}var Gp=ji(ip);function Up(e){const[t,n]=D.useState(e),o=D.useCallback(r=>n(i=>Bi(r,i)),[]);return[t,n,o]}function Kp(e){const[t,n]=D.useState(e),o=D.useCallback(r=>n(i=>Fi(r,i)),[]);return[t,n,o]}function sp({dimensions:e,lineWidth:t,variant:n,className:o}){return A.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ie(["react-flow__background-pattern",n,o])})}function ap({radius:e,className:t}){return A.jsx("circle",{cx:e,cy:e,r:e,className:ie(["react-flow__background-pattern","dots",t])})}var ke;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ke||(ke={}));const cp={[ke.Dots]:1,[ke.Lines]:1,[ke.Cross]:6},up=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function hs({id:e,variant:t=ke.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:c,className:u,patternClassName:d}){const l=D.useRef(null),{transform:f,patternId:h}=J(up,oe),g=o||cp[t],m=t===ke.Dots,w=t===ke.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*f[2]||1,y[1]*f[2]||1],p=g*f[2],x=Array.isArray(i)?i:[i,i],S=w?[p,p]:b,_=[x[0]*f[2]||1+S[0]/2,x[1]*f[2]||1+S[1]/2],N=`${h}${e||""}`;return A.jsxs("svg",{className:ie(["react-flow__background",u]),style:{...c,...ln,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:l,"data-testid":"rf__background",children:[A.jsx("pattern",{id:N,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:m?A.jsx(ap,{radius:p/2,className:d}):A.jsx(sp,{dimensions:S,lineWidth:r,variant:t,className:d})}),A.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}hs.displayName="Background";const Qp=D.memo(hs);function lp(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:A.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function dp(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:A.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fp(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:A.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function hp(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function pp(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Dt({children:e,className:t,...n}){return A.jsx("button",{type:"button",className:ie(["react-flow__controls-button",t]),...n,children:e})}const gp=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ps({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:c,className:u,children:d,position:l="bottom-left",orientation:f="vertical","aria-label":h}){const g=re(),{isInteractive:m,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:b}=J(gp,oe),{zoomIn:p,zoomOut:x,fitView:S}=ao(),_=()=>{p(),i?.()},N=()=>{x(),s?.()},P=()=>{S(r),a?.()},T=()=>{g.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),c?.(!m)},V=f==="horizontal"?"horizontal":"vertical";return A.jsxs(un,{className:ie(["react-flow__controls",V,u]),position:l,style:e,"data-testid":"rf__controls","aria-label":h??b["controls.ariaLabel"],children:[t&&A.jsxs(A.Fragment,{children:[A.jsx(Dt,{onClick:_,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:A.jsx(lp,{})}),A.jsx(Dt,{onClick:N,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:A.jsx(dp,{})})]}),n&&A.jsx(Dt,{className:"react-flow__controls-fitview",onClick:P,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:A.jsx(fp,{})}),o&&A.jsx(Dt,{className:"react-flow__controls-interactive",onClick:T,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:m?A.jsx(pp,{}):A.jsx(hp,{})}),d]})}ps.displayName="Controls";const Jp=D.memo(ps);function mp({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:c,className:u,borderRadius:d,shapeRendering:l,selected:f,onClick:h}){const{background:g,backgroundColor:m}=i||{},w=s||g||m;return A.jsx("rect",{className:ie(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:d,ry:d,width:o,height:r,style:{fill:w,stroke:a,strokeWidth:c},shapeRendering:l,onClick:h?y=>h(y,e):void 0})}const yp=D.memo(mp),xp=e=>e.nodes.map(t=>t.id),Mn=e=>e instanceof Function?e:()=>e;function wp({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=yp,onClick:s}){const a=J(xp,oe),c=Mn(t),u=Mn(e),d=Mn(n),l=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return A.jsx(A.Fragment,{children:a.map(f=>A.jsx(bp,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:l},f))})}function vp({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:c}){const{node:u,x:d,y:l,width:f,height:h}=J(g=>{const m=g.nodeLookup.get(e);if(!m)return{node:void 0,x:0,y:0,width:0,height:0};const w=m.internals.userNode,{x:y,y:b}=m.internals.positionAbsolute,{width:p,height:x}=Ee(w);return{node:w,x:y,y:b,width:p,height:x}},oe);return!u||u.hidden||!gi(u)?null:A.jsx(a,{x:d,y:l,width:f,height:h,style:u.style,selected:!!u.selected,className:o(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:c,id:u.id})}const bp=D.memo(vp);var _p=D.memo(wp);const Ep=200,Sp=150,Np=e=>!e.hidden,Cp=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?pi(_t(e.nodeLookup,{filter:Np}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Mp="react-flow__minimap-desc";function gs({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:l,position:f="bottom-right",onClick:h,onNodeClick:g,pannable:m=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:p=1,offsetScale:x=5}){const S=re(),_=D.useRef(null),{boundingRect:N,viewBB:P,rfId:T,panZoom:V,translateExtent:I,flowWidth:R,flowHeight:H,ariaLabelConfig:v}=J(Cp,oe),C=e?.width??Ep,E=e?.height??Sp,k=N.width/C,M=N.height/E,$=Math.max(k,M),z=$*C,O=$*E,L=x*$,j=N.x-(z-N.width)/2-L,F=N.y-(O-N.height)/2-L,Z=z+L*2,U=O+L*2,Y=`${Mp}-${T}`,B=D.useRef(0),W=D.useRef();B.current=$,D.useEffect(()=>{if(_.current&&V)return W.current=Yd({domNode:_.current,panZoom:V,getTransform:()=>S.getState().transform,getViewScale:()=>B.current}),()=>{W.current?.destroy()}},[V]),D.useEffect(()=>{W.current?.update({translateExtent:I,width:R,height:H,inversePan:b,pannable:m,zoomStep:p,zoomable:w})},[m,w,b,p,I,R,H]);const Q=h?G=>{const[ee,ne]=W.current?.pointer(G)||[0,0];h(G,{x:ee,y:ne})}:void 0,K=g?D.useCallback((G,ee)=>{const ne=S.getState().nodeLookup.get(ee).internals.userNode;g(G,ne)},[]):void 0,q=y??v["minimap.ariaLabel"];return A.jsx(un,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof l=="number"?l*$:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:A.jsxs("svg",{width:C,height:E,viewBox:`${j} ${F} ${Z} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:_,onClick:Q,children:[q&&A.jsx("title",{id:Y,children:q}),A.jsx(_p,{onClick:K,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),A.jsx("path",{className:"react-flow__minimap-mask",d:`M${j-L},${F-L}h${Z+L*2}v${U+L*2}h${-Z-L*2}z + M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}gs.displayName="MiniMap";const eg=D.memo(gs),kp=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Ip={[Ke.Line]:"right",[Ke.Handle]:"bottom-right"};function Ap({nodeId:e,position:t,variant:n=Ke.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:l=!1,resizeDirection:f,autoScale:h=!0,shouldResize:g,onResizeStart:m,onResize:w,onResizeEnd:y}){const b=Zi(),p=typeof e=="string"?e:b,x=re(),S=D.useRef(null),_=n===Ke.Handle,N=J(D.useCallback(kp(_&&h),[_,h]),oe),P=D.useRef(null),T=t??Ip[n];D.useEffect(()=>{if(!(!S.current||!p))return P.current||(P.current=af({domNode:S.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:I,transform:R,snapGrid:H,snapToGrid:v,nodeOrigin:C,domNode:E}=x.getState();return{nodeLookup:I,transform:R,snapGrid:H,snapToGrid:v,nodeOrigin:C,paneDomNode:E}},onChange:(I,R)=>{const{triggerNodeChanges:H,nodeLookup:v,parentLookup:C,nodeOrigin:E}=x.getState(),k=[],M={x:I.x,y:I.y},$=v.get(p);if($&&$.expandParent&&$.parentId){const z=$.origin??E,O=I.width??$.measured.width??0,L=I.height??$.measured.height??0,j={id:$.id,parentId:$.parentId,rect:{width:O,height:L,...mi({x:I.x??$.position.x,y:I.y??$.position.y},{width:O,height:L},$.parentId,v,z)}},F=so([j],v,C,E);k.push(...F),M.x=I.x?Math.max(z[0]*O,I.x):void 0,M.y=I.y?Math.max(z[1]*L,I.y):void 0}if(M.x!==void 0&&M.y!==void 0){const z={id:p,type:"position",position:{...M}};k.push(z)}if(I.width!==void 0&&I.height!==void 0){const O={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};k.push(O)}for(const z of R){const O={...z,type:"position"};k.push(O)}H(k)},onEnd:({width:I,height:R})=>{const H={id:p,type:"dimensions",resizing:!1,dimensions:{width:I,height:R}};x.getState().triggerNodeChanges([H])}})),P.current.update({controlPosition:T,boundaries:{minWidth:a,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:l,resizeDirection:f,onResizeStart:m,onResize:w,onResizeEnd:y,shouldResize:g}),()=>{P.current?.destroy()}},[T,a,c,u,d,l,m,w,y,g]);const V=T.split("-");return A.jsx("div",{className:ie(["react-flow__resize-control","nodrag",...V,n,o]),ref:S,style:{...r,scale:N,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}D.memo(Ap);const $p=["off","on","auto"],Pp=["16:9","9:16","1:1","4:3","3:4"],Tp=["","5s","10s"],Dp=["","720p","1080p"],Rp=["mp3","opus","aac","flac","wav"],We={textInput:{type:"textInput",label:"Input",description:"Static text provided by the user. Starting point of a workflow.",input:"none",output:"text",params:[{name:"inputText",type:"text",description:"The text value.",required:!0,default:""}]},output:{type:"output",label:"Output",description:"Displays whatever its upstream node produced. Accepts any kind.",input:"text",output:"none",params:[]},chat:{type:"chat",label:"LLM",description:"Run a Venice chat completion. Accepts upstream text as context.",input:"text",output:"text",params:[{name:"model",type:"string",description:"Venice chat model id.",required:!0,default:"llama-3.3-70b"},{name:"prompt",type:"text",description:"Instruction. Use {{input}} to position upstream text, or leave empty to append.",required:!0,default:""},{name:"temperature",type:"number",description:"Sampling temperature.",default:.7,min:0,max:2},{name:"maxTokens",type:"number",description:"Max output tokens.",default:4096,min:64,max:32768},{name:"webSearch",type:"enum",description:"Enable Venice web search.",default:"off",enumValues:$p}]},imageGen:{type:"imageGen",label:"Image Gen",description:"Generate an image from a text prompt.",input:"text",output:"image",params:[{name:"model",type:"string",description:"Venice image model id.",required:!0,default:"z-image-turbo"},{name:"prompt",type:"text",description:"Image prompt. Use {{input}} to position upstream text.",required:!0,default:""},{name:"negativePrompt",type:"string",description:"What to avoid.",default:""},{name:"steps",type:"number",description:"Denoising steps.",default:20,min:1,max:50},{name:"width",type:"number",description:"Image width in pixels.",default:1024,min:256,max:2048},{name:"height",type:"number",description:"Image height in pixels.",default:1024,min:256,max:2048},{name:"style",type:"string",description:"Style preset name.",default:""},{name:"hideWatermark",type:"boolean",description:"Omit watermark if allowed.",default:!0}]},tts:{type:"tts",label:"Text to Speech",description:"Narrate text into speech audio.",input:"text",output:"audio",params:[{name:"model",type:"string",description:"TTS model id.",required:!0,default:"tts-kokoro"},{name:"prompt",type:"text",description:"Text to speak. Use {{input}} to position upstream text.",default:""},{name:"voice",type:"string",description:"Voice id.",default:"af_sky"},{name:"speed",type:"number",description:"Playback speed.",default:1,min:.25,max:4},{name:"responseFormat",type:"enum",description:"Audio format.",default:"mp3",enumValues:Rp}]},music:{type:"music",label:"Music Gen",description:"Generate a music clip from a text prompt.",input:"text",output:"audio",params:[{name:"model",type:"string",description:"Music model id.",required:!0,default:"stable-audio"},{name:"prompt",type:"text",description:"Music prompt.",required:!0,default:""},{name:"duration",type:"number",description:"Duration in seconds.",default:30,min:5,max:120},{name:"instrumental",type:"boolean",description:"Force instrumental.",default:!1},{name:"lyrics",type:"text",description:"Optional lyrics.",default:""}]},video:{type:"video",label:"Video Gen",description:"Generate a short video from a text prompt.",input:"text",output:"video",params:[{name:"model",type:"string",description:"Video model id.",required:!0,default:"wan-2.1"},{name:"prompt",type:"text",description:"Video prompt.",required:!0,default:""},{name:"videoAspectRatio",type:"enum",description:"Aspect ratio.",default:"16:9",enumValues:Pp},{name:"videoDuration",type:"enum",description:"Clip duration. Empty means model default.",default:"",enumValues:Tp},{name:"videoResolution",type:"enum",description:"Resolution. Empty means model default.",default:"",enumValues:Dp}]}};function zp(e,t){return e!=="none"&&t!=="none"}function Hp(e,t){return e==="none"||t==="none"?!1:t==="text"?!0:e===t}const kn=280,ms=180,Rt=60,ys=60;function Lp(e){const t=We[e],n={label:t?.label??e,nodeType:e,model:"",prompt:""};for(const o of t?.params??[])o.default!==void 0&&(n[o.name]=o.default);return n}function Op(e,t){if(e.length===0)return e;const n=new Map,o=new Map;for(const l of e)n.set(l.id,0),o.set(l.id,[]);for(const l of t)!n.has(l.source)||!n.has(l.target)||(o.get(l.source).push(l.target),n.set(l.target,(n.get(l.target)??0)+1));const r=new Map,i=e.filter(l=>(n.get(l.id)??0)===0).map(l=>l.id);for(const l of i)r.set(l,0);const s=new Map(n);for(;i.length>0;){const l=i.shift(),f=r.get(l)??0;for(const h of o.get(l)??[]){r.set(h,Math.max(r.get(h)??0,f+1));const g=(s.get(h)??1)-1;s.set(h,g),g===0&&i.push(h)}}for(const l of e)r.has(l.id)||r.set(l.id,0);const a=new Map;for(const l of e){const f=r.get(l.id)??0;a.has(f)||a.set(f,[]),a.get(f).push(l.id)}const u=Math.max(...Array.from(a.values()).map(l=>l.length))*(kn+Rt),d=new Map;for(const[l,f]of a){const h=f.length*(kn+Rt)-Rt,g=(u-h)/2;f.forEach((m,w)=>{d.set(m,{x:g+w*(kn+Rt),y:40+l*(ms+ys)})})}return e.map(l=>({...l,position:d.get(l.id)??l.position}))}function Vp(e){return{x:280,y:40+e.length*(ms+ys)}}function Bp(e,t){const{nodes:n,edges:o}=e;switch(t.op){case"add_node":{if(!We[t.nodeType])throw new Error(`Unknown node type: ${t.nodeType}`);const r=t.id??An();if(n.some(c=>c.id===r))throw new Error(`Node id already exists: ${r}`);const i=t.position??Vp(n),s={...Lp(t.nodeType),...t.params??{}},a={id:r,type:"venice",position:i,data:s};return{nodes:[...n,a],edges:o,addedNodeId:r}}case"remove_node":{if(!n.some(r=>r.id===t.id))throw new Error(`Node not found: ${t.id}`);return{nodes:n.filter(r=>r.id!==t.id),edges:o.filter(r=>r.source!==t.id&&r.target!==t.id)}}case"set_params":{if(!n.some(r=>r.id===t.id))throw new Error(`Node not found: ${t.id}`);return{nodes:n.map(r=>r.id===t.id?{...r,data:{...r.data,...t.params}}:r),edges:o}}case"move_node":{if(!n.some(r=>r.id===t.id))throw new Error(`Node not found: ${t.id}`);return{nodes:n.map(r=>r.id===t.id?{...r,position:t.position}:r),edges:o}}case"connect":{if(!n.some(s=>s.id===t.source))throw new Error(`Source node not found: ${t.source}`);if(!n.some(s=>s.id===t.target))throw new Error(`Target node not found: ${t.target}`);if(t.source===t.target)throw new Error("Cannot connect a node to itself.");const r=t.id??`e-${t.source}-${t.target}-${An().slice(0,6)}`;if(o.some(s=>s.id===r))throw new Error(`Edge id already exists: ${r}`);const i={id:r,source:t.source,target:t.target,animated:!0};return{nodes:n,edges:[...o,i],addedEdgeId:r}}case"disconnect":{if(!o.some(r=>r.id===t.id))throw new Error(`Edge not found: ${t.id}`);return{nodes:n,edges:o.filter(r=>r.id!==t.id)}}case"clear":return{nodes:[],edges:[]}}}function Fp(e,t){let n=e,o,r;for(const s of t){const a=Bp(n,s);n={nodes:a.nodes,edges:a.edges},a.addedNodeId&&(o=a.addedNodeId),a.addedEdgeId&&(r=a.addedEdgeId)}return{nodes:Op(n.nodes,n.edges),edges:n.edges,addedNodeId:o,addedEdgeId:r}}const tg=Sa()(Na((e,t)=>({workflows:[],activeWorkflowId:null,runResults:{},isRunning:!1,createWorkflow:n=>{const o=An(),r={id:o,name:n,nodes:[],edges:[],createdAt:Date.now()};return e(i=>({workflows:[r,...i.workflows],activeWorkflowId:o})),o},updateWorkflow:(n,o)=>e(r=>({workflows:r.workflows.map(i=>i.id===n?{...i,...o}:i)})),deleteWorkflow:n=>e(o=>({workflows:o.workflows.filter(r=>r.id!==n),activeWorkflowId:o.activeWorkflowId===n?null:o.activeWorkflowId})),setActiveWorkflow:n=>e({activeWorkflowId:n}),setRunResults:n=>e({runResults:n}),updateNodeResult:(n,o)=>e(r=>({runResults:{...r.runResults,[n]:{...r.runResults[n],...o}}})),setIsRunning:n=>e({isRunning:n}),clearResults:()=>e({runResults:{}}),applyPatches:(n,o)=>{const r=t().workflows.find(s=>s.id===n);if(!r)throw new Error(`Workflow not found: ${n}`);const i=Fp({nodes:r.nodes,edges:r.edges},o);return e(s=>({workflows:s.workflows.map(a=>a.id===n?{...a,nodes:i.nodes,edges:i.edges}:a)})),i}}),{name:"venice-workflows",version:1,storage:Ca(()=>Ma()),partialize:e=>({workflows:e.workflows.slice(0,20),activeWorkflowId:e.activeWorkflowId})}));function jp(e,t){const n=new Map;for(const c of e)n.set(c.id,[]);for(const c of t)n.get(c.source)?.push(c.target);const o=0,r=1,i=2,s=new Map;for(const c of e)s.set(c.id,o);const a=c=>{s.set(c,r);for(const u of n.get(c)??[]){const d=s.get(u);if(d===r||d===o&&a(u))return!0}return s.set(c,i),!1};for(const c of e)if(s.get(c.id)===o&&a(c.id))return!0;return!1}function Nr(e,t){const n=e[t];return n==null?!0:typeof n=="string"?n.trim()==="":!1}function Wp({nodes:e,edges:t}){const n=[],o=[],r=new Set(e.map(i=>i.id));e.length===0&&o.push({severity:"warning",message:"Workflow is empty."});for(const i of e){const s=We[i.data?.nodeType];if(!s){n.push({severity:"error",nodeId:i.id,message:`Unknown node type: ${String(i.data?.nodeType)}`});continue}for(const a of s.params)if(a.required&&Nr(i.data,a.name)){const c=s.input!=="none"&&t.some(d=>d.target===i.id);(a.name==="prompt"||a.name==="inputText")&&c||n.push({severity:"error",nodeId:i.id,message:`${s.label}: missing required "${a.name}".`})}if(s.input==="none"){const a=t.filter(c=>c.target===i.id);for(const c of a)n.push({severity:"error",edgeId:c.id,message:`${s.label} does not accept inputs.`})}else t.filter(c=>c.target===i.id).length===0&&s.type!=="output"&&(!s.params.some(u=>u.name==="prompt"&&u.required)||Nr(i.data,"prompt"))&&o.push({severity:"warning",nodeId:i.id,message:`${s.label}: no upstream input connected.`});if(s.output==="none"){const a=t.filter(c=>c.source===i.id);for(const c of a)n.push({severity:"error",edgeId:c.id,message:`${s.label} has no output and cannot feed another node.`})}}for(const i of t){if(!r.has(i.source)){n.push({severity:"error",edgeId:i.id,message:`Edge source ${i.source} does not exist.`});continue}if(!r.has(i.target)){n.push({severity:"error",edgeId:i.id,message:`Edge target ${i.target} does not exist.`});continue}if(i.source===i.target){n.push({severity:"error",edgeId:i.id,message:"Self-loops are not allowed."});continue}const s=e.find(d=>d.id===i.source),a=e.find(d=>d.id===i.target);if(!s||!a)continue;const c=We[s.data.nodeType],u=We[a.data.nodeType];!c||!u||(zp(c.output,u.input)?Hp(c.output,u.input)||o.push({severity:"warning",edgeId:i.id,message:`${c.label} outputs ${c.output}; ${u.label} expects ${u.input}. Conversion may be lossy.`}):n.push({severity:"error",edgeId:i.id,message:`${c.label} (${c.output}) cannot connect to ${u.label} (${u.input}).`}))}return jp(e,t)&&n.push({severity:"error",message:"Workflow contains a cycle."}),{ok:n.length===0,errors:n,warnings:o}}const Cr=3e3,Mr=200;class In extends Error{nodeId;constructor(t,n){super(t),this.name="WorkflowExecutionError",this.nodeId=n}}function Xp(e,t){const n=new Map,o=new Map;for(const a of e)n.set(a.id,0),o.set(a.id,[]);for(const a of t)!n.has(a.source)||!n.has(a.target)||(o.get(a.source).push(a.target),n.set(a.target,(n.get(a.target)??0)+1));const r=[];let i=e.filter(a=>(n.get(a.id)??0)===0).map(a=>a.id),s=0;for(;i.length>0;){r.push(i),s+=i.length;const a=[];for(const c of i)for(const u of o.get(c)??[]){const d=(n.get(u)??1)-1;n.set(u,d),d===0&&a.push(u)}i=a}return s===e.length?r:null}function Yp(e,t,n){return t.filter(i=>i.target===e).map(i=>n.get(i.source)??"").filter(Boolean).join(` + +`)}function rt(e,t){return e?e.includes("{{input}}")?e.replace(/\{\{input\}\}/g,t):t?`${e} + +${t}`:e:t}async function kr({path:e,id:t,getStatus:n,getResult:o,getError:r,signal:i}){for(let s=0;s{const l=setTimeout(u,Cr);i?.addEventListener("abort",()=>{clearTimeout(l),d(new DOMException("Aborted","AbortError"))},{once:!0})});const a=await it(e,{method:"POST",body:JSON.stringify({id:t}),signal:i}),c=n(a).toLowerCase();if(c==="completed"){const u=o(a);if(u)return u;throw new Error("Completed but no output URL returned")}if(c==="failed")throw new Error(r(a)??"Generation failed")}throw new Error(`Generation timed out after ${Mr*Cr/1e3}s`)}async function Zp(e,t,n){const o=e.data;switch(o.nodeType){case"textInput":return o.inputText??"";case"output":return t;case"chat":{const r=rt(o.prompt,t);return(await it("/chat/completions",{method:"POST",body:JSON.stringify({model:o.model||"llama-3.3-70b",messages:[{role:"user",content:r}],temperature:o.temperature??.7,max_tokens:o.maxTokens??4096,venice_parameters:{enable_web_search:o.webSearch??"off"}}),signal:n})).choices[0]?.message?.content??""}case"imageGen":{const r=rt(o.prompt,t),i={model:o.model||"z-image-turbo",prompt:r,negative_prompt:o.negativePrompt||void 0,steps:o.steps??20,style_preset:o.style||void 0,width:o.width??1024,height:o.height??1024,hide_watermark:o.hideWatermark??!0};o.aspectRatio&&(i.aspect_ratio=o.aspectRatio);const a=(await it("/image/generate",{method:"POST",body:JSON.stringify(i),signal:n})).images[0],c=typeof a=="string"?a:a.b64_json;return`[image:data:${c.startsWith("/9j/")?"image/jpeg":c.startsWith("iVBOR")?"image/png":c.startsWith("UklGR")?"image/webp":"image/png"};base64,${c}]`}case"tts":{const r=rt(o.prompt,t),i=await ka("/audio/speech",{model:o.model||"tts-kokoro",input:r,voice:o.voice||"af_sky",speed:o.speed??1,response_format:o.responseFormat||"mp3"},{signal:n});return`[audio:${URL.createObjectURL(i)}]`}case"music":{const r=rt(o.prompt,t),i={model:o.model||"stable-audio",prompt:r,duration_seconds:o.duration??30,force_instrumental:o.instrumental??!1};o.lyrics&&(i.lyrics_prompt=o.lyrics);const s=await it("/audio/queue",{method:"POST",body:JSON.stringify(i),signal:n});return`[audio:${await kr({path:"/audio/retrieve",id:s.queue_id,getStatus:c=>c.status,getResult:c=>c.audio_url,getError:c=>c.error,signal:n})}]`}case"video":{const r=rt(o.prompt,t),i={model:o.model||"wan-2.1",prompt:r,aspect_ratio:o.videoAspectRatio||"16:9"};o.videoDuration&&(i.duration=o.videoDuration),o.videoResolution&&(i.resolution=o.videoResolution);const s=await it("/video/queue",{method:"POST",body:JSON.stringify(i),signal:n}),a=s.queue_id||s.id||"";return`[video:${await kr({path:"/video/retrieve",id:a,getStatus:u=>u.status,getResult:u=>u.video_url,getError:u=>u.error,signal:n})}]`}}}async function ng(e,t,n){const o=typeof n=="function"?{onUpdate:n}:n,{signal:r,onUpdate:i}=o,s=Wp({nodes:e,edges:t});if(!s.ok){const d=s.errors[0];throw new In(d?.message??"Workflow has validation errors.",d?.nodeId)}const a=Xp(e,t);if(!a)throw new In("Workflow contains a cycle.");const c=new Map,u=new Map(e.map(d=>[d.id,d]));for(const d of a){if(r?.aborted)return;await Promise.all(d.map(async l=>{const f=u.get(l);if(f){i(l,{status:"running",output:void 0,error:void 0});try{const h=Yp(l,t,c),g=await Zp(f,h,r);c.set(l,g);const m=We[f.data.nodeType]?.output;i(l,{status:"done",output:g,outputKind:m&&m!=="none"?m:void 0})}catch(h){if(h instanceof DOMException&&h.name==="AbortError")throw i(l,{status:"error",error:"Cancelled"}),h;const g=h instanceof Error?h.message:"Unknown error";throw i(l,{status:"error",error:g}),new In(g,l)}}}))}}export{Qp as B,Jp as C,Kt as H,eg as M,We as N,X as P,np as R,ao as a,Up as b,Kp as c,Sd as d,ke as e,ng as f,Fp as g,Bp as h,Gp as i,tg as u,Wp as v}; diff --git a/ventures/havre/open/assets/workflows-view-xQJlxU4f.js b/ventures/havre/open/assets/workflows-view-xQJlxU4f.js new file mode 100644 index 0000000..bbaa223 --- /dev/null +++ b/ventures/havre/open/assets/workflows-view-xQJlxU4f.js @@ -0,0 +1 @@ +import{r as h,j as e,c as w,u as F,S as _,g as E,t as M}from"./index-CfrUZ43_.js";import{u as y,a as R,H as O,P as S,R as z,b as H,c as $,d as U,i as Y,B as K,e as q,C as J,M as Q,f as X}from"./workflow-engine-ClbuiuAZ.js";function Z(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"22 12 16 12 14 15 10 9 8 12 2 12"})})}function ee(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})}function te(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]})}function oe(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),e.jsx("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})}function ne(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M9 18V5l12-2v13"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}function se(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polygon",{points:"23 7 16 12 23 17 23 7"}),e.jsx("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2"})]})}function ie(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M8 12h8M12 8v8"})]})}const re={textInput:void 0,output:void 0,chat:"text",imageGen:"image",tts:"tts",music:"music",video:"video"},ae={textInput:{label:"Input",Icon:Z,color:"border-blue-500/30",hasInput:!1,hasOutput:!0},chat:{label:"LLM",Icon:ee,color:"border-purple-500/30",hasInput:!0,hasOutput:!0},imageGen:{label:"Image Gen",Icon:te,color:"border-pink-500/30",hasInput:!0,hasOutput:!0},tts:{label:"Text to Speech",Icon:oe,color:"border-green-500/30",hasInput:!0,hasOutput:!0},music:{label:"Music Gen",Icon:ne,color:"border-yellow-500/30",hasInput:!0,hasOutput:!0},video:{label:"Video Gen",Icon:se,color:"border-orange-500/30",hasInput:!0,hasOutput:!0},output:{label:"Output",Icon:ie,color:"border-white/20",hasInput:!0,hasOutput:!1}},x="nodrag bg-white/[0.03] border border-white/[0.06] rounded px-1.5 py-0.5 text-[12px] text-white/40 outline-none",L="nodrag w-full bg-white/[0.03] border border-white/[0.06] rounded-md px-2 py-1 text-[13px] text-white/60 outline-none placeholder:text-white/15";function le({nodeType:s,value:t,onChange:i}){const o=re[s],{data:c}=F(o),p=c?.map(u=>({value:u.id,label:u.model_spec?.name||u.id}))??[];return e.jsx("div",{className:"nodrag",children:e.jsx(_,{value:t,onChange:i,options:p,searchable:!0,placeholder:"Select model...",className:"w-full [&_button]:!py-1 [&_button]:!text-[13px] [&_button]:!px-2"})})}function de({id:s,data:t}){const i=ae[t.nodeType],o=y(n=>n.runResults[s]),{setNodes:c}=R(),[p,u]=h.useState(!1),r=h.useCallback(n=>{c(m=>m.map(g=>g.id===s?{...g,data:{...g.data,...n}}:g))},[s,c]),a=h.useCallback(()=>{c(n=>n.filter(m=>m.id!==s))},[s,c]);return e.jsxs("div",{className:w("rounded-xl border-2 bg-[#111] shadow-xl min-w-[300px] max-w-[340px]",i.color,o?.status==="running"&&"ring-2 ring-white/20 animate-pulse",o?.status==="done"&&"ring-2 ring-green-500/30",o?.status==="error"&&"ring-2 ring-red-500/30"),children:[i.hasInput&&e.jsx(O,{type:"target",position:S.Top,className:"!w-3 !h-3 !bg-white/30 !border-2 !border-[#111]"}),e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.06]",children:[e.jsx("span",{className:"text-white/30",children:e.jsx(i.Icon,{})}),e.jsx("span",{className:"text-[14px] font-medium text-white/60",children:i.label}),o?.status==="running"&&e.jsx("span",{className:"text-[12px] text-white/30 ml-auto mr-1",children:"Running..."}),o?.status==="done"&&e.jsx("span",{className:"text-[12px] text-green-400/60 ml-auto mr-1",children:"Done"}),o?.status==="error"&&e.jsx("span",{className:"text-[12px] text-red-400/60 ml-auto mr-1",children:"Error"}),!o?.status&&e.jsx("span",{className:"ml-auto"}),e.jsx("button",{onClick:a,className:"nodrag text-white/10 hover:text-red-400/60 transition-colors p-0.5",title:"Delete node",children:e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"px-4 py-3 flex flex-col gap-1.5",children:[t.nodeType==="output"?o?.status==="done"&&o.output?e.jsx("div",{className:"min-h-[60px]",children:o.output.startsWith("[audio:")?e.jsx("audio",{src:o.output.slice(7,-1),controls:!0,className:"w-full h-8"}):o.output.startsWith("[video:")?e.jsx("a",{href:o.output.slice(7,-1),target:"_blank",rel:"noreferrer",className:"text-[14px] text-blue-400 underline",children:"Open video"}):o.output.startsWith("[image:")?e.jsx("img",{src:o.output.slice(7,-1),alt:"Generated",className:"w-full rounded-lg border border-white/[0.06]"}):e.jsx("p",{className:w("text-[14px] text-white/60 leading-relaxed whitespace-pre-wrap",!p&&"line-clamp-8"),onClick:()=>u(!p),children:o.output})}):o?.status==="running"?e.jsx("div",{className:"min-h-[40px] flex items-center justify-center",children:e.jsx("span",{className:"text-[13px] text-white/20",children:"Waiting for input..."})}):o?.status==="error"?e.jsx("p",{className:"text-[13px] text-red-400/60",children:o.error}):e.jsx("div",{className:"min-h-[40px] flex items-center justify-center",children:e.jsx("span",{className:"text-[13px] text-white/10",children:"Run workflow to see output"})}):t.nodeType==="textInput"?e.jsx("textarea",{value:t.inputText??"",onChange:n=>r({inputText:n.target.value}),placeholder:"Enter starting text...",rows:3,className:"nodrag nowheel w-full bg-white/[0.03] border border-white/[0.06] rounded-md px-2 py-1.5 text-[14px] text-white/70 outline-none resize-none placeholder:text-white/15"}):e.jsxs(e.Fragment,{children:[e.jsx(le,{nodeType:t.nodeType,value:t.model,onChange:n=>r({model:n})}),e.jsx("textarea",{value:t.prompt,onChange:n=>r({prompt:n.target.value}),placeholder:"Instructions for this step...",rows:2,className:"nodrag nowheel w-full bg-white/[0.03] border border-white/[0.06] rounded-md px-2 py-1.5 text-[14px] text-white/70 outline-none resize-none placeholder:text-white/15"}),t.nodeType==="chat"&&e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs("select",{value:t.webSearch??"off",onChange:n=>r({webSearch:n.target.value}),className:x,children:[e.jsx("option",{value:"off",children:"Search off"}),e.jsx("option",{value:"on",children:"Search on"}),e.jsx("option",{value:"auto",children:"Search auto"})]}),e.jsx("input",{type:"number",value:t.temperature??.7,onChange:n=>r({temperature:parseFloat(n.target.value)}),step:.1,min:0,max:2,className:w(x,"w-14"),title:"Temperature"}),e.jsx("input",{type:"number",value:t.maxTokens??4096,onChange:n=>r({maxTokens:parseInt(n.target.value)}),step:256,min:64,max:32768,className:w(x,"w-[72px]"),title:"Max tokens"})]}),t.nodeType==="imageGen"&&e.jsxs(e.Fragment,{children:[e.jsx("input",{value:t.negativePrompt??"",onChange:n=>r({negativePrompt:n.target.value}),placeholder:"Negative prompt...",className:L}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Steps"}),e.jsx("input",{type:"number",value:t.steps??20,onChange:n=>r({steps:parseInt(n.target.value)}),min:1,max:50,className:x+" w-full"})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Size"}),e.jsxs("select",{value:`${t.width??1024}x${t.height??1024}`,onChange:n=>{const[m,g]=n.target.value.split("x").map(Number);r({width:m,height:g})},className:x+" w-full",children:[e.jsx("option",{value:"512x512",children:"512"}),e.jsx("option",{value:"768x768",children:"768"}),e.jsx("option",{value:"1024x1024",children:"1024"}),e.jsx("option",{value:"1280x1280",children:"1280"})]})]})]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("input",{value:t.style??"",onChange:n=>r({style:n.target.value}),placeholder:"Style preset...",className:w(L,"flex-1")}),e.jsxs("label",{className:"nodrag flex items-center gap-1 text-[12px] text-white/30 cursor-pointer shrink-0",children:[e.jsx("input",{type:"checkbox",checked:t.hideWatermark??!0,onChange:n=>r({hideWatermark:n.target.checked}),className:"nodrag w-3 h-3 accent-white/50"}),"No WM"]})]})]}),t.nodeType==="tts"&&e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs("div",{className:"flex-1 min-w-[80px]",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Voice"}),e.jsx("input",{value:t.voice??"af_sky",onChange:n=>r({voice:n.target.value}),placeholder:"Voice ID",className:L})]}),e.jsxs("div",{className:"w-14",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Speed"}),e.jsx("input",{type:"number",value:t.speed??1,onChange:n=>r({speed:parseFloat(n.target.value)}),step:.25,min:.25,max:4,className:x+" w-full"})]}),e.jsxs("div",{className:"w-16",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Format"}),e.jsxs("select",{value:t.responseFormat??"mp3",onChange:n=>r({responseFormat:n.target.value}),className:x+" w-full",children:[e.jsx("option",{value:"mp3",children:"MP3"}),e.jsx("option",{value:"opus",children:"Opus"}),e.jsx("option",{value:"aac",children:"AAC"}),e.jsx("option",{value:"flac",children:"FLAC"}),e.jsx("option",{value:"wav",children:"WAV"})]})]})]}),t.nodeType==="music"&&e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:t.lyrics??"",onChange:n=>r({lyrics:n.target.value}),placeholder:"Lyrics (optional)...",rows:2,className:"nodrag nowheel w-full bg-white/[0.03] border border-white/[0.06] rounded-md px-2 py-1.5 text-[14px] text-white/70 outline-none resize-none placeholder:text-white/15"}),e.jsxs("div",{className:"flex gap-1.5 items-end",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Duration (s)"}),e.jsx("input",{type:"number",value:t.duration??30,onChange:n=>r({duration:parseInt(n.target.value)}),min:5,max:120,step:5,className:x+" w-full"})]}),e.jsxs("label",{className:"nodrag flex items-center gap-1 text-[12px] text-white/30 cursor-pointer pb-0.5",children:[e.jsx("input",{type:"checkbox",checked:t.instrumental??!1,onChange:n=>r({instrumental:n.target.checked}),className:"nodrag w-3 h-3 accent-white/50"}),"Instrumental"]})]})]}),t.nodeType==="video"&&e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs("div",{className:"flex-1 min-w-[60px]",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Aspect"}),e.jsxs("select",{value:t.videoAspectRatio??"16:9",onChange:n=>r({videoAspectRatio:n.target.value}),className:x+" w-full",children:[e.jsx("option",{value:"16:9",children:"16:9"}),e.jsx("option",{value:"9:16",children:"9:16"}),e.jsx("option",{value:"1:1",children:"1:1"}),e.jsx("option",{value:"4:3",children:"4:3"}),e.jsx("option",{value:"3:4",children:"3:4"})]})]}),e.jsxs("div",{className:"flex-1 min-w-[60px]",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Duration"}),e.jsxs("select",{value:t.videoDuration??"",onChange:n=>r({videoDuration:n.target.value}),className:x+" w-full",children:[e.jsx("option",{value:"",children:"Default"}),e.jsx("option",{value:"5s",children:"5s"}),e.jsx("option",{value:"10s",children:"10s"})]})]}),e.jsxs("div",{className:"flex-1 min-w-[60px]",children:[e.jsx("label",{className:"text-[11px] text-white/20 mb-0.5 block",children:"Resolution"}),e.jsxs("select",{value:t.videoResolution??"",onChange:n=>r({videoResolution:n.target.value}),className:x+" w-full",children:[e.jsx("option",{value:"",children:"Default"}),e.jsx("option",{value:"720p",children:"720p"}),e.jsx("option",{value:"1080p",children:"1080p"})]})]})]})]}),t.nodeType!=="output"&&o?.status==="done"&&o.output&&e.jsxs("div",{className:"mt-1 p-2 rounded-lg bg-green-500/[0.04] border border-green-500/[0.08] cursor-pointer",onClick:()=>u(!p),children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"text-green-400/40",children:e.jsx("polyline",{points:p?"18 15 12 9 6 15":"6 9 12 15 18 9"})}),e.jsx("span",{className:"text-[11px] text-green-400/40 uppercase tracking-wider font-medium",children:"Output"})]}),o.output.startsWith("[audio:")?e.jsx("audio",{src:o.output.slice(7,-1),controls:!0,className:"w-full h-7",onClick:n=>n.stopPropagation()}):o.output.startsWith("[video:")?e.jsx("a",{href:o.output.slice(7,-1),target:"_blank",rel:"noreferrer",className:"text-[13px] text-blue-400 underline",onClick:n=>n.stopPropagation(),children:"Open video"}):o.output.startsWith("[image:")?e.jsx("img",{src:o.output.slice(7,-1),alt:"Generated",className:"w-full rounded border border-white/[0.06]"}):e.jsx("p",{className:w("text-[13px] text-white/50 leading-relaxed whitespace-pre-wrap",!p&&"line-clamp-3"),children:o.output})]}),t.nodeType!=="output"&&o?.status==="error"&&e.jsxs("div",{className:"mt-1 p-2 rounded-lg bg-red-500/[0.04] border border-red-500/[0.08]",children:[e.jsx("span",{className:"text-[11px] text-red-400/40 uppercase tracking-wider font-medium",children:"Error"}),e.jsx("p",{className:"text-[13px] text-red-400/60 mt-0.5",children:o.error})]})]}),i.hasOutput&&e.jsx(O,{type:"source",position:S.Bottom,className:"!w-3 !h-3 !bg-white/30 !border-2 !border-[#111]"})]})}const ce=h.memo(de),pe={venice:ce};function ue(){return e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"22 12 16 12 14 15 10 9 8 12 2 12"})})}function xe(){return e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})}function he(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]})}function me(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),e.jsx("path",{d:"M15.54 8.46a5 5 0 010 7.07"})]})}function ge(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M9 18V5l12-2v13"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}function be(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polygon",{points:"23 7 16 12 23 17 23 7"}),e.jsx("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2"})]})}function we(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M8 12h8M12 8v8"})]})}const ve=[{type:"textInput",label:"Input",Icon:ue,color:"text-blue-400/50"},{type:"chat",label:"LLM",Icon:xe,color:"text-purple-400/50"},{type:"imageGen",label:"Image Gen",Icon:he,color:"text-pink-400/50"},{type:"tts",label:"Text to Speech",Icon:me,color:"text-green-400/50"},{type:"music",label:"Music Gen",Icon:ge,color:"text-yellow-400/50"},{type:"video",label:"Video Gen",Icon:be,color:"text-orange-400/50"},{type:"output",label:"Output",Icon:we,color:"text-white/40"}],je={textInput:"",output:"",chat:"llama-3.3-70b",imageGen:"z-image-turbo",tts:"tts-kokoro",music:"stable-audio",video:"wan-2.1"},j=s=>Array.from({length:s},()=>E()),d=(s,t)=>({id:`e-${s}-${t}`,source:s,target:t,animated:!0}),fe=[{name:"Album Cover",desc:"A song concept → visual art direction → cover artwork",build:()=>{const[s,t,i,o]=j(4);return{nodes:[{id:s,type:"venice",position:{x:280,y:40},data:{label:"Input",nodeType:"textInput",model:"",prompt:"",inputText:"A melancholic indie-folk album about leaving a small coastal town"}},{id:t,type:"venice",position:{x:280,y:220},data:{label:"LLM",nodeType:"chat",model:"llama-3.3-70b",prompt:"You are an art director. Given this album concept, write a vivid, specific image-generation prompt for the cover art — mood, color palette, composition, subject, style. Output only the prompt.",temperature:.9}},{id:i,type:"venice",position:{x:280,y:440},data:{label:"Image Gen",nodeType:"imageGen",model:"z-image-turbo",prompt:"",steps:30,width:1024,height:1024}},{id:o,type:"venice",position:{x:280,y:680},data:{label:"Output",nodeType:"output",model:"",prompt:""}}],edges:[d(s,t),d(t,i),d(i,o)]}}},{name:"Podcast Episode",desc:"Topic → web research → tight 90-second script → narrated audio",build:()=>{const[s,t,i,o,c]=j(5);return{nodes:[{id:s,type:"venice",position:{x:280,y:40},data:{label:"Input",nodeType:"textInput",model:"",prompt:"",inputText:"How CRISPR gene editing actually works"}},{id:t,type:"venice",position:{x:280,y:220},data:{label:"LLM",nodeType:"chat",model:"llama-3.3-70b",prompt:"Research this topic. Provide specific facts, mechanisms, and current developments. Cite sources.",webSearch:"on",temperature:.5}},{id:i,type:"venice",position:{x:280,y:460},data:{label:"LLM",nodeType:"chat",model:"llama-3.3-70b",prompt:"Rewrite this research as a conversational ~90-second podcast monologue. Start with a hook. No headings, no bullet points — just flowing spoken English.",temperature:.7}},{id:o,type:"venice",position:{x:280,y:700},data:{label:"Text to Speech",nodeType:"tts",model:"tts-kokoro",prompt:"",voice:"af_sky"}},{id:c,type:"venice",position:{x:280,y:900},data:{label:"Output",nodeType:"output",model:"",prompt:""}}],edges:[d(s,t),d(t,i),d(i,o),d(o,c)]}}},{name:"Music Video Mood",desc:"One vibe → parallel image, music, and video generation",build:()=>{const[s,t,i,o,c,p,u,r]=j(8);return{nodes:[{id:s,type:"venice",position:{x:340,y:40},data:{label:"Input",nodeType:"textInput",model:"",prompt:"",inputText:"Neon-lit Tokyo alley at 3am, light rain, reflective puddles, lonely synthwave"}},{id:t,type:"venice",position:{x:340,y:220},data:{label:"LLM",nodeType:"chat",model:"llama-3.3-70b",prompt:"You are a music-video director. Expand this mood into a single paragraph that captures visual style, camera, and sonic atmosphere. One tight paragraph, no lists.",temperature:.9}},{id:i,type:"venice",position:{x:40,y:460},data:{label:"Image Gen",nodeType:"imageGen",model:"z-image-turbo",prompt:"Cinematic still frame of: {{input}}",steps:30,width:1024,height:1024}},{id:o,type:"venice",position:{x:340,y:460},data:{label:"Music Gen",nodeType:"music",model:"stable-audio",prompt:"Atmospheric score matching: {{input}}",duration:30,instrumental:!0}},{id:c,type:"venice",position:{x:640,y:460},data:{label:"Video Gen",nodeType:"video",model:"wan-2.1",prompt:"{{input}}",videoAspectRatio:"16:9"}},{id:p,type:"venice",position:{x:40,y:740},data:{label:"Output",nodeType:"output",model:"",prompt:""}},{id:u,type:"venice",position:{x:340,y:740},data:{label:"Output",nodeType:"output",model:"",prompt:""}},{id:r,type:"venice",position:{x:640,y:740},data:{label:"Output",nodeType:"output",model:"",prompt:""}}],edges:[d(s,t),d(t,i),d(t,o),d(t,c),d(i,p),d(o,u),d(c,r)]}}},{name:"Song Writer",desc:"Theme → lyrics → music generation with vocals",build:()=>{const[s,t,i,o]=j(4);return{nodes:[{id:s,type:"venice",position:{x:280,y:40},data:{label:"Input",nodeType:"textInput",model:"",prompt:"",inputText:"A bittersweet goodbye between two old friends at a train station"}},{id:t,type:"venice",position:{x:280,y:220},data:{label:"LLM",nodeType:"chat",model:"llama-3.3-70b",prompt:"Write a short song (verse, chorus, verse) about this theme. Keep it under 100 words. Output only the lyrics — no headers or commentary.",temperature:.9}},{id:i,type:"venice",position:{x:280,y:460},data:{label:"Music Gen",nodeType:"music",model:"stable-audio",prompt:"Melancholic indie-folk, acoustic guitar, soft male vocals, slow tempo",duration:45,instrumental:!1}},{id:o,type:"venice",position:{x:280,y:680},data:{label:"Output",nodeType:"output",model:"",prompt:""}}],edges:[d(s,t),d(t,i),d(i,o)]}}},{name:"Character Portrait",desc:"Character concept → rich visual design brief → portrait",build:()=>{const[s,t,i,o]=j(4);return{nodes:[{id:s,type:"venice",position:{x:280,y:40},data:{label:"Input",nodeType:"textInput",model:"",prompt:"",inputText:"A disillusioned space-station botanist in her 50s, caretaker of the last Earth plants"}},{id:t,type:"venice",position:{x:280,y:220},data:{label:"LLM",nodeType:"chat",model:"llama-3.3-70b",prompt:"Write a detailed character portrait brief: physical description, clothing, posture, lighting, background, art style. Aim for concrete visual detail, not personality. Output as a single dense prompt paragraph.",temperature:.85}},{id:i,type:"venice",position:{x:280,y:460},data:{label:"Image Gen",nodeType:"imageGen",model:"z-image-turbo",prompt:"Portrait, 50mm lens, cinematic: {{input}}",steps:35,width:832,height:1216}},{id:o,type:"venice",position:{x:280,y:700},data:{label:"Output",nodeType:"output",model:"",prompt:""}}],edges:[d(s,t),d(t,i),d(i,o)]}}},{name:"Story Scene",desc:"One-line premise → cinematic scene description → illustration",build:()=>{const[s,t,i,o]=j(4);return{nodes:[{id:s,type:"venice",position:{x:280,y:40},data:{label:"Input",nodeType:"textInput",model:"",prompt:"",inputText:"A lighthouse keeper finds a message in a bottle from her younger self"}},{id:t,type:"venice",position:{x:280,y:220},data:{label:"LLM",nodeType:"chat",model:"llama-3.3-70b",prompt:"Expand this premise into a single cinematic scene description: setting, time of day, weather, key visual detail, subject pose, mood. 3-4 sentences, no narrative — purely visual.",temperature:.9}},{id:i,type:"venice",position:{x:280,y:460},data:{label:"Image Gen",nodeType:"imageGen",model:"z-image-turbo",prompt:"Cinematic wide shot, film still, moody lighting: {{input}}",steps:30,width:1216,height:832}},{id:o,type:"venice",position:{x:280,y:700},data:{label:"Output",nodeType:"output",model:"",prompt:""}}],edges:[d(s,t),d(t,i),d(i,o)]}}}];function ye(){const{activeWorkflowId:s,workflows:t,updateWorkflow:i,updateNodeResult:o,setIsRunning:c,isRunning:p,clearResults:u}=y(),r=t.find(l=>l.id===s),[a,n,m]=H(r?.nodes??[]),[g,k,N]=$(r?.edges??[]),{getNodes:I,getEdges:T}=R(),W=h.useRef(void 0),b=h.useCallback(()=>{clearTimeout(W.current),W.current=setTimeout(()=>{s&&i(s,{nodes:I(),edges:T()})},200)},[s,i,I,T]),G=h.useCallback(l=>{k(f=>U({...l,animated:!0},f)),b()},[k,b]),P=l=>{const C={id:E(),type:"venice",position:{x:250+Math.random()*100,y:100+a.length*180},data:{label:l,nodeType:l,model:je[l],prompt:"",inputText:l==="textInput"?"":void 0}};n(v=>[...v,C]),b()},A=async()=>{if(p)return;const l=I(),f=T();if(l.length===0)return;s&&i(s,{nodes:l,edges:f}),u(),c(!0);const C={};for(const v of l)C[v.id]={nodeId:v.id,status:"pending",output:void 0,error:void 0};y.getState().setRunResults(C);try{await X(l,f,{onUpdate:o}),M.success("Workflow completed")}catch(v){M.fromError(v,"Workflow failed")}finally{c(!1)}},B=h.useCallback(l=>{m(l),b()},[m,b]),D=h.useCallback(l=>{N(l),b()},[N,b]),V=h.useMemo(()=>pe,[]);return r?e.jsxs("div",{className:"flex h-full",children:[e.jsxs("div",{className:"w-56 border-r border-white/[0.06] bg-[#0a0a0a] flex flex-col shrink-0",children:[e.jsx("div",{className:"p-3 border-b border-white/[0.06]",children:e.jsx("span",{className:"text-[13px] font-medium text-white/15 uppercase tracking-[0.08em]",children:"Add Node"})}),e.jsx("div",{className:"p-2 flex flex-col gap-1",children:ve.map(l=>e.jsxs("button",{onClick:()=>P(l.type),className:"flex items-center gap-2 px-2.5 py-2 rounded-lg text-[14px] text-white/40 hover:text-white/60 hover:bg-white/[0.04] transition-colors text-left",children:[e.jsx("span",{className:l.color,children:e.jsx(l.Icon,{})}),l.label]},l.type))}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"p-3 border-t border-white/[0.06]",children:e.jsx("button",{onClick:A,disabled:p||a.length===0,className:w("w-full flex items-center justify-center gap-1.5 py-2 rounded-lg text-[14px] font-medium transition-all",p?"bg-white/[0.06] text-white/30 cursor-wait":"bg-white text-black hover:bg-white/90 disabled:opacity-30 disabled:cursor-not-allowed"),children:p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-3 h-3 border-2 border-white/30 border-t-transparent rounded-full animate-spin"}),"Running..."]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),"Run Workflow"]})})})]}),e.jsx("div",{className:"flex-1",children:e.jsxs(Y,{nodes:a,edges:g,onNodesChange:B,onEdgesChange:D,onConnect:G,nodeTypes:V,fitView:!0,proOptions:{hideAttribution:!0},className:"bg-[#080808]",defaultEdgeOptions:{animated:!0,style:{stroke:"rgba(255,255,255,0.1)",strokeWidth:2}},children:[e.jsx(K,{variant:q.Dots,gap:20,size:1,color:"rgba(255,255,255,0.03)"}),e.jsx(J,{className:"!bg-[#111] !border-white/[0.06] !shadow-xl [&>button]:!bg-[#111] [&>button]:!border-white/[0.06] [&>button]:!text-white/30 [&>button:hover]:!bg-white/[0.06]"}),e.jsx(Q,{nodeColor:"rgba(255,255,255,0.1)",maskColor:"rgba(0,0,0,0.8)",className:"!bg-[#0a0a0a] !border-white/[0.06]"})]})})]}):null}function Ce(){const{workflows:s,activeWorkflowId:t,createWorkflow:i,deleteWorkflow:o,setActiveWorkflow:c}=y(),[p,u]=h.useState(""),r=(a,n)=>{const m=a?.trim()||"Untitled Workflow",g=i(m);if(n){const{nodes:k,edges:N}=n.build();y.getState().updateWorkflow(g,{nodes:k,edges:N})}u("")};return t&&s.find(a=>a.id===t)?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5 border-b border-white/[0.06] bg-[#0a0a0a] shrink-0",children:[e.jsxs("button",{onClick:()=>c(null),className:"text-[13px] text-white/25 hover:text-white/50 transition-colors flex items-center gap-1",children:[e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),"Back"]}),e.jsx("div",{className:"w-px h-3.5 bg-white/[0.06]"}),e.jsx("span",{className:"text-[14px] text-white/50 font-medium",children:s.find(a=>a.id===t)?.name})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(z,{children:e.jsx(ye,{},t)})})]}):e.jsx("div",{className:"h-full overflow-y-auto",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-8",children:[e.jsx("h2",{className:"text-[16px] text-white/60 font-medium mb-1",children:"Workflows"}),e.jsx("p",{className:"text-[13px] text-white/20 mb-6",children:"Chain Venice models together visually"}),e.jsxs("div",{className:"flex gap-2 mb-6",children:[e.jsx("input",{value:p,onChange:a=>u(a.target.value),onKeyDown:a=>a.key==="Enter"&&r(p),placeholder:"Workflow name...",className:"flex-1 bg-white/[0.03] border border-white/[0.06] rounded-lg px-3 py-2 text-[15px] text-white/70 outline-none placeholder:text-white/15 focus:border-white/[0.12]"}),e.jsx("button",{onClick:()=>r(p),className:"text-[14px] font-medium px-4 py-2 rounded-lg bg-white text-black hover:bg-white/90 transition-colors",children:"New Workflow"})]}),e.jsx("h3",{className:"text-[13px] font-medium text-white/15 uppercase tracking-[0.08em] mb-3",children:"Templates"}),e.jsx("div",{className:"grid grid-cols-3 gap-3 mb-8",children:fe.map(a=>e.jsxs("button",{onClick:()=>r(a.name,a),className:"p-3.5 rounded-xl border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.12] transition-all text-left",children:[e.jsx("div",{className:"text-[15px] text-white/60 font-medium mb-1",children:a.name}),e.jsx("div",{className:"text-[13px] text-white/20",children:a.desc})]},a.name))}),s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-[13px] font-medium text-white/15 uppercase tracking-[0.08em] mb-3",children:"Saved Workflows"}),e.jsx("div",{className:"flex flex-col gap-2",children:s.map(a=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl border border-white/[0.06] bg-white/[0.02] hover:border-white/[0.1] transition-all cursor-pointer",onClick:()=>c(a.id),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[15px] text-white/60 font-medium truncate",children:a.name}),e.jsxs("div",{className:"text-[13px] text-white/15",children:[a.nodes.length," nodes"]})]}),e.jsx("button",{onClick:n=>{n.stopPropagation(),o(a.id)},className:"text-[13px] text-white/15 hover:text-red-400/60 transition-colors px-2 py-1",children:"Delete"})]},a.id))})]})]})})}export{Ce as WorkflowsView}; diff --git a/ventures/havre/open/favicon.svg b/ventures/havre/open/favicon.svg new file mode 100644 index 0000000..6c36897 --- /dev/null +++ b/ventures/havre/open/favicon.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ventures/havre/open/index.html b/ventures/havre/open/index.html new file mode 100644 index 0000000..e8357ed --- /dev/null +++ b/ventures/havre/open/index.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + OpenVenice — clean UI for the Venice AI API + + + + + + + + +
+ + diff --git a/ventures/havre/tools/build.sh b/ventures/havre/tools/build.sh index a55d2d3..e36f18f 100644 --- a/ventures/havre/tools/build.sh +++ b/ventures/havre/tools/build.sh @@ -23,6 +23,7 @@ done node tools/cast.mjs # cast/index.js, the harbor's own as the module the page imports, from cast/*.havre.json node tools/pages.mjs # c/ (a page and a V3 card for each of them, and the list) and sitemap.txt, from the same cards node --test tests/*.test.mjs +sh tools/open.sh # open/, openvenice at /open/ for testing if [ -z "${PW_MODULE:-}" ]; then PW_MODULE=$(find "${HOME:-/root}/.npm/_npx" -path '*/node_modules/playwright-core/index.mjs' 2>/dev/null | head -1 || true) diff --git a/ventures/havre/tools/open.sh b/ventures/havre/tools/open.sh new file mode 100644 index 0000000..74efd73 --- /dev/null +++ b/ventures/havre/tools/open.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# tools/open.sh: build openvenice (https://github.com/nikshepsvn/openvenice, MIT) into open/, served at /open/. +# Pinned to one commit; bump OV_REF to take a newer one. Run by tools/build.sh. Needs git, node 20+ and npm. +set -eu +cd "$(dirname "$0")/.." +OV_REF=d983874a79810edaffb85721911630af29d09d95 +src=$(mktemp -d) +git clone -q https://github.com/nikshepsvn/openvenice "$src" +git -C "$src" checkout -q "$OV_REF" +(cd "$src" && npm ci --silent --no-audit --no-fund >/dev/null && npx vite build --base=/open/ >/dev/null) +rm -rf open +cp -R "$src/dist" open +cat > open/LICENSE.txt <