From e624b950b30b80debdec8660c932ec5ed33f1ce4 Mon Sep 17 00:00:00 2001 From: Sadanand Pai Date: Wed, 13 Mar 2024 16:14:25 +0000 Subject: [PATCH] build files - github action --- ...{index-0N9kaHy_.css => index-LLxipE15.css} | 2 +- .../{index-Ca6bL0UK.js => index-e6kesGYl.js} | 34 +++++++++---------- docs/index.html | 4 +-- 3 files changed, 20 insertions(+), 20 deletions(-) rename docs/assets/{index-0N9kaHy_.css => index-LLxipE15.css} (59%) rename docs/assets/{index-Ca6bL0UK.js => index-e6kesGYl.js} (82%) diff --git a/docs/assets/index-0N9kaHy_.css b/docs/assets/index-LLxipE15.css similarity index 59% rename from docs/assets/index-0N9kaHy_.css rename to docs/assets/index-LLxipE15.css index 419ef3f..3e6da0f 100644 --- a/docs/assets/index-0N9kaHy_.css +++ b/docs/assets/index-LLxipE15.css @@ -1 +1 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";@media screen and (width >= 960px){[data-tooltip]{position:relative}[data-tooltip]:hover:after{position:absolute;bottom:-6px;left:50%;z-index:1;padding:5px;font-size:.75rem;color:#fff;text-align:center;content:attr(data-tooltip);background-color:#333;border-radius:4px;transition:opacity .3s ease-in-out;transform:translate(-50%,100%)}[data-tooltip]:hover:before{position:absolute;bottom:-6px;left:50%;content:"";border-color:transparent transparent #333;border-style:solid;border-width:0 6px 10px;transform:translate(-50%)}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.grid{display:grid}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.text-center{text-align:center}.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)}:root{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}@media screen and (prefers-color-scheme: dark){:root{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}}html[data-theme=light]{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}html[data-theme=dark]{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}body{font-family:Inter,sans-serif;color:var(--base);background-color:var(--background)}#screen-layout{position:fixed;top:0;left:0;width:100vw;height:100%;pointer-events:none}#screen-layout *{pointer-events:all}button.primary{padding:5px 10px;color:var(--light);background-color:var(--primary);border:1px solid var(--primary);border-radius:4px}button.primary-outline{padding:5px 10px;color:var(--base);border:1px solid var(--primary);border-radius:4px}button:disabled{cursor:not-allowed}button:active:enabled{transform:scale(.95)}._challenges_1ylei_1{display:flex;flex-direction:column;gap:50px;justify-content:center;width:90%;margin:auto}._card_1ylei_10{flex:1 1 0px;padding:20px;border-radius:4px;box-shadow:0 0 8px var(--shadow2)}._card_1ylei_10 h1{margin-bottom:1rem;font-size:1.25rem;font-weight:500;text-align:center}._card_1ylei_10 div{display:flex;justify-content:center}._card_1ylei_10 div img{height:250px}@media screen and (width >= 768px){._challenges_1ylei_1{flex-direction:row}}._navbar_1l9vc_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:10px 20px;margin-bottom:24px;box-shadow:0 4px 4px var(--shadow1)}._navbar_1l9vc_1 img{width:25px;height:25px}._navbar_1l9vc_1 h1{display:flex;gap:.5rem;align-items:center;font-size:1.5rem;font-weight:600}._navbar_1l9vc_1 h1 ._github_1l9vc_21{margin-left:4px}._navbar_1l9vc_1 ul{position:absolute;top:65px;left:0;z-index:1;gap:10px;width:100%;padding-bottom:12px;list-style:none;background-color:var(--background);box-shadow:0 4px 4px var(--shadow1)}._navbar_1l9vc_1 ul[data-toggle=false]{display:none}._navbar_1l9vc_1 ul li{width:100%;padding:10px}._navbar_1l9vc_1 ul li a{display:block;width:auto;padding:6px;text-transform:capitalize;border-radius:8px}._navbar_1l9vc_1 ul li a._active_1l9vc_50{color:var(--light);background-color:var(--primary)}._navbar_1l9vc_1 ul li a:hover{outline:1px solid var(--primary)}@media screen and (width >= 960px){._navbar_1l9vc_1._navbar_1l9vc_1{padding:10px 10px 10px 20px}._navbar_1l9vc_1._navbar_1l9vc_1 ul{position:static;display:flex;width:auto;padding-bottom:0;box-shadow:none}._navbar_1l9vc_1._navbar_1l9vc_1 ul li{padding:0}._navbar_1l9vc_1._navbar_1l9vc_1 button{display:none}}[data-theme=dark] ._navbar_1l9vc_1 img{filter:invert(1)}._iconBtn_5is4s_1{position:absolute;padding:5px;cursor:pointer;background-color:var(--light);border:1px solid var(--dark);border-radius:50%;opacity:.5}._iconBtn_5is4s_1 img{width:25px;height:25px}._controller_18d51_1{display:flex;align-items:center;justify-content:space-between;margin:20px}._controller_18d51_1 ._operation_18d51_7,._controller_18d51_1 ._execution_18d51_11{display:flex;gap:10px}._controller_18d51_1 button{text-transform:capitalize}._controller_18d51_1 button:disabled{opacity:.5}._controller_18d51_1 ._speed_18d51_21{display:none}@media (width >= 768px){._controller_18d51_1 ._speed_18d51_21{display:block}}[data-theme=dark] ._execution_18d51_11 img{filter:invert(1)}[data-theme=dark] select{background-color:var(--dark);color:var(--light)}._grid_q4uhk_1._grid_q4uhk_1{display:inline-grid;margin:auto;border:var(--pf-cell-size) solid var(--pf-cell-wall)}._grid_q4uhk_1._grid_q4uhk_1 ._type0_q4uhk_6{background-color:var(--pf-cell-clear)}._grid_q4uhk_1._grid_q4uhk_1 ._type1_q4uhk_9{background-color:var(--pf-cell-entry);border-color:var(--base)}._grid_q4uhk_1._grid_q4uhk_1 ._type2_q4uhk_13{background-color:var(--pf-cell-exit);border-color:var(--base)}._grid_q4uhk_1._grid_q4uhk_1 ._type3_q4uhk_17{background-color:var(--pf-cell-wall);border-color:var(--pf-cell-wall);animation:_wallAnimation_q4uhk_1 .5s}._grid_q4uhk_1._grid_q4uhk_1 ._type4_q4uhk_22{background-color:var(--pf-cell-fill);border-color:var(--pf-cell-fill);animation:_visitedAnimation_q4uhk_1 1s}._grid_q4uhk_1._grid_q4uhk_1 ._type5_q4uhk_27{background-color:var(--pf-cell-path);border-color:var(--pf-cell-fill);border-width:8px}._grid_q4uhk_1._grid_q4uhk_1 button{border:.5px solid rgb(240,240,240);transition:all .33s}[data-theme=dark] ._grid_q4uhk_1 button{border-color:#141414}@keyframes _visitedAnimation_q4uhk_1{0%{transform:scale(.3);border-radius:50%}30%{transform:scale(.6);border-radius:65%}60%{transform:scale(1);border-radius:80%}to{transform:scale(1)}}@keyframes _wallAnimation_q4uhk_1{0%{transform:scale(.3)}50%{transform:scale(1.2)}to{transform:scale(1)}}._controllerWrapper_18ff3_1{padding:0 20px;margin-bottom:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1{gap:10px;margin-bottom:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9{display:flex;flex-basis:80%;flex-wrap:wrap;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15{display:flex;flex:1;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._rndmBtn_18ff3_20{flex:1;padding:5px 10px;color:var(--light);background-color:var(--primary);border:none;border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._select_18ff3_28{flex:1;padding:0 4px;color:var(--dark);text-transform:capitalize;background-color:var(--light);border:1px solid var(--shadow1);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37{flex:2;width:100%;min-width:300px;padding:5px;color:var(--dark);background-color:var(--light);border:1px solid var(--dark);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:-moz-placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{display:flex;flex:1;flex-basis:25%;gap:16px;margin-top:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51 input[type=range]{flex:1;cursor:pointer}._checkboxWrapper_18ff3_63{display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70{list-style-type:none}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63{display:flex;gap:4px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>input,._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{cursor:pointer}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{text-transform:capitalize}._switchContainer_18ff3_87{display:flex;gap:20px;align-items:center;justify-content:center}@media screen and (width >= 768px){._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15,._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._rndmBtn_18ff3_20{flex-grow:0}}@media screen and (width >= 960px){._controllerWrapper_18ff3_1 ._controller_18ff3_1{display:flex}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{margin-top:0}}[data-theme=dark] ._controllerWrapper_18ff3_1 img{filter:invert(1)}._main_1hg6y_1{padding:10px 20px 0;text-align:center}._allAlgos_1hg6y_6{display:flex;flex-wrap:wrap;gap:20px;justify-content:center;margin:30px 0 80px}._container_wgxfy_1{display:inline-block;min-width:300px;max-width:100%;padding:20px;box-shadow:0 0 4px var(--shadow2)}._container_wgxfy_1 header,._container_wgxfy_1 footer{display:flex;align-items:center;justify-content:space-between}._container_wgxfy_1 h2{font-size:1.1rem;font-weight:700;text-transform:capitalize}._warning_wgxfy_20{font-size:1.15rem;font-weight:500;color:var(--error)}._arrayContainer_116to_1{position:relative;padding:25px 0 40px;overflow-x:auto}._arrayContainer_116to_1 ._values_116to_6{display:flex;align-items:flex-end;height:var(--bar-max-height)}._arrayContainer_116to_1 ._values_116to_6 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2);background-color:var(--color-bar);border:1px solid var(--color-bar)}._arrayContainer_116to_1 ._values_116to_6 ._pivot_116to_19{background-color:var(--color-pivot)}._arrayContainer_116to_1 ._values_116to_6 ._sort_116to_22{background-color:var(--color-sort)}._arrayContainer_116to_1 ._values_116to_6 ._highlight_116to_25{background-color:var(--color-highlight)}._arrayContainer_116to_1 ._indices_116to_28{position:absolute;bottom:20px;display:flex;width:100%;font-size:.4rem;opacity:.4}._arrayContainer_116to_1 ._indices_116to_28 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2)}._arrayContainer_9tgyc_1{position:relative;padding:0 20px;overflow:auto}._arrayContainer_9tgyc_1 ._values_9tgyc_6{display:flex;padding:calc(var(--cell-size) + 20px) 0}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._cell_9tgyc_10{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--cell-size);height:var(--cell-size);margin:0 calc(var(--cell-margin) / 2);color:var(--dark);background-color:var(--light);border:1px solid var(--base);border-radius:4px;box-shadow:0 4px 4px var(--shadow1)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._pivot_9tgyc_24{background-color:var(--color-pivot)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._sort_9tgyc_27{background-color:var(--color-sort)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._highlight_9tgyc_30{background-color:var(--color-highlight)}._arrayContainer_9tgyc_1 ._indices_9tgyc_33{position:absolute;bottom:calc(var(--cell-size) - 5px);z-index:-1;display:flex;font-size:.75rem;opacity:.25}._arrayContainer_9tgyc_1 ._indices_9tgyc_33 li{display:flex;justify-content:center;width:var(--cell-size);margin:0 calc(var(--cell-margin) / 2)} +@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";@media screen and (width >= 960px){[data-tooltip]{position:relative}[data-tooltip]:hover:after{position:absolute;bottom:-6px;left:50%;z-index:1;padding:5px;font-size:.75rem;color:#fff;text-align:center;content:attr(data-tooltip);background-color:#333;border-radius:4px;transition:opacity .3s ease-in-out;transform:translate(-50%,100%)}[data-tooltip]:hover:before{position:absolute;bottom:-6px;left:50%;content:"";border-color:transparent transparent #333;border-style:solid;border-width:0 6px 10px;transform:translate(-50%)}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.grid{display:grid}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.text-center{text-align:center}.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)}:root{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}@media screen and (prefers-color-scheme: dark){:root{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}}html[data-theme=light]{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}html[data-theme=dark]{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}body{font-family:Inter,sans-serif;color:var(--base);background-color:var(--background)}#screen-layout{position:fixed;top:0;left:0;width:100vw;height:100%;pointer-events:none}#screen-layout *{pointer-events:all}button.primary{padding:5px 10px;color:var(--light);background-color:var(--primary);border:1px solid var(--primary);border-radius:4px}button.primary-outline{padding:5px 10px;color:var(--base);border:1px solid var(--primary);border-radius:4px}button:disabled{cursor:not-allowed}button:active:enabled{transform:scale(.95)}._challenges_1ylei_1{display:flex;flex-direction:column;gap:50px;justify-content:center;width:90%;margin:auto}._card_1ylei_10{flex:1 1 0px;padding:20px;border-radius:4px;box-shadow:0 0 8px var(--shadow2)}._card_1ylei_10 h1{margin-bottom:1rem;font-size:1.25rem;font-weight:500;text-align:center}._card_1ylei_10 div{display:flex;justify-content:center}._card_1ylei_10 div img{height:250px}@media screen and (width >= 768px){._challenges_1ylei_1{flex-direction:row}}._navbar_1l9vc_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:10px 20px;margin-bottom:24px;box-shadow:0 4px 4px var(--shadow1)}._navbar_1l9vc_1 img{width:25px;height:25px}._navbar_1l9vc_1 h1{display:flex;gap:.5rem;align-items:center;font-size:1.5rem;font-weight:600}._navbar_1l9vc_1 h1 ._github_1l9vc_21{margin-left:4px}._navbar_1l9vc_1 ul{position:absolute;top:65px;left:0;z-index:1;gap:10px;width:100%;padding-bottom:12px;list-style:none;background-color:var(--background);box-shadow:0 4px 4px var(--shadow1)}._navbar_1l9vc_1 ul[data-toggle=false]{display:none}._navbar_1l9vc_1 ul li{width:100%;padding:10px}._navbar_1l9vc_1 ul li a{display:block;width:auto;padding:6px;text-transform:capitalize;border-radius:8px}._navbar_1l9vc_1 ul li a._active_1l9vc_50{color:var(--light);background-color:var(--primary)}._navbar_1l9vc_1 ul li a:hover{outline:1px solid var(--primary)}@media screen and (width >= 960px){._navbar_1l9vc_1._navbar_1l9vc_1{padding:10px 10px 10px 20px}._navbar_1l9vc_1._navbar_1l9vc_1 ul{position:static;display:flex;width:auto;padding-bottom:0;box-shadow:none}._navbar_1l9vc_1._navbar_1l9vc_1 ul li{padding:0}._navbar_1l9vc_1._navbar_1l9vc_1 button{display:none}}[data-theme=dark] ._navbar_1l9vc_1 img{filter:invert(1)}._iconBtn_5is4s_1{position:absolute;padding:5px;cursor:pointer;background-color:var(--light);border:1px solid var(--dark);border-radius:50%;opacity:.5}._iconBtn_5is4s_1 img{width:25px;height:25px}._controller_18d51_1{display:flex;align-items:center;justify-content:space-between;margin:20px}._controller_18d51_1 ._operation_18d51_7,._controller_18d51_1 ._execution_18d51_11{display:flex;gap:10px}._controller_18d51_1 button{text-transform:capitalize}._controller_18d51_1 button:disabled{opacity:.5}._controller_18d51_1 ._speed_18d51_21{display:none}@media (width >= 768px){._controller_18d51_1 ._speed_18d51_21{display:block}}[data-theme=dark] ._execution_18d51_11 img{filter:invert(1)}[data-theme=dark] select{background-color:var(--dark);color:var(--light)}._grid_1917o_1._grid_1917o_1{display:inline-grid;margin:auto;border:var(--pf-cell-size) solid var(--pf-cell-wall)}._grid_1917o_1._grid_1917o_1 ._type0_1917o_6{background-color:var(--pf-cell-clear)}._grid_1917o_1._grid_1917o_1 ._type1_1917o_9{background-color:var(--pf-cell-entry);border-color:var(--base)}._grid_1917o_1._grid_1917o_1 ._type2_1917o_13{background-color:var(--pf-cell-exit);border-color:var(--base)}._grid_1917o_1._grid_1917o_1 ._type3_1917o_17{background-color:var(--pf-cell-wall);border-color:var(--pf-cell-wall);animation:_wallAnimation_1917o_1 .5s}._grid_1917o_1._grid_1917o_1 ._type4_1917o_22{background-color:var(--pf-cell-fill);border-color:var(--pf-cell-fill);animation:_visitedAnimation_1917o_1 1s}._grid_1917o_1._grid_1917o_1 ._type5_1917o_27{background-color:var(--pf-cell-path);border-color:var(--pf-cell-fill);border-width:8px}._grid_1917o_1._grid_1917o_1 button{border:.5px solid rgb(240,240,240)}[data-theme=dark] ._grid_1917o_1 button{border-color:#141414}@keyframes _visitedAnimation_1917o_1{0%{transform:scale(.3);border-radius:50%;background-color:var(--pf-cell-fill-start)}30%{transform:scale(.6);border-radius:65%;background-color:var(--pf-cell-fill-mid)}60%{transform:scale(1.05);border-radius:80%}to{transform:scale(1);background-color:var(--pf-cell-fill)}}@keyframes _wallAnimation_1917o_1{0%{transform:scale(.3);opacity:.5}50%{transform:scale(1.2);opacity:.75}to{transform:scale(1);opacity:1}}._controllerWrapper_18ff3_1{padding:0 20px;margin-bottom:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1{gap:10px;margin-bottom:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9{display:flex;flex-basis:80%;flex-wrap:wrap;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15{display:flex;flex:1;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._rndmBtn_18ff3_20{flex:1;padding:5px 10px;color:var(--light);background-color:var(--primary);border:none;border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._select_18ff3_28{flex:1;padding:0 4px;color:var(--dark);text-transform:capitalize;background-color:var(--light);border:1px solid var(--shadow1);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37{flex:2;width:100%;min-width:300px;padding:5px;color:var(--dark);background-color:var(--light);border:1px solid var(--dark);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:-moz-placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{display:flex;flex:1;flex-basis:25%;gap:16px;margin-top:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51 input[type=range]{flex:1;cursor:pointer}._checkboxWrapper_18ff3_63{display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70{list-style-type:none}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63{display:flex;gap:4px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>input,._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{cursor:pointer}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{text-transform:capitalize}._switchContainer_18ff3_87{display:flex;gap:20px;align-items:center;justify-content:center}@media screen and (width >= 768px){._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15,._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._rndmBtn_18ff3_20{flex-grow:0}}@media screen and (width >= 960px){._controllerWrapper_18ff3_1 ._controller_18ff3_1{display:flex}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{margin-top:0}}[data-theme=dark] ._controllerWrapper_18ff3_1 img{filter:invert(1)}._main_1hg6y_1{padding:10px 20px 0;text-align:center}._allAlgos_1hg6y_6{display:flex;flex-wrap:wrap;gap:20px;justify-content:center;margin:30px 0 80px}._container_wgxfy_1{display:inline-block;min-width:300px;max-width:100%;padding:20px;box-shadow:0 0 4px var(--shadow2)}._container_wgxfy_1 header,._container_wgxfy_1 footer{display:flex;align-items:center;justify-content:space-between}._container_wgxfy_1 h2{font-size:1.1rem;font-weight:700;text-transform:capitalize}._warning_wgxfy_20{font-size:1.15rem;font-weight:500;color:var(--error)}._arrayContainer_116to_1{position:relative;padding:25px 0 40px;overflow-x:auto}._arrayContainer_116to_1 ._values_116to_6{display:flex;align-items:flex-end;height:var(--bar-max-height)}._arrayContainer_116to_1 ._values_116to_6 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2);background-color:var(--color-bar);border:1px solid var(--color-bar)}._arrayContainer_116to_1 ._values_116to_6 ._pivot_116to_19{background-color:var(--color-pivot)}._arrayContainer_116to_1 ._values_116to_6 ._sort_116to_22{background-color:var(--color-sort)}._arrayContainer_116to_1 ._values_116to_6 ._highlight_116to_25{background-color:var(--color-highlight)}._arrayContainer_116to_1 ._indices_116to_28{position:absolute;bottom:20px;display:flex;width:100%;font-size:.4rem;opacity:.4}._arrayContainer_116to_1 ._indices_116to_28 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2)}._arrayContainer_9tgyc_1{position:relative;padding:0 20px;overflow:auto}._arrayContainer_9tgyc_1 ._values_9tgyc_6{display:flex;padding:calc(var(--cell-size) + 20px) 0}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._cell_9tgyc_10{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--cell-size);height:var(--cell-size);margin:0 calc(var(--cell-margin) / 2);color:var(--dark);background-color:var(--light);border:1px solid var(--base);border-radius:4px;box-shadow:0 4px 4px var(--shadow1)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._pivot_9tgyc_24{background-color:var(--color-pivot)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._sort_9tgyc_27{background-color:var(--color-sort)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._highlight_9tgyc_30{background-color:var(--color-highlight)}._arrayContainer_9tgyc_1 ._indices_9tgyc_33{position:absolute;bottom:calc(var(--cell-size) - 5px);z-index:-1;display:flex;font-size:.75rem;opacity:.25}._arrayContainer_9tgyc_1 ._indices_9tgyc_33 li{display:flex;justify-content:center;width:var(--cell-size);margin:0 calc(var(--cell-margin) / 2)} diff --git a/docs/assets/index-Ca6bL0UK.js b/docs/assets/index-e6kesGYl.js similarity index 82% rename from docs/assets/index-Ca6bL0UK.js rename to docs/assets/index-e6kesGYl.js index c5265ea..bd1ffc2 100644 --- a/docs/assets/index-Ca6bL0UK.js +++ b/docs/assets/index-e6kesGYl.js @@ -6,7 +6,7 @@ function fp(e,t){for(var n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sv(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var xv=5e3;function rf(e,t){var n=e.version!==void 0?e.version:sv;e.debug;var r=e.stateReconciler===void 0?fv:e.stateReconciler,o=e.getStoredState||hv,i=e.timeout!==void 0?e.timeout:xv,l=null,a=!1,s=!0,u=function(f){return f._persist.rehydrated&&l&&!s&&l.update(f),f};return function(c,f){var d=c||{},g=d._persist,y=wv(d,["_persist"]),w=y;if(f.type===bu){var S=!1,h=function(N,L){S||(f.rehydrate(e.key,N,L),S=!0)};if(i&&setTimeout(function(){!S&&h(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},i),s=!1,l||(l=dv(e)),g)return en({},t(w,f),{_persist:g});if(typeof f.rehydrate!="function"||typeof f.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(e.key),o(e).then(function(R){var N=e.migrate||function(L,F){return Promise.resolve(L)};N(R,n).then(function(L){h(L)},function(L){h(void 0,L)})},function(R){h(void 0,R)}),en({},t(w,f),{_persist:{version:n,rehydrated:!1}})}else{if(f.type===Au)return a=!0,f.result(yv(e)),en({},t(w,f),{_persist:g});if(f.type===Du)return f.result(l&&l.flush()),en({},t(w,f),{_persist:g});if(f.type===Iu)s=!0;else if(f.type===Vl){if(a)return en({},w,{_persist:en({},g,{rehydrated:!0})});if(f.key===e.key){var p=t(w,f),m=f.payload,k=r!==!1&&m!==void 0?r(m,c,p,e):p,P=en({},k,{_persist:en({},g,{rehydrated:!0})});return u(P)}}}if(!g)return t(c,f);var v=t(w,f);return v===w?c:u(en({},v,{_persist:g}))}}function Fe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ev=typeof Symbol=="function"&&Symbol.observable||"@@observable",of=Ev,Pa=()=>Math.random().toString(36).substring(7).split("").join("."),kv={INIT:`@@redux/INIT${Pa()}`,REPLACE:`@@redux/REPLACE${Pa()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Pa()}`},fl=kv;function $u(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Uu(e,t,n){if(typeof e!="function")throw new Error(Fe(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Fe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Fe(1));return n(Uu)(e,t)}let r=e,o=t,i=new Map,l=i,a=0,s=!1;function u(){l===i&&(l=new Map,i.forEach((S,h)=>{l.set(h,S)}))}function c(){if(s)throw new Error(Fe(3));return o}function f(S){if(typeof S!="function")throw new Error(Fe(4));if(s)throw new Error(Fe(5));let h=!0;u();const p=a++;return l.set(p,S),function(){if(h){if(s)throw new Error(Fe(6));h=!1,u(),l.delete(p),i=null}}}function d(S){if(!$u(S))throw new Error(Fe(7));if(typeof S.type>"u")throw new Error(Fe(8));if(typeof S.type!="string")throw new Error(Fe(17));if(s)throw new Error(Fe(9));try{s=!0,o=r(o,S)}finally{s=!1}return(i=l).forEach(p=>{p()}),S}function g(S){if(typeof S!="function")throw new Error(Fe(10));r=S,d({type:fl.REPLACE})}function y(){const S=f;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Fe(11));function p(){const k=h;k.next&&k.next(c())}return p(),{unsubscribe:S(p)}},[of](){return this}}}return d({type:fl.INIT}),{dispatch:d,subscribe:f,getState:c,replaceReducer:g,[of]:y}}function _v(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:fl.INIT})>"u")throw new Error(Fe(12));if(typeof n(void 0,{type:fl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Fe(13))})}function Cv(e){const t=Object.keys(e),n={};for(let i=0;i"u")throw a&&a.type,new Error(Fe(14));u[f]=y,s=s||y!==g}return s=s||r.length!==Object.keys(l).length,s?u:l}}function dl(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Pv(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(Fe(15))};const l={getState:o.getState,dispatch:(s,...u)=>i(s,...u)},a=e.map(s=>s(l));return i=dl(...a)(o.dispatch),{...o,dispatch:i}}}function Rv(e){return $u(e)&&"type"in e&&typeof e.type=="string"}function lf(e){return Nv(e)||Mv(e)||Tv()}function Tv(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function Mv(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Nv(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:kp,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case Fu:return ds({},t,{registry:[].concat(lf(t.registry),[n.key])});case Vl:var r=t.registry.indexOf(n.key),o=lf(t.registry);return o.splice(r,1),ds({},t,{registry:o,bootstrapped:o.length===0});default:return t}};function Lv(e,t,n){var r=n||!1,o=Uu(jv,kp,t&&t.enhancer?t.enhancer:void 0),i=function(u){o.dispatch({type:Fu,key:u})},l=function(u,c,f){var d={type:Vl,payload:c,err:f,key:u};e.dispatch(d),o.dispatch(d),r&&a.getState().bootstrapped&&(r(),r=!1)},a=ds({},o,{purge:function(){var u=[];return e.dispatch({type:Au,result:function(f){u.push(f)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:Du,result:function(f){u.push(f)}}),Promise.all(u)},pause:function(){e.dispatch({type:Iu})},persist:function(){e.dispatch({type:bu,register:i,rehydrate:l})}});return t&&t.manualPersist||a.persist(),a}var _p=Symbol.for("immer-nothing"),sf=Symbol.for("immer-draftable"),ft=Symbol.for("immer-state");function bt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gr=Object.getPrototypeOf;function On(e){return!!e&&!!e[ft]}function sn(e){var t;return e?Cp(e)||Array.isArray(e)||!!e[sf]||!!((t=e.constructor)!=null&&t[sf])||Ql(e)||Gl(e):!1}var Ov=Object.prototype.constructor.toString();function Cp(e){if(!e||typeof e!="object")return!1;const t=Gr(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Ov}function Wo(e,t){Kl(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Kl(e){const t=e[ft];return t?t.type_:Array.isArray(e)?1:Ql(e)?2:Gl(e)?3:0}function ps(e,t){return Kl(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Pp(e,t,n){const r=Kl(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Dv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ql(e){return e instanceof Map}function Gl(e){return e instanceof Set}function Gn(e){return e.copy_||e.base_}function hs(e,t){if(Ql(e))return new Map(e);if(Gl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Cp(e))return Gr(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ft];let r=Reflect.ownKeys(n);for(let o=0;o1&&(e.set=e.add=e.clear=e.delete=Iv),Object.freeze(e),t&&Wo(e,(n,r)=>Bu(r,!0))),e}function Iv(){bt(2)}function Yl(e){return Object.isFrozen(e)}var bv={};function lr(e){const t=bv[e];return t||bt(0,e),t}var Vo;function Rp(){return Vo}function Av(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function uf(e,t){t&&(lr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ms(e){ys(e),e.drafts_.forEach(Fv),e.drafts_=null}function ys(e){e===Vo&&(Vo=e.parent_)}function cf(e){return Vo=Av(Vo,e)}function Fv(e){const t=e[ft];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ff(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ft].modified_&&(ms(t),bt(4)),sn(e)&&(e=pl(t,e),t.parent_||hl(t,e)),t.patches_&&lr("Patches").generateReplacementPatches_(n[ft].base_,e,t.patches_,t.inversePatches_)):e=pl(t,n,[]),ms(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_p?e:void 0}function pl(e,t,n){if(Yl(t))return t;const r=t[ft];if(!r)return Wo(t,(o,i)=>df(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return hl(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,l=!1;r.type_===3&&(i=new Set(o),o.clear(),l=!0),Wo(i,(a,s)=>df(e,r,o,a,s,n,l)),hl(e,o,!1),n&&e.patches_&&lr("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function df(e,t,n,r,o,i,l){if(On(o)){const a=i&&t&&t.type_!==3&&!ps(t.assigned_,r)?i.concat(r):void 0,s=pl(e,o,a);if(Pp(n,r,s),On(s))e.canAutoFreeze_=!1;else return}else l&&n.add(o);if(sn(o)&&!Yl(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;pl(e,o),(!t||!t.scope_.parent_)&&hl(e,o)}}function hl(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bu(t,n)}function $v(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Rp(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Hu;n&&(o=[r],i=Ko);const{revoke:l,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=l,a}var Hu={get(e,t){if(t===ft)return e;const n=Gn(e);if(!ps(n,t))return Uv(e,n,t);const r=n[t];return e.finalized_||!sn(r)?r:r===Ra(e.base_,t)?(Ta(e),e.copy_[t]=gs(r,e)):r},has(e,t){return t in Gn(e)},ownKeys(e){return Reflect.ownKeys(Gn(e))},set(e,t,n){const r=Tp(Gn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Ra(Gn(e),t),i=o==null?void 0:o[ft];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Dv(n,o)&&(n!==void 0||ps(e.base_,t)))return!0;Ta(e),vs(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ra(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ta(e),vs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Gn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){bt(11)},getPrototypeOf(e){return Gr(e.base_)},setPrototypeOf(){bt(12)}},Ko={};Wo(Hu,(e,t)=>{Ko[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ko.deleteProperty=function(e,t){return Ko.set.call(this,e,t,void 0)};Ko.set=function(e,t,n){return Hu.set.call(this,e[0],t,n,e[0])};function Ra(e,t){const n=e[ft];return(n?Gn(n):e)[t]}function Uv(e,t,n){var o;const r=Tp(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function Tp(e,t){if(!(t in e))return;let n=Gr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Gr(n)}}function vs(e){e.modified_||(e.modified_=!0,e.parent_&&vs(e.parent_))}function Ta(e){e.copy_||(e.copy_=hs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bv=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const l=this;return function(s=i,...u){return l.produce(s,c=>n.call(this,c,...u))}}typeof n!="function"&&bt(6),r!==void 0&&typeof r!="function"&&bt(7);let o;if(sn(t)){const i=cf(this),l=gs(t,void 0);let a=!0;try{o=n(l),a=!1}finally{a?ms(i):ys(i)}return uf(i,r),ff(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===_p&&(o=void 0),this.autoFreeze_&&Bu(o,!0),r){const i=[],l=[];lr("Patches").generateReplacementPatches_(t,o,i,l),r(i,l)}return o}else bt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...a)=>this.produceWithPatches(l,s=>t(s,...a));let r,o;return[this.produce(t,n,(l,a)=>{r=l,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){sn(e)||bt(8),On(e)&&(e=Mp(e));const t=cf(this),n=gs(e,void 0);return n[ft].isManual_=!0,ys(t),n}finishDraft(e,t){const n=e&&e[ft];(!n||!n.isManual_)&&bt(9);const{scope_:r}=n;return uf(r,t),ff(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=lr("Patches").applyPatches_;return On(e)?r(e,t):this.produce(e,o=>r(o,t))}};function gs(e,t){const n=Ql(e)?lr("MapSet").proxyMap_(e,t):Gl(e)?lr("MapSet").proxySet_(e,t):$v(e,t);return(t?t.scope_:Rp()).drafts_.push(n),n}function Mp(e){return On(e)||bt(10,e),Np(e)}function Np(e){if(!sn(e)||Yl(e))return e;const t=e[ft];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=hs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=hs(e,!0);return Wo(n,(r,o)=>{Pp(n,r,Np(o))}),t&&(t.finalized_=!1),n}var dt=new Bv,zp=dt.produce;dt.produceWithPatches.bind(dt);dt.setAutoFreeze.bind(dt);dt.setUseStrictShallowCopy.bind(dt);dt.applyPatches.bind(dt);dt.createDraft.bind(dt);dt.finishDraft.bind(dt);function Hv(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Wv(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var pf=e=>Array.isArray(e)?e:[e];function Vv(e){const t=Array.isArray(e[0])?e[0]:e;return Wv(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Kv(e,t){const n=[],{length:r}=e;for(let o=0;o{n=Ti(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function Xv(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e;return(...o)=>{let i=0,l=0,a,s={},u=o.pop();typeof u=="object"&&(s=u,u=o.pop()),Hv(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...n,...s},{memoize:f,memoizeOptions:d=[],argsMemoize:g=jp,argsMemoizeOptions:y=[],devModeChecks:w={}}=c,S=pf(d),h=pf(y),p=Vv(o),m=f(function(){return i++,u.apply(null,arguments)},...S),k=g(function(){l++;const v=Kv(p,arguments);return a=m.apply(null,v),a},...h);return Object.assign(k,{resultFunc:u,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:g})}}function Lp(e){return({dispatch:n,getState:r})=>o=>i=>typeof i=="function"?i(n,r,e):o(i)}var Jv=Lp(),qv=Lp,Zv=(...e)=>{const t=Xv(...e);return(...n)=>{const r=t(...n),o=(i,...l)=>r(On(i)?Mp(i):i,...l);return Object.assign(o,r),o}};Zv(jp);var eg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?dl:dl.apply(null,arguments)};function Qo(e,t){function n(...r){if(t){let o=t(...r);if(!o)throw new Error(Ft(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Rv(r)&&r.type===e,n}var Op=class Ro extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ro.prototype)}static get[Symbol.species](){return Ro}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ro(...t[0].concat(this)):new Ro(...t.concat(this))}};function mf(e){return sn(e)?zp(e,()=>{}):e}function yf(e,t,n){if(e.has(t)){let o=e.get(t);return n.update&&(o=n.update(o,t,e),e.set(t,o)),o}if(!n.insert)throw new Error(Ft(10));const r=n.insert(t,e);return e.set(t,r),r}function tg(e){return typeof e=="boolean"}var ng=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{};let l=new Op;return n&&(tg(n)?l.push(Jv):l.push(qv(n.extraArgument))),l},rg="RTK_autoBatch",Dp=e=>t=>{setTimeout(t,e)},og=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Dp(10),ig=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,l=!1;const a=new Set,s=e.type==="tick"?queueMicrotask:e.type==="raf"?og:e.type==="callback"?e.queueNotification:Dp(e.timeout),u=()=>{l=!1,i&&(i=!1,a.forEach(c=>c()))};return Object.assign({},r,{subscribe(c){const f=()=>o&&c(),d=r.subscribe(f);return a.add(c),()=>{d(),a.delete(c)}},dispatch(c){var f;try{return o=!((f=c==null?void 0:c.meta)!=null&&f[rg]),i=!o,i&&(l||(l=!0,s(u))),r.dispatch(c)}finally{o=!0}}})},lg=e=>function(n){const{autoBatch:r=!0}=n??{};let o=new Op(e);return r&&o.push(ig(typeof r=="object"?r:void 0)),o},ag=!0;function sg(e){const t=ng(),{reducer:n=void 0,middleware:r,devTools:o=!0,preloadedState:i=void 0,enhancers:l=void 0}=e||{};let a;if(typeof n=="function")a=n;else if($u(n))a=Cv(n);else throw new Error(Ft(1));let s;typeof r=="function"?s=r(t):s=t();let u=dl;o&&(u=eg({trace:!ag,...typeof o=="object"&&o}));const c=Pv(...s),f=lg(c);let d=typeof l=="function"?l(f):f();const g=u(...d);return Uu(a,i,g)}function Ip(e){const t={},n=[];let r;const o={addCase(i,l){const a=typeof i=="string"?i:i.type;if(!a)throw new Error(Ft(28));if(a in t)throw new Error(Ft(29));return t[a]=l,o},addMatcher(i,l){return n.push({matcher:i,reducer:l}),o},addDefaultCase(i){return r=i,o}};return e(o),[t,n,r]}function ug(e){return typeof e=="function"}function cg(e,t){let[n,r,o]=Ip(t),i;if(ug(e))i=()=>mf(e());else{const a=mf(e);i=()=>a}function l(a=i(),s){let u=[n[s.type],...r.filter(({matcher:c})=>c(s)).map(({reducer:c})=>c)];return u.filter(c=>!!c).length===0&&(u=[o]),u.reduce((c,f)=>{if(f)if(On(c)){const g=f(c,s);return g===void 0?c:g}else{if(sn(c))return zp(c,d=>f(d,s));{const d=f(c,s);if(d===void 0){if(c===null)return c;throw new Error(Ft(9))}return d}}return c},a)}return l.getInitialState=i,l}var fg=Symbol.for("rtk-slice-createasyncthunk");function dg(e,t){return`${e}/${t}`}function pg({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[fg];return function(o){const{name:i,reducerPath:l=i}=o;if(!i)throw new Error(Ft(11));typeof process<"u";const a=(typeof o.reducers=="function"?o.reducers(mg()):o.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(S,h){const p=typeof S=="string"?S:S.type;if(!p)throw new Error(Ft(12));if(p in u.sliceCaseReducersByType)throw new Error(Ft(13));return u.sliceCaseReducersByType[p]=h,c},addMatcher(S,h){return u.sliceMatchers.push({matcher:S,reducer:h}),c},exposeAction(S,h){return u.actionCreators[S]=h,c},exposeCaseReducer(S,h){return u.sliceCaseReducersByName[S]=h,c}};s.forEach(S=>{const h=a[S],p={reducerName:S,type:dg(i,S),createNotation:typeof o.reducers=="function"};vg(h)?wg(p,h,c,t):yg(p,h,c)});function f(){const[S={},h=[],p=void 0]=typeof o.extraReducers=="function"?Ip(o.extraReducers):[o.extraReducers],m={...S,...u.sliceCaseReducersByType};return cg(o.initialState,k=>{for(let P in m)k.addCase(P,m[P]);for(let P of u.sliceMatchers)k.addMatcher(P.matcher,P.reducer);for(let P of h)k.addMatcher(P.matcher,P.reducer);p&&k.addDefaultCase(p)})}const d=S=>S,g=new WeakMap;let y;const w={name:i,reducerPath:l,reducer(S,h){return y||(y=f()),y(S,h)},actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState(){return y||(y=f()),y.getInitialState()},getSelectors(S=d){const h=yf(g,this,{insert:()=>new WeakMap});return yf(h,S,{insert:()=>{const p={};for(const[m,k]of Object.entries(o.selectors??{}))p[m]=hg(this,k,S,this!==w);return p}})},selectSlice(S){let h=S[this.reducerPath];return typeof h>"u"&&this!==w&&(h=this.getInitialState()),h},get selectors(){return this.getSelectors(this.selectSlice)},injectInto(S,{reducerPath:h,...p}={}){const m=h??this.reducerPath;return S.inject({reducerPath:m,reducer:this.reducer},p),{...this,reducerPath:m}}};return w}}function hg(e,t,n,r){function o(i,...l){let a=n.call(e,i);return typeof a>"u"&&r&&(a=e.getInitialState()),t(a,...l)}return o.unwrapped=t,o}var Wu=pg();function mg(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function yg({type:e,reducerName:t,createNotation:n},r,o){let i,l;if("reducer"in r){if(n&&!gg(r))throw new Error(Ft(17));i=r.reducer,l=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,l?Qo(e,l):Qo(e))}function vg(e){return e._reducerDefinitionType==="asyncThunk"}function gg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function wg({type:e,reducerName:t},n,r,o){if(!o)throw new Error(Ft(18));const{payloadCreator:i,fulfilled:l,pending:a,rejected:s,settled:u,options:c}=n,f=o(e,i,c);r.exposeAction(t,f),l&&r.addCase(f.fulfilled,l),a&&r.addCase(f.pending,a),s&&r.addCase(f.rejected,s),u&&r.addMatcher(f.settled,u),r.exposeCaseReducer(t,{fulfilled:l||Mi,pending:a||Mi,rejected:s||Mi,settled:u||Mi})}function Mi(){}var Vu="listenerMiddleware";Qo(`${Vu}/add`);Qo(`${Vu}/removeAll`);Qo(`${Vu}/remove`);function Ft(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Sg={theme:null},bp=Wu({name:"app",initialState:Sg,reducers:{setTheme:(e,t)=>{e.theme=t.payload,document.documentElement.setAttribute("data-theme",t.payload)}}}),{setTheme:vf}=bp.actions,xg=bp.reducer,qn=25,io={clear:"transparent",entry:"aqua",exit:"lawngreen",wall:"darkred",fill:"rgb(184 145 245)",path:"yellow"},yr=document.querySelector(":root");yr.style.setProperty("--pf-cell-size",qn+"px");yr.style.setProperty("--pf-cell-clear",io.clear);yr.style.setProperty("--pf-cell-entry",io.entry);yr.style.setProperty("--pf-cell-exit",io.exit);yr.style.setProperty("--pf-cell-wall",io.wall);yr.style.setProperty("--pf-cell-fill",io.fill);yr.style.setProperty("--pf-cell-path",io.path);var D=(e=>(e[e.clear=0]="clear",e[e.entry=1]="entry",e[e.exit=2]="exit",e[e.wall=3]="wall",e[e.fill=4]="fill",e[e.path=5]="path",e))(D||{}),Me=(e=>(e[e.Generating=0]="Generating",e[e.Ready=1]="Ready",e[e.Searching=2]="Searching",e[e.Complete=3]="Complete",e))(Me||{});function pt(e,t,n=null){return Array.from(new Array(e),()=>new Array(t).fill(n))}function Eg(e,t){const n=pt(e,t,0);return n[0][0]=D.entry,n[e-1][t-1]=D.exit,n}function Ap(){let e=Math.floor((window.innerHeight-140-2*qn)/qn),t=Math.floor((window.innerWidth-3*qn)/qn);return e%2===0&&(e-=1),t%2===0&&(t-=1),{maxRows:e,maxCols:t}}const{maxRows:Ma,maxCols:Na}=Ap(),kg={rows:Ma,cols:Na,entry:{row:0,col:0},exit:{row:Ma-1,col:Na-1},grid:Eg(Ma,Na),status:Me.Ready},Fp=Wu({name:"pathFinder",initialState:kg,reducers:{setDimension:(e,t)=>{e.rows=t.payload.rows??e.rows,e.cols=t.payload.cols??e.cols},setGrid:(e,t)=>{if(!t.payload.clone){e.grid=t.payload.grid;return}const n=t.payload.grid.map(r=>r.slice());e.grid=n},setCell:(e,t)=>{const n=t.payload;if(e.grid[n.row][n.col]=n.cellType,n.cellType===D.entry||n.cellType===D.exit){const r=n.cellType===D.entry?"entry":"exit";e[r]={row:n.row,col:n.col}}},setCells:(e,t)=>{const{cells:n,cellType:r}=t.payload,o=e.grid.map(i=>i.slice());n.forEach(i=>{o[i.row][i.col]=r}),e.grid=o},setStatus:(e,t)=>{e.status=t.payload},clearGrid:e=>{const t=e.grid.map(n=>n.slice());for(let n=0;n{e.grid=pt(e.rows,e.cols,D.clear),(e.entry.row>=e.rows||e.entry.col>=e.cols)&&(e.entry={row:0,col:0}),e.grid[e.entry.row][e.entry.col]=D.entry,(e.exit.row>=e.rows||e.exit.col>=e.cols)&&(e.exit={row:e.rows-1,col:e.cols-1}),e.grid[e.exit.row][e.exit.col]=D.exit,e.grid[e.exit.row][e.exit.col]=D.exit,e.status=Me.Ready}}}),{setDimension:_g,setGrid:ws,setCell:Ss,setCells:$p,resetGrid:Up,clearGrid:za,setStatus:ml}=Fp.actions,Cg=Fp.reducer;let Bp,ar,yl=!1;const ja=2e3;let xs=250,sr=1e3;const Pg=()=>{yl||(yl=!0,Bp())},gf=()=>{yl&&(yl=!1,Hp())},Hp=()=>{ar=new Promise(e=>{Bp=e})},wf=e=>{sr=e},Rg=e=>{xs=e};Hp();function ur(e){return new Promise(t=>setTimeout(t,e))}async function*Yt(e,t,n){await ar;const r=e[t];e[t]=e[n],e[n]=r,yield{type:"swap",positions:[t,n]},await ur(sr),await ar}async function*ut(...e){yield{type:"highlight",positions:[-1,-1]},await ur(xs),await ar,yield{type:"highlight",positions:e},await ur(xs),await ar}async function*vl(e){yield{type:"pivot",position:e}}async function*De(e){yield{type:"sort",position:e}}async function*Tg(...e){await ar,yield{type:"move",positions:e},await ur(sr)}async function*Mg(e){let t,n;for(t=0;te[n+1]&&(yield*Yt(e,n,n+1));yield*De(n)}}async function*Ng(e){for(let t=0;te[n+1]&&(yield*Yt(e,n,n+1),r=0);if(r==1){for(let o=0;oe.length-n-1;o--)yield*ut(o-1,o),e[o]=0;n--)yield*Es(e,n,t);for(let n=e.length-1;n>0;n--)t--,yield*De(t),yield*Yt(e,0,n),yield*Es(e,0,t);yield*De(0)}async function*Es(e,t,n){const r=2*t+1,o=2*t+2;let i=t;const l=[];r0&&(yield*vl(t),yield*ut(...l)),re[i]&&(i=r),oe[i]&&(i=o),i!==t&&(yield*Yt(e,t,i),yield*vl(-1),yield*Es(e,i,n))}async function*jg(e){let t,n;for(t=0;t=0&&(yield*ut(r,n),e[n]>e[r]);n--)yield*Yt(e,n,r),r=n;yield*De(t)}}async function*ks(e,t=0,n=e.length-1,r=!0){if(t===n){r&&e.length===1&&(yield*De(t));return}if(te[u]){const c=e[u];Og(e,s,u),e[s]=c,yield*Tg(s,u),t++,a++,i&&(yield*De(s))}}for(let s=t+l;st;r--)e[r]=e[r-1]}async function*_s(e,t=0,n=e.length-1){if(t<=n){const r=yield*Dg(e,t,n);typeof r=="number"&&(yield*_s(e,t,r-1),yield*_s(e,r+1,n))}}async function*Dg(e,t,n){const r=t;let o=t,i=n+1;for(yield*vl(r);ot&&(yield*ut(i),!(e[i]e[r])););o0;){for(let n=t;n0&&e[r]<=e[r-t];)yield*ut(r,r-t),yield*Yt(e,r-t,r),r-=t;e[r]=o,t==1&&(yield*De(0),yield*De(n))}t=Math.floor((t-1)/3)}}const At=[{name:"bubble",fn:Mg},{name:"selection",fn:Ig},{name:"insertion",fn:jg},{name:"heap",fn:zg},{name:"merge",fn:ks},{name:"quick",fn:_s},{name:"shell",fn:bg},{name:"cocktail",fn:Ng}],Wp=At.map(e=>e.name).concat("all"),Ag=[6,8,3,5,1,9,2,7,4],Sf={min:10,max:40},Vp="Sorting is complete",kn={size:50,margin:4},Xl={size:30,minSize:10,maxHeight:250,margin:2},Jl={sort:"#8cf12b",highlight:"yellow",pivot:"orange",bar:"lightgrey"},Fg=At.map(()=>!0),Xt=document.querySelector(":root");Xt.style.setProperty("--cell-size",`${kn.size}px`);Xt.style.setProperty("--cell-margin",`${kn.margin}px`);Xt.style.setProperty("--bar-size",`${Xl.size}px`);Xt.style.setProperty("--bar-min-size",`${Xl.minSize}px`);Xt.style.setProperty("--bar-max-height",`${Xl.maxHeight}px`);Xt.style.setProperty("--bar-margin",`${Xl.margin}px`);Xt.style.setProperty("--color-sort",Jl.sort);Xt.style.setProperty("--color-highlight",Jl.highlight);Xt.style.setProperty("--color-pivot",Jl.pivot);Xt.style.setProperty("--color-bar",Jl.bar);const $g={array:Ag,visualizerType:"cell",isPlaying:!1,reset:!1,time:0,speed:5,timeIntervalId:null,selectedAlgosStatus:Fg},Kp=Wu({name:"sortViz",initialState:$g,reducers:{setArray:(e,t)=>{e.array=t.payload},setIsPlaying:(e,t)=>{e.isPlaying=t.payload,t.payload?Pg():gf(),!e.isPlaying&&e.timeIntervalId&&(clearInterval(e.timeIntervalId),e.timeIntervalId=null)},setIntervalId:(e,t)=>{e.timeIntervalId=t.payload},incrementTime:e=>{e.time++},setReset:e=>{e.reset=!e.reset,gf(),e.time=0},modifyAlgoSelection:(e,t)=>{e.selectedAlgosStatus[t.payload]=!e.selectedAlgosStatus[t.payload]},setSpeed:(e,t)=>{e.speed=t.payload,xf(e)},toggleVisualizerType:e=>{e.visualizerType=e.visualizerType==="cell"?"bar":"cell",xf(e)}}});function xf(e){e.visualizerType==="cell"?wf(ja/e.speed):wf(ja/(e.speed*4)),Rg(ja/(e.speed*4))}const{setArray:Cs,setIsPlaying:Yr,setReset:ql,setSpeed:Ef,setIntervalId:Ug,incrementTime:Bg,modifyAlgoSelection:Hg,toggleVisualizerType:Wg}=Kp.actions,Vg=Kp.reducer,Kg=()=>e=>{const t=setInterval(()=>{e(Bg())},100);e(Ug(t))};var Ku={},Qu={};Qu.__esModule=!0;Qu.default=Yg;function Ji(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ji=function(n){return typeof n}:Ji=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ji(e)}function La(){}var Qg={getItem:La,setItem:La,removeItem:La};function Gg(e){if((typeof self>"u"?"undefined":Ji(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function Yg(e){var t="".concat(e,"Storage");return Gg(t)?self[t]:Qg}Ku.__esModule=!0;Ku.default=qg;var Xg=Jg(Qu);function Jg(e){return e&&e.__esModule?e:{default:e}}function qg(e){var t=(0,Xg.default)(e);return{getItem:function(r){return new Promise(function(o,i){o(t.getItem(r))})},setItem:function(r,o){return new Promise(function(i,l){i(t.setItem(r,o))})},removeItem:function(r){return new Promise(function(o,i){o(t.removeItem(r))})}}}var Ps=void 0,Zg=e0(Ku);function e0(e){return e&&e.__esModule?e:{default:e}}var t0=(0,Zg.default)("local");Ps=t0;const Qp=sg({reducer:{app:rf({key:"app",storage:Ps},xg),sortViz:rf({key:"sorting-viz",storage:Ps},Vg),pathFinder:Cg},middleware:e=>e({serializableCheck:{ignoredActions:[Du,Vl,Iu,bu,Au,Fu]}})}),n0=Lv(Qp);var Gp={exports:{}},mt={},Yp={exports:{}},Xp={};/** + */var nv=E,rv=Symbol.for("react.element"),ov=Symbol.for("react.fragment"),iv=Object.prototype.hasOwnProperty,lv=nv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,av={key:!0,ref:!0,__self:!0,__source:!0};function Ep(e,t,n){var r,o={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)iv.call(t,r)&&!av.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:rv,type:e,key:i,ref:l,props:o,_owner:lv.current}}Wl.Fragment=ov;Wl.jsx=Ep;Wl.jsxs=Ep;pp.exports=Wl;var _=pp.exports,Ou="persist:",Du="persist/FLUSH",Vl="persist/REHYDRATE",Iu="persist/PAUSE",bu="persist/PERSIST",Au="persist/PURGE",Fu="persist/REGISTER",sv=-1;function Xi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xi=function(n){return typeof n}:Xi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Xi(e)}function tf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sv(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var xv=5e3;function rf(e,t){var n=e.version!==void 0?e.version:sv;e.debug;var r=e.stateReconciler===void 0?fv:e.stateReconciler,o=e.getStoredState||hv,i=e.timeout!==void 0?e.timeout:xv,l=null,a=!1,s=!0,u=function(f){return f._persist.rehydrated&&l&&!s&&l.update(f),f};return function(c,f){var d=c||{},g=d._persist,y=wv(d,["_persist"]),w=y;if(f.type===bu){var S=!1,h=function(N,L){S||(f.rehydrate(e.key,N,L),S=!0)};if(i&&setTimeout(function(){!S&&h(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},i),s=!1,l||(l=dv(e)),g)return en({},t(w,f),{_persist:g});if(typeof f.rehydrate!="function"||typeof f.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(e.key),o(e).then(function(R){var N=e.migrate||function(L,F){return Promise.resolve(L)};N(R,n).then(function(L){h(L)},function(L){h(void 0,L)})},function(R){h(void 0,R)}),en({},t(w,f),{_persist:{version:n,rehydrated:!1}})}else{if(f.type===Au)return a=!0,f.result(yv(e)),en({},t(w,f),{_persist:g});if(f.type===Du)return f.result(l&&l.flush()),en({},t(w,f),{_persist:g});if(f.type===Iu)s=!0;else if(f.type===Vl){if(a)return en({},w,{_persist:en({},g,{rehydrated:!0})});if(f.key===e.key){var p=t(w,f),m=f.payload,k=r!==!1&&m!==void 0?r(m,c,p,e):p,P=en({},k,{_persist:en({},g,{rehydrated:!0})});return u(P)}}}if(!g)return t(c,f);var v=t(w,f);return v===w?c:u(en({},v,{_persist:g}))}}function Fe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ev=typeof Symbol=="function"&&Symbol.observable||"@@observable",of=Ev,Pa=()=>Math.random().toString(36).substring(7).split("").join("."),kv={INIT:`@@redux/INIT${Pa()}`,REPLACE:`@@redux/REPLACE${Pa()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Pa()}`},fl=kv;function $u(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Uu(e,t,n){if(typeof e!="function")throw new Error(Fe(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Fe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Fe(1));return n(Uu)(e,t)}let r=e,o=t,i=new Map,l=i,a=0,s=!1;function u(){l===i&&(l=new Map,i.forEach((S,h)=>{l.set(h,S)}))}function c(){if(s)throw new Error(Fe(3));return o}function f(S){if(typeof S!="function")throw new Error(Fe(4));if(s)throw new Error(Fe(5));let h=!0;u();const p=a++;return l.set(p,S),function(){if(h){if(s)throw new Error(Fe(6));h=!1,u(),l.delete(p),i=null}}}function d(S){if(!$u(S))throw new Error(Fe(7));if(typeof S.type>"u")throw new Error(Fe(8));if(typeof S.type!="string")throw new Error(Fe(17));if(s)throw new Error(Fe(9));try{s=!0,o=r(o,S)}finally{s=!1}return(i=l).forEach(p=>{p()}),S}function g(S){if(typeof S!="function")throw new Error(Fe(10));r=S,d({type:fl.REPLACE})}function y(){const S=f;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Fe(11));function p(){const k=h;k.next&&k.next(c())}return p(),{unsubscribe:S(p)}},[of](){return this}}}return d({type:fl.INIT}),{dispatch:d,subscribe:f,getState:c,replaceReducer:g,[of]:y}}function _v(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:fl.INIT})>"u")throw new Error(Fe(12));if(typeof n(void 0,{type:fl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Fe(13))})}function Cv(e){const t=Object.keys(e),n={};for(let i=0;i"u")throw a&&a.type,new Error(Fe(14));u[f]=y,s=s||y!==g}return s=s||r.length!==Object.keys(l).length,s?u:l}}function dl(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Pv(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(Fe(15))};const l={getState:o.getState,dispatch:(s,...u)=>i(s,...u)},a=e.map(s=>s(l));return i=dl(...a)(o.dispatch),{...o,dispatch:i}}}function Rv(e){return $u(e)&&"type"in e&&typeof e.type=="string"}function lf(e){return Nv(e)||Mv(e)||Tv()}function Tv(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function Mv(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Nv(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:kp,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case Fu:return ds({},t,{registry:[].concat(lf(t.registry),[n.key])});case Vl:var r=t.registry.indexOf(n.key),o=lf(t.registry);return o.splice(r,1),ds({},t,{registry:o,bootstrapped:o.length===0});default:return t}};function Lv(e,t,n){var r=n||!1,o=Uu(jv,kp,t&&t.enhancer?t.enhancer:void 0),i=function(u){o.dispatch({type:Fu,key:u})},l=function(u,c,f){var d={type:Vl,payload:c,err:f,key:u};e.dispatch(d),o.dispatch(d),r&&a.getState().bootstrapped&&(r(),r=!1)},a=ds({},o,{purge:function(){var u=[];return e.dispatch({type:Au,result:function(f){u.push(f)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:Du,result:function(f){u.push(f)}}),Promise.all(u)},pause:function(){e.dispatch({type:Iu})},persist:function(){e.dispatch({type:bu,register:i,rehydrate:l})}});return t&&t.manualPersist||a.persist(),a}var _p=Symbol.for("immer-nothing"),sf=Symbol.for("immer-draftable"),ft=Symbol.for("immer-state");function bt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Yr=Object.getPrototypeOf;function Dn(e){return!!e&&!!e[ft]}function sn(e){var t;return e?Cp(e)||Array.isArray(e)||!!e[sf]||!!((t=e.constructor)!=null&&t[sf])||Ql(e)||Gl(e):!1}var Ov=Object.prototype.constructor.toString();function Cp(e){if(!e||typeof e!="object")return!1;const t=Yr(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Ov}function Wo(e,t){Kl(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Kl(e){const t=e[ft];return t?t.type_:Array.isArray(e)?1:Ql(e)?2:Gl(e)?3:0}function ps(e,t){return Kl(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Pp(e,t,n){const r=Kl(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Dv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ql(e){return e instanceof Map}function Gl(e){return e instanceof Set}function Xn(e){return e.copy_||e.base_}function hs(e,t){if(Ql(e))return new Map(e);if(Gl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Cp(e))return Yr(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ft];let r=Reflect.ownKeys(n);for(let o=0;o1&&(e.set=e.add=e.clear=e.delete=Iv),Object.freeze(e),t&&Wo(e,(n,r)=>Bu(r,!0))),e}function Iv(){bt(2)}function Yl(e){return Object.isFrozen(e)}var bv={};function sr(e){const t=bv[e];return t||bt(0,e),t}var Vo;function Rp(){return Vo}function Av(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function uf(e,t){t&&(sr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ms(e){ys(e),e.drafts_.forEach(Fv),e.drafts_=null}function ys(e){e===Vo&&(Vo=e.parent_)}function cf(e){return Vo=Av(Vo,e)}function Fv(e){const t=e[ft];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ff(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ft].modified_&&(ms(t),bt(4)),sn(e)&&(e=pl(t,e),t.parent_||hl(t,e)),t.patches_&&sr("Patches").generateReplacementPatches_(n[ft].base_,e,t.patches_,t.inversePatches_)):e=pl(t,n,[]),ms(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_p?e:void 0}function pl(e,t,n){if(Yl(t))return t;const r=t[ft];if(!r)return Wo(t,(o,i)=>df(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return hl(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,l=!1;r.type_===3&&(i=new Set(o),o.clear(),l=!0),Wo(i,(a,s)=>df(e,r,o,a,s,n,l)),hl(e,o,!1),n&&e.patches_&&sr("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function df(e,t,n,r,o,i,l){if(Dn(o)){const a=i&&t&&t.type_!==3&&!ps(t.assigned_,r)?i.concat(r):void 0,s=pl(e,o,a);if(Pp(n,r,s),Dn(s))e.canAutoFreeze_=!1;else return}else l&&n.add(o);if(sn(o)&&!Yl(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;pl(e,o),(!t||!t.scope_.parent_)&&hl(e,o)}}function hl(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bu(t,n)}function $v(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Rp(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Hu;n&&(o=[r],i=Ko);const{revoke:l,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=l,a}var Hu={get(e,t){if(t===ft)return e;const n=Xn(e);if(!ps(n,t))return Uv(e,n,t);const r=n[t];return e.finalized_||!sn(r)?r:r===Ra(e.base_,t)?(Ta(e),e.copy_[t]=gs(r,e)):r},has(e,t){return t in Xn(e)},ownKeys(e){return Reflect.ownKeys(Xn(e))},set(e,t,n){const r=Tp(Xn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Ra(Xn(e),t),i=o==null?void 0:o[ft];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Dv(n,o)&&(n!==void 0||ps(e.base_,t)))return!0;Ta(e),vs(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ra(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ta(e),vs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Xn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){bt(11)},getPrototypeOf(e){return Yr(e.base_)},setPrototypeOf(){bt(12)}},Ko={};Wo(Hu,(e,t)=>{Ko[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ko.deleteProperty=function(e,t){return Ko.set.call(this,e,t,void 0)};Ko.set=function(e,t,n){return Hu.set.call(this,e[0],t,n,e[0])};function Ra(e,t){const n=e[ft];return(n?Xn(n):e)[t]}function Uv(e,t,n){var o;const r=Tp(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function Tp(e,t){if(!(t in e))return;let n=Yr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Yr(n)}}function vs(e){e.modified_||(e.modified_=!0,e.parent_&&vs(e.parent_))}function Ta(e){e.copy_||(e.copy_=hs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bv=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const l=this;return function(s=i,...u){return l.produce(s,c=>n.call(this,c,...u))}}typeof n!="function"&&bt(6),r!==void 0&&typeof r!="function"&&bt(7);let o;if(sn(t)){const i=cf(this),l=gs(t,void 0);let a=!0;try{o=n(l),a=!1}finally{a?ms(i):ys(i)}return uf(i,r),ff(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===_p&&(o=void 0),this.autoFreeze_&&Bu(o,!0),r){const i=[],l=[];sr("Patches").generateReplacementPatches_(t,o,i,l),r(i,l)}return o}else bt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...a)=>this.produceWithPatches(l,s=>t(s,...a));let r,o;return[this.produce(t,n,(l,a)=>{r=l,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){sn(e)||bt(8),Dn(e)&&(e=Mp(e));const t=cf(this),n=gs(e,void 0);return n[ft].isManual_=!0,ys(t),n}finishDraft(e,t){const n=e&&e[ft];(!n||!n.isManual_)&&bt(9);const{scope_:r}=n;return uf(r,t),ff(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=sr("Patches").applyPatches_;return Dn(e)?r(e,t):this.produce(e,o=>r(o,t))}};function gs(e,t){const n=Ql(e)?sr("MapSet").proxyMap_(e,t):Gl(e)?sr("MapSet").proxySet_(e,t):$v(e,t);return(t?t.scope_:Rp()).drafts_.push(n),n}function Mp(e){return Dn(e)||bt(10,e),Np(e)}function Np(e){if(!sn(e)||Yl(e))return e;const t=e[ft];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=hs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=hs(e,!0);return Wo(n,(r,o)=>{Pp(n,r,Np(o))}),t&&(t.finalized_=!1),n}var dt=new Bv,zp=dt.produce;dt.produceWithPatches.bind(dt);dt.setAutoFreeze.bind(dt);dt.setUseStrictShallowCopy.bind(dt);dt.applyPatches.bind(dt);dt.createDraft.bind(dt);dt.finishDraft.bind(dt);function Hv(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Wv(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var pf=e=>Array.isArray(e)?e:[e];function Vv(e){const t=Array.isArray(e[0])?e[0]:e;return Wv(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Kv(e,t){const n=[],{length:r}=e;for(let o=0;o{n=Ti(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function Xv(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e;return(...o)=>{let i=0,l=0,a,s={},u=o.pop();typeof u=="object"&&(s=u,u=o.pop()),Hv(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...n,...s},{memoize:f,memoizeOptions:d=[],argsMemoize:g=jp,argsMemoizeOptions:y=[],devModeChecks:w={}}=c,S=pf(d),h=pf(y),p=Vv(o),m=f(function(){return i++,u.apply(null,arguments)},...S),k=g(function(){l++;const v=Kv(p,arguments);return a=m.apply(null,v),a},...h);return Object.assign(k,{resultFunc:u,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:g})}}function Lp(e){return({dispatch:n,getState:r})=>o=>i=>typeof i=="function"?i(n,r,e):o(i)}var Jv=Lp(),Zv=Lp,qv=(...e)=>{const t=Xv(...e);return(...n)=>{const r=t(...n),o=(i,...l)=>r(Dn(i)?Mp(i):i,...l);return Object.assign(o,r),o}};qv(jp);var eg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?dl:dl.apply(null,arguments)};function Qo(e,t){function n(...r){if(t){let o=t(...r);if(!o)throw new Error(Ft(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Rv(r)&&r.type===e,n}var Op=class Ro extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ro.prototype)}static get[Symbol.species](){return Ro}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ro(...t[0].concat(this)):new Ro(...t.concat(this))}};function mf(e){return sn(e)?zp(e,()=>{}):e}function yf(e,t,n){if(e.has(t)){let o=e.get(t);return n.update&&(o=n.update(o,t,e),e.set(t,o)),o}if(!n.insert)throw new Error(Ft(10));const r=n.insert(t,e);return e.set(t,r),r}function tg(e){return typeof e=="boolean"}var ng=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{};let l=new Op;return n&&(tg(n)?l.push(Jv):l.push(Zv(n.extraArgument))),l},rg="RTK_autoBatch",Dp=e=>t=>{setTimeout(t,e)},og=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Dp(10),ig=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,l=!1;const a=new Set,s=e.type==="tick"?queueMicrotask:e.type==="raf"?og:e.type==="callback"?e.queueNotification:Dp(e.timeout),u=()=>{l=!1,i&&(i=!1,a.forEach(c=>c()))};return Object.assign({},r,{subscribe(c){const f=()=>o&&c(),d=r.subscribe(f);return a.add(c),()=>{d(),a.delete(c)}},dispatch(c){var f;try{return o=!((f=c==null?void 0:c.meta)!=null&&f[rg]),i=!o,i&&(l||(l=!0,s(u))),r.dispatch(c)}finally{o=!0}}})},lg=e=>function(n){const{autoBatch:r=!0}=n??{};let o=new Op(e);return r&&o.push(ig(typeof r=="object"?r:void 0)),o},ag=!0;function sg(e){const t=ng(),{reducer:n=void 0,middleware:r,devTools:o=!0,preloadedState:i=void 0,enhancers:l=void 0}=e||{};let a;if(typeof n=="function")a=n;else if($u(n))a=Cv(n);else throw new Error(Ft(1));let s;typeof r=="function"?s=r(t):s=t();let u=dl;o&&(u=eg({trace:!ag,...typeof o=="object"&&o}));const c=Pv(...s),f=lg(c);let d=typeof l=="function"?l(f):f();const g=u(...d);return Uu(a,i,g)}function Ip(e){const t={},n=[];let r;const o={addCase(i,l){const a=typeof i=="string"?i:i.type;if(!a)throw new Error(Ft(28));if(a in t)throw new Error(Ft(29));return t[a]=l,o},addMatcher(i,l){return n.push({matcher:i,reducer:l}),o},addDefaultCase(i){return r=i,o}};return e(o),[t,n,r]}function ug(e){return typeof e=="function"}function cg(e,t){let[n,r,o]=Ip(t),i;if(ug(e))i=()=>mf(e());else{const a=mf(e);i=()=>a}function l(a=i(),s){let u=[n[s.type],...r.filter(({matcher:c})=>c(s)).map(({reducer:c})=>c)];return u.filter(c=>!!c).length===0&&(u=[o]),u.reduce((c,f)=>{if(f)if(Dn(c)){const g=f(c,s);return g===void 0?c:g}else{if(sn(c))return zp(c,d=>f(d,s));{const d=f(c,s);if(d===void 0){if(c===null)return c;throw new Error(Ft(9))}return d}}return c},a)}return l.getInitialState=i,l}var fg=Symbol.for("rtk-slice-createasyncthunk");function dg(e,t){return`${e}/${t}`}function pg({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[fg];return function(o){const{name:i,reducerPath:l=i}=o;if(!i)throw new Error(Ft(11));typeof process<"u";const a=(typeof o.reducers=="function"?o.reducers(mg()):o.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(S,h){const p=typeof S=="string"?S:S.type;if(!p)throw new Error(Ft(12));if(p in u.sliceCaseReducersByType)throw new Error(Ft(13));return u.sliceCaseReducersByType[p]=h,c},addMatcher(S,h){return u.sliceMatchers.push({matcher:S,reducer:h}),c},exposeAction(S,h){return u.actionCreators[S]=h,c},exposeCaseReducer(S,h){return u.sliceCaseReducersByName[S]=h,c}};s.forEach(S=>{const h=a[S],p={reducerName:S,type:dg(i,S),createNotation:typeof o.reducers=="function"};vg(h)?wg(p,h,c,t):yg(p,h,c)});function f(){const[S={},h=[],p=void 0]=typeof o.extraReducers=="function"?Ip(o.extraReducers):[o.extraReducers],m={...S,...u.sliceCaseReducersByType};return cg(o.initialState,k=>{for(let P in m)k.addCase(P,m[P]);for(let P of u.sliceMatchers)k.addMatcher(P.matcher,P.reducer);for(let P of h)k.addMatcher(P.matcher,P.reducer);p&&k.addDefaultCase(p)})}const d=S=>S,g=new WeakMap;let y;const w={name:i,reducerPath:l,reducer(S,h){return y||(y=f()),y(S,h)},actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState(){return y||(y=f()),y.getInitialState()},getSelectors(S=d){const h=yf(g,this,{insert:()=>new WeakMap});return yf(h,S,{insert:()=>{const p={};for(const[m,k]of Object.entries(o.selectors??{}))p[m]=hg(this,k,S,this!==w);return p}})},selectSlice(S){let h=S[this.reducerPath];return typeof h>"u"&&this!==w&&(h=this.getInitialState()),h},get selectors(){return this.getSelectors(this.selectSlice)},injectInto(S,{reducerPath:h,...p}={}){const m=h??this.reducerPath;return S.inject({reducerPath:m,reducer:this.reducer},p),{...this,reducerPath:m}}};return w}}function hg(e,t,n,r){function o(i,...l){let a=n.call(e,i);return typeof a>"u"&&r&&(a=e.getInitialState()),t(a,...l)}return o.unwrapped=t,o}var Wu=pg();function mg(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function yg({type:e,reducerName:t,createNotation:n},r,o){let i,l;if("reducer"in r){if(n&&!gg(r))throw new Error(Ft(17));i=r.reducer,l=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,l?Qo(e,l):Qo(e))}function vg(e){return e._reducerDefinitionType==="asyncThunk"}function gg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function wg({type:e,reducerName:t},n,r,o){if(!o)throw new Error(Ft(18));const{payloadCreator:i,fulfilled:l,pending:a,rejected:s,settled:u,options:c}=n,f=o(e,i,c);r.exposeAction(t,f),l&&r.addCase(f.fulfilled,l),a&&r.addCase(f.pending,a),s&&r.addCase(f.rejected,s),u&&r.addMatcher(f.settled,u),r.exposeCaseReducer(t,{fulfilled:l||Mi,pending:a||Mi,rejected:s||Mi,settled:u||Mi})}function Mi(){}var Vu="listenerMiddleware";Qo(`${Vu}/add`);Qo(`${Vu}/removeAll`);Qo(`${Vu}/remove`);function Ft(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Sg={theme:null},bp=Wu({name:"app",initialState:Sg,reducers:{setTheme:(e,t)=>{e.theme=t.payload,document.documentElement.setAttribute("data-theme",t.payload)}}}),{setTheme:vf}=bp.actions,xg=bp.reducer,er=25,Un={clear:"transparent",entry:"deepskyblue",exit:"lawngreen",wall:"darkred",fillStart:"blue",fillMid:"deepskyblue",fill:"rgb(225 208 254)",path:"deepskyblue"},pn=document.querySelector(":root");pn.style.setProperty("--pf-cell-size",er+"px");pn.style.setProperty("--pf-cell-clear",Un.clear);pn.style.setProperty("--pf-cell-entry",Un.entry);pn.style.setProperty("--pf-cell-exit",Un.exit);pn.style.setProperty("--pf-cell-wall",Un.wall);pn.style.setProperty("--pf-cell-fill",Un.fill);pn.style.setProperty("--pf-cell-fill-start",Un.fillStart);pn.style.setProperty("--pf-cell-fill-mid",Un.fillMid);pn.style.setProperty("--pf-cell-path",Un.path);var D=(e=>(e[e.clear=0]="clear",e[e.entry=1]="entry",e[e.exit=2]="exit",e[e.wall=3]="wall",e[e.fill=4]="fill",e[e.path=5]="path",e))(D||{}),Me=(e=>(e[e.Generating=0]="Generating",e[e.Ready=1]="Ready",e[e.Searching=2]="Searching",e[e.Complete=3]="Complete",e))(Me||{});function pt(e,t,n=null){return Array.from(new Array(e),()=>new Array(t).fill(n))}function Eg(e,t){const n=pt(e,t,0);return n[0][0]=D.entry,n[e-1][t-1]=D.exit,n}function Ap(){let e=Math.floor((window.innerHeight-140-2*er)/er),t=Math.floor((window.innerWidth-3*er)/er);return e%2===0&&(e-=1),t%2===0&&(t-=1),{maxRows:e,maxCols:t}}const{maxRows:Ma,maxCols:Na}=Ap(),kg={rows:Ma,cols:Na,entry:{row:0,col:0},exit:{row:Ma-1,col:Na-1},grid:Eg(Ma,Na),status:Me.Ready},Fp=Wu({name:"pathFinder",initialState:kg,reducers:{setDimension:(e,t)=>{e.rows=t.payload.rows??e.rows,e.cols=t.payload.cols??e.cols},setGrid:(e,t)=>{if(!t.payload.clone){e.grid=t.payload.grid;return}const n=t.payload.grid.map(r=>r.slice());e.grid=n},setCell:(e,t)=>{const n=t.payload;if(e.grid[n.row][n.col]=n.cellType,n.cellType===D.entry||n.cellType===D.exit){const r=n.cellType===D.entry?"entry":"exit";e[r]={row:n.row,col:n.col}}},setCells:(e,t)=>{const{cells:n,cellType:r}=t.payload,o=e.grid.map(i=>i.slice());n.forEach(i=>{o[i.row][i.col]=r}),e.grid=o},setStatus:(e,t)=>{e.status=t.payload},clearGrid:e=>{const t=e.grid.map(n=>n.slice());for(let n=0;n{e.grid=pt(e.rows,e.cols,D.clear),(e.entry.row>=e.rows||e.entry.col>=e.cols)&&(e.entry={row:0,col:0}),e.grid[e.entry.row][e.entry.col]=D.entry,(e.exit.row>=e.rows||e.exit.col>=e.cols)&&(e.exit={row:e.rows-1,col:e.cols-1}),e.grid[e.exit.row][e.exit.col]=D.exit,e.grid[e.exit.row][e.exit.col]=D.exit,e.status=Me.Ready}}}),{setDimension:_g,setGrid:ws,setCell:Ss,setCells:$p,resetGrid:Up,clearGrid:za,setStatus:ml}=Fp.actions,Cg=Fp.reducer;let Bp,ur,yl=!1;const ja=2e3;let xs=250,cr=1e3;const Pg=()=>{yl||(yl=!0,Bp())},gf=()=>{yl&&(yl=!1,Hp())},Hp=()=>{ur=new Promise(e=>{Bp=e})},wf=e=>{cr=e},Rg=e=>{xs=e};Hp();function fr(e){return new Promise(t=>setTimeout(t,e))}async function*Yt(e,t,n){await ur;const r=e[t];e[t]=e[n],e[n]=r,yield{type:"swap",positions:[t,n]},await fr(cr),await ur}async function*ut(...e){yield{type:"highlight",positions:[-1,-1]},await fr(xs),await ur,yield{type:"highlight",positions:e},await fr(xs),await ur}async function*vl(e){yield{type:"pivot",position:e}}async function*De(e){yield{type:"sort",position:e}}async function*Tg(...e){await ur,yield{type:"move",positions:e},await fr(cr)}async function*Mg(e){let t,n;for(t=0;te[n+1]&&(yield*Yt(e,n,n+1));yield*De(n)}}async function*Ng(e){for(let t=0;te[n+1]&&(yield*Yt(e,n,n+1),r=0);if(r==1){for(let o=0;oe.length-n-1;o--)yield*ut(o-1,o),e[o]=0;n--)yield*Es(e,n,t);for(let n=e.length-1;n>0;n--)t--,yield*De(t),yield*Yt(e,0,n),yield*Es(e,0,t);yield*De(0)}async function*Es(e,t,n){const r=2*t+1,o=2*t+2;let i=t;const l=[];r0&&(yield*vl(t),yield*ut(...l)),re[i]&&(i=r),oe[i]&&(i=o),i!==t&&(yield*Yt(e,t,i),yield*vl(-1),yield*Es(e,i,n))}async function*jg(e){let t,n;for(t=0;t=0&&(yield*ut(r,n),e[n]>e[r]);n--)yield*Yt(e,n,r),r=n;yield*De(t)}}async function*ks(e,t=0,n=e.length-1,r=!0){if(t===n){r&&e.length===1&&(yield*De(t));return}if(te[u]){const c=e[u];Og(e,s,u),e[s]=c,yield*Tg(s,u),t++,a++,i&&(yield*De(s))}}for(let s=t+l;st;r--)e[r]=e[r-1]}async function*_s(e,t=0,n=e.length-1){if(t<=n){const r=yield*Dg(e,t,n);typeof r=="number"&&(yield*_s(e,t,r-1),yield*_s(e,r+1,n))}}async function*Dg(e,t,n){const r=t;let o=t,i=n+1;for(yield*vl(r);ot&&(yield*ut(i),!(e[i]e[r])););o0;){for(let n=t;n0&&e[r]<=e[r-t];)yield*ut(r,r-t),yield*Yt(e,r-t,r),r-=t;e[r]=o,t==1&&(yield*De(0),yield*De(n))}t=Math.floor((t-1)/3)}}const At=[{name:"bubble",fn:Mg},{name:"selection",fn:Ig},{name:"insertion",fn:jg},{name:"heap",fn:zg},{name:"merge",fn:ks},{name:"quick",fn:_s},{name:"shell",fn:bg},{name:"cocktail",fn:Ng}],Wp=At.map(e=>e.name).concat("all"),Ag=[6,8,3,5,1,9,2,7,4],Sf={min:10,max:40},Vp="Sorting is complete",_n={size:50,margin:4},Xl={size:30,minSize:10,maxHeight:250,margin:2},Jl={sort:"#8cf12b",highlight:"yellow",pivot:"orange",bar:"lightgrey"},Fg=At.map(()=>!0),Xt=document.querySelector(":root");Xt.style.setProperty("--cell-size",`${_n.size}px`);Xt.style.setProperty("--cell-margin",`${_n.margin}px`);Xt.style.setProperty("--bar-size",`${Xl.size}px`);Xt.style.setProperty("--bar-min-size",`${Xl.minSize}px`);Xt.style.setProperty("--bar-max-height",`${Xl.maxHeight}px`);Xt.style.setProperty("--bar-margin",`${Xl.margin}px`);Xt.style.setProperty("--color-sort",Jl.sort);Xt.style.setProperty("--color-highlight",Jl.highlight);Xt.style.setProperty("--color-pivot",Jl.pivot);Xt.style.setProperty("--color-bar",Jl.bar);const $g={array:Ag,visualizerType:"cell",isPlaying:!1,reset:!1,time:0,speed:5,timeIntervalId:null,selectedAlgosStatus:Fg},Kp=Wu({name:"sortViz",initialState:$g,reducers:{setArray:(e,t)=>{e.array=t.payload},setIsPlaying:(e,t)=>{e.isPlaying=t.payload,t.payload?Pg():gf(),!e.isPlaying&&e.timeIntervalId&&(clearInterval(e.timeIntervalId),e.timeIntervalId=null)},setIntervalId:(e,t)=>{e.timeIntervalId=t.payload},incrementTime:e=>{e.time++},setReset:e=>{e.reset=!e.reset,gf(),e.time=0},modifyAlgoSelection:(e,t)=>{e.selectedAlgosStatus[t.payload]=!e.selectedAlgosStatus[t.payload]},setSpeed:(e,t)=>{e.speed=t.payload,xf(e)},toggleVisualizerType:e=>{e.visualizerType=e.visualizerType==="cell"?"bar":"cell",xf(e)}}});function xf(e){e.visualizerType==="cell"?wf(ja/e.speed):wf(ja/(e.speed*4)),Rg(ja/(e.speed*4))}const{setArray:Cs,setIsPlaying:Xr,setReset:Zl,setSpeed:Ef,setIntervalId:Ug,incrementTime:Bg,modifyAlgoSelection:Hg,toggleVisualizerType:Wg}=Kp.actions,Vg=Kp.reducer,Kg=()=>e=>{const t=setInterval(()=>{e(Bg())},100);e(Ug(t))};var Ku={},Qu={};Qu.__esModule=!0;Qu.default=Yg;function Ji(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ji=function(n){return typeof n}:Ji=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ji(e)}function La(){}var Qg={getItem:La,setItem:La,removeItem:La};function Gg(e){if((typeof self>"u"?"undefined":Ji(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function Yg(e){var t="".concat(e,"Storage");return Gg(t)?self[t]:Qg}Ku.__esModule=!0;Ku.default=Zg;var Xg=Jg(Qu);function Jg(e){return e&&e.__esModule?e:{default:e}}function Zg(e){var t=(0,Xg.default)(e);return{getItem:function(r){return new Promise(function(o,i){o(t.getItem(r))})},setItem:function(r,o){return new Promise(function(i,l){i(t.setItem(r,o))})},removeItem:function(r){return new Promise(function(o,i){o(t.removeItem(r))})}}}var Ps=void 0,qg=e0(Ku);function e0(e){return e&&e.__esModule?e:{default:e}}var t0=(0,qg.default)("local");Ps=t0;const Qp=sg({reducer:{app:rf({key:"app",storage:Ps},xg),sortViz:rf({key:"sorting-viz",storage:Ps},Vg),pathFinder:Cg},middleware:e=>e({serializableCheck:{ignoredActions:[Du,Vl,Iu,bu,Au,Fu]}})}),n0=Lv(Qp);var Gp={exports:{}},mt={},Yp={exports:{}},Xp={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ function fp(e,t){for(var n=0;n>>1,Z=M[V];if(0>>1;Vo(ze,A))beo(Mt,ze)?(M[V]=Mt,M[be]=A,V=be):(M[V]=ze,M[_e]=A,V=_e);else if(beo(Mt,A))M[V]=Mt,M[be]=A,V=be;else break e}}return b}function o(M,b){var A=M.sortIndex-b.sortIndex;return A!==0?A:M.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var s=[],u=[],c=1,f=null,d=3,g=!1,y=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(M){for(var b=n(u);b!==null;){if(b.callback===null)r(u);else if(b.startTime<=M)r(u),b.sortIndex=b.expirationTime,t(s,b);else break;b=n(u)}}function k(M){if(w=!1,m(M),!y)if(n(s)!==null)y=!0,ke(P);else{var b=n(u);b!==null&&ne(k,b.startTime-M)}}function P(M,b){y=!1,w&&(w=!1,h(N),N=-1),g=!0;var A=d;try{for(m(b),f=n(s);f!==null&&(!(f.expirationTime>b)||M&&!G());){var V=f.callback;if(typeof V=="function"){f.callback=null,d=f.priorityLevel;var Z=V(f.expirationTime<=b);b=e.unstable_now(),typeof Z=="function"?f.callback=Z:f===n(s)&&r(s),m(b)}else r(s);f=n(s)}if(f!==null)var ie=!0;else{var _e=n(u);_e!==null&&ne(k,_e.startTime-b),ie=!1}return ie}finally{f=null,d=A,g=!1}}var v=!1,R=null,N=-1,L=5,F=-1;function G(){return!(e.unstable_now()-FM||125V?(M.sortIndex=A,t(u,M),n(s)===null&&M===n(u)&&(w?(h(N),N=-1):w=!0,ne(k,A-V))):(M.sortIndex=Z,t(s,M),y||g||(y=!0,ke(P))),M},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(M){var b=d;return function(){var A=d;d=b;try{return M.apply(this,arguments)}finally{d=A}}}})(Xp);Yp.exports=Xp;var r0=Yp.exports;/** + */(function(e){function t(M,b){var A=M.length;M.push(b);e:for(;0>>1,q=M[V];if(0>>1;Vo(ze,A))beo(Mt,ze)?(M[V]=Mt,M[be]=A,V=be):(M[V]=ze,M[_e]=A,V=_e);else if(beo(Mt,A))M[V]=Mt,M[be]=A,V=be;else break e}}return b}function o(M,b){var A=M.sortIndex-b.sortIndex;return A!==0?A:M.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var s=[],u=[],c=1,f=null,d=3,g=!1,y=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(M){for(var b=n(u);b!==null;){if(b.callback===null)r(u);else if(b.startTime<=M)r(u),b.sortIndex=b.expirationTime,t(s,b);else break;b=n(u)}}function k(M){if(w=!1,m(M),!y)if(n(s)!==null)y=!0,ke(P);else{var b=n(u);b!==null&&ne(k,b.startTime-M)}}function P(M,b){y=!1,w&&(w=!1,h(N),N=-1),g=!0;var A=d;try{for(m(b),f=n(s);f!==null&&(!(f.expirationTime>b)||M&&!G());){var V=f.callback;if(typeof V=="function"){f.callback=null,d=f.priorityLevel;var q=V(f.expirationTime<=b);b=e.unstable_now(),typeof q=="function"?f.callback=q:f===n(s)&&r(s),m(b)}else r(s);f=n(s)}if(f!==null)var ie=!0;else{var _e=n(u);_e!==null&&ne(k,_e.startTime-b),ie=!1}return ie}finally{f=null,d=A,g=!1}}var v=!1,R=null,N=-1,L=5,F=-1;function G(){return!(e.unstable_now()-FM||125V?(M.sortIndex=A,t(u,M),n(s)===null&&M===n(u)&&(w?(h(N),N=-1):w=!0,ne(k,A-V))):(M.sortIndex=q,t(s,M),y||g||(y=!0,ke(P))),M},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(M){var b=d;return function(){var A=d;d=b;try{return M.apply(this,arguments)}finally{d=A}}}})(Xp);Yp.exports=Xp;var r0=Yp.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function fp(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rs=Object.prototype.hasOwnProperty,o0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,kf={},_f={};function i0(e){return Rs.call(_f,e)?!0:Rs.call(kf,e)?!1:o0.test(e)?_f[e]=!0:(kf[e]=!0,!1)}function l0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function a0(e,t,n,r){if(t===null||typeof t>"u"||l0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function qe(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new qe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Be[e]=new qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gu=/[\-:]([a-z])/g;function Yu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gu,Yu);Be[t]=new qe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gu,Yu);Be[t]=new qe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gu,Yu);Be[t]=new qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new qe(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xu(e,t,n,r){var o=Be.hasOwnProperty(t)?Be[t]:null;(o!==null?o.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rs=Object.prototype.hasOwnProperty,o0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,kf={},_f={};function i0(e){return Rs.call(_f,e)?!0:Rs.call(kf,e)?!1:o0.test(e)?_f[e]=!0:(kf[e]=!0,!1)}function l0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function a0(e,t,n,r){if(t===null||typeof t>"u"||l0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ze(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new Ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Be[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gu=/[\-:]([a-z])/g;function Yu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gu,Yu);Be[t]=new Ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gu,Yu);Be[t]=new Ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gu,Yu);Be[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xu(e,t,n,r){var o=Be.hasOwnProperty(t)?Be[t]:null;(o!==null?o.type!==0:r||!(2a||o[l]!==i[a]){var s=` -`+o[l].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{Da=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?To(e):""}function s0(e){switch(e.tag){case 5:return To(e.type);case 16:return To("Lazy");case 13:return To("Suspense");case 19:return To("SuspenseList");case 0:case 2:case 15:return e=Ia(e.type,!1),e;case 11:return e=Ia(e.type.render,!1),e;case 1:return e=Ia(e.type,!0),e;default:return""}}function zs(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Mr:return"Fragment";case Tr:return"Portal";case Ts:return"Profiler";case Ju:return"StrictMode";case Ms:return"Suspense";case Ns:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eh:return(e.displayName||"Context")+".Consumer";case Zp:return(e._context.displayName||"Context")+".Provider";case qu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zu:return t=e.displayName||null,t!==null?t:zs(e.type)||"Memo";case wn:t=e._payload,e=e._init;try{return zs(e(t))}catch{}}return null}function u0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zs(t);case 8:return t===Ju?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Dn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c0(e){var t=nh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zi(e){e._valueTracker||(e._valueTracker=c0(e))}function rh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function js(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function oh(e,t){t=t.checked,t!=null&&Xu(e,"checked",t,!1)}function Ls(e,t){oh(e,t);var n=Dn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Os(e,t.type,n):t.hasOwnProperty("defaultValue")&&Os(e,t.type,Dn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Os(e,t,n){(t!=="number"||gl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mo=Array.isArray;function Br(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ji.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},f0=["Webkit","ms","Moz","O"];Object.keys(jo).forEach(function(e){f0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jo[t]=jo[e]})});function sh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jo.hasOwnProperty(e)&&jo[e]?(""+t).trim():t+"px"}function uh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=sh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var d0=we({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bs(e,t){if(t){if(d0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function As(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fs=null;function ec(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $s=null,Hr=null,Wr=null;function Nf(e){if(e=vi(e)){if(typeof $s!="function")throw Error(z(280));var t=e.stateNode;t&&(t=ra(t),$s(e.stateNode,e.type,t))}}function ch(e){Hr?Wr?Wr.push(e):Wr=[e]:Hr=e}function fh(){if(Hr){var e=Hr,t=Wr;if(Wr=Hr=null,Nf(e),t)for(e=0;e>>=0,e===0?32:31-(k0(e)/_0|0)|0}var Li=64,Oi=4194304;function No(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function El(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=No(a):(i&=l,i!==0&&(r=No(i)))}else l=n&~o,l!==0?r=No(l):i!==0&&(r=No(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function mi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(t),e[t]=n}function T0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Oo),Ff=" ",$f=!1;function zh(e,t){switch(e){case"keyup":return n1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nr=!1;function o1(e,t){switch(e){case"compositionend":return jh(t);case"keypress":return t.which!==32?null:($f=!0,Ff);case"textInput":return e=t.data,e===Ff&&$f?null:e;default:return null}}function i1(e,t){if(Nr)return e==="compositionend"||!sc&&zh(e,t)?(e=Mh(),Zi=ic=_n=null,Nr=!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:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wf(n)}}function Ih(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ih(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bh(){for(var e=window,t=gl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gl(e.document)}return t}function uc(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")}function h1(e){var t=bh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ih(n.ownerDocument.documentElement,n)){if(r!==null&&uc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Vf(n,i);var l=Vf(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,zr=null,Ks=null,Io=null,Qs=!1;function Kf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qs||zr==null||zr!==gl(r)||(r=zr,"selectionStart"in r&&uc(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}),Io&&ti(Io,r)||(Io=r,r=Cl(Ks,"onSelect"),0Or||(e.current=Zs[Or],Zs[Or]=null,Or--)}function se(e,t){Or++,Zs[Or]=e.current,e.current=t}var In={},Qe=Un(In),tt=Un(!1),cr=In;function Jr(e,t){var n=e.type.contextTypes;if(!n)return In;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function nt(e){return e=e.childContextTypes,e!=null}function Rl(){fe(tt),fe(Qe)}function Zf(e,t,n){if(Qe.current!==In)throw Error(z(168));se(Qe,t),se(tt,n)}function Kh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,u0(e)||"Unknown",o));return we({},n,r)}function Tl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,cr=Qe.current,se(Qe,e),se(tt,tt.current),!0}function ed(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=Kh(e,t,cr),r.__reactInternalMemoizedMergedChildContext=e,fe(tt),fe(Qe),se(Qe,e)):fe(tt),se(tt,n)}var nn=null,oa=!1,Xa=!1;function Qh(e){nn===null?nn=[e]:nn.push(e)}function P1(e){oa=!0,Qh(e)}function Bn(){if(!Xa&&nn!==null){Xa=!0;var e=0,t=oe;try{var n=nn;for(oe=1;e>=l,o-=l,rn=1<<32-$t(t)+o|n<N?(L=R,R=null):L=R.sibling;var F=d(h,R,m[N],k);if(F===null){R===null&&(R=L);break}e&&R&&F.alternate===null&&t(h,R),p=i(F,p,N),v===null?P=F:v.sibling=F,v=F,R=L}if(N===m.length)return n(h,R),me&&Yn(h,N),P;if(R===null){for(;NN?(L=R,R=null):L=R.sibling;var G=d(h,R,F.value,k);if(G===null){R===null&&(R=L);break}e&&R&&G.alternate===null&&t(h,R),p=i(G,p,N),v===null?P=G:v.sibling=G,v=G,R=L}if(F.done)return n(h,R),me&&Yn(h,N),P;if(R===null){for(;!F.done;N++,F=m.next())F=f(h,F.value,k),F!==null&&(p=i(F,p,N),v===null?P=F:v.sibling=F,v=F);return me&&Yn(h,N),P}for(R=r(h,R);!F.done;N++,F=m.next())F=g(R,h,N,F.value,k),F!==null&&(e&&F.alternate!==null&&R.delete(F.key===null?N:F.key),p=i(F,p,N),v===null?P=F:v.sibling=F,v=F);return e&&R.forEach(function(re){return t(h,re)}),me&&Yn(h,N),P}function S(h,p,m,k){if(typeof m=="object"&&m!==null&&m.type===Mr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ni:e:{for(var P=m.key,v=p;v!==null;){if(v.key===P){if(P=m.type,P===Mr){if(v.tag===7){n(h,v.sibling),p=o(v,m.props.children),p.return=h,h=p;break e}}else if(v.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===wn&&ad(P)===v.type){n(h,v.sibling),p=o(v,m.props),p.ref=wo(h,v,m),p.return=h,h=p;break e}n(h,v);break}else t(h,v);v=v.sibling}m.type===Mr?(p=ir(m.props.children,h.mode,k,m.key),p.return=h,h=p):(k=al(m.type,m.key,m.props,null,h.mode,k),k.ref=wo(h,p,m),k.return=h,h=k)}return l(h);case Tr:e:{for(v=m.key;p!==null;){if(p.key===v)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(h,p.sibling),p=o(p,m.children||[]),p.return=h,h=p;break e}else{n(h,p);break}else t(h,p);p=p.sibling}p=os(m,h.mode,k),p.return=h,h=p}return l(h);case wn:return v=m._init,S(h,p,v(m._payload),k)}if(Mo(m))return y(h,p,m,k);if(ho(m))return w(h,p,m,k);Ui(h,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(h,p.sibling),p=o(p,m),p.return=h,h=p):(n(h,p),p=rs(m,h.mode,k),p.return=h,h=p),l(h)):n(h,p)}return S}var Zr=tm(!0),nm=tm(!1),gi={},Gt=Un(gi),ii=Un(gi),li=Un(gi);function tr(e){if(e===gi)throw Error(z(174));return e}function gc(e,t){switch(se(li,t),se(ii,e),se(Gt,gi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Is(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Is(t,e)}fe(Gt),se(Gt,t)}function eo(){fe(Gt),fe(ii),fe(li)}function rm(e){tr(li.current);var t=tr(Gt.current),n=Is(t,e.type);t!==n&&(se(ii,e),se(Gt,n))}function wc(e){ii.current===e&&(fe(Gt),fe(ii))}var ve=Un(0);function Ol(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ja=[];function Sc(){for(var e=0;en?n:4,e(!0);var r=qa.transition;qa.transition={};try{e(!1),t()}finally{oe=n,qa.transition=r}}function wm(){return Tt().memoizedState}function N1(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sm(e))xm(t,n);else if(n=Jh(e,t,n,r),n!==null){var o=Xe();Ut(n,e,r,o),Em(n,t,r)}}function z1(e,t,n){var r=jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sm(e))xm(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(o.hasEagerState=!0,o.eagerState=a,Bt(a,l)){var s=t.interleaved;s===null?(o.next=o,yc(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=Jh(e,t,o,r),n!==null&&(o=Xe(),Ut(n,e,r,o),Em(n,t,r))}}function Sm(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function xm(e,t){bo=Dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Em(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nc(e,n)}}var Il={readContext:Rt,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},j1={readContext:Rt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:ud,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,rl(4194308,4,hm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return rl(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=N1.bind(null,ge,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:sd,useDebugValue:Cc,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=sd(!1),t=e[0];return e=M1.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ge,o=Vt();if(me){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ie===null)throw Error(z(349));dr&30||lm(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ud(sm.bind(null,r,i,e),[e]),r.flags|=2048,ui(9,am.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vt(),t=Ie.identifierPrefix;if(me){var n=on,r=rn;n=(r&~(1<<32-$t(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ai++,0")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{Da=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?To(e):""}function s0(e){switch(e.tag){case 5:return To(e.type);case 16:return To("Lazy");case 13:return To("Suspense");case 19:return To("SuspenseList");case 0:case 2:case 15:return e=Ia(e.type,!1),e;case 11:return e=Ia(e.type.render,!1),e;case 1:return e=Ia(e.type,!0),e;default:return""}}function zs(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Nr:return"Fragment";case Mr:return"Portal";case Ts:return"Profiler";case Ju:return"StrictMode";case Ms:return"Suspense";case Ns:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eh:return(e.displayName||"Context")+".Consumer";case qp:return(e._context.displayName||"Context")+".Provider";case Zu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qu:return t=e.displayName||null,t!==null?t:zs(e.type)||"Memo";case Sn:t=e._payload,e=e._init;try{return zs(e(t))}catch{}}return null}function u0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zs(t);case 8:return t===Ju?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function In(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c0(e){var t=nh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zi(e){e._valueTracker||(e._valueTracker=c0(e))}function rh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function js(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=In(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function oh(e,t){t=t.checked,t!=null&&Xu(e,"checked",t,!1)}function Ls(e,t){oh(e,t);var n=In(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Os(e,t.type,n):t.hasOwnProperty("defaultValue")&&Os(e,t.type,In(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Os(e,t,n){(t!=="number"||gl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mo=Array.isArray;function Hr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ji.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},f0=["Webkit","ms","Moz","O"];Object.keys(jo).forEach(function(e){f0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jo[t]=jo[e]})});function sh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jo.hasOwnProperty(e)&&jo[e]?(""+t).trim():t+"px"}function uh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=sh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var d0=we({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bs(e,t){if(t){if(d0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function As(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fs=null;function ec(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $s=null,Wr=null,Vr=null;function Nf(e){if(e=vi(e)){if(typeof $s!="function")throw Error(z(280));var t=e.stateNode;t&&(t=ra(t),$s(e.stateNode,e.type,t))}}function ch(e){Wr?Vr?Vr.push(e):Vr=[e]:Wr=e}function fh(){if(Wr){var e=Wr,t=Vr;if(Vr=Wr=null,Nf(e),t)for(e=0;e>>=0,e===0?32:31-(k0(e)/_0|0)|0}var Li=64,Oi=4194304;function No(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function El(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=No(a):(i&=l,i!==0&&(r=No(i)))}else l=n&~o,l!==0?r=No(l):i!==0&&(r=No(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function mi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(t),e[t]=n}function T0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Oo),Ff=" ",$f=!1;function zh(e,t){switch(e){case"keyup":return n1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function o1(e,t){switch(e){case"compositionend":return jh(t);case"keypress":return t.which!==32?null:($f=!0,Ff);case"textInput":return e=t.data,e===Ff&&$f?null:e;default:return null}}function i1(e,t){if(zr)return e==="compositionend"||!sc&&zh(e,t)?(e=Mh(),qi=ic=Cn=null,zr=!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:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wf(n)}}function Ih(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ih(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bh(){for(var e=window,t=gl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gl(e.document)}return t}function uc(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")}function h1(e){var t=bh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ih(n.ownerDocument.documentElement,n)){if(r!==null&&uc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Vf(n,i);var l=Vf(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jr=null,Ks=null,Io=null,Qs=!1;function Kf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qs||jr==null||jr!==gl(r)||(r=jr,"selectionStart"in r&&uc(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}),Io&&ti(Io,r)||(Io=r,r=Cl(Ks,"onSelect"),0Dr||(e.current=qs[Dr],qs[Dr]=null,Dr--)}function se(e,t){Dr++,qs[Dr]=e.current,e.current=t}var bn={},Qe=Hn(bn),tt=Hn(!1),dr=bn;function Zr(e,t){var n=e.type.contextTypes;if(!n)return bn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function nt(e){return e=e.childContextTypes,e!=null}function Rl(){fe(tt),fe(Qe)}function qf(e,t,n){if(Qe.current!==bn)throw Error(z(168));se(Qe,t),se(tt,n)}function Kh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,u0(e)||"Unknown",o));return we({},n,r)}function Tl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bn,dr=Qe.current,se(Qe,e),se(tt,tt.current),!0}function ed(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=Kh(e,t,dr),r.__reactInternalMemoizedMergedChildContext=e,fe(tt),fe(Qe),se(Qe,e)):fe(tt),se(tt,n)}var nn=null,oa=!1,Xa=!1;function Qh(e){nn===null?nn=[e]:nn.push(e)}function P1(e){oa=!0,Qh(e)}function Wn(){if(!Xa&&nn!==null){Xa=!0;var e=0,t=oe;try{var n=nn;for(oe=1;e>=l,o-=l,rn=1<<32-$t(t)+o|n<N?(L=R,R=null):L=R.sibling;var F=d(h,R,m[N],k);if(F===null){R===null&&(R=L);break}e&&R&&F.alternate===null&&t(h,R),p=i(F,p,N),v===null?P=F:v.sibling=F,v=F,R=L}if(N===m.length)return n(h,R),me&&Jn(h,N),P;if(R===null){for(;NN?(L=R,R=null):L=R.sibling;var G=d(h,R,F.value,k);if(G===null){R===null&&(R=L);break}e&&R&&G.alternate===null&&t(h,R),p=i(G,p,N),v===null?P=G:v.sibling=G,v=G,R=L}if(F.done)return n(h,R),me&&Jn(h,N),P;if(R===null){for(;!F.done;N++,F=m.next())F=f(h,F.value,k),F!==null&&(p=i(F,p,N),v===null?P=F:v.sibling=F,v=F);return me&&Jn(h,N),P}for(R=r(h,R);!F.done;N++,F=m.next())F=g(R,h,N,F.value,k),F!==null&&(e&&F.alternate!==null&&R.delete(F.key===null?N:F.key),p=i(F,p,N),v===null?P=F:v.sibling=F,v=F);return e&&R.forEach(function(re){return t(h,re)}),me&&Jn(h,N),P}function S(h,p,m,k){if(typeof m=="object"&&m!==null&&m.type===Nr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ni:e:{for(var P=m.key,v=p;v!==null;){if(v.key===P){if(P=m.type,P===Nr){if(v.tag===7){n(h,v.sibling),p=o(v,m.props.children),p.return=h,h=p;break e}}else if(v.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Sn&&ad(P)===v.type){n(h,v.sibling),p=o(v,m.props),p.ref=wo(h,v,m),p.return=h,h=p;break e}n(h,v);break}else t(h,v);v=v.sibling}m.type===Nr?(p=ar(m.props.children,h.mode,k,m.key),p.return=h,h=p):(k=al(m.type,m.key,m.props,null,h.mode,k),k.ref=wo(h,p,m),k.return=h,h=k)}return l(h);case Mr:e:{for(v=m.key;p!==null;){if(p.key===v)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(h,p.sibling),p=o(p,m.children||[]),p.return=h,h=p;break e}else{n(h,p);break}else t(h,p);p=p.sibling}p=os(m,h.mode,k),p.return=h,h=p}return l(h);case Sn:return v=m._init,S(h,p,v(m._payload),k)}if(Mo(m))return y(h,p,m,k);if(ho(m))return w(h,p,m,k);Ui(h,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(h,p.sibling),p=o(p,m),p.return=h,h=p):(n(h,p),p=rs(m,h.mode,k),p.return=h,h=p),l(h)):n(h,p)}return S}var eo=tm(!0),nm=tm(!1),gi={},Gt=Hn(gi),ii=Hn(gi),li=Hn(gi);function rr(e){if(e===gi)throw Error(z(174));return e}function gc(e,t){switch(se(li,t),se(ii,e),se(Gt,gi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Is(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Is(t,e)}fe(Gt),se(Gt,t)}function to(){fe(Gt),fe(ii),fe(li)}function rm(e){rr(li.current);var t=rr(Gt.current),n=Is(t,e.type);t!==n&&(se(ii,e),se(Gt,n))}function wc(e){ii.current===e&&(fe(Gt),fe(ii))}var ve=Hn(0);function Ol(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ja=[];function Sc(){for(var e=0;en?n:4,e(!0);var r=Za.transition;Za.transition={};try{e(!1),t()}finally{oe=n,Za.transition=r}}function wm(){return Tt().memoizedState}function N1(e,t,n){var r=Ln(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sm(e))xm(t,n);else if(n=Jh(e,t,n,r),n!==null){var o=Xe();Ut(n,e,r,o),Em(n,t,r)}}function z1(e,t,n){var r=Ln(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sm(e))xm(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(o.hasEagerState=!0,o.eagerState=a,Bt(a,l)){var s=t.interleaved;s===null?(o.next=o,yc(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=Jh(e,t,o,r),n!==null&&(o=Xe(),Ut(n,e,r,o),Em(n,t,r))}}function Sm(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function xm(e,t){bo=Dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Em(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nc(e,n)}}var Il={readContext:Rt,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},j1={readContext:Rt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:ud,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,rl(4194308,4,hm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return rl(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=N1.bind(null,ge,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:sd,useDebugValue:Cc,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=sd(!1),t=e[0];return e=M1.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ge,o=Vt();if(me){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ie===null)throw Error(z(349));hr&30||lm(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ud(sm.bind(null,r,i,e),[e]),r.flags|=2048,ui(9,am.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vt(),t=Ie.identifierPrefix;if(me){var n=on,r=rn;n=(r&~(1<<32-$t(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ai++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Kt]=t,e[oi]=r,zm(e,t,!1,!1),t.stateNode=e;e:{switch(l=As(n,r),n){case"dialog":ce("cancel",e),ce("close",e),o=r;break;case"iframe":case"object":case"embed":ce("load",e),o=r;break;case"video":case"audio":for(o=0;ono&&(t.flags|=128,r=!0,So(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ol(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),So(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!me)return Ve(t),null}else 2*Pe()-i.renderingStartTime>no&&n!==1073741824&&(t.flags|=128,r=!0,So(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Pe(),t.sibling=null,n=ve.current,se(ve,r?n&1|2:n&1),t):(Ve(t),null);case 22:case 23:return zc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function $1(e,t){switch(fc(t),t.tag){case 1:return nt(t.type)&&Rl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return eo(),fe(tt),fe(Qe),Sc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wc(t),null;case 13:if(fe(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(ve),null;case 4:return eo(),null;case 10:return mc(t.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var Hi=!1,Ke=!1,U1=typeof WeakSet=="function"?WeakSet:Set,I=null;function Ar(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function fu(e,t,n){try{n()}catch(r){xe(e,t,r)}}var gd=!1;function B1(e,t){if(Gs=kl,e=bh(),uc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var g;f!==n||o!==0&&f.nodeType!==3||(a=l+o),f!==i||r!==0&&f.nodeType!==3||(s=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(g=f.firstChild)!==null;)d=f,f=g;for(;;){if(f===e)break t;if(d===n&&++u===o&&(a=l),d===i&&++c===r&&(s=l),(g=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=g}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ys={focusedElem:e,selectionRange:n},kl=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,S=y.memoizedState,h=t.stateNode,p=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:Lt(t.type,w),S);h.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(k){xe(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return y=gd,gd=!1,y}function Ao(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&fu(t,n,i)}o=o.next}while(o!==r)}}function aa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function du(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Om(e){var t=e.alternate;t!==null&&(e.alternate=null,Om(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[oi],delete t[qs],delete t[_1],delete t[C1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Dm(e){return e.tag===5||e.tag===3||e.tag===4}function wd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dm(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.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 pu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pl));else if(r!==4&&(e=e.child,e!==null))for(pu(e,t,n),e=e.sibling;e!==null;)pu(e,t,n),e=e.sibling}function hu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hu(e,t,n),e=e.sibling;e!==null;)hu(e,t,n),e=e.sibling}var $e=null,Ot=!1;function vn(e,t,n){for(n=n.child;n!==null;)Im(e,t,n),n=n.sibling}function Im(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Zl,n)}catch{}switch(n.tag){case 5:Ke||Ar(n,t);case 6:var r=$e,o=Ot;$e=null,vn(e,t,n),$e=r,Ot=o,$e!==null&&(Ot?(e=$e,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$e.removeChild(n.stateNode));break;case 18:$e!==null&&(Ot?(e=$e,n=n.stateNode,e.nodeType===8?Ya(e.parentNode,n):e.nodeType===1&&Ya(e,n),Zo(e)):Ya($e,n.stateNode));break;case 4:r=$e,o=Ot,$e=n.stateNode.containerInfo,Ot=!0,vn(e,t,n),$e=r,Ot=o;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&fu(n,t,l),o=o.next}while(o!==r)}vn(e,t,n);break;case 1:if(!Ke&&(Ar(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){xe(n,t,a)}vn(e,t,n);break;case 21:vn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,vn(e,t,n),Ke=r):vn(e,t,n);break;default:vn(e,t,n)}}function Sd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new U1),t.forEach(function(r){var o=J1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function zt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=Pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*W1(r/1960))-r,10e?16:e,Cn===null)var r=!1;else{if(e=Cn,Cn=null,Fl=0,ee&6)throw Error(z(331));var o=ee;for(ee|=4,I=e.current;I!==null;){var i=I,l=i.child;if(I.flags&16){var a=i.deletions;if(a!==null){for(var s=0;sPe()-Mc?or(e,0):Tc|=n),rt(e,t)}function Wm(e,t){t===0&&(e.mode&1?(t=Oi,Oi<<=1,!(Oi&130023424)&&(Oi=4194304)):t=1);var n=Xe();e=fn(e,t),e!==null&&(mi(e,t,n),rt(e,n))}function X1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wm(e,n)}function J1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Wm(e,n)}var Vm;Vm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)et=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return et=!1,A1(e,t,n);et=!!(e.flags&131072)}else et=!1,me&&t.flags&1048576&&Gh(t,Nl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ol(e,t),e=t.pendingProps;var o=Jr(t,Qe.current);Kr(t,n),o=Ec(null,t,r,e,o,n);var i=kc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,nt(r)?(i=!0,Tl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,vc(t),o.updater=ia,t.stateNode=o,o._reactInternals=t,ou(t,r,e,n),t=au(null,t,r,!0,i,n)):(t.tag=0,me&&i&&cc(t),Ye(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ol(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Z1(r),e=Lt(r,e),o){case 0:t=lu(null,t,r,e,n);break e;case 1:t=md(null,t,r,e,n);break e;case 11:t=pd(null,t,r,e,n);break e;case 14:t=hd(null,t,r,Lt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),lu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),md(e,t,r,o,n);case 3:e:{if(Tm(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,qh(e,t),Ll(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=to(Error(z(423)),t),t=yd(e,t,r,n,o);break e}else if(r!==o){o=to(Error(z(424)),t),t=yd(e,t,r,n,o);break e}else for(at=Mn(t.stateNode.containerInfo.firstChild),ct=t,me=!0,It=null,n=nm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qr(),r===o){t=dn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return rm(t),e===null&&tu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Xs(r,o)?l=null:i!==null&&Xs(r,i)&&(t.flags|=32),Rm(e,t),Ye(e,t,l,n),t.child;case 6:return e===null&&tu(t),null;case 13:return Mm(e,t,n);case 4:return gc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zr(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),pd(e,t,r,o,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,se(zl,r._currentValue),r._currentValue=l,i!==null)if(Bt(i.value,l)){if(i.children===o.children&&!tt.current){t=dn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=ln(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?s.next=s:(s.next=c.next,c.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),nu(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(z(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),nu(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Ye(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Kr(t,n),o=Rt(o),r=r(o),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,o=Lt(r,t.pendingProps),o=Lt(r.type,o),hd(e,t,r,o,n);case 15:return Cm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),ol(e,t),t.tag=1,nt(r)?(e=!0,Tl(t)):e=!1,Kr(t,n),em(t,r,o),ou(t,r,o,n),au(null,t,r,!0,e,n);case 19:return Nm(e,t,n);case 22:return Pm(e,t,n)}throw Error(z(156,t.tag))};function Km(e,t){return gh(e,t)}function q1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,n,r){return new q1(e,t,n,r)}function Lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Z1(e){if(typeof e=="function")return Lc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===qu)return 11;if(e===Zu)return 14}return 2}function Ln(e,t){var n=e.alternate;return n===null?(n=_t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function al(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")Lc(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Mr:return ir(n.children,o,i,t);case Ju:l=8,o|=8;break;case Ts:return e=_t(12,n,t,o|2),e.elementType=Ts,e.lanes=i,e;case Ms:return e=_t(13,n,t,o),e.elementType=Ms,e.lanes=i,e;case Ns:return e=_t(19,n,t,o),e.elementType=Ns,e.lanes=i,e;case th:return ua(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zp:l=10;break e;case eh:l=9;break e;case qu:l=11;break e;case Zu:l=14;break e;case wn:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=_t(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ir(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function ua(e,t,n,r){return e=_t(22,e,r,t),e.elementType=th,e.lanes=n,e.stateNode={isHidden:!1},e}function rs(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function os(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ew(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Aa(0),this.expirationTimes=Aa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Aa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Oc(e,t,n,r,o,i,l,a,s){return e=new ew(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=_t(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vc(i),e}function tw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xm)}catch(e){console.error(e)}}Xm(),Gp.exports=mt;var ha=Gp.exports;const Jm=dp(ha),lw=fp({__proto__:null,default:Jm},[ha]);/** +`+i.stack}return{value:e,source:t,stack:o,digest:null}}function ts(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function iu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var D1=typeof WeakMap=="function"?WeakMap:Map;function km(e,t,n){n=ln(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Al||(Al=!0,mu=r),iu(e,t)},n}function _m(e,t,n){n=ln(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){iu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){iu(e,t),typeof r!="function"&&(jn===null?jn=new Set([this]):jn.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function cd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new D1;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(n)||(o.add(n),e=Y1.bind(null,e,t,n),t.then(e,e))}function fd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function dd(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ln(-1,1),t.tag=2,zn(n,t,1))),n.lanes|=1),e)}var I1=hn.ReactCurrentOwner,et=!1;function Ye(e,t,n,r){t.child=e===null?nm(t,null,n,r):eo(t,e.child,n,r)}function pd(e,t,n,r,o){n=n.render;var i=t.ref;return Qr(t,o),r=Ec(e,t,n,r,i,o),n=kc(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,dn(e,t,o)):(me&&n&&cc(t),t.flags|=1,Ye(e,t,r,o),t.child)}function hd(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Lc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Cm(e,t,i,r,o)):(e=al(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:ti,n(l,r)&&e.ref===t.ref)return dn(e,t,o)}return t.flags|=1,e=On(i,r),e.ref=t.ref,e.return=t,t.child=e}function Cm(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ti(i,r)&&e.ref===t.ref)if(et=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(et=!0);else return t.lanes=e.lanes,dn(e,t,o)}return lu(e,t,n,r,o)}function Pm(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},se($r,lt),lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,se($r,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,se($r,lt),lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,se($r,lt),lt|=r;return Ye(e,t,o,n),t.child}function Rm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function lu(e,t,n,r,o){var i=nt(n)?dr:Qe.current;return i=Zr(t,i),Qr(t,o),n=Ec(e,t,n,r,i,o),r=kc(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,dn(e,t,o)):(me&&r&&cc(t),t.flags|=1,Ye(e,t,n,o),t.child)}function md(e,t,n,r,o){if(nt(n)){var i=!0;Tl(t)}else i=!1;if(Qr(t,o),t.stateNode===null)ol(e,t),em(t,n,r),ou(t,n,r,o),r=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var s=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=Rt(u):(u=nt(n)?dr:Qe.current,u=Zr(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof l.getSnapshotBeforeUpdate=="function";f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||s!==u)&&ld(t,l,r,u),xn=!1;var d=t.memoizedState;l.state=d,Ll(t,r,l,o),s=t.memoizedState,a!==r||d!==s||tt.current||xn?(typeof c=="function"&&(ru(t,n,c,r),s=t.memoizedState),(a=xn||id(t,n,a,r,d,s,u))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),l.props=r,l.state=s,l.context=u,r=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Zh(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Lt(t.type,a),l.props=u,f=t.pendingProps,d=l.context,s=n.contextType,typeof s=="object"&&s!==null?s=Rt(s):(s=nt(n)?dr:Qe.current,s=Zr(t,s));var g=n.getDerivedStateFromProps;(c=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==f||d!==s)&&ld(t,l,r,s),xn=!1,d=t.memoizedState,l.state=d,Ll(t,r,l,o);var y=t.memoizedState;a!==f||d!==y||tt.current||xn?(typeof g=="function"&&(ru(t,n,g,r),y=t.memoizedState),(u=xn||id(t,n,u,r,d,y,s)||!1)?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,y,s),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,y,s)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),l.props=r,l.state=y,l.context=s,r=u):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return au(e,t,n,r,i,o)}function au(e,t,n,r,o,i){Rm(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&ed(t,n,!1),dn(e,t,i);r=t.stateNode,I1.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=eo(t,e.child,null,i),t.child=eo(t,null,a,i)):Ye(e,t,a,i),t.memoizedState=r.state,o&&ed(t,n,!0),t.child}function Tm(e){var t=e.stateNode;t.pendingContext?qf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qf(e,t.context,!1),gc(e,t.containerInfo)}function yd(e,t,n,r,o){return qr(),dc(o),t.flags|=256,Ye(e,t,n,r),t.child}var su={dehydrated:null,treeContext:null,retryLane:0};function uu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mm(e,t,n){var r=t.pendingProps,o=ve.current,i=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),se(ve,o&1),e===null)return tu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,i?(r=t.mode,i=t.child,l={mode:"hidden",children:l},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=ua(l,r,0,null),e=ar(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uu(n),t.memoizedState=su,e):Pc(t,l));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return b1(e,t,l,r,a,o,n);if(i){i=r.fallback,l=t.mode,o=e.child,a=o.sibling;var s={mode:"hidden",children:r.children};return!(l&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=On(o,s),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=On(a,i):(i=ar(i,l,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,l=e.child.memoizedState,l=l===null?uu(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=su,r}return i=e.child,e=i.sibling,r=On(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Pc(e,t){return t=ua({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bi(e,t,n,r){return r!==null&&dc(r),eo(t,e.child,null,n),e=Pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function b1(e,t,n,r,o,i,l){if(n)return t.flags&256?(t.flags&=-257,r=ts(Error(z(422))),Bi(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=ua({mode:"visible",children:r.children},o,0,null),i=ar(i,o,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&eo(t,e.child,null,l),t.child.memoizedState=uu(l),t.memoizedState=su,i);if(!(t.mode&1))return Bi(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(z(419)),r=ts(i,r,void 0),Bi(e,t,l,r)}if(a=(l&e.childLanes)!==0,et||a){if(r=Ie,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|l)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,fn(e,o),Ut(r,e,o,-1))}return jc(),r=ts(Error(z(421))),Bi(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=X1.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,at=Nn(o.nextSibling),ct=t,me=!0,It=null,e!==null&&(Et[kt++]=rn,Et[kt++]=on,Et[kt++]=pr,rn=e.id,on=e.overflow,pr=t),t=Pc(t,r.children),t.flags|=4096,t)}function vd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),nu(e.return,t,n)}function ns(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Nm(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ye(e,t,r.children,n),r=ve.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vd(e,n,t);else if(e.tag===19)vd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(se(ve,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ol(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ns(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ol(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ns(t,!0,n,null,i);break;case"together":ns(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ol(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=On(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=On(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function A1(e,t,n){switch(t.tag){case 3:Tm(t),qr();break;case 5:rm(t);break;case 1:nt(t.type)&&Tl(t);break;case 4:gc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;se(zl,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(se(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Mm(e,t,n):(se(ve,ve.current&1),e=dn(e,t,n),e!==null?e.sibling:null);se(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Nm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),se(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,Pm(e,t,n)}return dn(e,t,n)}var zm,cu,jm,Lm;zm=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};cu=function(){};jm=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,rr(Gt.current);var i=null;switch(n){case"input":o=js(e,o),r=js(e,r),i=[];break;case"select":o=we({},o,{value:void 0}),r=we({},r,{value:void 0}),i=[];break;case"textarea":o=Ds(e,o),r=Ds(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pl)}bs(n,r);var l;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Go.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var s=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&s!==a&&(s!=null||a!=null))if(u==="style")if(a){for(l in a)!a.hasOwnProperty(l)||s&&s.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in s)s.hasOwnProperty(l)&&a[l]!==s[l]&&(n||(n={}),n[l]=s[l])}else n||(i||(i=[]),i.push(u,n)),n=s;else u==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,a=a?a.__html:void 0,s!=null&&a!==s&&(i=i||[]).push(u,s)):u==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(u,""+s):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Go.hasOwnProperty(u)?(s!=null&&u==="onScroll"&&ce("scroll",e),i||a===s||(i=[])):(i=i||[]).push(u,s))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Lm=function(e,t,n,r){n!==r&&(t.flags|=4)};function So(e,t){if(!me)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function F1(e,t,n){var r=t.pendingProps;switch(fc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(t),null;case 1:return nt(t.type)&&Rl(),Ve(t),null;case 3:return r=t.stateNode,to(),fe(tt),fe(Qe),Sc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&($i(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,It!==null&&(gu(It),It=null))),cu(e,t),Ve(t),null;case 5:wc(t);var o=rr(li.current);if(n=t.type,e!==null&&t.stateNode!=null)jm(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return Ve(t),null}if(e=rr(Gt.current),$i(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Kt]=t,r[oi]=i,e=(t.mode&1)!==0,n){case"dialog":ce("cancel",r),ce("close",r);break;case"iframe":case"object":case"embed":ce("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Kt]=t,e[oi]=r,zm(e,t,!1,!1),t.stateNode=e;e:{switch(l=As(n,r),n){case"dialog":ce("cancel",e),ce("close",e),o=r;break;case"iframe":case"object":case"embed":ce("load",e),o=r;break;case"video":case"audio":for(o=0;oro&&(t.flags|=128,r=!0,So(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ol(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),So(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!me)return Ve(t),null}else 2*Pe()-i.renderingStartTime>ro&&n!==1073741824&&(t.flags|=128,r=!0,So(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Pe(),t.sibling=null,n=ve.current,se(ve,r?n&1|2:n&1),t):(Ve(t),null);case 22:case 23:return zc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function $1(e,t){switch(fc(t),t.tag){case 1:return nt(t.type)&&Rl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return to(),fe(tt),fe(Qe),Sc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wc(t),null;case 13:if(fe(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(ve),null;case 4:return to(),null;case 10:return mc(t.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var Hi=!1,Ke=!1,U1=typeof WeakSet=="function"?WeakSet:Set,I=null;function Fr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function fu(e,t,n){try{n()}catch(r){xe(e,t,r)}}var gd=!1;function B1(e,t){if(Gs=kl,e=bh(),uc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var g;f!==n||o!==0&&f.nodeType!==3||(a=l+o),f!==i||r!==0&&f.nodeType!==3||(s=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(g=f.firstChild)!==null;)d=f,f=g;for(;;){if(f===e)break t;if(d===n&&++u===o&&(a=l),d===i&&++c===r&&(s=l),(g=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=g}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ys={focusedElem:e,selectionRange:n},kl=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,S=y.memoizedState,h=t.stateNode,p=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:Lt(t.type,w),S);h.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(k){xe(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return y=gd,gd=!1,y}function Ao(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&fu(t,n,i)}o=o.next}while(o!==r)}}function aa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function du(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Om(e){var t=e.alternate;t!==null&&(e.alternate=null,Om(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[oi],delete t[Zs],delete t[_1],delete t[C1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Dm(e){return e.tag===5||e.tag===3||e.tag===4}function wd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dm(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.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 pu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pl));else if(r!==4&&(e=e.child,e!==null))for(pu(e,t,n),e=e.sibling;e!==null;)pu(e,t,n),e=e.sibling}function hu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hu(e,t,n),e=e.sibling;e!==null;)hu(e,t,n),e=e.sibling}var $e=null,Ot=!1;function gn(e,t,n){for(n=n.child;n!==null;)Im(e,t,n),n=n.sibling}function Im(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(ql,n)}catch{}switch(n.tag){case 5:Ke||Fr(n,t);case 6:var r=$e,o=Ot;$e=null,gn(e,t,n),$e=r,Ot=o,$e!==null&&(Ot?(e=$e,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$e.removeChild(n.stateNode));break;case 18:$e!==null&&(Ot?(e=$e,n=n.stateNode,e.nodeType===8?Ya(e.parentNode,n):e.nodeType===1&&Ya(e,n),qo(e)):Ya($e,n.stateNode));break;case 4:r=$e,o=Ot,$e=n.stateNode.containerInfo,Ot=!0,gn(e,t,n),$e=r,Ot=o;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&fu(n,t,l),o=o.next}while(o!==r)}gn(e,t,n);break;case 1:if(!Ke&&(Fr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){xe(n,t,a)}gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,gn(e,t,n),Ke=r):gn(e,t,n);break;default:gn(e,t,n)}}function Sd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new U1),t.forEach(function(r){var o=J1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function zt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=Pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*W1(r/1960))-r,10e?16:e,Pn===null)var r=!1;else{if(e=Pn,Pn=null,Fl=0,ee&6)throw Error(z(331));var o=ee;for(ee|=4,I=e.current;I!==null;){var i=I,l=i.child;if(I.flags&16){var a=i.deletions;if(a!==null){for(var s=0;sPe()-Mc?lr(e,0):Tc|=n),rt(e,t)}function Wm(e,t){t===0&&(e.mode&1?(t=Oi,Oi<<=1,!(Oi&130023424)&&(Oi=4194304)):t=1);var n=Xe();e=fn(e,t),e!==null&&(mi(e,t,n),rt(e,n))}function X1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wm(e,n)}function J1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Wm(e,n)}var Vm;Vm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)et=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return et=!1,A1(e,t,n);et=!!(e.flags&131072)}else et=!1,me&&t.flags&1048576&&Gh(t,Nl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ol(e,t),e=t.pendingProps;var o=Zr(t,Qe.current);Qr(t,n),o=Ec(null,t,r,e,o,n);var i=kc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,nt(r)?(i=!0,Tl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,vc(t),o.updater=ia,t.stateNode=o,o._reactInternals=t,ou(t,r,e,n),t=au(null,t,r,!0,i,n)):(t.tag=0,me&&i&&cc(t),Ye(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ol(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=q1(r),e=Lt(r,e),o){case 0:t=lu(null,t,r,e,n);break e;case 1:t=md(null,t,r,e,n);break e;case 11:t=pd(null,t,r,e,n);break e;case 14:t=hd(null,t,r,Lt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),lu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),md(e,t,r,o,n);case 3:e:{if(Tm(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Zh(e,t),Ll(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=no(Error(z(423)),t),t=yd(e,t,r,n,o);break e}else if(r!==o){o=no(Error(z(424)),t),t=yd(e,t,r,n,o);break e}else for(at=Nn(t.stateNode.containerInfo.firstChild),ct=t,me=!0,It=null,n=nm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qr(),r===o){t=dn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return rm(t),e===null&&tu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Xs(r,o)?l=null:i!==null&&Xs(r,i)&&(t.flags|=32),Rm(e,t),Ye(e,t,l,n),t.child;case 6:return e===null&&tu(t),null;case 13:return Mm(e,t,n);case 4:return gc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=eo(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),pd(e,t,r,o,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,se(zl,r._currentValue),r._currentValue=l,i!==null)if(Bt(i.value,l)){if(i.children===o.children&&!tt.current){t=dn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=ln(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?s.next=s:(s.next=c.next,c.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),nu(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(z(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),nu(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Ye(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Qr(t,n),o=Rt(o),r=r(o),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,o=Lt(r,t.pendingProps),o=Lt(r.type,o),hd(e,t,r,o,n);case 15:return Cm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lt(r,o),ol(e,t),t.tag=1,nt(r)?(e=!0,Tl(t)):e=!1,Qr(t,n),em(t,r,o),ou(t,r,o,n),au(null,t,r,!0,e,n);case 19:return Nm(e,t,n);case 22:return Pm(e,t,n)}throw Error(z(156,t.tag))};function Km(e,t){return gh(e,t)}function Z1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,n,r){return new Z1(e,t,n,r)}function Lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function q1(e){if(typeof e=="function")return Lc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zu)return 11;if(e===qu)return 14}return 2}function On(e,t){var n=e.alternate;return n===null?(n=_t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function al(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")Lc(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Nr:return ar(n.children,o,i,t);case Ju:l=8,o|=8;break;case Ts:return e=_t(12,n,t,o|2),e.elementType=Ts,e.lanes=i,e;case Ms:return e=_t(13,n,t,o),e.elementType=Ms,e.lanes=i,e;case Ns:return e=_t(19,n,t,o),e.elementType=Ns,e.lanes=i,e;case th:return ua(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qp:l=10;break e;case eh:l=9;break e;case Zu:l=11;break e;case qu:l=14;break e;case Sn:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=_t(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ar(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function ua(e,t,n,r){return e=_t(22,e,r,t),e.elementType=th,e.lanes=n,e.stateNode={isHidden:!1},e}function rs(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function os(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ew(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Aa(0),this.expirationTimes=Aa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Aa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Oc(e,t,n,r,o,i,l,a,s){return e=new ew(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=_t(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vc(i),e}function tw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xm)}catch(e){console.error(e)}}Xm(),Gp.exports=mt;var ha=Gp.exports;const Jm=dp(ha),lw=fp({__proto__:null,default:Jm},[ha]);/** * @remix-run/router v1.14.1 * * Copyright (c) Remix Software Inc. @@ -46,8 +46,8 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function bn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sw(){return Math.random().toString(36).substr(2,8)}function Md(e,t){return{usr:e.state,key:e.key,idx:t}}function fi(e,t,n,r){return n===void 0&&(n=null),Ee({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jt(t):t,{state:n,key:t&&t.key||r||sw()})}function mr(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Jt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function uw(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,a=Ce.Pop,s=null,u=c();u==null&&(u=0,l.replaceState(Ee({},l.state,{idx:u}),""));function c(){return(l.state||{idx:null}).idx}function f(){a=Ce.Pop;let S=c(),h=S==null?null:S-u;u=S,s&&s({action:a,location:w.location,delta:h})}function d(S,h){a=Ce.Push;let p=fi(w.location,S,h);n&&n(p,S),u=c()+1;let m=Md(p,u),k=w.createHref(p);try{l.pushState(m,"",k)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(k)}i&&s&&s({action:a,location:w.location,delta:1})}function g(S,h){a=Ce.Replace;let p=fi(w.location,S,h);n&&n(p,S),u=c();let m=Md(p,u),k=w.createHref(p);l.replaceState(m,"",k),i&&s&&s({action:a,location:w.location,delta:0})}function y(S){let h=o.location.origin!=="null"?o.location.origin:o.location.href,p=typeof S=="string"?S:mr(S);return Q(h,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,h)}let w={get action(){return a},get location(){return e(o,l)},listen(S){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(Td,f),s=S,()=>{o.removeEventListener(Td,f),s=null}},createHref(S){return t(o,S)},createURL:y,encodeLocation(S){let h=y(S);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:d,replace:g,go(S){return l.go(S)}};return w}var Se;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Se||(Se={}));const cw=new Set(["lazy","caseSensitive","path","id","index","children"]);function fw(e){return e.index===!0}function wu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let l=[...n,i],a=typeof o.id=="string"?o.id:l.join("-");if(Q(o.index!==!0||!o.children,"Cannot specify children on an index route"),Q(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),fw(o)){let s=Ee({},o,t(o),{id:a});return r[a]=s,s}else{let s=Ee({},o,t(o),{id:a,children:void 0});return r[a]=s,o.children&&(s.children=wu(o.children,t,l,r)),s}})}function $r(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Jt(t):t,o=An(r.pathname||"/",n);if(o==null)return null;let i=qm(e);pw(i);let l=null;for(let a=0;l==null&&a{let s={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};s.relativePath.startsWith("/")&&(Q(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=an([r,s.relativePath]),c=n.concat(s);i.children&&i.children.length>0&&(Q(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),qm(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Sw(u,i.index),routesMeta:c})};return e.forEach((i,l)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,l);else for(let s of Zm(i.path))o(i,l,s)}),t}function Zm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=Zm(r.join("/")),a=[];return a.push(...l.map(s=>s===""?i:[i,s].join("/"))),o&&a.push(...l),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function pw(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xw(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const hw=/^:\w+$/,mw=3,yw=2,vw=1,gw=10,ww=-2,Nd=e=>e==="*";function Sw(e,t){let n=e.split("/"),r=n.length;return n.some(Nd)&&(r+=ww),t&&(r+=yw),n.filter(o=>!Nd(o)).reduce((o,i)=>o+(hw.test(i)?mw:i===""?vw:gw),r)}function xw(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Ew(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let l=0;l{let{paramName:d,isOptional:g}=c;if(d==="*"){let w=a[f]||"";l=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const y=a[f];return g&&!y?u[d]=void 0:u[d]=Cw(y||"",d),u},{}),pathname:i,pathnameBase:l,pattern:e}}function kw(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),bn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(l,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function _w(e){try{return decodeURI(e)}catch(t){return bn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Cw(e,t){try{return decodeURIComponent(e)}catch(n){return bn(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function An(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Pw(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Jt(e):e;return{pathname:n?n.startsWith("/")?n:Rw(n,t):t,search:Mw(r),hash:Nw(o)}}function Rw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function is(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function ey(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ac(e,t){let n=ey(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Fc(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Jt(e):(o=Ee({},e),Q(!o.pathname||!o.pathname.includes("?"),is("?","pathname","search",o)),Q(!o.pathname||!o.pathname.includes("#"),is("#","pathname","hash",o)),Q(!o.search||!o.search.includes("#"),is("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,a;if(l==null)a=n;else{let f=t.length-1;if(!r&&l.startsWith("..")){let d=l.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}a=f>=0?t[f]:"/"}let s=Pw(o,a),u=l&&l!=="/"&&l.endsWith("/"),c=(i||l===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}const an=e=>e.join("/").replace(/\/\/+/g,"/"),Tw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Mw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class $c{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ty(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ny=["post","put","patch","delete"],zw=new Set(ny),jw=["get",...ny],Lw=new Set(jw),Ow=new Set([301,302,303,307,308]),Dw=new Set([307,308]),ls={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Iw={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Eo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bw=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),oy="remix-router-transitions";function Aw(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Q(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let x=e.detectErrorBoundary;o=C=>({hasErrorBoundary:x(C)})}else o=bw;let i={},l=wu(e.routes,o,void 0,i),a,s=e.basename||"/",u=Ee({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),c=null,f=new Set,d=null,g=null,y=null,w=e.hydrationData!=null,S=$r(l,e.history.location,s),h=null;if(S==null){let x=xt(404,{pathname:e.history.location.pathname}),{matches:C,route:T}=Ad(l);S=C,h={[T.id]:x}}let p,m=S.some(x=>x.route.lazy),k=S.some(x=>x.route.loader);if(m)p=!1;else if(!k)p=!0;else if(u.v7_partialHydration){let x=e.hydrationData?e.hydrationData.loaderData:null,C=e.hydrationData?e.hydrationData.errors:null;p=S.every(T=>T.route.loader&&T.route.loader.hydrate!==!0&&(x&&x[T.route.id]!==void 0||C&&C[T.route.id]!==void 0))}else p=e.hydrationData!=null;let P,v={historyAction:e.history.action,location:e.history.location,matches:S,initialized:p,navigation:ls,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||h,fetchers:new Map,blockers:new Map},R=Ce.Pop,N=!1,L,F=!1,G=new Map,re=null,q=!1,te=!1,de=[],ke=[],ne=new Map,M=0,b=-1,A=new Map,V=new Set,Z=new Map,ie=new Map,_e=new Set,ze=new Map,be=new Map,Mt=!1;function ki(){if(c=e.history.listen(x=>{let{action:C,location:T,delta:O}=x;if(Mt){Mt=!1;return}bn(be.size===0||O!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let $=Yc({currentLocation:v.location,nextLocation:T,historyAction:C});if($&&O!=null){Mt=!0,e.history.go(O*-1),xr($,{state:"blocked",location:T,proceed(){xr($,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),e.history.go(O)},reset(){let Y=new Map(v.blockers);Y.set($,Eo),Ge({blockers:Y})}});return}return Zt(C,T)}),n){Yw(t,G);let x=()=>Xw(t,G);t.addEventListener("pagehide",x),re=()=>t.removeEventListener("pagehide",x)}return v.initialized||Zt(Ce.Pop,v.location,{initialHydration:!0}),P}function hn(){c&&c(),re&&re(),f.clear(),L&&L.abort(),v.fetchers.forEach((x,C)=>ot(C)),v.blockers.forEach((x,C)=>Kn(C))}function va(x){return f.add(x),()=>f.delete(x)}function Ge(x,C){C===void 0&&(C={}),v=Ee({},v,x);let T=[],O=[];u.v7_fetcherPersist&&v.fetchers.forEach(($,Y)=>{$.state==="idle"&&(_e.has(Y)?O.push(Y):T.push(Y))}),[...f].forEach($=>$(v,{deletedFetchers:O,unstable_viewTransitionOpts:C.viewTransitionOpts,unstable_flushSync:C.flushSync===!0})),u.v7_fetcherPersist&&(T.forEach($=>v.fetchers.delete($)),O.forEach($=>ot($)))}function He(x,C,T){var O,$;let{flushSync:Y}=T===void 0?{}:T,W=v.actionData!=null&&v.navigation.formMethod!=null&&Dt(v.navigation.formMethod)&&v.navigation.state==="loading"&&((O=x.state)==null?void 0:O._isRedirect)!==!0,H;C.actionData?Object.keys(C.actionData).length>0?H=C.actionData:H=null:W?H=v.actionData:H=null;let U=C.loaderData?bd(v.loaderData,C.loaderData,C.matches||[],C.errors):v.loaderData,J=v.blockers;J.size>0&&(J=new Map(J),J.forEach((ae,Ae)=>J.set(Ae,Eo)));let je=N===!0||v.navigation.formMethod!=null&&Dt(v.navigation.formMethod)&&(($=x.state)==null?void 0:$._isRedirect)!==!0;a&&(l=a,a=void 0),q||R===Ce.Pop||(R===Ce.Push?e.history.push(x,x.state):R===Ce.Replace&&e.history.replace(x,x.state));let K;if(R===Ce.Pop){let ae=G.get(v.location.pathname);ae&&ae.has(x.pathname)?K={currentLocation:v.location,nextLocation:x}:G.has(x.pathname)&&(K={currentLocation:x,nextLocation:v.location})}else if(F){let ae=G.get(v.location.pathname);ae?ae.add(x.pathname):(ae=new Set([x.pathname]),G.set(v.location.pathname,ae)),K={currentLocation:v.location,nextLocation:x}}Ge(Ee({},C,{actionData:H,loaderData:U,historyAction:R,location:x,initialized:!0,navigation:ls,revalidation:"idle",restoreScrollPosition:Jc(x,C.matches||v.matches),preventScrollReset:je,blockers:J}),{viewTransitionOpts:K,flushSync:Y===!0}),R=Ce.Pop,N=!1,F=!1,q=!1,te=!1,de=[],ke=[]}async function qt(x,C){if(typeof x=="number"){e.history.go(x);return}let T=xu(v.location,v.matches,s,u.v7_prependBasename,x,u.v7_relativeSplatPath,C==null?void 0:C.fromRouteId,C==null?void 0:C.relative),{path:O,submission:$,error:Y}=zd(u.v7_normalizeFormMethod,!1,T,C),W=v.location,H=fi(v.location,O,C&&C.state);H=Ee({},H,e.history.encodeLocation(H));let U=C&&C.replace!=null?C.replace:void 0,J=Ce.Push;U===!0?J=Ce.Replace:U===!1||$!=null&&Dt($.formMethod)&&$.formAction===v.location.pathname+v.location.search&&(J=Ce.Replace);let je=C&&"preventScrollReset"in C?C.preventScrollReset===!0:void 0,K=(C&&C.unstable_flushSync)===!0,ae=Yc({currentLocation:W,nextLocation:H,historyAction:J});if(ae){xr(ae,{state:"blocked",location:H,proceed(){xr(ae,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),qt(x,C)},reset(){let Ae=new Map(v.blockers);Ae.set(ae,Eo),Ge({blockers:Ae})}});return}return await Zt(J,H,{submission:$,pendingError:Y,preventScrollReset:je,replace:C&&C.replace,enableViewTransition:C&&C.unstable_viewTransition,flushSync:K})}function ga(){if(po(),Ge({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){Zt(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}Zt(R||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation})}}async function Zt(x,C,T){L&&L.abort(),L=null,R=x,q=(T&&T.startUninterruptedRevalidation)===!0,Ay(v.location,v.matches),N=(T&&T.preventScrollReset)===!0,F=(T&&T.enableViewTransition)===!0;let O=a||l,$=T&&T.overrideNavigation,Y=$r(O,C,s),W=(T&&T.flushSync)===!0;if(!Y){let Ae=xt(404,{pathname:C.pathname}),{matches:St,route:Le}=Ad(O);Sa(),He(C,{matches:St,loaderData:{},errors:{[Le.id]:Ae}},{flushSync:W});return}if(v.initialized&&!te&&Hw(v.location,C)&&!(T&&T.submission&&Dt(T.submission.formMethod))){He(C,{matches:Y},{flushSync:W});return}L=new AbortController;let H=_o(e.history,C,L.signal,T&&T.submission),U,J;if(T&&T.pendingError)J={[Uo(Y).route.id]:T.pendingError};else if(T&&T.submission&&Dt(T.submission.formMethod)){let Ae=await wr(H,C,T.submission,Y,{replace:T.replace,flushSync:W});if(Ae.shortCircuited)return;U=Ae.pendingActionData,J=Ae.pendingActionError,$=as(C,T.submission),W=!1,H=new Request(H.url,{signal:H.signal})}let{shortCircuited:je,loaderData:K,errors:ae}=await uo(H,C,Y,$,T&&T.submission,T&&T.fetcherSubmission,T&&T.replace,T&&T.initialHydration===!0,W,U,J);je||(L=null,He(C,Ee({matches:Y},U?{actionData:U}:{},{loaderData:K,errors:ae})))}async function wr(x,C,T,O,$){$===void 0&&($={}),po();let Y=Qw(C,T);Ge({navigation:Y},{flushSync:$.flushSync===!0});let W,H=ku(O,C);if(!H.route.action&&!H.route.lazy)W={type:Se.error,error:xt(405,{method:x.method,pathname:C.pathname,routeId:H.route.id})};else if(W=await ko("action",x,H,O,i,o,s,u.v7_relativeSplatPath),x.signal.aborted)return{shortCircuited:!0};if(rr(W)){let U;return $&&$.replace!=null?U=$.replace:U=W.location===v.location.pathname+v.location.search,await gt(v,W,{submission:T,replace:U}),{shortCircuited:!0}}if(Ur(W)){let U=Uo(O,H.route.id);return($&&$.replace)!==!0&&(R=Ce.Push),{pendingActionData:{},pendingActionError:{[U.route.id]:W.error}}}if(nr(W))throw xt(400,{type:"defer-action"});return{pendingActionData:{[H.route.id]:W.data}}}async function uo(x,C,T,O,$,Y,W,H,U,J,je){let K=O||as(C,$),ae=$||Y||Ud(K),Ae=a||l,[St,Le]=jd(e.history,v,T,ae,C,u.v7_partialHydration&&H===!0,te,de,ke,_e,Z,V,Ae,s,J,je);if(Sa(le=>!(T&&T.some(he=>he.route.id===le))||St&&St.some(he=>he.route.id===le)),b=++M,St.length===0&&Le.length===0){let le=ye();return He(C,Ee({matches:T,loaderData:{},errors:je||null},J?{actionData:J}:{},le?{fetchers:new Map(v.fetchers)}:{}),{flushSync:U}),{shortCircuited:!0}}if(!q&&(!u.v7_partialHydration||!H)){Le.forEach(he=>{let Ht=v.fetchers.get(he.key),Pi=Co(void 0,Ht?Ht.data:void 0);v.fetchers.set(he.key,Pi)});let le=J||v.actionData;Ge(Ee({navigation:K},le?Object.keys(le).length===0?{actionData:null}:{actionData:le}:{},Le.length>0?{fetchers:new Map(v.fetchers)}:{}),{flushSync:U})}Le.forEach(le=>{ne.has(le.key)&&B(le.key),le.controller&&ne.set(le.key,le.controller)});let Er=()=>Le.forEach(le=>B(le.key));L&&L.signal.addEventListener("abort",Er);let{results:xa,loaderResults:kr,fetcherResults:yn}=await fo(v.matches,T,St,Le,x);if(x.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",Er),Le.forEach(le=>ne.delete(le.key));let Qn=Fd(xa);if(Qn){if(Qn.idx>=St.length){let le=Le[Qn.idx-St.length].key;V.add(le)}return await gt(v,Qn.result,{replace:W}),{shortCircuited:!0}}let{loaderData:Ea,errors:ka}=Id(v,T,St,kr,je,Le,yn,ze);ze.forEach((le,he)=>{le.subscribe(Ht=>{(Ht||le.done)&&ze.delete(he)})});let _a=ye(),_r=it(b),Ci=_a||_r||Le.length>0;return Ee({loaderData:Ea,errors:ka},Ci?{fetchers:new Map(v.fetchers)}:{})}function co(x,C,T,O){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ne.has(x)&&B(x);let $=(O&&O.unstable_flushSync)===!0,Y=a||l,W=xu(v.location,v.matches,s,u.v7_prependBasename,T,u.v7_relativeSplatPath,C,O==null?void 0:O.relative),H=$r(Y,W,s);if(!H){Vn(x,C,xt(404,{pathname:W}),{flushSync:$});return}let{path:U,submission:J,error:je}=zd(u.v7_normalizeFormMethod,!0,W,O);if(je){Vn(x,C,je,{flushSync:$});return}let K=ku(H,U);if(N=(O&&O.preventScrollReset)===!0,J&&Dt(J.formMethod)){mn(x,C,U,K,H,$,J);return}Z.set(x,{routeId:C,path:U}),_i(x,C,U,K,H,$,J)}async function mn(x,C,T,O,$,Y,W){if(po(),Z.delete(x),!O.route.action&&!O.route.lazy){let he=xt(405,{method:W.formMethod,pathname:T,routeId:C});Vn(x,C,he,{flushSync:Y});return}let H=v.fetchers.get(x);Nt(x,Gw(W,H),{flushSync:Y});let U=new AbortController,J=_o(e.history,T,U.signal,W);ne.set(x,U);let je=M,K=await ko("action",J,O,$,i,o,s,u.v7_relativeSplatPath);if(J.signal.aborted){ne.get(x)===U&&ne.delete(x);return}if(u.v7_fetcherPersist&&_e.has(x)){if(rr(K)||Ur(K)){Nt(x,gn(void 0));return}}else{if(rr(K))if(ne.delete(x),b>je){Nt(x,gn(void 0));return}else return V.add(x),Nt(x,Co(W)),gt(v,K,{fetcherSubmission:W});if(Ur(K)){Vn(x,C,K.error);return}}if(nr(K))throw xt(400,{type:"defer-action"});let ae=v.navigation.location||v.location,Ae=_o(e.history,ae,U.signal),St=a||l,Le=v.navigation.state!=="idle"?$r(St,v.navigation.location,s):v.matches;Q(Le,"Didn't find any matches after fetcher action");let Er=++M;A.set(x,Er);let xa=Co(W,K.data);v.fetchers.set(x,xa);let[kr,yn]=jd(e.history,v,Le,W,ae,!1,te,de,ke,_e,Z,V,St,s,{[O.route.id]:K.data},void 0);yn.filter(he=>he.key!==x).forEach(he=>{let Ht=he.key,Pi=v.fetchers.get(Ht),$y=Co(void 0,Pi?Pi.data:void 0);v.fetchers.set(Ht,$y),ne.has(Ht)&&B(Ht),he.controller&&ne.set(Ht,he.controller)}),Ge({fetchers:new Map(v.fetchers)});let Qn=()=>yn.forEach(he=>B(he.key));U.signal.addEventListener("abort",Qn);let{results:Ea,loaderResults:ka,fetcherResults:_a}=await fo(v.matches,Le,kr,yn,Ae);if(U.signal.aborted)return;U.signal.removeEventListener("abort",Qn),A.delete(x),ne.delete(x),yn.forEach(he=>ne.delete(he.key));let _r=Fd(Ea);if(_r){if(_r.idx>=kr.length){let he=yn[_r.idx-kr.length].key;V.add(he)}return gt(v,_r.result)}let{loaderData:Ci,errors:le}=Id(v,v.matches,kr,ka,void 0,yn,_a,ze);if(v.fetchers.has(x)){let he=gn(K.data);v.fetchers.set(x,he)}it(Er),v.navigation.state==="loading"&&Er>b?(Q(R,"Expected pending action"),L&&L.abort(),He(v.navigation.location,{matches:Le,loaderData:Ci,errors:le,fetchers:new Map(v.fetchers)})):(Ge({errors:le,loaderData:bd(v.loaderData,Ci,Le,le),fetchers:new Map(v.fetchers)}),te=!1)}async function _i(x,C,T,O,$,Y,W){let H=v.fetchers.get(x);Nt(x,Co(W,H?H.data:void 0),{flushSync:Y});let U=new AbortController,J=_o(e.history,T,U.signal);ne.set(x,U);let je=M,K=await ko("loader",J,O,$,i,o,s,u.v7_relativeSplatPath);if(nr(K)&&(K=await ay(K,J.signal,!0)||K),ne.get(x)===U&&ne.delete(x),!J.signal.aborted){if(_e.has(x)){Nt(x,gn(void 0));return}if(rr(K))if(b>je){Nt(x,gn(void 0));return}else{V.add(x),await gt(v,K);return}if(Ur(K)){Vn(x,C,K.error);return}Q(!nr(K),"Unhandled fetcher deferred data"),Nt(x,gn(K.data))}}async function gt(x,C,T){let{submission:O,fetcherSubmission:$,replace:Y}=T===void 0?{}:T;C.revalidate&&(te=!0);let W=fi(x.location,C.location,{_isRedirect:!0});if(Q(W,"Expected a location on the redirect navigation"),n){let ae=!1;if(C.reloadDocument)ae=!0;else if(ry.test(C.location)){const Ae=e.history.createURL(C.location);ae=Ae.origin!==t.location.origin||An(Ae.pathname,s)==null}if(ae){Y?t.location.replace(C.location):t.location.assign(C.location);return}}L=null;let H=Y===!0?Ce.Replace:Ce.Push,{formMethod:U,formAction:J,formEncType:je}=x.navigation;!O&&!$&&U&&J&&je&&(O=Ud(x.navigation));let K=O||$;if(Dw.has(C.status)&&K&&Dt(K.formMethod))await Zt(H,W,{submission:Ee({},K,{formAction:C.location}),preventScrollReset:N});else{let ae=as(W,O);await Zt(H,W,{overrideNavigation:ae,fetcherSubmission:$,preventScrollReset:N})}}async function fo(x,C,T,O,$){let Y=await Promise.all([...T.map(U=>ko("loader",$,U,C,i,o,s,u.v7_relativeSplatPath)),...O.map(U=>U.matches&&U.match&&U.controller?ko("loader",_o(e.history,U.path,U.controller.signal),U.match,U.matches,i,o,s,u.v7_relativeSplatPath):{type:Se.error,error:xt(404,{pathname:U.path})})]),W=Y.slice(0,T.length),H=Y.slice(T.length);return await Promise.all([$d(x,T,W,W.map(()=>$.signal),!1,v.loaderData),$d(x,O.map(U=>U.match),H,O.map(U=>U.controller?U.controller.signal:null),!0)]),{results:Y,loaderResults:W,fetcherResults:H}}function po(){te=!0,de.push(...Sa()),Z.forEach((x,C)=>{ne.has(C)&&(ke.push(C),B(C))})}function Nt(x,C,T){T===void 0&&(T={}),v.fetchers.set(x,C),Ge({fetchers:new Map(v.fetchers)},{flushSync:(T&&T.flushSync)===!0})}function Vn(x,C,T,O){O===void 0&&(O={});let $=Uo(v.matches,C);ot(x),Ge({errors:{[$.route.id]:T},fetchers:new Map(v.fetchers)},{flushSync:(O&&O.flushSync)===!0})}function Sr(x){return u.v7_fetcherPersist&&(ie.set(x,(ie.get(x)||0)+1),_e.has(x)&&_e.delete(x)),v.fetchers.get(x)||Iw}function ot(x){let C=v.fetchers.get(x);ne.has(x)&&!(C&&C.state==="loading"&&A.has(x))&&B(x),Z.delete(x),A.delete(x),V.delete(x),_e.delete(x),v.fetchers.delete(x)}function wa(x){if(u.v7_fetcherPersist){let C=(ie.get(x)||0)-1;C<=0?(ie.delete(x),_e.add(x)):ie.set(x,C)}else ot(x);Ge({fetchers:new Map(v.fetchers)})}function B(x){let C=ne.get(x);Q(C,"Expected fetch controller: "+x),C.abort(),ne.delete(x)}function pe(x){for(let C of x){let T=Sr(C),O=gn(T.data);v.fetchers.set(C,O)}}function ye(){let x=[],C=!1;for(let T of V){let O=v.fetchers.get(T);Q(O,"Expected fetcher: "+T),O.state==="loading"&&(V.delete(T),x.push(T),C=!0)}return pe(x),C}function it(x){let C=[];for(let[T,O]of A)if(O0}function wt(x,C){let T=v.blockers.get(x)||Eo;return be.get(x)!==C&&be.set(x,C),T}function Kn(x){v.blockers.delete(x),be.delete(x)}function xr(x,C){let T=v.blockers.get(x)||Eo;Q(T.state==="unblocked"&&C.state==="blocked"||T.state==="blocked"&&C.state==="blocked"||T.state==="blocked"&&C.state==="proceeding"||T.state==="blocked"&&C.state==="unblocked"||T.state==="proceeding"&&C.state==="unblocked","Invalid blocker state transition: "+T.state+" -> "+C.state);let O=new Map(v.blockers);O.set(x,C),Ge({blockers:O})}function Yc(x){let{currentLocation:C,nextLocation:T,historyAction:O}=x;if(be.size===0)return;be.size>1&&bn(!1,"A router only supports one blocker at a time");let $=Array.from(be.entries()),[Y,W]=$[$.length-1],H=v.blockers.get(Y);if(!(H&&H.state==="proceeding")&&W({currentLocation:C,nextLocation:T,historyAction:O}))return Y}function Sa(x){let C=[];return ze.forEach((T,O)=>{(!x||x(O))&&(T.cancel(),C.push(O),ze.delete(O))}),C}function by(x,C,T){if(d=x,y=C,g=T||null,!w&&v.navigation===ls){w=!0;let O=Jc(v.location,v.matches);O!=null&&Ge({restoreScrollPosition:O})}return()=>{d=null,y=null,g=null}}function Xc(x,C){return g&&g(x,C.map(O=>dw(O,v.loaderData)))||x.key}function Ay(x,C){if(d&&y){let T=Xc(x,C);d[T]=y()}}function Jc(x,C){if(d){let T=Xc(x,C),O=d[T];if(typeof O=="number")return O}return null}function Fy(x){i={},a=wu(x,o,void 0,i)}return P={get basename(){return s},get future(){return u},get state(){return v},get routes(){return l},get window(){return t},initialize:ki,subscribe:va,enableScrollRestoration:by,navigate:qt,fetch:co,revalidate:ga,createHref:x=>e.history.createHref(x),encodeLocation:x=>e.history.encodeLocation(x),getFetcher:Sr,deleteFetcher:wa,dispose:hn,getBlocker:wt,deleteBlocker:Kn,_internalFetchControllers:ne,_internalActiveDeferreds:ze,_internalSetRoutes:Fy},P}function Fw(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xu(e,t,n,r,o,i,l,a){let s,u;if(l){s=[];for(let f of t)if(s.push(f),f.route.id===l){u=f;break}}else s=t,u=t[t.length-1];let c=Fc(o||".",Ac(s,i),An(e.pathname,n)||e.pathname,a==="path");return o==null&&(c.search=e.search,c.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!Uc(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:an([n,c.pathname])),mr(c)}function zd(e,t,n,r){if(!r||!Fw(r))return{path:n};if(r.formMethod&&!Kw(r.formMethod))return{path:n,error:xt(405,{method:r.formMethod})};let o=()=>({path:n,error:xt(400,{type:"invalid-body"})}),i=r.formMethod||"get",l=e?i.toUpperCase():i.toLowerCase(),a=ly(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Dt(l))return o();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[w,S]=y;return""+g+w+"="+S+` -`},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!Dt(l))return o();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:a,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return o()}}}Q(typeof FormData=="function","FormData is not available in this environment");let s,u;if(r.formData)s=Eu(r.formData),u=r.formData;else if(r.body instanceof FormData)s=Eu(r.body),u=r.body;else if(r.body instanceof URLSearchParams)s=r.body,u=Dd(s);else if(r.body==null)s=new URLSearchParams,u=new FormData;else try{s=new URLSearchParams(r.body),u=Dd(s)}catch{return o()}let c={formMethod:l,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Dt(c.formMethod))return{path:n,submission:c};let f=Jt(n);return t&&f.search&&Uc(f.search)&&s.append("index",""),f.search="?"+s,{path:mr(f),submission:c}}function $w(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function jd(e,t,n,r,o,i,l,a,s,u,c,f,d,g,y,w){let S=w?Object.values(w)[0]:y?Object.values(y)[0]:void 0,h=e.createURL(t.location),p=e.createURL(o),m=w?Object.keys(w)[0]:void 0,P=$w(n,m).filter((R,N)=>{let{route:L}=R;if(L.lazy)return!0;if(L.loader==null)return!1;if(i)return L.loader.hydrate?!0:t.loaderData[L.id]===void 0&&(!t.errors||t.errors[L.id]===void 0);if(Uw(t.loaderData,t.matches[N],R)||a.some(re=>re===R.route.id))return!0;let F=t.matches[N],G=R;return Ld(R,Ee({currentUrl:h,currentParams:F.params,nextUrl:p,nextParams:G.params},r,{actionResult:S,defaultShouldRevalidate:l||h.pathname+h.search===p.pathname+p.search||h.search!==p.search||iy(F,G)}))}),v=[];return c.forEach((R,N)=>{if(i||!n.some(q=>q.route.id===R.routeId)||u.has(N))return;let L=$r(d,R.path,g);if(!L){v.push({key:N,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let F=t.fetchers.get(N),G=ku(L,R.path),re=!1;f.has(N)?re=!1:s.includes(N)?re=!0:F&&F.state!=="idle"&&F.data===void 0?re=l:re=Ld(G,Ee({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:n[n.length-1].params},r,{actionResult:S,defaultShouldRevalidate:l})),re&&v.push({key:N,routeId:R.routeId,path:R.path,matches:L,match:G,controller:new AbortController})}),[P,v]}function Uw(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function iy(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ld(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Od(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Q(o,"No route found in manifest");let i={};for(let l in r){let s=o[l]!==void 0&&l!=="hasErrorBoundary";bn(!s,'Route "'+o.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!s&&!cw.has(l)&&(i[l]=r[l])}Object.assign(o,i),Object.assign(o,Ee({},t(o),{lazy:void 0}))}async function ko(e,t,n,r,o,i,l,a,s){s===void 0&&(s={});let u,c,f,d=w=>{let S,h=new Promise((p,m)=>S=m);return f=()=>S(),t.signal.addEventListener("abort",f),Promise.race([w({request:t,params:n.params,context:s.requestContext}),h])};try{let w=n.route[e];if(n.route.lazy)if(w){let S,h=await Promise.all([d(w).catch(p=>{S=p}),Od(n.route,i,o)]);if(S)throw S;c=h[0]}else if(await Od(n.route,i,o),w=n.route[e],w)c=await d(w);else if(e==="action"){let S=new URL(t.url),h=S.pathname+S.search;throw xt(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:Se.data,data:void 0};else if(w)c=await d(w);else{let S=new URL(t.url),h=S.pathname+S.search;throw xt(404,{pathname:h})}Q(c!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(w){u=Se.error,c=w}finally{f&&t.signal.removeEventListener("abort",f)}if(Vw(c)){let w=c.status;if(Ow.has(w)){let h=c.headers.get("Location");if(Q(h,"Redirects returned/thrown from loaders/actions must have a Location header"),!ry.test(h))h=xu(new URL(t.url),r.slice(0,r.indexOf(n)+1),l,!0,h,a);else if(!s.isStaticRequest){let p=new URL(t.url),m=h.startsWith("//")?new URL(p.protocol+h):new URL(h),k=An(m.pathname,l)!=null;m.origin===p.origin&&k&&(h=m.pathname+m.search+m.hash)}if(s.isStaticRequest)throw c.headers.set("Location",h),c;return{type:Se.redirect,status:w,location:h,revalidate:c.headers.get("X-Remix-Revalidate")!==null,reloadDocument:c.headers.get("X-Remix-Reload-Document")!==null}}if(s.isRouteRequest)throw{type:u===Se.error?Se.error:Se.data,response:c};let S;try{let h=c.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?S=await c.json():S=await c.text()}catch(h){return{type:Se.error,error:h}}return u===Se.error?{type:u,error:new $c(w,c.statusText,S),headers:c.headers}:{type:Se.data,data:S,statusCode:c.status,headers:c.headers}}if(u===Se.error)return{type:u,error:c};if(Ww(c)){var g,y;return{type:Se.deferred,deferredData:c,statusCode:(g=c.init)==null?void 0:g.status,headers:((y=c.init)==null?void 0:y.headers)&&new Headers(c.init.headers)}}return{type:Se.data,data:c}}function _o(e,t,n,r){let o=e.createURL(ly(t)).toString(),i={signal:n};if(r&&Dt(r.formMethod)){let{formMethod:l,formEncType:a}=r;i.method=l.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=Eu(r.formData):i.body=r.formData}return new Request(o,i)}function Eu(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Dd(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Bw(e,t,n,r,o){let i={},l=null,a,s=!1,u={};return n.forEach((c,f)=>{let d=t[f].route.id;if(Q(!rr(c),"Cannot handle redirect results in processLoaderData"),Ur(c)){let g=Uo(e,d),y=c.error;r&&(y=Object.values(r)[0],r=void 0),l=l||{},l[g.route.id]==null&&(l[g.route.id]=y),i[d]=void 0,s||(s=!0,a=ty(c.error)?c.error.status:500),c.headers&&(u[d]=c.headers)}else nr(c)?(o.set(d,c.deferredData),i[d]=c.deferredData.data):i[d]=c.data,c.statusCode!=null&&c.statusCode!==200&&!s&&(a=c.statusCode),c.headers&&(u[d]=c.headers)}),r&&(l=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:l,statusCode:a||200,loaderHeaders:u}}function Id(e,t,n,r,o,i,l,a){let{loaderData:s,errors:u}=Bw(t,n,r,o,a);for(let c=0;cr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Ad(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xt(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,l="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(l="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(l="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",a='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new $c(e||500,l,new Error(a),!0)}function Fd(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(rr(n))return{result:n,idx:t}}}function ly(e){let t=typeof e=="string"?Jt(e):e;return mr(Ee({},t,{hash:""}))}function Hw(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function nr(e){return e.type===Se.deferred}function Ur(e){return e.type===Se.error}function rr(e){return(e&&e.type)===Se.redirect}function Ww(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Vw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Kw(e){return Lw.has(e.toLowerCase())}function Dt(e){return zw.has(e.toLowerCase())}async function $d(e,t,n,r,o,i){for(let l=0;lf.route.id===s.route.id),c=u!=null&&!iy(u,s)&&(i&&i[s.route.id])!==void 0;if(nr(a)&&(o||c)){let f=r[l];Q(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await ay(a,f,o).then(d=>{d&&(n[l]=d||n[l])})}}}async function ay(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Se.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Se.error,error:o}}return{type:Se.data,data:e.deferredData.data}}}function Uc(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ku(e,t){let n=typeof t=="string"?Jt(t).search:t.search;if(e[e.length-1].route.index&&Uc(n||""))return e[e.length-1];let r=ey(e);return r[r.length-1]}function Ud(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:l}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function as(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qw(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Co(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Gw(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function gn(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Yw(e,t){try{let n=e.sessionStorage.getItem(oy);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function Xw(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(oy,JSON.stringify(n))}catch(r){bn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + */function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function An(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sw(){return Math.random().toString(36).substr(2,8)}function Md(e,t){return{usr:e.state,key:e.key,idx:t}}function fi(e,t,n,r){return n===void 0&&(n=null),Ee({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jt(t):t,{state:n,key:t&&t.key||r||sw()})}function vr(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Jt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function uw(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,a=Ce.Pop,s=null,u=c();u==null&&(u=0,l.replaceState(Ee({},l.state,{idx:u}),""));function c(){return(l.state||{idx:null}).idx}function f(){a=Ce.Pop;let S=c(),h=S==null?null:S-u;u=S,s&&s({action:a,location:w.location,delta:h})}function d(S,h){a=Ce.Push;let p=fi(w.location,S,h);n&&n(p,S),u=c()+1;let m=Md(p,u),k=w.createHref(p);try{l.pushState(m,"",k)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(k)}i&&s&&s({action:a,location:w.location,delta:1})}function g(S,h){a=Ce.Replace;let p=fi(w.location,S,h);n&&n(p,S),u=c();let m=Md(p,u),k=w.createHref(p);l.replaceState(m,"",k),i&&s&&s({action:a,location:w.location,delta:0})}function y(S){let h=o.location.origin!=="null"?o.location.origin:o.location.href,p=typeof S=="string"?S:vr(S);return Q(h,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,h)}let w={get action(){return a},get location(){return e(o,l)},listen(S){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(Td,f),s=S,()=>{o.removeEventListener(Td,f),s=null}},createHref(S){return t(o,S)},createURL:y,encodeLocation(S){let h=y(S);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:d,replace:g,go(S){return l.go(S)}};return w}var Se;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Se||(Se={}));const cw=new Set(["lazy","caseSensitive","path","id","index","children"]);function fw(e){return e.index===!0}function wu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let l=[...n,i],a=typeof o.id=="string"?o.id:l.join("-");if(Q(o.index!==!0||!o.children,"Cannot specify children on an index route"),Q(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),fw(o)){let s=Ee({},o,t(o),{id:a});return r[a]=s,s}else{let s=Ee({},o,t(o),{id:a,children:void 0});return r[a]=s,o.children&&(s.children=wu(o.children,t,l,r)),s}})}function Ur(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Jt(t):t,o=Fn(r.pathname||"/",n);if(o==null)return null;let i=Zm(e);pw(i);let l=null;for(let a=0;l==null&&a{let s={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};s.relativePath.startsWith("/")&&(Q(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=an([r,s.relativePath]),c=n.concat(s);i.children&&i.children.length>0&&(Q(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Zm(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Sw(u,i.index),routesMeta:c})};return e.forEach((i,l)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,l);else for(let s of qm(i.path))o(i,l,s)}),t}function qm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=qm(r.join("/")),a=[];return a.push(...l.map(s=>s===""?i:[i,s].join("/"))),o&&a.push(...l),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function pw(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xw(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const hw=/^:\w+$/,mw=3,yw=2,vw=1,gw=10,ww=-2,Nd=e=>e==="*";function Sw(e,t){let n=e.split("/"),r=n.length;return n.some(Nd)&&(r+=ww),t&&(r+=yw),n.filter(o=>!Nd(o)).reduce((o,i)=>o+(hw.test(i)?mw:i===""?vw:gw),r)}function xw(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Ew(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let l=0;l{let{paramName:d,isOptional:g}=c;if(d==="*"){let w=a[f]||"";l=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const y=a[f];return g&&!y?u[d]=void 0:u[d]=Cw(y||"",d),u},{}),pathname:i,pathnameBase:l,pattern:e}}function kw(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),An(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(l,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function _w(e){try{return decodeURI(e)}catch(t){return An(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Cw(e,t){try{return decodeURIComponent(e)}catch(n){return An(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Fn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Pw(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Jt(e):e;return{pathname:n?n.startsWith("/")?n:Rw(n,t):t,search:Mw(r),hash:Nw(o)}}function Rw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function is(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function ey(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ac(e,t){let n=ey(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Fc(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Jt(e):(o=Ee({},e),Q(!o.pathname||!o.pathname.includes("?"),is("?","pathname","search",o)),Q(!o.pathname||!o.pathname.includes("#"),is("#","pathname","hash",o)),Q(!o.search||!o.search.includes("#"),is("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,a;if(l==null)a=n;else{let f=t.length-1;if(!r&&l.startsWith("..")){let d=l.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}a=f>=0?t[f]:"/"}let s=Pw(o,a),u=l&&l!=="/"&&l.endsWith("/"),c=(i||l===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}const an=e=>e.join("/").replace(/\/\/+/g,"/"),Tw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Mw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class $c{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ty(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ny=["post","put","patch","delete"],zw=new Set(ny),jw=["get",...ny],Lw=new Set(jw),Ow=new Set([301,302,303,307,308]),Dw=new Set([307,308]),ls={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Iw={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Eo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bw=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),oy="remix-router-transitions";function Aw(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Q(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let x=e.detectErrorBoundary;o=C=>({hasErrorBoundary:x(C)})}else o=bw;let i={},l=wu(e.routes,o,void 0,i),a,s=e.basename||"/",u=Ee({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),c=null,f=new Set,d=null,g=null,y=null,w=e.hydrationData!=null,S=Ur(l,e.history.location,s),h=null;if(S==null){let x=xt(404,{pathname:e.history.location.pathname}),{matches:C,route:T}=Ad(l);S=C,h={[T.id]:x}}let p,m=S.some(x=>x.route.lazy),k=S.some(x=>x.route.loader);if(m)p=!1;else if(!k)p=!0;else if(u.v7_partialHydration){let x=e.hydrationData?e.hydrationData.loaderData:null,C=e.hydrationData?e.hydrationData.errors:null;p=S.every(T=>T.route.loader&&T.route.loader.hydrate!==!0&&(x&&x[T.route.id]!==void 0||C&&C[T.route.id]!==void 0))}else p=e.hydrationData!=null;let P,v={historyAction:e.history.action,location:e.history.location,matches:S,initialized:p,navigation:ls,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||h,fetchers:new Map,blockers:new Map},R=Ce.Pop,N=!1,L,F=!1,G=new Map,re=null,Z=!1,te=!1,de=[],ke=[],ne=new Map,M=0,b=-1,A=new Map,V=new Set,q=new Map,ie=new Map,_e=new Set,ze=new Map,be=new Map,Mt=!1;function ki(){if(c=e.history.listen(x=>{let{action:C,location:T,delta:O}=x;if(Mt){Mt=!1;return}An(be.size===0||O!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let $=Yc({currentLocation:v.location,nextLocation:T,historyAction:C});if($&&O!=null){Mt=!0,e.history.go(O*-1),Er($,{state:"blocked",location:T,proceed(){Er($,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),e.history.go(O)},reset(){let Y=new Map(v.blockers);Y.set($,Eo),Ge({blockers:Y})}});return}return qt(C,T)}),n){Yw(t,G);let x=()=>Xw(t,G);t.addEventListener("pagehide",x),re=()=>t.removeEventListener("pagehide",x)}return v.initialized||qt(Ce.Pop,v.location,{initialHydration:!0}),P}function mn(){c&&c(),re&&re(),f.clear(),L&&L.abort(),v.fetchers.forEach((x,C)=>ot(C)),v.blockers.forEach((x,C)=>Gn(C))}function va(x){return f.add(x),()=>f.delete(x)}function Ge(x,C){C===void 0&&(C={}),v=Ee({},v,x);let T=[],O=[];u.v7_fetcherPersist&&v.fetchers.forEach(($,Y)=>{$.state==="idle"&&(_e.has(Y)?O.push(Y):T.push(Y))}),[...f].forEach($=>$(v,{deletedFetchers:O,unstable_viewTransitionOpts:C.viewTransitionOpts,unstable_flushSync:C.flushSync===!0})),u.v7_fetcherPersist&&(T.forEach($=>v.fetchers.delete($)),O.forEach($=>ot($)))}function He(x,C,T){var O,$;let{flushSync:Y}=T===void 0?{}:T,W=v.actionData!=null&&v.navigation.formMethod!=null&&Dt(v.navigation.formMethod)&&v.navigation.state==="loading"&&((O=x.state)==null?void 0:O._isRedirect)!==!0,H;C.actionData?Object.keys(C.actionData).length>0?H=C.actionData:H=null:W?H=v.actionData:H=null;let U=C.loaderData?bd(v.loaderData,C.loaderData,C.matches||[],C.errors):v.loaderData,J=v.blockers;J.size>0&&(J=new Map(J),J.forEach((ae,Ae)=>J.set(Ae,Eo)));let je=N===!0||v.navigation.formMethod!=null&&Dt(v.navigation.formMethod)&&(($=x.state)==null?void 0:$._isRedirect)!==!0;a&&(l=a,a=void 0),Z||R===Ce.Pop||(R===Ce.Push?e.history.push(x,x.state):R===Ce.Replace&&e.history.replace(x,x.state));let K;if(R===Ce.Pop){let ae=G.get(v.location.pathname);ae&&ae.has(x.pathname)?K={currentLocation:v.location,nextLocation:x}:G.has(x.pathname)&&(K={currentLocation:x,nextLocation:v.location})}else if(F){let ae=G.get(v.location.pathname);ae?ae.add(x.pathname):(ae=new Set([x.pathname]),G.set(v.location.pathname,ae)),K={currentLocation:v.location,nextLocation:x}}Ge(Ee({},C,{actionData:H,loaderData:U,historyAction:R,location:x,initialized:!0,navigation:ls,revalidation:"idle",restoreScrollPosition:Jc(x,C.matches||v.matches),preventScrollReset:je,blockers:J}),{viewTransitionOpts:K,flushSync:Y===!0}),R=Ce.Pop,N=!1,F=!1,Z=!1,te=!1,de=[],ke=[]}async function Zt(x,C){if(typeof x=="number"){e.history.go(x);return}let T=xu(v.location,v.matches,s,u.v7_prependBasename,x,u.v7_relativeSplatPath,C==null?void 0:C.fromRouteId,C==null?void 0:C.relative),{path:O,submission:$,error:Y}=zd(u.v7_normalizeFormMethod,!1,T,C),W=v.location,H=fi(v.location,O,C&&C.state);H=Ee({},H,e.history.encodeLocation(H));let U=C&&C.replace!=null?C.replace:void 0,J=Ce.Push;U===!0?J=Ce.Replace:U===!1||$!=null&&Dt($.formMethod)&&$.formAction===v.location.pathname+v.location.search&&(J=Ce.Replace);let je=C&&"preventScrollReset"in C?C.preventScrollReset===!0:void 0,K=(C&&C.unstable_flushSync)===!0,ae=Yc({currentLocation:W,nextLocation:H,historyAction:J});if(ae){Er(ae,{state:"blocked",location:H,proceed(){Er(ae,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),Zt(x,C)},reset(){let Ae=new Map(v.blockers);Ae.set(ae,Eo),Ge({blockers:Ae})}});return}return await qt(J,H,{submission:$,pendingError:Y,preventScrollReset:je,replace:C&&C.replace,enableViewTransition:C&&C.unstable_viewTransition,flushSync:K})}function ga(){if(po(),Ge({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){qt(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}qt(R||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation})}}async function qt(x,C,T){L&&L.abort(),L=null,R=x,Z=(T&&T.startUninterruptedRevalidation)===!0,Ay(v.location,v.matches),N=(T&&T.preventScrollReset)===!0,F=(T&&T.enableViewTransition)===!0;let O=a||l,$=T&&T.overrideNavigation,Y=Ur(O,C,s),W=(T&&T.flushSync)===!0;if(!Y){let Ae=xt(404,{pathname:C.pathname}),{matches:St,route:Le}=Ad(O);Sa(),He(C,{matches:St,loaderData:{},errors:{[Le.id]:Ae}},{flushSync:W});return}if(v.initialized&&!te&&Hw(v.location,C)&&!(T&&T.submission&&Dt(T.submission.formMethod))){He(C,{matches:Y},{flushSync:W});return}L=new AbortController;let H=_o(e.history,C,L.signal,T&&T.submission),U,J;if(T&&T.pendingError)J={[Uo(Y).route.id]:T.pendingError};else if(T&&T.submission&&Dt(T.submission.formMethod)){let Ae=await Sr(H,C,T.submission,Y,{replace:T.replace,flushSync:W});if(Ae.shortCircuited)return;U=Ae.pendingActionData,J=Ae.pendingActionError,$=as(C,T.submission),W=!1,H=new Request(H.url,{signal:H.signal})}let{shortCircuited:je,loaderData:K,errors:ae}=await uo(H,C,Y,$,T&&T.submission,T&&T.fetcherSubmission,T&&T.replace,T&&T.initialHydration===!0,W,U,J);je||(L=null,He(C,Ee({matches:Y},U?{actionData:U}:{},{loaderData:K,errors:ae})))}async function Sr(x,C,T,O,$){$===void 0&&($={}),po();let Y=Qw(C,T);Ge({navigation:Y},{flushSync:$.flushSync===!0});let W,H=ku(O,C);if(!H.route.action&&!H.route.lazy)W={type:Se.error,error:xt(405,{method:x.method,pathname:C.pathname,routeId:H.route.id})};else if(W=await ko("action",x,H,O,i,o,s,u.v7_relativeSplatPath),x.signal.aborted)return{shortCircuited:!0};if(ir(W)){let U;return $&&$.replace!=null?U=$.replace:U=W.location===v.location.pathname+v.location.search,await gt(v,W,{submission:T,replace:U}),{shortCircuited:!0}}if(Br(W)){let U=Uo(O,H.route.id);return($&&$.replace)!==!0&&(R=Ce.Push),{pendingActionData:{},pendingActionError:{[U.route.id]:W.error}}}if(or(W))throw xt(400,{type:"defer-action"});return{pendingActionData:{[H.route.id]:W.data}}}async function uo(x,C,T,O,$,Y,W,H,U,J,je){let K=O||as(C,$),ae=$||Y||Ud(K),Ae=a||l,[St,Le]=jd(e.history,v,T,ae,C,u.v7_partialHydration&&H===!0,te,de,ke,_e,q,V,Ae,s,J,je);if(Sa(le=>!(T&&T.some(he=>he.route.id===le))||St&&St.some(he=>he.route.id===le)),b=++M,St.length===0&&Le.length===0){let le=ye();return He(C,Ee({matches:T,loaderData:{},errors:je||null},J?{actionData:J}:{},le?{fetchers:new Map(v.fetchers)}:{}),{flushSync:U}),{shortCircuited:!0}}if(!Z&&(!u.v7_partialHydration||!H)){Le.forEach(he=>{let Ht=v.fetchers.get(he.key),Pi=Co(void 0,Ht?Ht.data:void 0);v.fetchers.set(he.key,Pi)});let le=J||v.actionData;Ge(Ee({navigation:K},le?Object.keys(le).length===0?{actionData:null}:{actionData:le}:{},Le.length>0?{fetchers:new Map(v.fetchers)}:{}),{flushSync:U})}Le.forEach(le=>{ne.has(le.key)&&B(le.key),le.controller&&ne.set(le.key,le.controller)});let kr=()=>Le.forEach(le=>B(le.key));L&&L.signal.addEventListener("abort",kr);let{results:xa,loaderResults:_r,fetcherResults:vn}=await fo(v.matches,T,St,Le,x);if(x.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",kr),Le.forEach(le=>ne.delete(le.key));let Yn=Fd(xa);if(Yn){if(Yn.idx>=St.length){let le=Le[Yn.idx-St.length].key;V.add(le)}return await gt(v,Yn.result,{replace:W}),{shortCircuited:!0}}let{loaderData:Ea,errors:ka}=Id(v,T,St,_r,je,Le,vn,ze);ze.forEach((le,he)=>{le.subscribe(Ht=>{(Ht||le.done)&&ze.delete(he)})});let _a=ye(),Cr=it(b),Ci=_a||Cr||Le.length>0;return Ee({loaderData:Ea,errors:ka},Ci?{fetchers:new Map(v.fetchers)}:{})}function co(x,C,T,O){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ne.has(x)&&B(x);let $=(O&&O.unstable_flushSync)===!0,Y=a||l,W=xu(v.location,v.matches,s,u.v7_prependBasename,T,u.v7_relativeSplatPath,C,O==null?void 0:O.relative),H=Ur(Y,W,s);if(!H){Qn(x,C,xt(404,{pathname:W}),{flushSync:$});return}let{path:U,submission:J,error:je}=zd(u.v7_normalizeFormMethod,!0,W,O);if(je){Qn(x,C,je,{flushSync:$});return}let K=ku(H,U);if(N=(O&&O.preventScrollReset)===!0,J&&Dt(J.formMethod)){yn(x,C,U,K,H,$,J);return}q.set(x,{routeId:C,path:U}),_i(x,C,U,K,H,$,J)}async function yn(x,C,T,O,$,Y,W){if(po(),q.delete(x),!O.route.action&&!O.route.lazy){let he=xt(405,{method:W.formMethod,pathname:T,routeId:C});Qn(x,C,he,{flushSync:Y});return}let H=v.fetchers.get(x);Nt(x,Gw(W,H),{flushSync:Y});let U=new AbortController,J=_o(e.history,T,U.signal,W);ne.set(x,U);let je=M,K=await ko("action",J,O,$,i,o,s,u.v7_relativeSplatPath);if(J.signal.aborted){ne.get(x)===U&&ne.delete(x);return}if(u.v7_fetcherPersist&&_e.has(x)){if(ir(K)||Br(K)){Nt(x,wn(void 0));return}}else{if(ir(K))if(ne.delete(x),b>je){Nt(x,wn(void 0));return}else return V.add(x),Nt(x,Co(W)),gt(v,K,{fetcherSubmission:W});if(Br(K)){Qn(x,C,K.error);return}}if(or(K))throw xt(400,{type:"defer-action"});let ae=v.navigation.location||v.location,Ae=_o(e.history,ae,U.signal),St=a||l,Le=v.navigation.state!=="idle"?Ur(St,v.navigation.location,s):v.matches;Q(Le,"Didn't find any matches after fetcher action");let kr=++M;A.set(x,kr);let xa=Co(W,K.data);v.fetchers.set(x,xa);let[_r,vn]=jd(e.history,v,Le,W,ae,!1,te,de,ke,_e,q,V,St,s,{[O.route.id]:K.data},void 0);vn.filter(he=>he.key!==x).forEach(he=>{let Ht=he.key,Pi=v.fetchers.get(Ht),$y=Co(void 0,Pi?Pi.data:void 0);v.fetchers.set(Ht,$y),ne.has(Ht)&&B(Ht),he.controller&&ne.set(Ht,he.controller)}),Ge({fetchers:new Map(v.fetchers)});let Yn=()=>vn.forEach(he=>B(he.key));U.signal.addEventListener("abort",Yn);let{results:Ea,loaderResults:ka,fetcherResults:_a}=await fo(v.matches,Le,_r,vn,Ae);if(U.signal.aborted)return;U.signal.removeEventListener("abort",Yn),A.delete(x),ne.delete(x),vn.forEach(he=>ne.delete(he.key));let Cr=Fd(Ea);if(Cr){if(Cr.idx>=_r.length){let he=vn[Cr.idx-_r.length].key;V.add(he)}return gt(v,Cr.result)}let{loaderData:Ci,errors:le}=Id(v,v.matches,_r,ka,void 0,vn,_a,ze);if(v.fetchers.has(x)){let he=wn(K.data);v.fetchers.set(x,he)}it(kr),v.navigation.state==="loading"&&kr>b?(Q(R,"Expected pending action"),L&&L.abort(),He(v.navigation.location,{matches:Le,loaderData:Ci,errors:le,fetchers:new Map(v.fetchers)})):(Ge({errors:le,loaderData:bd(v.loaderData,Ci,Le,le),fetchers:new Map(v.fetchers)}),te=!1)}async function _i(x,C,T,O,$,Y,W){let H=v.fetchers.get(x);Nt(x,Co(W,H?H.data:void 0),{flushSync:Y});let U=new AbortController,J=_o(e.history,T,U.signal);ne.set(x,U);let je=M,K=await ko("loader",J,O,$,i,o,s,u.v7_relativeSplatPath);if(or(K)&&(K=await ay(K,J.signal,!0)||K),ne.get(x)===U&&ne.delete(x),!J.signal.aborted){if(_e.has(x)){Nt(x,wn(void 0));return}if(ir(K))if(b>je){Nt(x,wn(void 0));return}else{V.add(x),await gt(v,K);return}if(Br(K)){Qn(x,C,K.error);return}Q(!or(K),"Unhandled fetcher deferred data"),Nt(x,wn(K.data))}}async function gt(x,C,T){let{submission:O,fetcherSubmission:$,replace:Y}=T===void 0?{}:T;C.revalidate&&(te=!0);let W=fi(x.location,C.location,{_isRedirect:!0});if(Q(W,"Expected a location on the redirect navigation"),n){let ae=!1;if(C.reloadDocument)ae=!0;else if(ry.test(C.location)){const Ae=e.history.createURL(C.location);ae=Ae.origin!==t.location.origin||Fn(Ae.pathname,s)==null}if(ae){Y?t.location.replace(C.location):t.location.assign(C.location);return}}L=null;let H=Y===!0?Ce.Replace:Ce.Push,{formMethod:U,formAction:J,formEncType:je}=x.navigation;!O&&!$&&U&&J&&je&&(O=Ud(x.navigation));let K=O||$;if(Dw.has(C.status)&&K&&Dt(K.formMethod))await qt(H,W,{submission:Ee({},K,{formAction:C.location}),preventScrollReset:N});else{let ae=as(W,O);await qt(H,W,{overrideNavigation:ae,fetcherSubmission:$,preventScrollReset:N})}}async function fo(x,C,T,O,$){let Y=await Promise.all([...T.map(U=>ko("loader",$,U,C,i,o,s,u.v7_relativeSplatPath)),...O.map(U=>U.matches&&U.match&&U.controller?ko("loader",_o(e.history,U.path,U.controller.signal),U.match,U.matches,i,o,s,u.v7_relativeSplatPath):{type:Se.error,error:xt(404,{pathname:U.path})})]),W=Y.slice(0,T.length),H=Y.slice(T.length);return await Promise.all([$d(x,T,W,W.map(()=>$.signal),!1,v.loaderData),$d(x,O.map(U=>U.match),H,O.map(U=>U.controller?U.controller.signal:null),!0)]),{results:Y,loaderResults:W,fetcherResults:H}}function po(){te=!0,de.push(...Sa()),q.forEach((x,C)=>{ne.has(C)&&(ke.push(C),B(C))})}function Nt(x,C,T){T===void 0&&(T={}),v.fetchers.set(x,C),Ge({fetchers:new Map(v.fetchers)},{flushSync:(T&&T.flushSync)===!0})}function Qn(x,C,T,O){O===void 0&&(O={});let $=Uo(v.matches,C);ot(x),Ge({errors:{[$.route.id]:T},fetchers:new Map(v.fetchers)},{flushSync:(O&&O.flushSync)===!0})}function xr(x){return u.v7_fetcherPersist&&(ie.set(x,(ie.get(x)||0)+1),_e.has(x)&&_e.delete(x)),v.fetchers.get(x)||Iw}function ot(x){let C=v.fetchers.get(x);ne.has(x)&&!(C&&C.state==="loading"&&A.has(x))&&B(x),q.delete(x),A.delete(x),V.delete(x),_e.delete(x),v.fetchers.delete(x)}function wa(x){if(u.v7_fetcherPersist){let C=(ie.get(x)||0)-1;C<=0?(ie.delete(x),_e.add(x)):ie.set(x,C)}else ot(x);Ge({fetchers:new Map(v.fetchers)})}function B(x){let C=ne.get(x);Q(C,"Expected fetch controller: "+x),C.abort(),ne.delete(x)}function pe(x){for(let C of x){let T=xr(C),O=wn(T.data);v.fetchers.set(C,O)}}function ye(){let x=[],C=!1;for(let T of V){let O=v.fetchers.get(T);Q(O,"Expected fetcher: "+T),O.state==="loading"&&(V.delete(T),x.push(T),C=!0)}return pe(x),C}function it(x){let C=[];for(let[T,O]of A)if(O0}function wt(x,C){let T=v.blockers.get(x)||Eo;return be.get(x)!==C&&be.set(x,C),T}function Gn(x){v.blockers.delete(x),be.delete(x)}function Er(x,C){let T=v.blockers.get(x)||Eo;Q(T.state==="unblocked"&&C.state==="blocked"||T.state==="blocked"&&C.state==="blocked"||T.state==="blocked"&&C.state==="proceeding"||T.state==="blocked"&&C.state==="unblocked"||T.state==="proceeding"&&C.state==="unblocked","Invalid blocker state transition: "+T.state+" -> "+C.state);let O=new Map(v.blockers);O.set(x,C),Ge({blockers:O})}function Yc(x){let{currentLocation:C,nextLocation:T,historyAction:O}=x;if(be.size===0)return;be.size>1&&An(!1,"A router only supports one blocker at a time");let $=Array.from(be.entries()),[Y,W]=$[$.length-1],H=v.blockers.get(Y);if(!(H&&H.state==="proceeding")&&W({currentLocation:C,nextLocation:T,historyAction:O}))return Y}function Sa(x){let C=[];return ze.forEach((T,O)=>{(!x||x(O))&&(T.cancel(),C.push(O),ze.delete(O))}),C}function by(x,C,T){if(d=x,y=C,g=T||null,!w&&v.navigation===ls){w=!0;let O=Jc(v.location,v.matches);O!=null&&Ge({restoreScrollPosition:O})}return()=>{d=null,y=null,g=null}}function Xc(x,C){return g&&g(x,C.map(O=>dw(O,v.loaderData)))||x.key}function Ay(x,C){if(d&&y){let T=Xc(x,C);d[T]=y()}}function Jc(x,C){if(d){let T=Xc(x,C),O=d[T];if(typeof O=="number")return O}return null}function Fy(x){i={},a=wu(x,o,void 0,i)}return P={get basename(){return s},get future(){return u},get state(){return v},get routes(){return l},get window(){return t},initialize:ki,subscribe:va,enableScrollRestoration:by,navigate:Zt,fetch:co,revalidate:ga,createHref:x=>e.history.createHref(x),encodeLocation:x=>e.history.encodeLocation(x),getFetcher:xr,deleteFetcher:wa,dispose:mn,getBlocker:wt,deleteBlocker:Gn,_internalFetchControllers:ne,_internalActiveDeferreds:ze,_internalSetRoutes:Fy},P}function Fw(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xu(e,t,n,r,o,i,l,a){let s,u;if(l){s=[];for(let f of t)if(s.push(f),f.route.id===l){u=f;break}}else s=t,u=t[t.length-1];let c=Fc(o||".",Ac(s,i),Fn(e.pathname,n)||e.pathname,a==="path");return o==null&&(c.search=e.search,c.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!Uc(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:an([n,c.pathname])),vr(c)}function zd(e,t,n,r){if(!r||!Fw(r))return{path:n};if(r.formMethod&&!Kw(r.formMethod))return{path:n,error:xt(405,{method:r.formMethod})};let o=()=>({path:n,error:xt(400,{type:"invalid-body"})}),i=r.formMethod||"get",l=e?i.toUpperCase():i.toLowerCase(),a=ly(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Dt(l))return o();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[w,S]=y;return""+g+w+"="+S+` +`},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!Dt(l))return o();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:a,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return o()}}}Q(typeof FormData=="function","FormData is not available in this environment");let s,u;if(r.formData)s=Eu(r.formData),u=r.formData;else if(r.body instanceof FormData)s=Eu(r.body),u=r.body;else if(r.body instanceof URLSearchParams)s=r.body,u=Dd(s);else if(r.body==null)s=new URLSearchParams,u=new FormData;else try{s=new URLSearchParams(r.body),u=Dd(s)}catch{return o()}let c={formMethod:l,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Dt(c.formMethod))return{path:n,submission:c};let f=Jt(n);return t&&f.search&&Uc(f.search)&&s.append("index",""),f.search="?"+s,{path:vr(f),submission:c}}function $w(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function jd(e,t,n,r,o,i,l,a,s,u,c,f,d,g,y,w){let S=w?Object.values(w)[0]:y?Object.values(y)[0]:void 0,h=e.createURL(t.location),p=e.createURL(o),m=w?Object.keys(w)[0]:void 0,P=$w(n,m).filter((R,N)=>{let{route:L}=R;if(L.lazy)return!0;if(L.loader==null)return!1;if(i)return L.loader.hydrate?!0:t.loaderData[L.id]===void 0&&(!t.errors||t.errors[L.id]===void 0);if(Uw(t.loaderData,t.matches[N],R)||a.some(re=>re===R.route.id))return!0;let F=t.matches[N],G=R;return Ld(R,Ee({currentUrl:h,currentParams:F.params,nextUrl:p,nextParams:G.params},r,{actionResult:S,defaultShouldRevalidate:l||h.pathname+h.search===p.pathname+p.search||h.search!==p.search||iy(F,G)}))}),v=[];return c.forEach((R,N)=>{if(i||!n.some(Z=>Z.route.id===R.routeId)||u.has(N))return;let L=Ur(d,R.path,g);if(!L){v.push({key:N,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let F=t.fetchers.get(N),G=ku(L,R.path),re=!1;f.has(N)?re=!1:s.includes(N)?re=!0:F&&F.state!=="idle"&&F.data===void 0?re=l:re=Ld(G,Ee({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:n[n.length-1].params},r,{actionResult:S,defaultShouldRevalidate:l})),re&&v.push({key:N,routeId:R.routeId,path:R.path,matches:L,match:G,controller:new AbortController})}),[P,v]}function Uw(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function iy(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ld(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Od(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Q(o,"No route found in manifest");let i={};for(let l in r){let s=o[l]!==void 0&&l!=="hasErrorBoundary";An(!s,'Route "'+o.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!s&&!cw.has(l)&&(i[l]=r[l])}Object.assign(o,i),Object.assign(o,Ee({},t(o),{lazy:void 0}))}async function ko(e,t,n,r,o,i,l,a,s){s===void 0&&(s={});let u,c,f,d=w=>{let S,h=new Promise((p,m)=>S=m);return f=()=>S(),t.signal.addEventListener("abort",f),Promise.race([w({request:t,params:n.params,context:s.requestContext}),h])};try{let w=n.route[e];if(n.route.lazy)if(w){let S,h=await Promise.all([d(w).catch(p=>{S=p}),Od(n.route,i,o)]);if(S)throw S;c=h[0]}else if(await Od(n.route,i,o),w=n.route[e],w)c=await d(w);else if(e==="action"){let S=new URL(t.url),h=S.pathname+S.search;throw xt(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:Se.data,data:void 0};else if(w)c=await d(w);else{let S=new URL(t.url),h=S.pathname+S.search;throw xt(404,{pathname:h})}Q(c!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(w){u=Se.error,c=w}finally{f&&t.signal.removeEventListener("abort",f)}if(Vw(c)){let w=c.status;if(Ow.has(w)){let h=c.headers.get("Location");if(Q(h,"Redirects returned/thrown from loaders/actions must have a Location header"),!ry.test(h))h=xu(new URL(t.url),r.slice(0,r.indexOf(n)+1),l,!0,h,a);else if(!s.isStaticRequest){let p=new URL(t.url),m=h.startsWith("//")?new URL(p.protocol+h):new URL(h),k=Fn(m.pathname,l)!=null;m.origin===p.origin&&k&&(h=m.pathname+m.search+m.hash)}if(s.isStaticRequest)throw c.headers.set("Location",h),c;return{type:Se.redirect,status:w,location:h,revalidate:c.headers.get("X-Remix-Revalidate")!==null,reloadDocument:c.headers.get("X-Remix-Reload-Document")!==null}}if(s.isRouteRequest)throw{type:u===Se.error?Se.error:Se.data,response:c};let S;try{let h=c.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?S=await c.json():S=await c.text()}catch(h){return{type:Se.error,error:h}}return u===Se.error?{type:u,error:new $c(w,c.statusText,S),headers:c.headers}:{type:Se.data,data:S,statusCode:c.status,headers:c.headers}}if(u===Se.error)return{type:u,error:c};if(Ww(c)){var g,y;return{type:Se.deferred,deferredData:c,statusCode:(g=c.init)==null?void 0:g.status,headers:((y=c.init)==null?void 0:y.headers)&&new Headers(c.init.headers)}}return{type:Se.data,data:c}}function _o(e,t,n,r){let o=e.createURL(ly(t)).toString(),i={signal:n};if(r&&Dt(r.formMethod)){let{formMethod:l,formEncType:a}=r;i.method=l.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=Eu(r.formData):i.body=r.formData}return new Request(o,i)}function Eu(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Dd(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Bw(e,t,n,r,o){let i={},l=null,a,s=!1,u={};return n.forEach((c,f)=>{let d=t[f].route.id;if(Q(!ir(c),"Cannot handle redirect results in processLoaderData"),Br(c)){let g=Uo(e,d),y=c.error;r&&(y=Object.values(r)[0],r=void 0),l=l||{},l[g.route.id]==null&&(l[g.route.id]=y),i[d]=void 0,s||(s=!0,a=ty(c.error)?c.error.status:500),c.headers&&(u[d]=c.headers)}else or(c)?(o.set(d,c.deferredData),i[d]=c.deferredData.data):i[d]=c.data,c.statusCode!=null&&c.statusCode!==200&&!s&&(a=c.statusCode),c.headers&&(u[d]=c.headers)}),r&&(l=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:l,statusCode:a||200,loaderHeaders:u}}function Id(e,t,n,r,o,i,l,a){let{loaderData:s,errors:u}=Bw(t,n,r,o,a);for(let c=0;cr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Ad(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xt(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,l="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(l="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(l="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",a='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new $c(e||500,l,new Error(a),!0)}function Fd(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ir(n))return{result:n,idx:t}}}function ly(e){let t=typeof e=="string"?Jt(e):e;return vr(Ee({},t,{hash:""}))}function Hw(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function or(e){return e.type===Se.deferred}function Br(e){return e.type===Se.error}function ir(e){return(e&&e.type)===Se.redirect}function Ww(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Vw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Kw(e){return Lw.has(e.toLowerCase())}function Dt(e){return zw.has(e.toLowerCase())}async function $d(e,t,n,r,o,i){for(let l=0;lf.route.id===s.route.id),c=u!=null&&!iy(u,s)&&(i&&i[s.route.id])!==void 0;if(or(a)&&(o||c)){let f=r[l];Q(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await ay(a,f,o).then(d=>{d&&(n[l]=d||n[l])})}}}async function ay(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Se.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Se.error,error:o}}return{type:Se.data,data:e.deferredData.data}}}function Uc(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ku(e,t){let n=typeof t=="string"?Jt(t).search:t.search;if(e[e.length-1].route.index&&Uc(n||""))return e[e.length-1];let r=ey(e);return r[r.length-1]}function Ud(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:l}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function as(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qw(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Co(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Gw(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function wn(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Yw(e,t){try{let n=e.sessionStorage.getItem(oy);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function Xw(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(oy,JSON.stringify(n))}catch(r){An(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.21.1 * * Copyright (c) Remix Software Inc. @@ -56,7 +56,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function di(){return di=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),E.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=Fc(u,JSON.parse(l),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:an([t,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,l,i,e])}function Hc(){let{matches:e}=E.useContext(Wn),t=e[e.length-1];return t?t.params:{}}function ya(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=E.useContext(Hn),{matches:o}=E.useContext(Wn),{pathname:i}=xi(),l=JSON.stringify(Ac(o,r.v7_relativeSplatPath));return E.useMemo(()=>Fc(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Zw(e,t,n,r){Si()||Q(!1);let{navigator:o}=E.useContext(Hn),{matches:i}=E.useContext(Wn),l=i[i.length-1],a=l?l.params:{};l&&l.pathname;let s=l?l.pathnameBase:"/";l&&l.route;let u=xi(),c;if(t){var f;let S=typeof t=="string"?Jt(t):t;s==="/"||(f=S.pathname)!=null&&f.startsWith(s)||Q(!1),c=S}else c=u;let d=c.pathname||"/",g=s==="/"?d:d.slice(s.length)||"/",y=$r(e,{pathname:g}),w=oS(y&&y.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:an([s,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?s:an([s,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&w?E.createElement(ma.Provider,{value:{location:di({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Ce.Pop}},w):w}function eS(){let e=sS(),t=ty(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),n?E.createElement("pre",{style:o},n):null,null)}const tS=E.createElement(eS,null);class nS extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?E.createElement(Wn.Provider,{value:this.props.routeContext},E.createElement(sy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rS(e){let{routeContext:t,match:n,children:r}=e,o=E.useContext(wi);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(Wn.Provider,{value:t},r)}function oS(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let l=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let c=l.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id]));c>=0||Q(!1),l=l.slice(0,Math.min(l.length,c+1))}let s=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((c,f,d)=>{let g,y=!1,w=null,S=null;n&&(g=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||tS,s&&(u<0&&d===0?(cS("route-fallback",!1),y=!0,S=null):u===d&&(y=!0,S=f.route.hydrateFallbackElement||null)));let h=t.concat(l.slice(0,d+1)),p=()=>{let m;return g?m=w:y?m=S:f.route.Component?m=E.createElement(f.route.Component,null):f.route.element?m=f.route.element:m=c,E.createElement(rS,{match:f,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:m})};return n&&(f.route.ErrorBoundary||f.route.errorElement||d===0)?E.createElement(nS,{location:n.location,revalidation:n.revalidation,component:w,error:g,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()},null)}var fy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(fy||{}),Bl=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bl||{});function iS(e){let t=E.useContext(wi);return t||Q(!1),t}function lS(e){let t=E.useContext(Bc);return t||Q(!1),t}function aS(e){let t=E.useContext(Wn);return t||Q(!1),t}function dy(e){let t=aS(),n=t.matches[t.matches.length-1];return n.route.id||Q(!1),n.route.id}function sS(){var e;let t=E.useContext(sy),n=lS(Bl.UseRouteError),r=dy(Bl.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function uS(){let{router:e}=iS(fy.UseNavigateStable),t=dy(Bl.UseNavigateStable),n=E.useRef(!1);return uy(()=>{n.current=!0}),E.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,di({fromRouteId:t},i)))},[e,t])}const Bd={};function cS(e,t,n){!t&&!Bd[e]&&(Bd[e]=!0)}function fS(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ce.Pop,navigator:i,static:l=!1,future:a}=e;Si()&&Q(!1);let s=t.replace(/^\/*/,"/"),u=E.useMemo(()=>({basename:s,navigator:i,static:l,future:di({v7_relativeSplatPath:!1},a)}),[s,a,i,l]);typeof r=="string"&&(r=Jt(r));let{pathname:c="/",search:f="",hash:d="",state:g=null,key:y="default"}=r,w=E.useMemo(()=>{let S=An(c,s);return S==null?null:{location:{pathname:S,search:f,hash:d,state:g,key:y},navigationType:o}},[s,c,f,d,g,y,o]);return w==null?null:E.createElement(Hn.Provider,{value:u},E.createElement(ma.Provider,{children:n,value:w}))}new Promise(()=>{});function dS(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:E.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:E.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:E.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + */function di(){return di=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),E.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=Fc(u,JSON.parse(l),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:an([t,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,l,i,e])}function Hc(){let{matches:e}=E.useContext(Kn),t=e[e.length-1];return t?t.params:{}}function ya(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=E.useContext(Vn),{matches:o}=E.useContext(Kn),{pathname:i}=xi(),l=JSON.stringify(Ac(o,r.v7_relativeSplatPath));return E.useMemo(()=>Fc(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function qw(e,t,n,r){Si()||Q(!1);let{navigator:o}=E.useContext(Vn),{matches:i}=E.useContext(Kn),l=i[i.length-1],a=l?l.params:{};l&&l.pathname;let s=l?l.pathnameBase:"/";l&&l.route;let u=xi(),c;if(t){var f;let S=typeof t=="string"?Jt(t):t;s==="/"||(f=S.pathname)!=null&&f.startsWith(s)||Q(!1),c=S}else c=u;let d=c.pathname||"/",g=s==="/"?d:d.slice(s.length)||"/",y=Ur(e,{pathname:g}),w=oS(y&&y.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:an([s,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?s:an([s,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&w?E.createElement(ma.Provider,{value:{location:di({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Ce.Pop}},w):w}function eS(){let e=sS(),t=ty(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),n?E.createElement("pre",{style:o},n):null,null)}const tS=E.createElement(eS,null);class nS extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?E.createElement(Kn.Provider,{value:this.props.routeContext},E.createElement(sy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rS(e){let{routeContext:t,match:n,children:r}=e,o=E.useContext(wi);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(Kn.Provider,{value:t},r)}function oS(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let l=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let c=l.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id]));c>=0||Q(!1),l=l.slice(0,Math.min(l.length,c+1))}let s=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((c,f,d)=>{let g,y=!1,w=null,S=null;n&&(g=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||tS,s&&(u<0&&d===0?(cS("route-fallback",!1),y=!0,S=null):u===d&&(y=!0,S=f.route.hydrateFallbackElement||null)));let h=t.concat(l.slice(0,d+1)),p=()=>{let m;return g?m=w:y?m=S:f.route.Component?m=E.createElement(f.route.Component,null):f.route.element?m=f.route.element:m=c,E.createElement(rS,{match:f,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:m})};return n&&(f.route.ErrorBoundary||f.route.errorElement||d===0)?E.createElement(nS,{location:n.location,revalidation:n.revalidation,component:w,error:g,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()},null)}var fy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(fy||{}),Bl=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bl||{});function iS(e){let t=E.useContext(wi);return t||Q(!1),t}function lS(e){let t=E.useContext(Bc);return t||Q(!1),t}function aS(e){let t=E.useContext(Kn);return t||Q(!1),t}function dy(e){let t=aS(),n=t.matches[t.matches.length-1];return n.route.id||Q(!1),n.route.id}function sS(){var e;let t=E.useContext(sy),n=lS(Bl.UseRouteError),r=dy(Bl.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function uS(){let{router:e}=iS(fy.UseNavigateStable),t=dy(Bl.UseNavigateStable),n=E.useRef(!1);return uy(()=>{n.current=!0}),E.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,di({fromRouteId:t},i)))},[e,t])}const Bd={};function cS(e,t,n){!t&&!Bd[e]&&(Bd[e]=!0)}function fS(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ce.Pop,navigator:i,static:l=!1,future:a}=e;Si()&&Q(!1);let s=t.replace(/^\/*/,"/"),u=E.useMemo(()=>({basename:s,navigator:i,static:l,future:di({v7_relativeSplatPath:!1},a)}),[s,a,i,l]);typeof r=="string"&&(r=Jt(r));let{pathname:c="/",search:f="",hash:d="",state:g=null,key:y="default"}=r,w=E.useMemo(()=>{let S=Fn(c,s);return S==null?null:{location:{pathname:S,search:f,hash:d,state:g,key:y},navigationType:o}},[s,c,f,d,g,y,o]);return w==null?null:E.createElement(Vn.Provider,{value:u},E.createElement(ma.Provider,{children:n,value:w}))}new Promise(()=>{});function dS(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:E.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:E.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:E.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.21.1 * * Copyright (c) Remix Software Inc. @@ -65,7 +65,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ro(){return ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function pS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hS(e,t){return e.button===0&&(!t||t==="_self")&&!pS(e)}const mS=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],yS=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];function vS(e,t){return Aw({basename:t==null?void 0:t.basename,future:ro({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:aw({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||gS(),routes:e,mapRouteProperties:dS,window:t==null?void 0:t.window}).initialize()}function gS(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ro({},t,{errors:wS(t.errors)})),t}function wS(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new $c(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let l=new i(o.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const hy=E.createContext({isTransitioning:!1}),SS=E.createContext(new Map),xS="startTransition",Hd=fs[xS],ES="flushSync",Wd=lw[ES];function kS(e){Hd?Hd(e):e()}function Po(e){Wd?Wd(e):e()}class _S{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function CS(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=E.useState(n.state),[l,a]=E.useState(),[s,u]=E.useState({isTransitioning:!1}),[c,f]=E.useState(),[d,g]=E.useState(),[y,w]=E.useState(),S=E.useRef(new Map),{v7_startTransition:h}=r||{},p=E.useCallback(R=>{h?kS(R):R()},[h]),m=E.useCallback((R,N)=>{let{deletedFetchers:L,unstable_flushSync:F,unstable_viewTransitionOpts:G}=N;L.forEach(q=>S.current.delete(q)),R.fetchers.forEach((q,te)=>{q.data!==void 0&&S.current.set(te,q.data)});let re=n.window==null||typeof n.window.document.startViewTransition!="function";if(!G||re){F?Po(()=>i(R)):p(()=>i(R));return}if(F){Po(()=>{d&&(c&&c.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let q=n.window.document.startViewTransition(()=>{Po(()=>i(R))});q.finished.finally(()=>{Po(()=>{f(void 0),g(void 0),a(void 0),u({isTransitioning:!1})})}),Po(()=>g(q));return}d?(c&&c.resolve(),d.skipTransition(),w({state:R,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(a(R),u({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[n.window,d,c,S,p]);E.useLayoutEffect(()=>n.subscribe(m),[n,m]),E.useEffect(()=>{s.isTransitioning&&!s.flushSync&&f(new _S)},[s]),E.useEffect(()=>{if(c&&l&&n.window){let R=l,N=c.promise,L=n.window.document.startViewTransition(async()=>{p(()=>i(R)),await N});L.finished.finally(()=>{f(void 0),g(void 0),a(void 0),u({isTransitioning:!1})}),g(L)}},[p,l,c,n.window]),E.useEffect(()=>{c&&l&&o.location.key===l.location.key&&c.resolve()},[c,d,o.location,l]),E.useEffect(()=>{!s.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),w(void 0))},[s.isTransitioning,y]),E.useEffect(()=>{},[]);let k=E.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:R=>n.navigate(R),push:(R,N,L)=>n.navigate(R,{state:N,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(R,N,L)=>n.navigate(R,{replace:!0,state:N,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[n]),P=n.basename||"/",v=E.useMemo(()=>({router:n,navigator:k,static:!1,basename:P}),[n,k,P]);return E.createElement(E.Fragment,null,E.createElement(wi.Provider,{value:v},E.createElement(Bc.Provider,{value:o},E.createElement(SS.Provider,{value:S.current},E.createElement(hy.Provider,{value:s},E.createElement(fS,{basename:P,location:o.location,navigationType:o.historyAction,navigator:k,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?E.createElement(PS,{routes:n.routes,future:n.future,state:o}):t))))),null)}function PS(e){let{routes:t,future:n,state:r}=e;return Zw(t,void 0,r,n)}const RS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,my=E.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:l,state:a,target:s,to:u,preventScrollReset:c,unstable_viewTransition:f}=t,d=py(t,mS),{basename:g}=E.useContext(Hn),y,w=!1;if(typeof u=="string"&&TS.test(u)&&(y=u,RS))try{let m=new URL(window.location.href),k=u.startsWith("//")?new URL(m.protocol+u):new URL(u),P=An(k.pathname,g);k.origin===m.origin&&P!=null?u=P+k.search+k.hash:w=!0}catch{}let S=Jw(u,{relative:o}),h=NS(u,{replace:l,state:a,target:s,preventScrollReset:c,relative:o,unstable_viewTransition:f});function p(m){r&&r(m),m.defaultPrevented||h(m)}return E.createElement("a",ro({},d,{href:y||S,onClick:w||i?r:p,ref:n,target:s}))}),yy=E.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:l=!1,style:a,to:s,unstable_viewTransition:u,children:c}=t,f=py(t,yS),d=ya(s,{relative:f.relative}),g=xi(),y=E.useContext(Bc),{navigator:w}=E.useContext(Hn),S=y!=null&&zS(d)&&u===!0,h=w.encodeLocation?w.encodeLocation(d).pathname:d.pathname,p=g.pathname,m=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;o||(p=p.toLowerCase(),m=m?m.toLowerCase():null,h=h.toLowerCase());const k=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let P=p===h||!l&&p.startsWith(h)&&p.charAt(k)==="/",v=m!=null&&(m===h||!l&&m.startsWith(h)&&m.charAt(h.length)==="/"),R={isActive:P,isPending:v,isTransitioning:S},N=P?r:void 0,L;typeof i=="function"?L=i(R):L=[i,P?"active":null,v?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(R):a;return E.createElement(my,ro({},f,{"aria-current":N,className:L,ref:n,style:F,to:s,unstable_viewTransition:u}),typeof c=="function"?c(R):c)});var _u;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_u||(_u={}));var Vd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Vd||(Vd={}));function MS(e){let t=E.useContext(wi);return t||Q(!1),t}function NS(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a}=t===void 0?{}:t,s=cy(),u=xi(),c=ya(e,{relative:l});return E.useCallback(f=>{if(hS(f,n)){f.preventDefault();let d=r!==void 0?r:mr(u)===mr(c);s(e,{replace:d,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a})}},[u,s,c,r,o,n,e,i,l,a])}function zS(e,t){t===void 0&&(t={});let n=E.useContext(hy);n==null&&Q(!1);let{basename:r}=MS(_u.useViewTransitionState),o=ya(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=An(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=An(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Su(o.pathname,l)!=null||Su(o.pathname,i)!=null}const jS="_challenges_1ylei_1",LS="_card_1ylei_10",vy={challenges:jS,card:LS};function OS({name:e,link:t,img:n}){return _.jsxs(yy,{to:t,className:vy.card,children:[_.jsx("h1",{children:e}),_.jsx("div",{className:"",children:_.jsx("img",{src:n,alt:""})})]})}const DS="/algo-visualizers/images/cell.png",IS="/algo-visualizers/images/path.png",bS=[{name:"Sorting Visualizer",link:"/sorting-visualizer/bubble",img:DS},{name:"Path Finder",link:"/path-finder/",img:IS}];function AS(){return _.jsx("section",{className:vy.challenges,children:bS.map(e=>_.jsx(OS,{...e},e.name))})}const FS="_navbar_1l9vc_1",$S="_github_1l9vc_21",US="_active_1l9vc_50",Ki={navbar:FS,github:$S,active:US},BS="/algo-visualizers/icons/ham.svg";/** + */function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function pS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hS(e,t){return e.button===0&&(!t||t==="_self")&&!pS(e)}const mS=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],yS=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];function vS(e,t){return Aw({basename:t==null?void 0:t.basename,future:oo({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:aw({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||gS(),routes:e,mapRouteProperties:dS,window:t==null?void 0:t.window}).initialize()}function gS(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=oo({},t,{errors:wS(t.errors)})),t}function wS(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new $c(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let l=new i(o.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const hy=E.createContext({isTransitioning:!1}),SS=E.createContext(new Map),xS="startTransition",Hd=fs[xS],ES="flushSync",Wd=lw[ES];function kS(e){Hd?Hd(e):e()}function Po(e){Wd?Wd(e):e()}class _S{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function CS(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=E.useState(n.state),[l,a]=E.useState(),[s,u]=E.useState({isTransitioning:!1}),[c,f]=E.useState(),[d,g]=E.useState(),[y,w]=E.useState(),S=E.useRef(new Map),{v7_startTransition:h}=r||{},p=E.useCallback(R=>{h?kS(R):R()},[h]),m=E.useCallback((R,N)=>{let{deletedFetchers:L,unstable_flushSync:F,unstable_viewTransitionOpts:G}=N;L.forEach(Z=>S.current.delete(Z)),R.fetchers.forEach((Z,te)=>{Z.data!==void 0&&S.current.set(te,Z.data)});let re=n.window==null||typeof n.window.document.startViewTransition!="function";if(!G||re){F?Po(()=>i(R)):p(()=>i(R));return}if(F){Po(()=>{d&&(c&&c.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let Z=n.window.document.startViewTransition(()=>{Po(()=>i(R))});Z.finished.finally(()=>{Po(()=>{f(void 0),g(void 0),a(void 0),u({isTransitioning:!1})})}),Po(()=>g(Z));return}d?(c&&c.resolve(),d.skipTransition(),w({state:R,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(a(R),u({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[n.window,d,c,S,p]);E.useLayoutEffect(()=>n.subscribe(m),[n,m]),E.useEffect(()=>{s.isTransitioning&&!s.flushSync&&f(new _S)},[s]),E.useEffect(()=>{if(c&&l&&n.window){let R=l,N=c.promise,L=n.window.document.startViewTransition(async()=>{p(()=>i(R)),await N});L.finished.finally(()=>{f(void 0),g(void 0),a(void 0),u({isTransitioning:!1})}),g(L)}},[p,l,c,n.window]),E.useEffect(()=>{c&&l&&o.location.key===l.location.key&&c.resolve()},[c,d,o.location,l]),E.useEffect(()=>{!s.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),w(void 0))},[s.isTransitioning,y]),E.useEffect(()=>{},[]);let k=E.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:R=>n.navigate(R),push:(R,N,L)=>n.navigate(R,{state:N,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(R,N,L)=>n.navigate(R,{replace:!0,state:N,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[n]),P=n.basename||"/",v=E.useMemo(()=>({router:n,navigator:k,static:!1,basename:P}),[n,k,P]);return E.createElement(E.Fragment,null,E.createElement(wi.Provider,{value:v},E.createElement(Bc.Provider,{value:o},E.createElement(SS.Provider,{value:S.current},E.createElement(hy.Provider,{value:s},E.createElement(fS,{basename:P,location:o.location,navigationType:o.historyAction,navigator:k,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?E.createElement(PS,{routes:n.routes,future:n.future,state:o}):t))))),null)}function PS(e){let{routes:t,future:n,state:r}=e;return qw(t,void 0,r,n)}const RS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,my=E.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:l,state:a,target:s,to:u,preventScrollReset:c,unstable_viewTransition:f}=t,d=py(t,mS),{basename:g}=E.useContext(Vn),y,w=!1;if(typeof u=="string"&&TS.test(u)&&(y=u,RS))try{let m=new URL(window.location.href),k=u.startsWith("//")?new URL(m.protocol+u):new URL(u),P=Fn(k.pathname,g);k.origin===m.origin&&P!=null?u=P+k.search+k.hash:w=!0}catch{}let S=Jw(u,{relative:o}),h=NS(u,{replace:l,state:a,target:s,preventScrollReset:c,relative:o,unstable_viewTransition:f});function p(m){r&&r(m),m.defaultPrevented||h(m)}return E.createElement("a",oo({},d,{href:y||S,onClick:w||i?r:p,ref:n,target:s}))}),yy=E.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:l=!1,style:a,to:s,unstable_viewTransition:u,children:c}=t,f=py(t,yS),d=ya(s,{relative:f.relative}),g=xi(),y=E.useContext(Bc),{navigator:w}=E.useContext(Vn),S=y!=null&&zS(d)&&u===!0,h=w.encodeLocation?w.encodeLocation(d).pathname:d.pathname,p=g.pathname,m=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;o||(p=p.toLowerCase(),m=m?m.toLowerCase():null,h=h.toLowerCase());const k=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let P=p===h||!l&&p.startsWith(h)&&p.charAt(k)==="/",v=m!=null&&(m===h||!l&&m.startsWith(h)&&m.charAt(h.length)==="/"),R={isActive:P,isPending:v,isTransitioning:S},N=P?r:void 0,L;typeof i=="function"?L=i(R):L=[i,P?"active":null,v?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(R):a;return E.createElement(my,oo({},f,{"aria-current":N,className:L,ref:n,style:F,to:s,unstable_viewTransition:u}),typeof c=="function"?c(R):c)});var _u;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_u||(_u={}));var Vd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Vd||(Vd={}));function MS(e){let t=E.useContext(wi);return t||Q(!1),t}function NS(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a}=t===void 0?{}:t,s=cy(),u=xi(),c=ya(e,{relative:l});return E.useCallback(f=>{if(hS(f,n)){f.preventDefault();let d=r!==void 0?r:vr(u)===vr(c);s(e,{replace:d,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a})}},[u,s,c,r,o,n,e,i,l,a])}function zS(e,t){t===void 0&&(t={});let n=E.useContext(hy);n==null&&Q(!1);let{basename:r}=MS(_u.useViewTransitionState),o=ya(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Fn(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Fn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Su(o.pathname,l)!=null||Su(o.pathname,i)!=null}const jS="_challenges_1ylei_1",LS="_card_1ylei_10",vy={challenges:jS,card:LS};function OS({name:e,link:t,img:n}){return _.jsxs(yy,{to:t,className:vy.card,children:[_.jsx("h1",{children:e}),_.jsx("div",{className:"",children:_.jsx("img",{src:n,alt:""})})]})}const DS="/algo-visualizers/images/cell.png",IS="/algo-visualizers/images/path.png",bS=[{name:"Sorting Visualizer",link:"/sorting-visualizer/bubble",img:DS},{name:"Path Finder",link:"/path-finder/",img:IS}];function AS(){return _.jsx("section",{className:vy.challenges,children:bS.map(e=>_.jsx(OS,{...e},e.name))})}const FS="_navbar_1l9vc_1",$S="_github_1l9vc_21",US="_active_1l9vc_50",Ki={navbar:FS,github:$S,active:US},BS="/algo-visualizers/icons/ham.svg";/** * @license lucide-react v0.350.0 - ISC * * This source code is licensed under the ISC license. @@ -118,19 +118,19 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ei=E;function XS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var JS=typeof Object.is=="function"?Object.is:XS,qS=Ei.useSyncExternalStore,ZS=Ei.useRef,ex=Ei.useEffect,tx=Ei.useMemo,nx=Ei.useDebugValue;Sy.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=ZS(null);if(i.current===null){var l={hasValue:!1,value:null};i.current=l}else l=i.current;i=tx(function(){function s(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&l.hasValue){var y=l.value;if(o(y,g))return f=y}return f=g}if(y=f,JS(c,g))return y;var w=r(g);return o!==void 0&&o(y,w)?y:(c=g,f=w)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return s(t())},d===null?void 0:function(){return s(d())}]},[t,n,r,o]);var a=qS(e,i[0],i[1]);return ex(function(){l.hasValue=!0,l.value=a},[a]),nx(a),a};wy.exports=Sy;var rx=wy.exports,st="default"in fs?j:fs,Kd=Symbol.for("react-redux-context"),Qd=typeof globalThis<"u"?globalThis:{};function ox(){if(!st.createContext)return{};const e=Qd[Kd]??(Qd[Kd]=new Map);let t=e.get(st.createContext);return t||(t=st.createContext(null),e.set(st.createContext,t)),t}var Fn=ox(),ix=()=>{throw new Error("uSES not initialized!")};function Vc(e=Fn){return function(){return st.useContext(e)}}var xy=Vc(),Ey=ix,lx=e=>{Ey=e},ax=(e,t)=>e===t;function sx(e=Fn){const t=e===Fn?xy:Vc(e);return function(r,o={}){const{equalityFn:i=ax,devModeChecks:l={}}=typeof o=="function"?{equalityFn:o}:o,{store:a,subscription:s,getServerState:u,stabilityCheck:c,identityFunctionCheck:f}=t();st.useRef(!0);const d=st.useCallback({[r.name](y){return r(y)}}[r.name],[r,c,l.stabilityCheck]),g=Ey(s.addNestedSub,a.getState,u||a.getState,d,i);return st.useDebugValue(g),g}}var ux=sx();function cx(e){e()}function fx(){let e=null,t=null;return{clear(){e=null,t=null},notify(){cx(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0,o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Gd={notify(){},get:()=>[]};function dx(e,t){let n,r=Gd,o=0,i=!1;function l(w){c();const S=r.subscribe(w);let h=!1;return()=>{h||(h=!0,S(),f())}}function a(){r.notify()}function s(){y.onStateChange&&y.onStateChange()}function u(){return i}function c(){o++,n||(n=t?t.addNestedSub(s):e.subscribe(s),r=fx())}function f(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Gd)}function d(){i||(i=!0,c())}function g(){i&&(i=!1,f())}const y={addNestedSub:l,notifyNestedSubs:a,handleChangeWrapper:s,isSubscribed:u,trySubscribe:d,tryUnsubscribe:g,getListeners:()=>r};return y}var px=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hx=px?st.useLayoutEffect:st.useEffect;function mx({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:i="once"}){const l=st.useMemo(()=>{const u=dx(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:i}},[e,r,o,i]),a=st.useMemo(()=>e.getState(),[e]);hx(()=>{const{subscription:u}=l;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[l,a]);const s=t||Fn;return st.createElement(s.Provider,{value:l},n)}var yx=mx;function ky(e=Fn){const t=e===Fn?xy:Vc(e);return function(){const{store:r}=t();return r}}var vx=ky();function gx(e=Fn){const t=e===Fn?vx:ky(e);return function(){return t().dispatch}}var wx=gx();lx(rx.useSyncExternalStoreWithSelector);const vt=wx,ue=ux;var Jn=(e=>(e.LIGHT="light",e.DARK="dark",e))(Jn||{});const Sx="_iconBtn_5is4s_1",xx={iconBtn:Sx};function Kc({top:e,left:t,bottom:n,right:r=20}){const o=vt(),i=ue(s=>s.app.theme),l=window.matchMedia("(prefers-color-scheme: dark)").matches?Jn.DARK:Jn.LIGHT,a=i??l;return E.useEffect(()=>{i?o(vf(i)):document.documentElement.setAttribute("data-theme",l)},[]),_.jsx(_.Fragment,{children:ha.createPortal(_.jsx("button",{className:xx.iconBtn,style:{top:e,left:t,bottom:n,right:r},onClick:()=>o(vf(a===Jn.LIGHT?Jn.DARK:Jn.LIGHT)),children:a===Jn.LIGHT?_.jsx(KS,{}):_.jsx(GS,{color:"black"})}),document.getElementById("screen-layout"))})}function Ex(){return _.jsxs(_.Fragment,{children:[_.jsx(Kc,{top:10,right:20}),_.jsx(Wc,{title:"Algo visualizers"}),_.jsx(AS,{})]})}function kx(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}kx(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);var _x=e=>{switch(e){case"success":return Rx;case"info":return Mx;case"warning":return Tx;case"error":return Nx;default:return null}},Cx=Array(12).fill(0),Px=({visible:e})=>j.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},j.createElement("div",{className:"sonner-spinner"},Cx.map((t,n)=>j.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Rx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Tx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Mx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Nx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Cu=1,zx=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Cu++,i=this.toasts.find(a=>a.id===o),l=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:l,title:n}):a):this.addToast({title:n,...r,dismissible:l,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(i=>{if(i&&typeof i.ok=="boolean"&&!i.ok){o=!1;let l=typeof t.error=="function"?t.error(`HTTP error! status: ${i.status}`):t.error;this.create({id:n,type:"error",message:l})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?t.success(i):t.success;this.create({id:n,type:"success",message:l})}}).catch(i=>{if(t.error!==void 0){o=!1;let l=typeof t.error=="function"?t.error(i):t.error;this.create({id:n,type:"error",message:l})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Cu++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},jt=new zx,jx=(e,t)=>{let n=(t==null?void 0:t.id)||Cu++;return jt.addToast({title:e,...t,id:n}),n},Lx=jx,Bo=Object.assign(Lx,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading}),Ox=3,Dx="32px",Ix=4e3,bx=356,_y=14,Ax=20,Fx=200;function Pr(...e){return e.filter(Boolean).join(" ")}var $x=e=>{var t,n,r,o,i,l,a;let{invert:s,toast:u,unstyled:c,interacting:f,setHeights:d,visibleToasts:g,heights:y,index:w,toasts:S,expanded:h,removeToast:p,closeButton:m,style:k,cancelButtonStyle:P,actionButtonStyle:v,className:R="",descriptionClassName:N="",duration:L,position:F,gap:G=_y,loadingIcon:re,expandByDefault:q,classNames:te,closeButtonAriaLabel:de="Close toast"}=e,[ke,ne]=j.useState(!1),[M,b]=j.useState(!1),[A,V]=j.useState(!1),[Z,ie]=j.useState(!1),[_e,ze]=j.useState(0),[be,Mt]=j.useState(0),ki=j.useRef(null),hn=j.useRef(null),va=w===0,Ge=w+1<=g,He=u.type,qt=u.dismissible!==!1,ga=u.className||"",Zt=u.descriptionClassName||"",wr=j.useMemo(()=>y.findIndex(B=>B.toastId===u.id)||0,[y,u.id]),uo=j.useMemo(()=>u.duration||L||Ix,[u.duration,L]),co=j.useRef(0),mn=j.useRef(0);j.useRef(uo);let _i=j.useRef(0),gt=j.useRef(null),[fo,po]=F.split("-"),Nt=j.useMemo(()=>y.reduce((B,pe,ye)=>ye>=wr?B:B+pe.height,0),[y,wr]),Vn=u.invert||s,Sr=He==="loading";mn.current=j.useMemo(()=>wr*G+Nt,[wr,Nt]),j.useEffect(()=>{ne(!0)},[]),j.useLayoutEffect(()=>{if(!ke)return;let B=hn.current,pe=B.style.height;B.style.height="auto";let ye=B.getBoundingClientRect().height;B.style.height=pe,Mt(ye),d(it=>it.find(wt=>wt.toastId===u.id)?it.map(wt=>wt.toastId===u.id?{...wt,height:ye}:wt):[{toastId:u.id,height:ye},...it])},[ke,u.title,u.description,d,u.id]);let ot=j.useCallback(()=>{b(!0),ze(mn.current),d(B=>B.filter(pe=>pe.toastId!==u.id)),setTimeout(()=>{p(u)},Fx)},[u,p,d,mn]);j.useEffect(()=>{if(u.promise&&He==="loading"||u.duration===1/0)return;let B,pe=uo;return h||f?(()=>{if(_i.current{var ye;(ye=u.onAutoClose)==null||ye.call(u,u),ot()},pe)),()=>clearTimeout(B)},[h,f,q,u,uo,ot,u.promise,He]),j.useEffect(()=>{let B=hn.current;if(B){let pe=B.getBoundingClientRect().height;return Mt(pe),d(ye=>[{toastId:u.id,height:pe},...ye]),()=>d(ye=>ye.filter(it=>it.toastId!==u.id))}},[d,u.id]),j.useEffect(()=>{u.delete&&ot()},[ot,u.delete]);function wa(){return re?j.createElement("div",{className:"loader","data-visible":He==="loading"},re):j.createElement(Px,{visible:He==="loading"})}return j.createElement("li",{"aria-live":u.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:hn,className:Pr(R,ga,te==null?void 0:te.toast,(t=u==null?void 0:u.classNames)==null?void 0:t.toast,te==null?void 0:te[He],(n=u==null?void 0:u.classNames)==null?void 0:n[He]),"data-sonner-toast":"","data-styled":!(u.jsx||u.unstyled||c),"data-mounted":ke,"data-promise":!!u.promise,"data-removed":M,"data-visible":Ge,"data-y-position":fo,"data-x-position":po,"data-index":w,"data-front":va,"data-swiping":A,"data-dismissible":qt,"data-type":He,"data-invert":Vn,"data-swipe-out":Z,"data-expanded":!!(h||q&&ke),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${M?_e:mn.current}px`,"--initial-height":q?"auto":`${be}px`,...k,...u.style},onPointerDown:B=>{Sr||!qt||(ki.current=new Date,ze(mn.current),B.target.setPointerCapture(B.pointerId),B.target.tagName!=="BUTTON"&&(V(!0),gt.current={x:B.clientX,y:B.clientY}))},onPointerUp:()=>{var B,pe,ye,it;if(Z||!qt)return;gt.current=null;let wt=Number(((B=hn.current)==null?void 0:B.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Kn=new Date().getTime()-((pe=ki.current)==null?void 0:pe.getTime()),xr=Math.abs(wt)/Kn;if(Math.abs(wt)>=Ax||xr>.11){ze(mn.current),(ye=u.onDismiss)==null||ye.call(u,u),ot(),ie(!0);return}(it=hn.current)==null||it.style.setProperty("--swipe-amount","0px"),V(!1)},onPointerMove:B=>{var pe;if(!gt.current||!qt)return;let ye=B.clientY-gt.current.y,it=B.clientX-gt.current.x,wt=(fo==="top"?Math.min:Math.max)(0,ye),Kn=B.pointerType==="touch"?10:2;Math.abs(wt)>Kn?(pe=hn.current)==null||pe.style.setProperty("--swipe-amount",`${ye}px`):Math.abs(it)>Kn&&(gt.current=null)}},m&&!u.jsx?j.createElement("button",{"aria-label":de,"data-disabled":Sr,"data-close-button":!0,onClick:Sr||!qt?()=>{}:()=>{var B;ot(),(B=u.onDismiss)==null||B.call(u,u)},className:Pr(te==null?void 0:te.closeButton,(r=u==null?void 0:u.classNames)==null?void 0:r.closeButton)},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},j.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),j.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,u.jsx||j.isValidElement(u.title)?u.jsx||u.title:j.createElement(j.Fragment,null,He||u.icon||u.promise?j.createElement("div",{"data-icon":""},(u.promise||u.type==="loading")&&!u.icon?wa():null,u.icon||_x(He)):null,j.createElement("div",{"data-content":""},j.createElement("div",{"data-title":"",className:Pr(te==null?void 0:te.title,(o=u==null?void 0:u.classNames)==null?void 0:o.title)},u.title),u.description?j.createElement("div",{"data-description":"",className:Pr(N,Zt,te==null?void 0:te.description,(i=u==null?void 0:u.classNames)==null?void 0:i.description)},u.description):null),u.cancel?j.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||P,onClick:()=>{var B;qt&&(ot(),(B=u.cancel)!=null&&B.onClick&&u.cancel.onClick())},className:Pr(te==null?void 0:te.cancelButton,(l=u==null?void 0:u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,u.action?j.createElement("button",{"data-button":"",style:u.actionButtonStyle||v,onClick:B=>{var pe;(pe=u.action)==null||pe.onClick(B),!B.defaultPrevented&&ot()},className:Pr(te==null?void 0:te.actionButton,(a=u==null?void 0:u.classNames)==null?void 0:a.actionButton)},u.action.label):null))};function Yd(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Qc=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:l,offset:a,theme:s="light",richColors:u,duration:c,style:f,visibleToasts:d=Ox,toastOptions:g,dir:y=Yd(),gap:w,loadingIcon:S,containerAriaLabel:h="Notifications"}=e,[p,m]=j.useState([]),k=j.useMemo(()=>Array.from(new Set([n].concat(p.filter(M=>M.position).map(M=>M.position)))),[p,n]),[P,v]=j.useState([]),[R,N]=j.useState(!1),[L,F]=j.useState(!1),[G,re]=j.useState(s!=="system"?s:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=j.useRef(null),te=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),de=j.useRef(null),ke=j.useRef(!1),ne=j.useCallback(M=>m(b=>b.filter(({id:A})=>A!==M.id)),[]);return j.useEffect(()=>jt.subscribe(M=>{if(M.dismiss){m(b=>b.map(A=>A.id===M.id?{...A,delete:!0}:A));return}setTimeout(()=>{Jm.flushSync(()=>{m(b=>{let A=b.findIndex(V=>V.id===M.id);return A!==-1?[...b.slice(0,A),{...b[A],...M},...b.slice(A+1)]:[M,...b]})})})}),[]),j.useEffect(()=>{if(s!=="system"){re(s);return}s==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:M})=>{re(M?"dark":"light")})},[s]),j.useEffect(()=>{p.length<=1&&N(!1)},[p]),j.useEffect(()=>{let M=b=>{var A,V;r.every(Z=>b[Z]||b.code===Z)&&(N(!0),(A=q.current)==null||A.focus()),b.code==="Escape"&&(document.activeElement===q.current||(V=q.current)!=null&&V.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),j.useEffect(()=>{if(q.current)return()=>{de.current&&(de.current.focus({preventScroll:!0}),de.current=null,ke.current=!1)}},[q.current]),p.length?j.createElement("section",{"aria-label":`${h} ${te}`,tabIndex:-1},k.map((M,b)=>{var A;let[V,Z]=M.split("-");return j.createElement("ol",{key:M,dir:y==="auto"?Yd():y,tabIndex:-1,ref:q,className:l,"data-sonner-toaster":!0,"data-theme":G,"data-rich-colors":u,"data-y-position":V,"data-x-position":Z,style:{"--front-toast-height":`${(A=P[0])==null?void 0:A.height}px`,"--offset":typeof a=="number"?`${a}px`:a||Dx,"--width":`${bx}px`,"--gap":`${_y}px`,...f},onBlur:ie=>{ke.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(ke.current=!1,de.current&&(de.current.focus({preventScroll:!0}),de.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||ke.current||(ke.current=!0,de.current=ie.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{L||N(!1)},onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},p.filter(ie=>!ie.position&&b===0||ie.position===M).map((ie,_e)=>{var ze;return j.createElement($x,{key:ie.id,index:_e,toast:ie,duration:(ze=g==null?void 0:g.duration)!=null?ze:c,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:d,closeButton:i,interacting:L,position:M,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ne,toasts:p,heights:P,setHeights:v,expandByDefault:o,gap:w,loadingIcon:S,expanded:R})}))})):null};function Ux(e){for(var t=[],n=1;n=0&&u>=0&&sf.slice()),i=o.length,l=o[0].length,a=pt(i,l,!1),s=pt(i,l,null),u=[t];a[t.row][t.col]=!0;const c=Gx(o,s,a,u);for(;u.length;){const f=u.length,d=[];for(let g=0;g=l||d>=a||s[f][d]||i[f][d]===D.wall?!1:(s[f][d]=!0,u[f][d]={row:g,col:y},f===n.row&&d===n.col?!0:(y!==-1&&g!==-1&&await r(i,{row:f,col:d},D.fill),await o(f+1,d,f,d)||await o(f-1,d,f,d)||await o(f,d+1,f,d)||await o(f,d-1,f,d)))}const i=e.map(f=>f.slice()),l=i.length,a=i[0].length,s=pt(l,a,!1),u=pt(l,a,null);return await o(t.row,t.col)?{grid:i,parents:u}:{grid:i,parents:null}}const us=new Map([["bfs",{name:"BFS",fn:Yx}],["dfs",{name:"DFS",fn:Xx}]]),Jx="_controller_18d51_1",qx="_operation_18d51_7",Zx="_execution_18d51_11",eE="_speed_18d51_21",pi={controller:Jx,operation:qx,execution:Zx,speed:eE};async function tE(e,t,n,r,o,i){let l=n.row,a=n.col;[l,a]=[e[l][a].row,e[l][a].col];let s=0;if(t.row===l&&t.col===a)return s;do r({row:l,col:a}),i>0&&await ur(i),[l,a]=[e[l][a].row,e[l][a].col],s+=1;while(o()&&(t.row!==l||t.col!==a));return s}function Xd(e,t){return async(n,r)=>{const o=r().pathFinder;n(ml(Me.Searching));function i(){return r().pathFinder.status===Me.Searching}async function l(a,s,u=D.clear){if(!i())throw new Error("Path search cancelled");Array.isArray(s)||(s=[s]),s.forEach(c=>{a[c.row][c.col]=u}),t&&(n($p({cells:s,cellType:u})),await ur(t))}try{const{grid:a,parents:s}=await e({grid:o.grid,entry:o.entry,exit:o.exit,updateCells:l});if(n(ws({grid:a})),s){Bo.success("Path found!!! 😃");const u=await tE(s,o.entry,o.exit,c=>n(Ss({...c,cellType:D.path})),()=>r().pathFinder.status===Me.Searching,t*2);Bo("Path length is "+(u+1))}else Bo.error("No path found 😔");n(ml(Me.Complete))}catch{}}}const Jd=new Map([["∞",0],["4x",1],["2x",20],["1x",30],["0.5x",50],["0.1x",250]]);function nE(){const e=vt(),[t,n]=E.useState([...us.keys()][0]),[r,o]=E.useState([...Jd.values()][1]),i=ue(c=>c.pathFinder.entry),l=ue(c=>c.pathFinder.exit),a=ue(c=>c.pathFinder.status),s=us.get(t);Cy(()=>{a===Me.Complete&&(e(za()),e(Xd(s.fn,0)))},333,[i,l]);function u(){a===Me.Complete&&e(za()),e(Xd(s.fn,r))}return _.jsxs("div",{className:pi.execution,children:[_.jsx("select",{name:"path-finder",id:"maze",value:t,onChange:c=>n(c.target.value),children:[...us.entries()].map(([c,{name:f}])=>_.jsx("option",{value:c,children:f},c))}),_.jsx("select",{className:pi.speed,name:"speed",id:"speed",value:r,onChange:c=>o(+c.target.value),children:[...Jd.entries()].map(([c,f])=>_.jsx("option",{value:f,children:c},c))}),_.jsx("button",{"data-testid":"player",onClick:u,disabled:a===Me.Generating||a===Me.Searching,"data-tooltip":"Play",children:_.jsx(gy,{size:24})}),_.jsx("button",{"data-testid":"clear",onClick:()=>e(za()),disabled:a===Me.Generating,"data-tooltip":"clear",children:_.jsx(QS,{size:24})})]})}async function rE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.clear);o(l);for(let a=0;a({row:t+i.row,col:n+i.col})).filter(i=>i.row>=0&&i.row=0&&i.cole[i.row][i.col]!==D.clear)}function oE(e,{row:t,col:n}){const r=e.length,o=e[0].length;return Py.map(i=>({row:t+i.row,col:n+i.col})).filter(i=>i.row>=0&&i.row=0&&i.cole[i.row][i.col]===D.clear)}function iE(e,t){const n=oE(e,t),r=n[Math.floor(Math.random()*n.length)];return{row:t.row+(r.row-t.row)/2,col:t.col+(r.col-t.col)/2}}async function lE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.wall);o(l);const a=[],s={row:0,col:0};for(i(l,s),a.push(...qd(l,s));a.length;){const u=Math.floor(Math.random()*a.length),c=a[u];if(a.splice(u,1),l[c.row][c.col]!==D.clear){const f=iE(l,c);await i(l,[f,c]),a.push(...qd(l,c))}}return i(l,n,D.entry),i(l,r,D.exit),l}function Zd(e,t){return Math.floor(Math.random()*(t-e+1)/2)*2+e}function ep(e,t){return Math.floor(Math.random()*(t-e)/2)*2+1+e}async function aE(e,{updateCells:t,divisionPoint:n,passagePoint:r,start:o,end:i}){for(let l=o;l<=i;l++)await t(e,[{row:n,col:l}],D.wall);await t(e,[{row:n,col:r}])}async function sE(e,{updateCells:t,divisionPoint:n,passagePoint:r,start:o,end:i}){for(let l=o;l<=i;l++)await t(e,[{row:l,col:n}],D.wall);await t(e,[{row:r,col:n}])}async function uE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.clear);o(l);async function a(s,u,c,f){if(u-s<2||f-c<2)return;const d=f-c,g=u-s;if(d({row:t+i.row,col:n+i.col})).filter(i=>i.row>=0&&i.row=0&&i.cole[i.row][i.col]!==D.clear)}async function dE(e,t,n,r){const o={row:r.row+(n.row-r.row)/2,col:r.col+(n.col-r.col)/2};await t(e,[o,r],D.clear)}async function pE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.wall);o(l),i(l,{row:0,col:0});async function a(s,u){const c=fE(l,s,u);for(;c.length;){const f=Math.floor(Math.random()*c.length),d=c[f];c.splice(f,1),l[d.row][d.col]!==D.clear&&(await dE(l,i,{row:s,col:u},d),await a(d.row,d.col))}}return await a(0,0),i(l,n,D.entry),i(l,r,D.exit),l}const hE=[{row:-1,col:0},{row:0,col:-1}],mE=(e,t)=>{const n=e.length,r=e[0].length;return hE.map(o=>({row:t.row+o.row,col:t.col+o.col})).filter(o=>o.row>=0&&o.row=0&&o.colnew Set([`${c}-${f}`]));for(;a.length;){const c=Math.floor(Math.random()*a.length),f=a.splice(c,1)[0],[d,g]=wE(f),y=u.find(S=>S.has(`${d.row}-${d.col}`)),w=u.find(S=>S.has(`${g.row}-${g.col}`));y!==w?(w.forEach(S=>y.add(S)),u.splice(u.indexOf(w),1),await i(l,[d,g,f])):await i(l,f,D.wall)}return i(l,n,D.entry),i(l,r,D.exit),l}async function xE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.wall);o(l);const a=l[0].map((s,u)=>({row:0,col:u}));await i(l,a);for(let s=2;s{s[f.row][f.col]=c}),t&&(n($p({cells:u,cellType:c})),await ur(t))}try{const s=await e({rows:o.rows,cols:o.cols,entry:o.entry,exit:o.exit,updateGrid:i,updateCells:a});n(ws({grid:s})),n(ml(Me.Ready))}catch{}}}const tp=new Map([["∞",0],["4x",1],["2x",10],["1x",25],["0.7x",50],["0.5x",100],["0.1x",250]]);function kE(){const e=vt(),[t,n]=E.useState([...tp.values()][1]),[r,o]=E.useState([...cs.keys()][0]),i=ue(s=>s.pathFinder.status),l=cs.get(r);function a(){l&&e(EE(l.fn,t))}return _.jsxs("div",{className:pi.operation,children:[_.jsx("select",{name:"maze",id:"maze",value:r,onChange:s=>o(s.target.value),children:[...cs.entries()].map(([s,{name:u}])=>_.jsx("option",{value:s,children:u},s))}),_.jsx("select",{className:pi.speed,name:"speed",id:"speed",value:t,onChange:s=>n(+s.target.value),children:[...tp.entries()].map(([s,u])=>_.jsx("option",{value:u,children:s},s))}),_.jsx("button",{"data-testid":"generate-maze",onClick:a,"data-tooltip":"Play",disabled:![Me.Ready,Me.Complete].includes(i),children:_.jsx(gy,{size:24})}),_.jsx("button",{"data-testid":"reset",onClick:()=>e(Up()),"data-tooltip":"Reset",children:_.jsx(YS,{size:24})})]})}function _E(){const e=vt(),t=ue(i=>i.pathFinder.rows),n=ue(i=>i.pathFinder.cols),{width:r,height:o}=Qx();return Cy(()=>{const i=Ap();i.maxRows===t&&i.maxCols===n||(e(_g({rows:i.maxRows,cols:i.maxCols})),e(Up()))},333,[r,o]),_.jsxs("section",{className:pi.controller,children:[_.jsx(kE,{}),_.jsx(nE,{})]})}const CE="_grid_q4uhk_1",PE="_type0_q4uhk_6",RE="_type1_q4uhk_9",TE="_type2_q4uhk_13",ME="_type3_q4uhk_17",NE="_wallAnimation_q4uhk_1",zE="_type4_q4uhk_22",jE="_visitedAnimation_q4uhk_1",LE="_type5_q4uhk_27",np={grid:CE,type0:PE,type1:RE,type2:TE,type3:ME,wallAnimation:NE,type4:zE,visitedAnimation:jE,type5:LE};function rp(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function Ry(e){if(!e)return{isValidCell:!1};if(e.tagName!=="BUTTON")return{isValidCell:!1};const t=+(e.dataset.row??-1),n=+(e.dataset.col??-1),r=+(e.dataset.cellType??-1);return t===-1||n===-1||r===-1?{isValidCell:!1}:{isValidCell:!0,selectedCell:{row:t,col:n,cellType:r}}}function OE({isMobile:e,ref:t}){const[n,r]=E.useState(null),o=E.useRef(null),i=E.useCallback(l=>{if(!e)return;const a=l.target;if(!a)return;const{isValidCell:s,selectedCell:u}=Ry(a);if(!s)return;const c=u.cellType;if([D.entry,D.exit].includes(c)){o.current=u;return}if(![D.entry,D.exit,D.wall].includes(u.cellType)&&o.current){r({...u,cellType:o.current.cellType}),o.current=null;return}r({...u,cellType:c===D.wall?D.clear:D.wall}),o.current=null},[e]);return E.useEffect(()=>{if(!e)return;const l=t.current;if(l)return l.addEventListener("click",i),()=>{l.removeEventListener("mousedown",i)}},[e,i,t]),n}function DE({isMobile:e,ref:t}){const[n,r]=E.useState(null),o=E.useRef(!1);E.useEffect(()=>{if(e)return;const s=t.current;if(s)return s.addEventListener("mousedown",i),s.addEventListener("mousemove",l),s.addEventListener("mouseup",a),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mousedown",i),s.removeEventListener("mouseleave",l),s.removeEventListener("mouseup",a),s.removeEventListener("mouseleave",a)}},[e,t]);const i=s=>{s.target&&(o.current=!0,r(s.target))},l=s=>{o.current&&r(s.target)},a=()=>{o.current=!1,r(null)};return{element:n,isMouseDown:o.current}}function IE({isMobile:e,ref:t}){const[n,r]=E.useState(null),{element:o,isMouseDown:i}=DE({isMobile:e,ref:t}),{isValidCell:l,selectedCell:a}=Ry(o),s=E.useRef(null),u=E.useRef(!1);return E.useEffect(()=>{var f,d;if(!(!l||((f=s.current)==null?void 0:f.col)===a.col&&((d=s.current)==null?void 0:d.row)===a.row)){if(u.current&&s.current){[D.entry,D.exit,D.wall].includes(a.cellType)||(r({...a,cellType:s.current.cellType}),s.current={...a,cellType:s.current.cellType});return}[D.entry,D.exit].includes(a.cellType)||(r({row:a.row,col:a.col,cellType:a.cellType===D.wall?D.clear:D.wall}),s.current=a)}},[l,a]),E.useEffect(()=>{i&&a&&!s.current&&(s.current=a,u.current=[D.entry,D.exit].includes(a.cellType)),i||(s.current=null,u.current=!1)},[i,a]),n}function bE(){const e=vt(),t=ue(c=>c.pathFinder.grid),n=ue(c=>c.pathFinder.entry),r=ue(c=>c.pathFinder.exit),o=ue(c=>c.pathFinder.status),i=E.useRef(null),l=OE({isMobile:rp(),ref:i}),a=IE({isMobile:rp(),ref:i}),s=E.useCallback(function(f){if(f){const d=f.cellType===D.entry?n:r;[D.entry,D.exit].includes(f.cellType)&&!(f.row===d.row&&f.col===d.col)&&e(Ss({...d,cellType:D.clear})),d.row===f.row&&d.col===f.col||e(Ss(f))}},[e,n,r]);E.useEffect(()=>{s(l)},[l,s]),E.useEffect(()=>{s(a)},[a,s]);const u={gridTemplateRows:`repeat(${t.length}, ${qn}px)`,gridTemplateColumns:`repeat(${t[0].length}, ${qn}px)`};return _.jsx("div",{className:np.grid,style:u,ref:i,children:t.map((c,f)=>c.map((d,g)=>_.jsx("button",{"data-row":f,"data-col":g,"data-cell-type":d,className:np["type"+d],disabled:o===Me.Searching},`${f}-${g}`)))})}function AE(){return _.jsxs(_.Fragment,{children:[_.jsx(Kc,{top:10,right:20}),_.jsx(Wc,{title:"Path Finder"}),_.jsx(_E,{}),_.jsx("main",{className:"text-center",children:_.jsx(bE,{})})]})}function FE(){return _.jsxs(_.Fragment,{children:[_.jsx(Qc,{richColors:!0,duration:3e3,position:"top-center"}),_.jsx(AE,{})]})}const $E=[{path:"/path-finder/",element:_.jsx(FE,{})}];function UE(e){return e=e.replace(/\s/g,""),e=e.replace(/\d{4}/g,""),e=e.replace(/\s\s/g," "),e=e.replace(/\s,/g,","),e=e.replace(/,,/g,","),e=e.replace(/[^0-9,\s]/g,""),e.split(",").join(", ").trim()}function BE(e){return e.split(",").filter(t=>t!=="").map(t=>+t)}function op(e=0,t=999){return Math.floor(Math.random()*(t-e))+e}const HE=e=>{const t=e.length;for(let n=0;nn-r);case"descending":return[...t].sort((n,r)=>r-n);case"random":return HE([...t])}return t}const WE="_controllerWrapper_18ff3_1",VE="_controller_18ff3_1",KE="_numbers_18ff3_9",QE="_generator_18ff3_15",GE="_rndmBtn_18ff3_20",YE="_select_18ff3_28",XE="_arrayInput_18ff3_37",JE="_controls_18ff3_51",qE="_checkboxWrapper_18ff3_63",ZE="_listItem_18ff3_70",ek="_checkbox_18ff3_63",tk="_switchContainer_18ff3_87",Pt={controllerWrapper:WE,controller:VE,numbers:KE,generator:QE,rndmBtn:GE,select:YE,arrayInput:XE,controls:JE,checkboxWrapper:qE,listItem:ZE,checkbox:ek,switchContainer:tk},nk=["random","ascending","descending"];function rk({setInput:e}){const t=vt(),n=ue(a=>a.sortViz.array),[r,o]=E.useState("random"),i=()=>{let a=Array.from(new Array(op(Sf.min,Sf.max)),()=>op());r!=="random"&&(a=ip(r,a)),e(a.join(", ")),t(Cs(a))},l=a=>{const s=a.target.value;o(s);const u=ip(s,n);e(u.join(", ")),t(Cs(u))};return _.jsxs("div",{className:Pt.generator,children:[_.jsx("button",{className:Pt.rndmBtn,onClick:i,children:"Generate"}),_.jsx("select",{className:Pt.select,onChange:l,value:r,children:nk.map(a=>_.jsx("option",{value:a,children:a},a))})]})}function ok(){const e=vt(),t=ue(i=>i.sortViz.array),[n,r]=E.useState(t.join(", "));E.useEffect(()=>{e(Yr(!1)),e(ql())},[t,e]);const o=i=>{const l=UE(i.target.value);r(l);const a=BE(l);e(Cs(a))};return _.jsxs("div",{className:Pt.numbers,children:[_.jsx(rk,{setInput:r}),_.jsx("input",{id:"user-input",className:Pt.arrayInput,type:"text",placeholder:"Numbers to sort (comma separate - max 3 digits)",value:n,onChange:o})]})}const ik="/algo-visualizers/icons/pause.svg",lk="/algo-visualizers/icons/play.svg",ak="/algo-visualizers/icons/reset.svg";function sk(){const e=vt(),t=ue(i=>i.sortViz.array),n=ue(i=>i.sortViz.speed),r=ue(i=>i.sortViz.isPlaying),o=ue(i=>i.sortViz.reset);return E.useEffect(()=>{r&&e(Kg())},[e,r]),E.useEffect(()=>{e(Yr(!1))},[e,o]),E.useEffect(()=>{e(Ef(n))},[e,n]),_.jsxs("div",{className:Pt.controls,children:[_.jsx("button",{"data-testid":"player",onClick:()=>e(Yr(!r)),disabled:t.length===0||r===null,"data-tooltip":r?"Pause":"Play",children:_.jsx("img",{src:r?ik:lk,alt:r?"Pause":"Play",height:24,width:24})}),_.jsx("button",{onClick:()=>e(ql()),disabled:t.length===0,"data-tooltip":"Reset",children:_.jsx("img",{src:ak,height:24,width:24})}),_.jsx("input",{id:"speed","data-tooltip":"Animation speed",type:"range",min:1,max:20,value:n,step:1,onChange:i=>e(Ef(i.target.valueAsNumber))})]})}function Pu(){return Pu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=s)&&this.A(n),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(n){n.preventDefault(),typeof n.button=="number"&&n.button!==0||(this.I(n.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(n){n.preventDefault(),this.L(n.clientX)},t.prototype.g=function(n){this.U(n),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(n){this.X=null,this.I(n.touches[0].clientX)},t.prototype.m=function(n){this.L(n.touches[0].clientX)},t.prototype.M=function(n){n.preventDefault(),this.U(n)},t.prototype.$=function(n){Date.now()-this.l>50&&(this.A(n),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(n){this.H=n},t.prototype.T=function(n){n.preventDefault(),this.H.focus(),this.A(n),this.W&&this.setState({j:!1})},t.prototype.A=function(n){var r=this.props;(0,r.onChange)(!r.checked,n,r.id)},t.prototype.render=function(){var n=this.props,r=n.checked,o=n.disabled,i=n.className,l=n.offColor,a=n.onColor,s=n.offHandleColor,u=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,d=n.checkedHandleIcon,g=n.uncheckedHandleIcon,y=n.boxShadow,w=n.activeBoxShadow,S=n.height,h=n.width,p=n.borderRadius,m=function(de,ke){var ne={};for(var M in de)Object.prototype.hasOwnProperty.call(de,M)&&ke.indexOf(M)===-1&&(ne[M]=de[M]);return ne}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),k=this.state,P=k.h,v=k.N,R=k.j,N={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:S/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},L={height:S,width:h,margin:Math.max(0,(this.t-S)/2),position:"relative",background:ap(P,this.i,this.o,l,a),borderRadius:typeof p=="number"?p:S/2,cursor:o?"default":"pointer",WebkitTransition:v?null:"background 0.25s",MozTransition:v?null:"background 0.25s",transition:v?null:"background 0.25s"},F={height:S,width:Math.min(1.5*S,h-(this.t+S)/2+1),position:"relative",opacity:(P-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"},G={height:S,width:Math.min(1.5*S,h-(this.t+S)/2+1),position:"absolute",opacity:1-(P-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"},re={height:this.t,width:this.t,background:ap(P,this.i,this.o,s,u),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof p=="number"?p-1:"50%",position:"absolute",transform:"translateX("+P+"px)",top:Math.max(0,(S-this.t)/2),outline:0,boxShadow:R?w:y,border:0,WebkitTransition:v?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:v?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:v?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},q={height:this.t,width:this.t,opacity:Math.max(2*(1-(P-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"},te={height:this.t,width:this.t,opacity:Math.max(2*((P-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"};return j.createElement("div",{className:i,style:N},j.createElement("div",{className:"react-switch-bg",style:L,onClick:o?null:this.T,onMouseDown:function(de){return de.preventDefault()}},c&&j.createElement("div",{style:F},c),f&&j.createElement("div",{style:G},f)),j.createElement("div",{className:"react-switch-handle",style:re,onClick:function(de){return de.preventDefault()},onMouseDown:o?null:this.p,onTouchStart:o?null:this.k,onTouchMove:o?null:this.m,onTouchEnd:o?null:this.M,onTouchCancel:o?null:this.O},g&&j.createElement("div",{style:q},g),d&&j.createElement("div",{style:te},d)),j.createElement("input",Pu({},{type:"checkbox",role:"switch","aria-checked":r,checked:r,disabled:o,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},m,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})))},t}(E.Component);Ty.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:uk,checkedIcon:ck,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};function fk(){const e=vt(),t=ue(n=>n.sortViz.visualizerType);return _.jsxs("div",{className:Pt.switchContainer,children:[_.jsx("label",{children:"Cell"}),_.jsx(Ty,{id:"visualizerType",onChange:()=>e(Wg()),checked:t==="bar",checkedIcon:!1,uncheckedIcon:!1,height:20,width:40,offColor:"#2b4bfe",onColor:"#2b4bfe"}),_.jsx("label",{children:"Bar"})]})}function dk(){const{algoName:e}=Hc(),t=vt();return E.useEffect(()=>{t(Yr(!1)),t(ql())},[e,t]),_.jsxs("section",{className:Pt.controllerWrapper,children:[_.jsxs("div",{className:Pt.controller,"data-testid":"controller",children:[_.jsx(ok,{}),_.jsx(sk,{})]}),_.jsx(fk,{})]})}const pk="_main_1hg6y_1",hk="_allAlgos_1hg6y_6",My={main:pk,allAlgos:hk};function Hl({children:e}){return _.jsxs("div",{children:[_.jsx(Kc,{bottom:10,right:20}),_.jsx(Wc,{title:"Sorting Visualizer",menuItems:Wp}),_.jsx(dk,{}),_.jsx("main",{className:My.main,children:e})]})}const mk="_container_wgxfy_1",yk="_warning_wgxfy_20",Ny={container:mk,warning:yk};function zy(){return _.jsx("p",{className:Ny.warning,children:"Please enter a valid list of numbers to play with the visualization"})}function vk({algoName:e,isCompleted:t}){const n=ue(o=>o.sortViz.time),r=E.useRef(0);return E.useEffect(()=>{t&&(r.current=n)},[t]),_.jsxs("header",{children:[_.jsxs("h2",{children:[e," Sort"]}),_.jsxs("span",{children:["Time: ",_.jsx("strong",{children:r.current||n})]})]})}const gk="_arrayContainer_116to_1",wk="_values_116to_6",Sk="_pivot_116to_19",xk="_sort_116to_22",Ek="_highlight_116to_25",kk="_indices_116to_28",Qi={arrayContainer:gk,values:wk,pivot:Sk,sort:xk,highlight:Ek,indices:kk};function _k({array:e,sorts:t,highlights:n,pivot:r}){const o=E.useMemo(()=>Math.max(...e),[e]);function i(l){let a="";return r===l&&(a="pivot"),t.includes(l)&&(a="sort"),n.includes(l)&&(a="highlight"),a}return _.jsxs("div",{className:Qi.arrayContainer,children:[_.jsx("ul",{className:Qi.values,"data-testid":"bar-values",children:e.map((l,a)=>_.jsx("li",{className:Qi[i(a)],style:{height:`${l/o*100}%`}},a))}),_.jsx("ul",{className:Qi.indices,children:e.map((l,a)=>_.jsx("li",{children:a},a))})]})}const Ck="_arrayContainer_9tgyc_1",Pk="_values_9tgyc_6",Rk="_cell_9tgyc_10",Tk="_pivot_9tgyc_24",Mk="_sort_9tgyc_27",Nk="_highlight_9tgyc_30",zk="_indices_9tgyc_33",Ho={arrayContainer:Ck,values:Pk,cell:Rk,pivot:Tk,sort:Mk,highlight:Nk,indices:zk};function Gc({order:e,animation:t,value:n,isSorted:r=!1,isHighlighted:o=!1,isPivot:i=!1}){let l="";return i&&(l="pivot"),r&&(l="sort"),o&&(l="highlight"),_.jsx("li",{className:`${Ho.cell} ${Ho[l]}`,style:{animation:t,order:e},children:n})}const Rr=document.querySelector('[data-id="animation-element"]');function jy(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=kn.size+kn.margin,i=`@keyframes ${n} { + */var Ei=E;function XS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var JS=typeof Object.is=="function"?Object.is:XS,ZS=Ei.useSyncExternalStore,qS=Ei.useRef,ex=Ei.useEffect,tx=Ei.useMemo,nx=Ei.useDebugValue;Sy.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=qS(null);if(i.current===null){var l={hasValue:!1,value:null};i.current=l}else l=i.current;i=tx(function(){function s(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&l.hasValue){var y=l.value;if(o(y,g))return f=y}return f=g}if(y=f,JS(c,g))return y;var w=r(g);return o!==void 0&&o(y,w)?y:(c=g,f=w)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return s(t())},d===null?void 0:function(){return s(d())}]},[t,n,r,o]);var a=ZS(e,i[0],i[1]);return ex(function(){l.hasValue=!0,l.value=a},[a]),nx(a),a};wy.exports=Sy;var rx=wy.exports,st="default"in fs?j:fs,Kd=Symbol.for("react-redux-context"),Qd=typeof globalThis<"u"?globalThis:{};function ox(){if(!st.createContext)return{};const e=Qd[Kd]??(Qd[Kd]=new Map);let t=e.get(st.createContext);return t||(t=st.createContext(null),e.set(st.createContext,t)),t}var $n=ox(),ix=()=>{throw new Error("uSES not initialized!")};function Vc(e=$n){return function(){return st.useContext(e)}}var xy=Vc(),Ey=ix,lx=e=>{Ey=e},ax=(e,t)=>e===t;function sx(e=$n){const t=e===$n?xy:Vc(e);return function(r,o={}){const{equalityFn:i=ax,devModeChecks:l={}}=typeof o=="function"?{equalityFn:o}:o,{store:a,subscription:s,getServerState:u,stabilityCheck:c,identityFunctionCheck:f}=t();st.useRef(!0);const d=st.useCallback({[r.name](y){return r(y)}}[r.name],[r,c,l.stabilityCheck]),g=Ey(s.addNestedSub,a.getState,u||a.getState,d,i);return st.useDebugValue(g),g}}var ux=sx();function cx(e){e()}function fx(){let e=null,t=null;return{clear(){e=null,t=null},notify(){cx(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0,o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Gd={notify(){},get:()=>[]};function dx(e,t){let n,r=Gd,o=0,i=!1;function l(w){c();const S=r.subscribe(w);let h=!1;return()=>{h||(h=!0,S(),f())}}function a(){r.notify()}function s(){y.onStateChange&&y.onStateChange()}function u(){return i}function c(){o++,n||(n=t?t.addNestedSub(s):e.subscribe(s),r=fx())}function f(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Gd)}function d(){i||(i=!0,c())}function g(){i&&(i=!1,f())}const y={addNestedSub:l,notifyNestedSubs:a,handleChangeWrapper:s,isSubscribed:u,trySubscribe:d,tryUnsubscribe:g,getListeners:()=>r};return y}var px=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hx=px?st.useLayoutEffect:st.useEffect;function mx({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:i="once"}){const l=st.useMemo(()=>{const u=dx(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:i}},[e,r,o,i]),a=st.useMemo(()=>e.getState(),[e]);hx(()=>{const{subscription:u}=l;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[l,a]);const s=t||$n;return st.createElement(s.Provider,{value:l},n)}var yx=mx;function ky(e=$n){const t=e===$n?xy:Vc(e);return function(){const{store:r}=t();return r}}var vx=ky();function gx(e=$n){const t=e===$n?vx:ky(e);return function(){return t().dispatch}}var wx=gx();lx(rx.useSyncExternalStoreWithSelector);const vt=wx,ue=ux;var qn=(e=>(e.LIGHT="light",e.DARK="dark",e))(qn||{});const Sx="_iconBtn_5is4s_1",xx={iconBtn:Sx};function Kc({top:e,left:t,bottom:n,right:r=20}){const o=vt(),i=ue(s=>s.app.theme),l=window.matchMedia("(prefers-color-scheme: dark)").matches?qn.DARK:qn.LIGHT,a=i??l;return E.useEffect(()=>{i?o(vf(i)):document.documentElement.setAttribute("data-theme",l)},[]),_.jsx(_.Fragment,{children:ha.createPortal(_.jsx("button",{className:xx.iconBtn,style:{top:e,left:t,bottom:n,right:r},onClick:()=>o(vf(a===qn.LIGHT?qn.DARK:qn.LIGHT)),children:a===qn.LIGHT?_.jsx(KS,{}):_.jsx(GS,{color:"black"})}),document.getElementById("screen-layout"))})}function Ex(){return _.jsxs(_.Fragment,{children:[_.jsx(Kc,{top:10,right:20}),_.jsx(Wc,{title:"Algo visualizers"}),_.jsx(AS,{})]})}function kx(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}kx(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} +`);var _x=e=>{switch(e){case"success":return Rx;case"info":return Mx;case"warning":return Tx;case"error":return Nx;default:return null}},Cx=Array(12).fill(0),Px=({visible:e})=>j.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},j.createElement("div",{className:"sonner-spinner"},Cx.map((t,n)=>j.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Rx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Tx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Mx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Nx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Cu=1,zx=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Cu++,i=this.toasts.find(a=>a.id===o),l=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:l,title:n}):a):this.addToast({title:n,...r,dismissible:l,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(i=>{if(i&&typeof i.ok=="boolean"&&!i.ok){o=!1;let l=typeof t.error=="function"?t.error(`HTTP error! status: ${i.status}`):t.error;this.create({id:n,type:"error",message:l})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?t.success(i):t.success;this.create({id:n,type:"success",message:l})}}).catch(i=>{if(t.error!==void 0){o=!1;let l=typeof t.error=="function"?t.error(i):t.error;this.create({id:n,type:"error",message:l})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Cu++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},jt=new zx,jx=(e,t)=>{let n=(t==null?void 0:t.id)||Cu++;return jt.addToast({title:e,...t,id:n}),n},Lx=jx,Bo=Object.assign(Lx,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading}),Ox=3,Dx="32px",Ix=4e3,bx=356,_y=14,Ax=20,Fx=200;function Rr(...e){return e.filter(Boolean).join(" ")}var $x=e=>{var t,n,r,o,i,l,a;let{invert:s,toast:u,unstyled:c,interacting:f,setHeights:d,visibleToasts:g,heights:y,index:w,toasts:S,expanded:h,removeToast:p,closeButton:m,style:k,cancelButtonStyle:P,actionButtonStyle:v,className:R="",descriptionClassName:N="",duration:L,position:F,gap:G=_y,loadingIcon:re,expandByDefault:Z,classNames:te,closeButtonAriaLabel:de="Close toast"}=e,[ke,ne]=j.useState(!1),[M,b]=j.useState(!1),[A,V]=j.useState(!1),[q,ie]=j.useState(!1),[_e,ze]=j.useState(0),[be,Mt]=j.useState(0),ki=j.useRef(null),mn=j.useRef(null),va=w===0,Ge=w+1<=g,He=u.type,Zt=u.dismissible!==!1,ga=u.className||"",qt=u.descriptionClassName||"",Sr=j.useMemo(()=>y.findIndex(B=>B.toastId===u.id)||0,[y,u.id]),uo=j.useMemo(()=>u.duration||L||Ix,[u.duration,L]),co=j.useRef(0),yn=j.useRef(0);j.useRef(uo);let _i=j.useRef(0),gt=j.useRef(null),[fo,po]=F.split("-"),Nt=j.useMemo(()=>y.reduce((B,pe,ye)=>ye>=Sr?B:B+pe.height,0),[y,Sr]),Qn=u.invert||s,xr=He==="loading";yn.current=j.useMemo(()=>Sr*G+Nt,[Sr,Nt]),j.useEffect(()=>{ne(!0)},[]),j.useLayoutEffect(()=>{if(!ke)return;let B=mn.current,pe=B.style.height;B.style.height="auto";let ye=B.getBoundingClientRect().height;B.style.height=pe,Mt(ye),d(it=>it.find(wt=>wt.toastId===u.id)?it.map(wt=>wt.toastId===u.id?{...wt,height:ye}:wt):[{toastId:u.id,height:ye},...it])},[ke,u.title,u.description,d,u.id]);let ot=j.useCallback(()=>{b(!0),ze(yn.current),d(B=>B.filter(pe=>pe.toastId!==u.id)),setTimeout(()=>{p(u)},Fx)},[u,p,d,yn]);j.useEffect(()=>{if(u.promise&&He==="loading"||u.duration===1/0)return;let B,pe=uo;return h||f?(()=>{if(_i.current{var ye;(ye=u.onAutoClose)==null||ye.call(u,u),ot()},pe)),()=>clearTimeout(B)},[h,f,Z,u,uo,ot,u.promise,He]),j.useEffect(()=>{let B=mn.current;if(B){let pe=B.getBoundingClientRect().height;return Mt(pe),d(ye=>[{toastId:u.id,height:pe},...ye]),()=>d(ye=>ye.filter(it=>it.toastId!==u.id))}},[d,u.id]),j.useEffect(()=>{u.delete&&ot()},[ot,u.delete]);function wa(){return re?j.createElement("div",{className:"loader","data-visible":He==="loading"},re):j.createElement(Px,{visible:He==="loading"})}return j.createElement("li",{"aria-live":u.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:mn,className:Rr(R,ga,te==null?void 0:te.toast,(t=u==null?void 0:u.classNames)==null?void 0:t.toast,te==null?void 0:te[He],(n=u==null?void 0:u.classNames)==null?void 0:n[He]),"data-sonner-toast":"","data-styled":!(u.jsx||u.unstyled||c),"data-mounted":ke,"data-promise":!!u.promise,"data-removed":M,"data-visible":Ge,"data-y-position":fo,"data-x-position":po,"data-index":w,"data-front":va,"data-swiping":A,"data-dismissible":Zt,"data-type":He,"data-invert":Qn,"data-swipe-out":q,"data-expanded":!!(h||Z&&ke),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${M?_e:yn.current}px`,"--initial-height":Z?"auto":`${be}px`,...k,...u.style},onPointerDown:B=>{xr||!Zt||(ki.current=new Date,ze(yn.current),B.target.setPointerCapture(B.pointerId),B.target.tagName!=="BUTTON"&&(V(!0),gt.current={x:B.clientX,y:B.clientY}))},onPointerUp:()=>{var B,pe,ye,it;if(q||!Zt)return;gt.current=null;let wt=Number(((B=mn.current)==null?void 0:B.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Gn=new Date().getTime()-((pe=ki.current)==null?void 0:pe.getTime()),Er=Math.abs(wt)/Gn;if(Math.abs(wt)>=Ax||Er>.11){ze(yn.current),(ye=u.onDismiss)==null||ye.call(u,u),ot(),ie(!0);return}(it=mn.current)==null||it.style.setProperty("--swipe-amount","0px"),V(!1)},onPointerMove:B=>{var pe;if(!gt.current||!Zt)return;let ye=B.clientY-gt.current.y,it=B.clientX-gt.current.x,wt=(fo==="top"?Math.min:Math.max)(0,ye),Gn=B.pointerType==="touch"?10:2;Math.abs(wt)>Gn?(pe=mn.current)==null||pe.style.setProperty("--swipe-amount",`${ye}px`):Math.abs(it)>Gn&&(gt.current=null)}},m&&!u.jsx?j.createElement("button",{"aria-label":de,"data-disabled":xr,"data-close-button":!0,onClick:xr||!Zt?()=>{}:()=>{var B;ot(),(B=u.onDismiss)==null||B.call(u,u)},className:Rr(te==null?void 0:te.closeButton,(r=u==null?void 0:u.classNames)==null?void 0:r.closeButton)},j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},j.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),j.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,u.jsx||j.isValidElement(u.title)?u.jsx||u.title:j.createElement(j.Fragment,null,He||u.icon||u.promise?j.createElement("div",{"data-icon":""},(u.promise||u.type==="loading")&&!u.icon?wa():null,u.icon||_x(He)):null,j.createElement("div",{"data-content":""},j.createElement("div",{"data-title":"",className:Rr(te==null?void 0:te.title,(o=u==null?void 0:u.classNames)==null?void 0:o.title)},u.title),u.description?j.createElement("div",{"data-description":"",className:Rr(N,qt,te==null?void 0:te.description,(i=u==null?void 0:u.classNames)==null?void 0:i.description)},u.description):null),u.cancel?j.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||P,onClick:()=>{var B;Zt&&(ot(),(B=u.cancel)!=null&&B.onClick&&u.cancel.onClick())},className:Rr(te==null?void 0:te.cancelButton,(l=u==null?void 0:u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,u.action?j.createElement("button",{"data-button":"",style:u.actionButtonStyle||v,onClick:B=>{var pe;(pe=u.action)==null||pe.onClick(B),!B.defaultPrevented&&ot()},className:Rr(te==null?void 0:te.actionButton,(a=u==null?void 0:u.classNames)==null?void 0:a.actionButton)},u.action.label):null))};function Yd(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Qc=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:l,offset:a,theme:s="light",richColors:u,duration:c,style:f,visibleToasts:d=Ox,toastOptions:g,dir:y=Yd(),gap:w,loadingIcon:S,containerAriaLabel:h="Notifications"}=e,[p,m]=j.useState([]),k=j.useMemo(()=>Array.from(new Set([n].concat(p.filter(M=>M.position).map(M=>M.position)))),[p,n]),[P,v]=j.useState([]),[R,N]=j.useState(!1),[L,F]=j.useState(!1),[G,re]=j.useState(s!=="system"?s:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=j.useRef(null),te=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),de=j.useRef(null),ke=j.useRef(!1),ne=j.useCallback(M=>m(b=>b.filter(({id:A})=>A!==M.id)),[]);return j.useEffect(()=>jt.subscribe(M=>{if(M.dismiss){m(b=>b.map(A=>A.id===M.id?{...A,delete:!0}:A));return}setTimeout(()=>{Jm.flushSync(()=>{m(b=>{let A=b.findIndex(V=>V.id===M.id);return A!==-1?[...b.slice(0,A),{...b[A],...M},...b.slice(A+1)]:[M,...b]})})})}),[]),j.useEffect(()=>{if(s!=="system"){re(s);return}s==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:M})=>{re(M?"dark":"light")})},[s]),j.useEffect(()=>{p.length<=1&&N(!1)},[p]),j.useEffect(()=>{let M=b=>{var A,V;r.every(q=>b[q]||b.code===q)&&(N(!0),(A=Z.current)==null||A.focus()),b.code==="Escape"&&(document.activeElement===Z.current||(V=Z.current)!=null&&V.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),j.useEffect(()=>{if(Z.current)return()=>{de.current&&(de.current.focus({preventScroll:!0}),de.current=null,ke.current=!1)}},[Z.current]),p.length?j.createElement("section",{"aria-label":`${h} ${te}`,tabIndex:-1},k.map((M,b)=>{var A;let[V,q]=M.split("-");return j.createElement("ol",{key:M,dir:y==="auto"?Yd():y,tabIndex:-1,ref:Z,className:l,"data-sonner-toaster":!0,"data-theme":G,"data-rich-colors":u,"data-y-position":V,"data-x-position":q,style:{"--front-toast-height":`${(A=P[0])==null?void 0:A.height}px`,"--offset":typeof a=="number"?`${a}px`:a||Dx,"--width":`${bx}px`,"--gap":`${_y}px`,...f},onBlur:ie=>{ke.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(ke.current=!1,de.current&&(de.current.focus({preventScroll:!0}),de.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||ke.current||(ke.current=!0,de.current=ie.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{L||N(!1)},onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},p.filter(ie=>!ie.position&&b===0||ie.position===M).map((ie,_e)=>{var ze;return j.createElement($x,{key:ie.id,index:_e,toast:ie,duration:(ze=g==null?void 0:g.duration)!=null?ze:c,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:d,closeButton:i,interacting:L,position:M,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ne,toasts:p,heights:P,setHeights:v,expandByDefault:o,gap:w,loadingIcon:S,expanded:R})}))})):null};function Ux(e){for(var t=[],n=1;n=0&&u>=0&&sf.slice()),i=o.length,l=o[0].length,a=pt(i,l,!1),s=pt(i,l,null),u=[t];a[t.row][t.col]=!0;const c=Gx(o,s,a,u);for(;u.length;){const f=u.length,d=[];for(let g=0;g=l||d>=a||s[f][d]||i[f][d]===D.wall?!1:(s[f][d]=!0,u[f][d]={row:g,col:y},f===n.row&&d===n.col?!0:(y!==-1&&g!==-1&&await r(i,{row:f,col:d},D.fill),await o(f+1,d,f,d)||await o(f-1,d,f,d)||await o(f,d+1,f,d)||await o(f,d-1,f,d)))}const i=e.map(f=>f.slice()),l=i.length,a=i[0].length,s=pt(l,a,!1),u=pt(l,a,null);return await o(t.row,t.col)?{grid:i,parents:u}:{grid:i,parents:null}}const us=new Map([["bfs",{name:"BFS",fn:Yx}],["dfs",{name:"DFS",fn:Xx}]]),Jx="_controller_18d51_1",Zx="_operation_18d51_7",qx="_execution_18d51_11",eE="_speed_18d51_21",pi={controller:Jx,operation:Zx,execution:qx,speed:eE};async function tE(e,t,n,r,o,i){let l=n.row,a=n.col;[l,a]=[e[l][a].row,e[l][a].col];let s=0;if(t.row===l&&t.col===a)return s;do r({row:l,col:a}),i>0&&await fr(i),[l,a]=[e[l][a].row,e[l][a].col],s+=1;while(o()&&(t.row!==l||t.col!==a));return s}function Xd(e,t){return async(n,r)=>{const o=r().pathFinder;n(ml(Me.Searching));function i(){return r().pathFinder.status===Me.Searching}async function l(a,s,u=D.clear){if(!i())throw new Error("Path search cancelled");Array.isArray(s)||(s=[s]),s.forEach(c=>{a[c.row][c.col]=u}),t&&(n($p({cells:s,cellType:u})),await fr(t))}try{const{grid:a,parents:s}=await e({grid:o.grid,entry:o.entry,exit:o.exit,updateCells:l});if(n(ws({grid:a})),s){Bo.success("Path found!!! 😃");const u=await tE(s,o.entry,o.exit,c=>n(Ss({...c,cellType:D.path})),()=>r().pathFinder.status===Me.Searching,t*2);Bo("Path length is "+(u+1))}else Bo.error("No path found 😔");n(ml(Me.Complete))}catch{}}}const Jd=new Map([["∞",0],["4x",1],["2x",20],["1x",30],["0.5x",50],["0.1x",250]]);function nE(){const e=vt(),[t,n]=E.useState([...us.keys()][0]),[r,o]=E.useState([...Jd.values()][1]),i=ue(c=>c.pathFinder.entry),l=ue(c=>c.pathFinder.exit),a=ue(c=>c.pathFinder.status),s=us.get(t);Cy(()=>{a===Me.Complete&&(e(za()),e(Xd(s.fn,0)))},333,[i,l]);function u(){a===Me.Complete&&e(za()),e(Xd(s.fn,r))}return _.jsxs("div",{className:pi.execution,children:[_.jsx("select",{name:"path-finder",id:"maze",value:t,onChange:c=>n(c.target.value),children:[...us.entries()].map(([c,{name:f}])=>_.jsx("option",{value:c,children:f},c))}),_.jsx("select",{className:pi.speed,name:"speed",id:"speed",value:r,onChange:c=>o(+c.target.value),children:[...Jd.entries()].map(([c,f])=>_.jsx("option",{value:f,children:c},c))}),_.jsx("button",{"data-testid":"player",onClick:u,disabled:a===Me.Generating||a===Me.Searching,"data-tooltip":"Play",children:_.jsx(gy,{size:24})}),_.jsx("button",{"data-testid":"clear",onClick:()=>e(za()),disabled:a===Me.Generating,"data-tooltip":"clear",children:_.jsx(QS,{size:24})})]})}async function rE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.clear);o(l);for(let a=0;a({row:t+i.row,col:n+i.col})).filter(i=>i.row>=0&&i.row=0&&i.cole[i.row][i.col]!==D.clear)}function oE(e,{row:t,col:n}){const r=e.length,o=e[0].length;return Py.map(i=>({row:t+i.row,col:n+i.col})).filter(i=>i.row>=0&&i.row=0&&i.cole[i.row][i.col]===D.clear)}function iE(e,t){const n=oE(e,t),r=n[Math.floor(Math.random()*n.length)];return{row:t.row+(r.row-t.row)/2,col:t.col+(r.col-t.col)/2}}async function lE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.wall);o(l);const a=[],s={row:0,col:0};for(i(l,s),a.push(...Zd(l,s));a.length;){const u=Math.floor(Math.random()*a.length),c=a[u];if(a.splice(u,1),l[c.row][c.col]!==D.clear){const f=iE(l,c);await i(l,[f,c]),a.push(...Zd(l,c))}}return i(l,n,D.entry),i(l,r,D.exit),l}function qd(e,t){return Math.floor(Math.random()*(t-e+1)/2)*2+e}function ep(e,t){return Math.floor(Math.random()*(t-e)/2)*2+1+e}async function aE(e,{updateCells:t,divisionPoint:n,passagePoint:r,start:o,end:i}){for(let l=o;l<=i;l++)await t(e,[{row:n,col:l}],D.wall);await t(e,[{row:n,col:r}])}async function sE(e,{updateCells:t,divisionPoint:n,passagePoint:r,start:o,end:i}){for(let l=o;l<=i;l++)await t(e,[{row:l,col:n}],D.wall);await t(e,[{row:r,col:n}])}async function uE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.clear);o(l);async function a(s,u,c,f){if(u-s<2||f-c<2)return;const d=f-c,g=u-s;if(d({row:t+i.row,col:n+i.col})).filter(i=>i.row>=0&&i.row=0&&i.cole[i.row][i.col]!==D.clear)}async function dE(e,t,n,r){const o={row:r.row+(n.row-r.row)/2,col:r.col+(n.col-r.col)/2};await t(e,[o,r],D.clear)}async function pE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.wall);o(l),i(l,{row:0,col:0});async function a(s,u){const c=fE(l,s,u);for(;c.length;){const f=Math.floor(Math.random()*c.length),d=c[f];c.splice(f,1),l[d.row][d.col]!==D.clear&&(await dE(l,i,{row:s,col:u},d),await a(d.row,d.col))}}return await a(0,0),i(l,n,D.entry),i(l,r,D.exit),l}const hE=[{row:-1,col:0},{row:0,col:-1}],mE=(e,t)=>{const n=e.length,r=e[0].length;return hE.map(o=>({row:t.row+o.row,col:t.col+o.col})).filter(o=>o.row>=0&&o.row=0&&o.colnew Set([`${c}-${f}`]));for(;a.length;){const c=Math.floor(Math.random()*a.length),f=a.splice(c,1)[0],[d,g]=wE(f),y=u.find(S=>S.has(`${d.row}-${d.col}`)),w=u.find(S=>S.has(`${g.row}-${g.col}`));y!==w?(w.forEach(S=>y.add(S)),u.splice(u.indexOf(w),1),await i(l,[d,g,f])):await i(l,f,D.wall)}return i(l,n,D.entry),i(l,r,D.exit),l}async function xE({rows:e,cols:t,entry:n,exit:r,updateGrid:o,updateCells:i}){const l=pt(e,t,D.wall);o(l);const a=l[0].map((s,u)=>({row:0,col:u}));await i(l,a);for(let s=2;s{s[f.row][f.col]=c}),t&&(n($p({cells:u,cellType:c})),await fr(t))}try{const s=await e({rows:o.rows,cols:o.cols,entry:o.entry,exit:o.exit,updateGrid:i,updateCells:a});n(ws({grid:s})),n(ml(Me.Ready))}catch{}}}const tp=new Map([["∞",0],["4x",1],["2x",10],["1x",25],["0.7x",50],["0.5x",100],["0.1x",250]]);function kE(){const e=vt(),[t,n]=E.useState([...tp.values()][1]),[r,o]=E.useState([...cs.keys()][0]),i=ue(s=>s.pathFinder.status),l=cs.get(r);function a(){l&&e(EE(l.fn,t))}return _.jsxs("div",{className:pi.operation,children:[_.jsx("select",{name:"maze",id:"maze",value:r,onChange:s=>o(s.target.value),children:[...cs.entries()].map(([s,{name:u}])=>_.jsx("option",{value:s,children:u},s))}),_.jsx("select",{className:pi.speed,name:"speed",id:"speed",value:t,onChange:s=>n(+s.target.value),children:[...tp.entries()].map(([s,u])=>_.jsx("option",{value:u,children:s},s))}),_.jsx("button",{"data-testid":"generate-maze",onClick:a,"data-tooltip":"Play",disabled:![Me.Ready,Me.Complete].includes(i),children:_.jsx(gy,{size:24})}),_.jsx("button",{"data-testid":"reset",onClick:()=>e(Up()),"data-tooltip":"Reset",children:_.jsx(YS,{size:24})})]})}function _E(){const e=vt(),t=ue(i=>i.pathFinder.rows),n=ue(i=>i.pathFinder.cols),{width:r,height:o}=Qx();return Cy(()=>{const i=Ap();i.maxRows===t&&i.maxCols===n||(e(_g({rows:i.maxRows,cols:i.maxCols})),e(Up()))},333,[r,o]),_.jsxs("section",{className:pi.controller,children:[_.jsx(kE,{}),_.jsx(nE,{})]})}const CE="_grid_1917o_1",PE="_type0_1917o_6",RE="_type1_1917o_9",TE="_type2_1917o_13",ME="_type3_1917o_17",NE="_wallAnimation_1917o_1",zE="_type4_1917o_22",jE="_visitedAnimation_1917o_1",LE="_type5_1917o_27",np={grid:CE,type0:PE,type1:RE,type2:TE,type3:ME,wallAnimation:NE,type4:zE,visitedAnimation:jE,type5:LE};function rp(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function Ry(e){if(!e)return{isValidCell:!1};if(e.tagName!=="BUTTON")return{isValidCell:!1};const t=+(e.dataset.row??-1),n=+(e.dataset.col??-1),r=+(e.dataset.cellType??-1);return t===-1||n===-1||r===-1?{isValidCell:!1}:{isValidCell:!0,selectedCell:{row:t,col:n,cellType:r}}}function OE({isMobile:e,ref:t}){const[n,r]=E.useState(null),o=E.useRef(null),i=E.useCallback(l=>{if(!e)return;const a=l.target;if(!a)return;const{isValidCell:s,selectedCell:u}=Ry(a);if(!s)return;const c=u.cellType;if([D.entry,D.exit].includes(c)){o.current=u;return}if(![D.entry,D.exit,D.wall].includes(u.cellType)&&o.current){r({...u,cellType:o.current.cellType}),o.current=null;return}r({...u,cellType:c===D.wall?D.clear:D.wall}),o.current=null},[e]);return E.useEffect(()=>{if(!e)return;const l=t.current;if(l)return l.addEventListener("click",i),()=>{l.removeEventListener("mousedown",i)}},[e,i,t]),n}function DE({isMobile:e,ref:t}){const[n,r]=E.useState(null),o=E.useRef(!1);E.useEffect(()=>{if(e)return;const s=t.current;if(s)return s.addEventListener("mousedown",i),s.addEventListener("mousemove",l),s.addEventListener("mouseup",a),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mousedown",i),s.removeEventListener("mouseleave",l),s.removeEventListener("mouseup",a),s.removeEventListener("mouseleave",a)}},[e,t]);const i=s=>{s.target&&(o.current=!0,r(s.target))},l=s=>{o.current&&r(s.target)},a=()=>{o.current=!1,r(null)};return{element:n,isMouseDown:o.current}}function IE({isMobile:e,ref:t}){const[n,r]=E.useState(null),{element:o,isMouseDown:i}=DE({isMobile:e,ref:t}),{isValidCell:l,selectedCell:a}=Ry(o),s=E.useRef(null),u=E.useRef(!1);return E.useEffect(()=>{var f,d;if(!(!l||((f=s.current)==null?void 0:f.col)===a.col&&((d=s.current)==null?void 0:d.row)===a.row)){if(u.current&&s.current){[D.entry,D.exit,D.wall].includes(a.cellType)||(r({...a,cellType:s.current.cellType}),s.current={...a,cellType:s.current.cellType});return}[D.entry,D.exit].includes(a.cellType)||(r({row:a.row,col:a.col,cellType:a.cellType===D.wall?D.clear:D.wall}),s.current=a)}},[l,a]),E.useEffect(()=>{i&&a&&!s.current&&(s.current=a,u.current=[D.entry,D.exit].includes(a.cellType)),i||(s.current=null,u.current=!1)},[i,a]),n}function bE(){const e=vt(),t=ue(c=>c.pathFinder.grid),n=ue(c=>c.pathFinder.entry),r=ue(c=>c.pathFinder.exit),o=ue(c=>c.pathFinder.status),i=E.useRef(null),l=OE({isMobile:rp(),ref:i}),a=IE({isMobile:rp(),ref:i}),s=E.useCallback(function(f){if(f){const d=f.cellType===D.entry?n:r;[D.entry,D.exit].includes(f.cellType)&&!(f.row===d.row&&f.col===d.col)&&e(Ss({...d,cellType:D.clear})),d.row===f.row&&d.col===f.col||e(Ss(f))}},[e,n,r]);E.useEffect(()=>{s(l)},[l,s]),E.useEffect(()=>{s(a)},[a,s]);const u={gridTemplateRows:`repeat(${t.length}, ${er}px)`,gridTemplateColumns:`repeat(${t[0].length}, ${er}px)`};return _.jsx("div",{className:np.grid,style:u,ref:i,children:t.map((c,f)=>c.map((d,g)=>_.jsx("button",{"data-row":f,"data-col":g,"data-cell-type":d,className:np["type"+d],disabled:o===Me.Searching},`${f}-${g}`)))})}function AE(){return _.jsxs(_.Fragment,{children:[_.jsx(Kc,{top:10,right:20}),_.jsx(Wc,{title:"Path Finder"}),_.jsx(_E,{}),_.jsx("main",{className:"text-center",children:_.jsx(bE,{})})]})}function FE(){return _.jsxs(_.Fragment,{children:[_.jsx(Qc,{richColors:!0,duration:3e3,position:"top-center"}),_.jsx(AE,{})]})}const $E=[{path:"/path-finder/",element:_.jsx(FE,{})}];function UE(e){return e=e.replace(/\s/g,""),e=e.replace(/\d{4}/g,""),e=e.replace(/\s\s/g," "),e=e.replace(/\s,/g,","),e=e.replace(/,,/g,","),e=e.replace(/[^0-9,\s]/g,""),e.split(",").join(", ").trim()}function BE(e){return e.split(",").filter(t=>t!=="").map(t=>+t)}function op(e=0,t=999){return Math.floor(Math.random()*(t-e))+e}const HE=e=>{const t=e.length;for(let n=0;nn-r);case"descending":return[...t].sort((n,r)=>r-n);case"random":return HE([...t])}return t}const WE="_controllerWrapper_18ff3_1",VE="_controller_18ff3_1",KE="_numbers_18ff3_9",QE="_generator_18ff3_15",GE="_rndmBtn_18ff3_20",YE="_select_18ff3_28",XE="_arrayInput_18ff3_37",JE="_controls_18ff3_51",ZE="_checkboxWrapper_18ff3_63",qE="_listItem_18ff3_70",ek="_checkbox_18ff3_63",tk="_switchContainer_18ff3_87",Pt={controllerWrapper:WE,controller:VE,numbers:KE,generator:QE,rndmBtn:GE,select:YE,arrayInput:XE,controls:JE,checkboxWrapper:ZE,listItem:qE,checkbox:ek,switchContainer:tk},nk=["random","ascending","descending"];function rk({setInput:e}){const t=vt(),n=ue(a=>a.sortViz.array),[r,o]=E.useState("random"),i=()=>{let a=Array.from(new Array(op(Sf.min,Sf.max)),()=>op());r!=="random"&&(a=ip(r,a)),e(a.join(", ")),t(Cs(a))},l=a=>{const s=a.target.value;o(s);const u=ip(s,n);e(u.join(", ")),t(Cs(u))};return _.jsxs("div",{className:Pt.generator,children:[_.jsx("button",{className:Pt.rndmBtn,onClick:i,children:"Generate"}),_.jsx("select",{className:Pt.select,onChange:l,value:r,children:nk.map(a=>_.jsx("option",{value:a,children:a},a))})]})}function ok(){const e=vt(),t=ue(i=>i.sortViz.array),[n,r]=E.useState(t.join(", "));E.useEffect(()=>{e(Xr(!1)),e(Zl())},[t,e]);const o=i=>{const l=UE(i.target.value);r(l);const a=BE(l);e(Cs(a))};return _.jsxs("div",{className:Pt.numbers,children:[_.jsx(rk,{setInput:r}),_.jsx("input",{id:"user-input",className:Pt.arrayInput,type:"text",placeholder:"Numbers to sort (comma separate - max 3 digits)",value:n,onChange:o})]})}const ik="/algo-visualizers/icons/pause.svg",lk="/algo-visualizers/icons/play.svg",ak="/algo-visualizers/icons/reset.svg";function sk(){const e=vt(),t=ue(i=>i.sortViz.array),n=ue(i=>i.sortViz.speed),r=ue(i=>i.sortViz.isPlaying),o=ue(i=>i.sortViz.reset);return E.useEffect(()=>{r&&e(Kg())},[e,r]),E.useEffect(()=>{e(Xr(!1))},[e,o]),E.useEffect(()=>{e(Ef(n))},[e,n]),_.jsxs("div",{className:Pt.controls,children:[_.jsx("button",{"data-testid":"player",onClick:()=>e(Xr(!r)),disabled:t.length===0||r===null,"data-tooltip":r?"Pause":"Play",children:_.jsx("img",{src:r?ik:lk,alt:r?"Pause":"Play",height:24,width:24})}),_.jsx("button",{onClick:()=>e(Zl()),disabled:t.length===0,"data-tooltip":"Reset",children:_.jsx("img",{src:ak,height:24,width:24})}),_.jsx("input",{id:"speed","data-tooltip":"Animation speed",type:"range",min:1,max:20,value:n,step:1,onChange:i=>e(Ef(i.target.valueAsNumber))})]})}function Pu(){return Pu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=s)&&this.A(n),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(n){n.preventDefault(),typeof n.button=="number"&&n.button!==0||(this.I(n.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(n){n.preventDefault(),this.L(n.clientX)},t.prototype.g=function(n){this.U(n),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(n){this.X=null,this.I(n.touches[0].clientX)},t.prototype.m=function(n){this.L(n.touches[0].clientX)},t.prototype.M=function(n){n.preventDefault(),this.U(n)},t.prototype.$=function(n){Date.now()-this.l>50&&(this.A(n),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(n){this.H=n},t.prototype.T=function(n){n.preventDefault(),this.H.focus(),this.A(n),this.W&&this.setState({j:!1})},t.prototype.A=function(n){var r=this.props;(0,r.onChange)(!r.checked,n,r.id)},t.prototype.render=function(){var n=this.props,r=n.checked,o=n.disabled,i=n.className,l=n.offColor,a=n.onColor,s=n.offHandleColor,u=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,d=n.checkedHandleIcon,g=n.uncheckedHandleIcon,y=n.boxShadow,w=n.activeBoxShadow,S=n.height,h=n.width,p=n.borderRadius,m=function(de,ke){var ne={};for(var M in de)Object.prototype.hasOwnProperty.call(de,M)&&ke.indexOf(M)===-1&&(ne[M]=de[M]);return ne}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),k=this.state,P=k.h,v=k.N,R=k.j,N={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:S/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},L={height:S,width:h,margin:Math.max(0,(this.t-S)/2),position:"relative",background:ap(P,this.i,this.o,l,a),borderRadius:typeof p=="number"?p:S/2,cursor:o?"default":"pointer",WebkitTransition:v?null:"background 0.25s",MozTransition:v?null:"background 0.25s",transition:v?null:"background 0.25s"},F={height:S,width:Math.min(1.5*S,h-(this.t+S)/2+1),position:"relative",opacity:(P-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"},G={height:S,width:Math.min(1.5*S,h-(this.t+S)/2+1),position:"absolute",opacity:1-(P-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"},re={height:this.t,width:this.t,background:ap(P,this.i,this.o,s,u),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof p=="number"?p-1:"50%",position:"absolute",transform:"translateX("+P+"px)",top:Math.max(0,(S-this.t)/2),outline:0,boxShadow:R?w:y,border:0,WebkitTransition:v?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:v?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:v?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},Z={height:this.t,width:this.t,opacity:Math.max(2*(1-(P-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"},te={height:this.t,width:this.t,opacity:Math.max(2*((P-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:v?null:"opacity 0.25s",MozTransition:v?null:"opacity 0.25s",transition:v?null:"opacity 0.25s"};return j.createElement("div",{className:i,style:N},j.createElement("div",{className:"react-switch-bg",style:L,onClick:o?null:this.T,onMouseDown:function(de){return de.preventDefault()}},c&&j.createElement("div",{style:F},c),f&&j.createElement("div",{style:G},f)),j.createElement("div",{className:"react-switch-handle",style:re,onClick:function(de){return de.preventDefault()},onMouseDown:o?null:this.p,onTouchStart:o?null:this.k,onTouchMove:o?null:this.m,onTouchEnd:o?null:this.M,onTouchCancel:o?null:this.O},g&&j.createElement("div",{style:Z},g),d&&j.createElement("div",{style:te},d)),j.createElement("input",Pu({},{type:"checkbox",role:"switch","aria-checked":r,checked:r,disabled:o,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},m,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})))},t}(E.Component);Ty.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:uk,checkedIcon:ck,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};function fk(){const e=vt(),t=ue(n=>n.sortViz.visualizerType);return _.jsxs("div",{className:Pt.switchContainer,children:[_.jsx("label",{children:"Cell"}),_.jsx(Ty,{id:"visualizerType",onChange:()=>e(Wg()),checked:t==="bar",checkedIcon:!1,uncheckedIcon:!1,height:20,width:40,offColor:"#2b4bfe",onColor:"#2b4bfe"}),_.jsx("label",{children:"Bar"})]})}function dk(){const{algoName:e}=Hc(),t=vt();return E.useEffect(()=>{t(Xr(!1)),t(Zl())},[e,t]),_.jsxs("section",{className:Pt.controllerWrapper,children:[_.jsxs("div",{className:Pt.controller,"data-testid":"controller",children:[_.jsx(ok,{}),_.jsx(sk,{})]}),_.jsx(fk,{})]})}const pk="_main_1hg6y_1",hk="_allAlgos_1hg6y_6",My={main:pk,allAlgos:hk};function Hl({children:e}){return _.jsxs("div",{children:[_.jsx(Kc,{bottom:10,right:20}),_.jsx(Wc,{title:"Sorting Visualizer",menuItems:Wp}),_.jsx(dk,{}),_.jsx("main",{className:My.main,children:e})]})}const mk="_container_wgxfy_1",yk="_warning_wgxfy_20",Ny={container:mk,warning:yk};function zy(){return _.jsx("p",{className:Ny.warning,children:"Please enter a valid list of numbers to play with the visualization"})}function vk({algoName:e,isCompleted:t}){const n=ue(o=>o.sortViz.time),r=E.useRef(0);return E.useEffect(()=>{t&&(r.current=n)},[t]),_.jsxs("header",{children:[_.jsxs("h2",{children:[e," Sort"]}),_.jsxs("span",{children:["Time: ",_.jsx("strong",{children:r.current||n})]})]})}const gk="_arrayContainer_116to_1",wk="_values_116to_6",Sk="_pivot_116to_19",xk="_sort_116to_22",Ek="_highlight_116to_25",kk="_indices_116to_28",Qi={arrayContainer:gk,values:wk,pivot:Sk,sort:xk,highlight:Ek,indices:kk};function _k({array:e,sorts:t,highlights:n,pivot:r}){const o=E.useMemo(()=>Math.max(...e),[e]);function i(l){let a="";return r===l&&(a="pivot"),t.includes(l)&&(a="sort"),n.includes(l)&&(a="highlight"),a}return _.jsxs("div",{className:Qi.arrayContainer,children:[_.jsx("ul",{className:Qi.values,"data-testid":"bar-values",children:e.map((l,a)=>_.jsx("li",{className:Qi[i(a)],style:{height:`${l/o*100}%`}},a))}),_.jsx("ul",{className:Qi.indices,children:e.map((l,a)=>_.jsx("li",{children:a},a))})]})}const Ck="_arrayContainer_9tgyc_1",Pk="_values_9tgyc_6",Rk="_cell_9tgyc_10",Tk="_pivot_9tgyc_24",Mk="_sort_9tgyc_27",Nk="_highlight_9tgyc_30",zk="_indices_9tgyc_33",Ho={arrayContainer:Ck,values:Pk,cell:Rk,pivot:Tk,sort:Mk,highlight:Nk,indices:zk};function Gc({order:e,animation:t,value:n,isSorted:r=!1,isHighlighted:o=!1,isPivot:i=!1}){let l="";return i&&(l="pivot"),r&&(l="sort"),o&&(l="highlight"),_.jsx("li",{className:`${Ho.cell} ${Ho[l]}`,style:{animation:t,order:e},children:n})}const Tr=document.querySelector('[data-id="animation-element"]');function jy(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=_n.size+_n.margin,i=`@keyframes ${n} { 25% { - transform: translateY(${Math.sign(e)*(kn.size+5)}px); + transform: translateY(${Math.sign(e)*(_n.size+5)}px); } 75% { - transform: translate(${e*o}px, ${Math.sign(e)*(kn.size+5)}px); + transform: translate(${e*o}px, ${Math.sign(e)*(_n.size+5)}px); } 100% { transform: translate(${e*o}px, 0); } -}`;return Ly(i),r}function jk(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=kn.size+kn.margin,i=`@keyframes ${n} { +}`;return Ly(i),r}function jk(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=_n.size+_n.margin,i=`@keyframes ${n} { 100% { transform: translateX(${e*o}px); } - }`;return Ly(i),r}function Ly(e){var n;const t=(n=Rr==null?void 0:Rr.sheet)==null?void 0:n.insertRule(e);setTimeout(()=>{var r;t&&((r=Rr==null?void 0:Rr.sheet)==null||r.deleteRule(t))},sr)}function Lk({originalOrder:e,isSwap:t,order:n,value:r,isHighlighted:o}){let i=jk(e-n,sr);return t&&(i=jy(e-n,sr)),_.jsx(Gc,{animation:i,order:n,value:r,isHighlighted:o})}function Ok({originalOrder:e,order:t,value:n,isHighlighted:r}){const o=jy(e-t,sr);return _.jsx(Gc,{animation:o,order:t,value:n,isHighlighted:r})}const Dk=function({array:t,swaps:n,sorts:r,highlights:o,moves:i,pivot:l}){function a(s,u){return n.includes(s)?_.jsx(Ok,{originalOrder:s,order:n[0]===s?n[1]:n[0],value:u,isHighlighted:o.includes(s)},s):i&&s>=i[0]&&s<=i[1]?_.jsx(Lk,{originalOrder:s,order:s===i[0]?i[1]:s-1,isSwap:s===i[0],value:u,isHighlighted:o.includes(s)},s):_.jsx(Gc,{order:s,value:u,isSorted:r.includes(s),isHighlighted:o.includes(s),isPivot:s===l},s)}return _.jsxs("div",{className:Ho.arrayContainer,children:[_.jsx("ul",{className:Ho.values,"data-testid":"cell-values",children:t.map((s,u)=>a(u,s))}),_.jsx("ul",{className:Ho.indices,children:t.map((s,u)=>_.jsx("li",{children:u},u))})]})};function Ik(e){const t=ue(n=>n.sortViz.visualizerType);return t==="cell"?_.jsx(Dk,{...e}):t==="bar"?_.jsx(_k,{...e}):null}function bk(e,t){const[n,r]=E.useState([-1,-1]),[o,i]=E.useState([-1,-1]),[l,a]=E.useState([]),[s,u]=E.useState([-1,-1]),[c,f]=E.useState(-1),[d,g]=E.useState(!1),y=E.useRef(t(e)),w=E.useRef(0),S=E.useRef(0),h=async()=>{await ar;for await(const p of y.current)switch(r([-1,-1]),u([-1,-1]),i([-1,-1]),p.type){case"swap":u(p.positions),r(p.positions),p.positions[0]!==p.positions[1]&&w.current++;break;case"sort":a(m=>[...m,p.position]);break;case"highlight":u(p.positions),p.positions[0]!==p.positions[1]&&S.current++;break;case"pivot":f(p.position);break;case"move":u([p.positions[0],p.positions[0]+1]),i(p.positions),p.positions[0]!==p.positions[1]&&w.current++;break}g(!0)};return E.useEffect(()=>{h()},[]),{pivot:c,isCompleted:d,swaps:n,sorts:l,highlights:s,moves:o,swapCount:w.current,compareCount:S.current}}const Oy=function({array:t,algoFn:n,algoName:r="Bubble",onComplete:o}){const i=E.useRef([...t]),{swapCount:l,compareCount:a,isCompleted:s,swaps:u,sorts:c,highlights:f,pivot:d,moves:g}=bk(i.current,n);return E.useEffect(()=>{s&&o()},[s,o]),_.jsxs("section",{className:Ny.container,children:[_.jsx(vk,{algoName:r,isCompleted:s}),_.jsx(Ik,{pivot:d,array:i.current,swaps:u,highlights:f,sorts:c,moves:g}),_.jsxs("footer",{children:[_.jsxs("span",{children:["Swaps: ",_.jsx("strong",{children:l})]}),_.jsxs("span",{children:["Comparisons: ",_.jsx("strong",{children:a})]})]})]})};function Dy(e,t){const[n,r]=E.useState(!1),o=E.useRef(0);E.useEffect(()=>{o.current=0,r(!1)},[t]);function i(){o.current++,o.current===e&&r(!0)}return{onComplete:i,isComplete:n}}function Ak(){const{algoName:e}=Hc(),t=vt(),n=ue(a=>a.sortViz.array),r=ue(a=>a.sortViz.reset),o=At.find(({name:a})=>a===e)??At[0],{onComplete:i,isComplete:l}=Dy(1,r);return E.useEffect(()=>{l&&(Bo.success(Vp),t(Yr(null)))},[t,l]),n.length===0?_.jsx(Hl,{children:_.jsx(zy,{})}):_.jsx(Hl,{children:_.jsx(Oy,{array:n,algoName:o.name,algoFn:o.fn,onComplete:i},o.name+n.toString()+r)})}function sp(){const{algoName:e}=Hc(),t=cy();return E.useEffect(()=>{e||t(`/sorting-visualizer/${Wp[0]}`)},[e,t]),_.jsxs(_.Fragment,{children:[_.jsx(Qc,{richColors:!0,duration:3e3}),_.jsx(Ak,{})]})}function Fk(){const e=vt(),t=ue(r=>r.sortViz.selectedAlgosStatus),n=r=>{e(Hg(r)),e(ql())};return _.jsx("div",{className:Pt.checkboxWrapper,children:t.map((r,o)=>_.jsx("li",{className:Pt.listItem,children:_.jsxs("div",{className:Pt.checkbox,children:[_.jsx("input",{type:"checkbox",id:`custom-checkbox-${At[o].name}`,name:At[o].name,value:At[o].name,checked:r,onChange:()=>n(o)}),_.jsx("label",{htmlFor:`custom-checkbox-${At[o].name}`,children:At[o].name})]})},o))})}function $k(){const e=vt(),t=ue(a=>a.sortViz.array),n=ue(a=>a.sortViz.reset),r=ue(a=>a.sortViz.selectedAlgosStatus);let o=At.filter((a,s)=>r[s]);o.length===0&&(o=At);const{onComplete:i,isComplete:l}=Dy(o.length,n);return E.useEffect(()=>{l&&(Bo.success(Vp),e(Yr(null)))},[e,l]),t.length===0?_.jsx(Hl,{children:_.jsx(zy,{})}):_.jsxs(Hl,{children:[_.jsx(Fk,{}),_.jsx("div",{className:My.allAlgos,children:o.map(a=>_.jsx(Oy,{array:t,algoName:a.name,algoFn:a.fn,onComplete:i},t.toString()+n+a.name))})]})}function Uk(){return _.jsxs(_.Fragment,{children:[_.jsx(Qc,{richColors:!0,duration:3e3}),_.jsx($k,{})]})}const Bk=[{path:"/sorting-visualizer/",element:_.jsx(sp,{})},{path:"/sorting-visualizer/all",element:_.jsx(Uk,{})},{path:"/sorting-visualizer/:algoName",element:_.jsx(sp,{})}],Hk=vS([...Bk,...$E,{path:"/",element:_.jsx(Ex,{})}]);function Wk(){return _.jsx(CS,{router:Hk})}function sl(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sl=function(n){return typeof n}:sl=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},sl(e)}function Vk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function up(e,t){for(var n=0;n{var r;t&&((r=Tr==null?void 0:Tr.sheet)==null||r.deleteRule(t))},cr)}function Lk({originalOrder:e,isSwap:t,order:n,value:r,isHighlighted:o}){let i=jk(e-n,cr);return t&&(i=jy(e-n,cr)),_.jsx(Gc,{animation:i,order:n,value:r,isHighlighted:o})}function Ok({originalOrder:e,order:t,value:n,isHighlighted:r}){const o=jy(e-t,cr);return _.jsx(Gc,{animation:o,order:t,value:n,isHighlighted:r})}const Dk=function({array:t,swaps:n,sorts:r,highlights:o,moves:i,pivot:l}){function a(s,u){return n.includes(s)?_.jsx(Ok,{originalOrder:s,order:n[0]===s?n[1]:n[0],value:u,isHighlighted:o.includes(s)},s):i&&s>=i[0]&&s<=i[1]?_.jsx(Lk,{originalOrder:s,order:s===i[0]?i[1]:s-1,isSwap:s===i[0],value:u,isHighlighted:o.includes(s)},s):_.jsx(Gc,{order:s,value:u,isSorted:r.includes(s),isHighlighted:o.includes(s),isPivot:s===l},s)}return _.jsxs("div",{className:Ho.arrayContainer,children:[_.jsx("ul",{className:Ho.values,"data-testid":"cell-values",children:t.map((s,u)=>a(u,s))}),_.jsx("ul",{className:Ho.indices,children:t.map((s,u)=>_.jsx("li",{children:u},u))})]})};function Ik(e){const t=ue(n=>n.sortViz.visualizerType);return t==="cell"?_.jsx(Dk,{...e}):t==="bar"?_.jsx(_k,{...e}):null}function bk(e,t){const[n,r]=E.useState([-1,-1]),[o,i]=E.useState([-1,-1]),[l,a]=E.useState([]),[s,u]=E.useState([-1,-1]),[c,f]=E.useState(-1),[d,g]=E.useState(!1),y=E.useRef(t(e)),w=E.useRef(0),S=E.useRef(0),h=async()=>{await ur;for await(const p of y.current)switch(r([-1,-1]),u([-1,-1]),i([-1,-1]),p.type){case"swap":u(p.positions),r(p.positions),p.positions[0]!==p.positions[1]&&w.current++;break;case"sort":a(m=>[...m,p.position]);break;case"highlight":u(p.positions),p.positions[0]!==p.positions[1]&&S.current++;break;case"pivot":f(p.position);break;case"move":u([p.positions[0],p.positions[0]+1]),i(p.positions),p.positions[0]!==p.positions[1]&&w.current++;break}g(!0)};return E.useEffect(()=>{h()},[]),{pivot:c,isCompleted:d,swaps:n,sorts:l,highlights:s,moves:o,swapCount:w.current,compareCount:S.current}}const Oy=function({array:t,algoFn:n,algoName:r="Bubble",onComplete:o}){const i=E.useRef([...t]),{swapCount:l,compareCount:a,isCompleted:s,swaps:u,sorts:c,highlights:f,pivot:d,moves:g}=bk(i.current,n);return E.useEffect(()=>{s&&o()},[s,o]),_.jsxs("section",{className:Ny.container,children:[_.jsx(vk,{algoName:r,isCompleted:s}),_.jsx(Ik,{pivot:d,array:i.current,swaps:u,highlights:f,sorts:c,moves:g}),_.jsxs("footer",{children:[_.jsxs("span",{children:["Swaps: ",_.jsx("strong",{children:l})]}),_.jsxs("span",{children:["Comparisons: ",_.jsx("strong",{children:a})]})]})]})};function Dy(e,t){const[n,r]=E.useState(!1),o=E.useRef(0);E.useEffect(()=>{o.current=0,r(!1)},[t]);function i(){o.current++,o.current===e&&r(!0)}return{onComplete:i,isComplete:n}}function Ak(){const{algoName:e}=Hc(),t=vt(),n=ue(a=>a.sortViz.array),r=ue(a=>a.sortViz.reset),o=At.find(({name:a})=>a===e)??At[0],{onComplete:i,isComplete:l}=Dy(1,r);return E.useEffect(()=>{l&&(Bo.success(Vp),t(Xr(null)))},[t,l]),n.length===0?_.jsx(Hl,{children:_.jsx(zy,{})}):_.jsx(Hl,{children:_.jsx(Oy,{array:n,algoName:o.name,algoFn:o.fn,onComplete:i},o.name+n.toString()+r)})}function sp(){const{algoName:e}=Hc(),t=cy();return E.useEffect(()=>{e||t(`/sorting-visualizer/${Wp[0]}`)},[e,t]),_.jsxs(_.Fragment,{children:[_.jsx(Qc,{richColors:!0,duration:3e3}),_.jsx(Ak,{})]})}function Fk(){const e=vt(),t=ue(r=>r.sortViz.selectedAlgosStatus),n=r=>{e(Hg(r)),e(Zl())};return _.jsx("div",{className:Pt.checkboxWrapper,children:t.map((r,o)=>_.jsx("li",{className:Pt.listItem,children:_.jsxs("div",{className:Pt.checkbox,children:[_.jsx("input",{type:"checkbox",id:`custom-checkbox-${At[o].name}`,name:At[o].name,value:At[o].name,checked:r,onChange:()=>n(o)}),_.jsx("label",{htmlFor:`custom-checkbox-${At[o].name}`,children:At[o].name})]})},o))})}function $k(){const e=vt(),t=ue(a=>a.sortViz.array),n=ue(a=>a.sortViz.reset),r=ue(a=>a.sortViz.selectedAlgosStatus);let o=At.filter((a,s)=>r[s]);o.length===0&&(o=At);const{onComplete:i,isComplete:l}=Dy(o.length,n);return E.useEffect(()=>{l&&(Bo.success(Vp),e(Xr(null)))},[e,l]),t.length===0?_.jsx(Hl,{children:_.jsx(zy,{})}):_.jsxs(Hl,{children:[_.jsx(Fk,{}),_.jsx("div",{className:My.allAlgos,children:o.map(a=>_.jsx(Oy,{array:t,algoName:a.name,algoFn:a.fn,onComplete:i},t.toString()+n+a.name))})]})}function Uk(){return _.jsxs(_.Fragment,{children:[_.jsx(Qc,{richColors:!0,duration:3e3}),_.jsx($k,{})]})}const Bk=[{path:"/sorting-visualizer/",element:_.jsx(sp,{})},{path:"/sorting-visualizer/all",element:_.jsx(Uk,{})},{path:"/sorting-visualizer/:algoName",element:_.jsx(sp,{})}],Hk=vS([...Bk,...$E,{path:"/",element:_.jsx(Ex,{})}]);function Wk(){return _.jsx(CS,{router:Hk})}function sl(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sl=function(n){return typeof n}:sl=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},sl(e)}function Vk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function up(e,t){for(var n=0;n Algo Visualizers - - + +