diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 5e603ec..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "react-app" -} diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ad0365 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# pizza-restaurant-react-project +Fast Pizza - Full React Project with multi-pages using React, React Router data loading, Redux, Redux Toolkit, thunks and Tailwind CSS diff --git a/assets/index-5e95a5e1.css b/assets/index-5e95a5e1.css new file mode 100644 index 0000000..433b07c --- /dev/null +++ b/assets/index-5e95a5e1.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Roboto Mono,monospace;font-feature-settings:normal;font-variation-settings:normal}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-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-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}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}}.input{border-radius:9999px;border-width:1px;--tw-border-opacity: 1;border-color:rgb(231 229 228 / var(--tw-border-opacity));padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.input::-moz-placeholder{--tw-text-opacity: 1;color:rgb(168 162 158 / var(--tw-text-opacity))}.input::placeholder{--tw-text-opacity: 1;color:rgb(168 162 158 / var(--tw-text-opacity))}.input:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(250 204 21 / var(--tw-ring-opacity))}@media (min-width: 768px){.input{padding:.75rem 1.5rem}}.loader{width:45px;aspect-ratio:.75;--c: no-repeat linear-gradient(#292524 0 0);background:var(--c) 0% 50%,var(--c) 50% 50%,var(--c) 100% 50%;background-size:20% 50%;animation:loading 1s infinite linear}@keyframes loading{20%{background-position:0% 0%,50% 50%,100% 50%}40%{background-position:0% 100%,50% 0%,100% 50%}60%{background-position:0% 50%,50% 100%,100% 0%}80%{background-position:0% 50%,50% 50%,100% 100%}}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.right-\[3px\]{right:3px}.top-\[3px\]{top:3px}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-8{margin-bottom:2rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-24{height:6rem}.h-6{height:1.5rem}.h-screen{height:100vh}.w-28{width:7rem}.w-6{width:1.5rem}.w-72{width:18rem}.w-full{width:100%}.max-w-3xl{max-width:48rem}.grow{flex-grow:1}.grid-rows-\[auto_1fr_auto\]{grid-template-rows:auto 1fr auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-stone-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(231 229 228 / var(--tw-divide-opacity))}.overflow-scroll{overflow:scroll}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-stone-200{--tw-border-opacity: 1;border-color:rgb(231 229 228 / var(--tw-border-opacity))}.border-stone-300{--tw-border-opacity: 1;border-color:rgb(214 211 209 / var(--tw-border-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-slate-200\/20{background-color:#e2e8f033}.bg-stone-100{--tw-bg-opacity: 1;background-color:rgb(245 245 244 / var(--tw-bg-opacity))}.bg-stone-200{--tw-bg-opacity: 1;background-color:rgb(231 229 228 / var(--tw-bg-opacity))}.bg-stone-800{--tw-bg-opacity: 1;background-color:rgb(41 37 36 / var(--tw-bg-opacity))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity))}.p-2{padding:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-green-50{--tw-text-opacity: 1;color:rgb(240 253 244 / var(--tw-text-opacity))}.text-red-50{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.text-stone-200{--tw-text-opacity: 1;color:rgb(231 229 228 / var(--tw-text-opacity))}.text-stone-300{--tw-text-opacity: 1;color:rgb(214 211 209 / var(--tw-text-opacity))}.text-stone-400{--tw-text-opacity: 1;color:rgb(168 162 158 / var(--tw-text-opacity))}.text-stone-500{--tw-text-opacity: 1;color:rgb(120 113 108 / var(--tw-text-opacity))}.text-stone-600{--tw-text-opacity: 1;color:rgb(87 83 78 / var(--tw-text-opacity))}.text-stone-700{--tw-text-opacity: 1;color:rgb(68 64 60 / var(--tw-text-opacity))}.text-stone-800{--tw-text-opacity: 1;color:rgb(41 37 36 / var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.accent-yellow-400{accent-color:#facc15}.opacity-70{opacity:.7}.grayscale{--tw-grayscale: grayscale(100%);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)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.placeholder\:text-stone-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(168 162 158 / var(--tw-text-opacity))}.placeholder\:text-stone-400::placeholder{--tw-text-opacity: 1;color:rgb(168 162 158 / var(--tw-text-opacity))}.hover\:bg-stone-300:hover{--tw-bg-opacity: 1;background-color:rgb(214 211 209 / var(--tw-bg-opacity))}.hover\:bg-yellow-300:hover{--tw-bg-opacity: 1;background-color:rgb(253 224 71 / var(--tw-bg-opacity))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.hover\:text-stone-800:hover{--tw-text-opacity: 1;color:rgb(41 37 36 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus\:bg-stone-300:focus{--tw-bg-opacity: 1;background-color:rgb(214 211 209 / var(--tw-bg-opacity))}.focus\:bg-yellow-300:focus{--tw-bg-opacity: 1;background-color:rgb(253 224 71 / var(--tw-bg-opacity))}.focus\:text-stone-800:focus{--tw-text-opacity: 1;color:rgb(41 37 36 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-stone-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(231 229 228 / var(--tw-ring-opacity))}.focus\:ring-yellow-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 224 71 / var(--tw-ring-opacity))}.focus\:ring-yellow-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 204 21 / var(--tw-ring-opacity))}.focus\:ring-yellow-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(234 179 8 / var(--tw-ring-opacity))}.focus\:ring-opacity-50:focus{--tw-ring-opacity: .5}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}@media (min-width: 640px){.sm\:my-16{margin-top:4rem;margin-bottom:4rem}.sm\:mb-0{margin-bottom:0}.sm\:flex{display:flex}.sm\:w-64{width:16rem}.sm\:basis-40{flex-basis:10rem}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-6{gap:1.5rem}.sm\:gap-8{gap:2rem}.sm\:space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:focus\:w-72:focus{width:18rem}}@media (min-width: 768px){.md\:right-\[5px\]{right:5px}.md\:top-\[5px\]{top:5px}.md\:block{display:block}.md\:gap-3{gap:.75rem}.md\:px-3{padding-left:.75rem;padding-right:.75rem}.md\:px-3\.5{padding-left:.875rem;padding-right:.875rem}.md\:px-5{padding-left:1.25rem;padding-right:1.25rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.md\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\:py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.md\:py-4{padding-top:1rem;padding-bottom:1rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}} diff --git a/assets/index-f2ed36eb.js b/assets/index-f2ed36eb.js new file mode 100644 index 0000000..26fa7fa --- /dev/null +++ b/assets/index-f2ed36eb.js @@ -0,0 +1,98 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function pm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wf={exports:{}},Kl={},Vf={exports:{}},b={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var No=Symbol.for("react.element"),hm=Symbol.for("react.portal"),mm=Symbol.for("react.fragment"),vm=Symbol.for("react.strict_mode"),ym=Symbol.for("react.profiler"),gm=Symbol.for("react.provider"),wm=Symbol.for("react.context"),Sm=Symbol.for("react.forward_ref"),xm=Symbol.for("react.suspense"),Em=Symbol.for("react.memo"),km=Symbol.for("react.lazy"),qs=Symbol.iterator;function Cm(e){return e===null||typeof e!="object"?null:(e=qs&&e[qs]||e["@@iterator"],typeof e=="function"?e:null)}var Hf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qf=Object.assign,bf={};function Rr(e,t,n){this.props=e,this.context=t,this.refs=bf,this.updater=n||Hf}Rr.prototype.isReactComponent={};Rr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Rr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kf(){}Kf.prototype=Rr.prototype;function Ta(e,t,n){this.props=e,this.context=t,this.refs=bf,this.updater=n||Hf}var za=Ta.prototype=new Kf;za.constructor=Ta;Qf(za,Rr.prototype);za.isPureReactComponent=!0;var ec=Array.isArray,Yf=Object.prototype.hasOwnProperty,Ia={current:null},Xf={key:!0,ref:!0,__self:!0,__source:!0};function Gf(e,t,n){var r,o={},l=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(l=""+t.key),t)Yf.call(t,r)&&!Xf.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(u===1)o.children=n;else if(1>>1,re=D[Q];if(0>>1;Qo(Je,H))Tto(Vn,Je)?(D[Q]=Vn,D[Tt]=H,Q=Tt):(D[Q]=Je,D[Mt]=H,Q=Mt);else if(Tto(Vn,H))D[Q]=Vn,D[Tt]=H,Q=Tt;else break e}}return W}function o(D,W){var H=D.sortIndex-W.sortIndex;return H!==0?H:D.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var a=[],s=[],f=1,p=null,h=3,v=!1,y=!1,g=!1,E=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,d=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(D){for(var W=n(s);W!==null;){if(W.callback===null)r(s);else if(W.startTime<=D)r(s),W.sortIndex=W.expirationTime,t(a,W);else break;W=n(s)}}function w(D){if(g=!1,m(D),!y)if(n(a)!==null)y=!0,Ge(C);else{var W=n(s);W!==null&&kn(w,W.startTime-D)}}function C(D,W){y=!1,g&&(g=!1,c(M),M=-1),v=!0;var H=h;try{for(m(W),p=n(a);p!==null&&(!(p.expirationTime>W)||D&&!fe());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,h=p.priorityLevel;var re=Q(p.expirationTime<=W);W=e.unstable_now(),typeof re=="function"?p.callback=re:p===n(a)&&r(a),m(W)}else r(a);p=n(a)}if(p!==null)var Cn=!0;else{var Mt=n(s);Mt!==null&&kn(w,Mt.startTime-W),Cn=!1}return Cn}finally{p=null,h=H,v=!1}}var _=!1,O=null,M=-1,j=5,$=-1;function fe(){return!(e.unstable_now()-$D||125Q?(D.sortIndex=H,t(s,D),n(a)===null&&D===n(s)&&(g?(c(M),M=-1):g=!0,kn(w,H-Q))):(D.sortIndex=re,t(a,D),y||v||(y=!0,Ge(C))),D},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(D){var W=h;return function(){var H=h;h=W;try{return D.apply(this,arguments)}finally{h=H}}}})(nd);td.exports=nd;var Im=td.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var rd=k,Qe=Im;function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tu=Object.prototype.hasOwnProperty,$m=/^[: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]*$/,nc={},rc={};function jm(e){return Tu.call(rc,e)?!0:Tu.call(nc,e)?!1:$m.test(e)?rc[e]=!0:(nc[e]=!0,!1)}function Fm(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 Am(e,t,n,r){if(t===null||typeof t>"u"||Fm(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 Ie(e,t,n,r,o,l,i){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=l,this.removeEmptyString=i}var Pe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pe[e]=new Ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pe[t]=new Ie(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pe[e]=new Ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pe[e]=new Ie(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){Pe[e]=new Ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pe[e]=new Ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pe[e]=new Ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pe[e]=new Ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pe[e]=new Ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var ja=/[\-:]([a-z])/g;function Fa(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(ja,Fa);Pe[t]=new Ie(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(ja,Fa);Pe[t]=new Ie(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(ja,Fa);Pe[t]=new Ie(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pe[e]=new Ie(e,1,!1,e.toLowerCase(),null,!1,!1)});Pe.xlinkHref=new Ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pe[e]=new Ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function Aa(e,t,n,r){var o=Pe.hasOwnProperty(t)?Pe[t]:null;(o!==null?o.type!==0:r||!(2u||o[i]!==l[u]){var a=` +`+o[i].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=i&&0<=u);break}}}finally{Gi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hr(e):""}function Um(e){switch(e.tag){case 5:return Hr(e.type);case 16:return Hr("Lazy");case 13:return Hr("Suspense");case 19:return Hr("SuspenseList");case 0:case 2:case 15:return e=Ji(e.type,!1),e;case 11:return e=Ji(e.type.render,!1),e;case 1:return e=Ji(e.type,!0),e;default:return""}}function ju(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 Yn:return"Fragment";case Kn:return"Portal";case zu:return"Profiler";case Ua:return"StrictMode";case Iu:return"Suspense";case $u:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case id:return(e.displayName||"Context")+".Consumer";case ld:return(e._context.displayName||"Context")+".Provider";case Ba:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wa:return t=e.displayName||null,t!==null?t:ju(e.type)||"Memo";case Xt:t=e._payload,e=e._init;try{return ju(e(t))}catch{}}return null}function Bm(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 ju(t);case 8:return t===Ua?"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 hn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ad(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wm(e){var t=ad(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,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bo(e){e._valueTracker||(e._valueTracker=Wm(e))}function sd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ad(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vl(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 Fu(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function lc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=hn(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 cd(e,t){t=t.checked,t!=null&&Aa(e,"checked",t,!1)}function Au(e,t){cd(e,t);var n=hn(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")?Uu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Uu(e,t.type,hn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ic(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 Uu(e,t,n){(t!=="number"||vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qr=Array.isArray;function ur(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Wo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function io(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xr={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},Vm=["Webkit","ms","Moz","O"];Object.keys(Xr).forEach(function(e){Vm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xr[t]=Xr[e]})});function hd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xr.hasOwnProperty(e)&&Xr[e]?(""+t).trim():t+"px"}function md(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=hd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Hm=se({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 Vu(e,t){if(t){if(Hm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Hu(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 Qu=null;function Va(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bu=null,ar=null,sr=null;function sc(e){if(e=Do(e)){if(typeof bu!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Zl(t),bu(e.stateNode,e.type,t))}}function vd(e){ar?sr?sr.push(e):sr=[e]:ar=e}function yd(){if(ar){var e=ar,t=sr;if(sr=ar=null,sc(e),t)for(e=0;e>>=0,e===0?32:31-(tv(e)/nv|0)|0}var Vo=64,Ho=4194304;function br(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 Sl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,l=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~o;u!==0?r=br(u):(l&=i,l!==0&&(r=br(l)))}else i=n&~o,i!==0?r=br(i):l!==0&&(r=br(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,l=t&-t,o>=l||o===16&&(l&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 _o(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mt(t),e[t]=n}function iv(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=Jr),gc=String.fromCharCode(32),wc=!1;function jd(e,t){switch(e){case"keyup":return zv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xn=!1;function $v(e,t){switch(e){case"compositionend":return Fd(t);case"keypress":return t.which!==32?null:(wc=!0,gc);case"textInput":return e=t.data,e===gc&&wc?null:e;default:return null}}function jv(e,t){if(Xn)return e==="compositionend"||!Ja&&jd(e,t)?(e=Id(),ll=Ya=en=null,Xn=!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=kc(n)}}function Wd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vd(){for(var e=window,t=vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vl(e.document)}return t}function Za(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 bv(e){var t=Vd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Wd(n.ownerDocument.documentElement,n)){if(r!==null&&Za(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,l=Math.min(r.start,o);r=r.end===void 0?l:Math.min(r.end,o),!e.extend&&l>r&&(o=r,r=l,l=o),o=Cc(n,l);var i=Cc(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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,Gn=null,Zu=null,qr=null,qu=!1;function Pc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qu||Gn==null||Gn!==vl(r)||(r=Gn,"selectionStart"in r&&Za(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}),qr&&po(qr,r)||(qr=r,r=kl(Zu,"onSelect"),0qn||(e.current=la[qn],la[qn]=null,qn--)}function ee(e,t){qn++,la[qn]=e.current,e.current=t}var mn={},Le=Sn(mn),Fe=Sn(!1),zn=mn;function yr(e,t){var n=e.type.contextTypes;if(!n)return mn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ae(e){return e=e.childContextTypes,e!=null}function Pl(){ne(Fe),ne(Le)}function Mc(e,t,n){if(Le.current!==mn)throw Error(N(168));ee(Le,t),ee(Fe,n)}function Zd(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(N(108,Bm(e)||"Unknown",o));return se({},n,r)}function Rl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mn,zn=Le.current,ee(Le,e),ee(Fe,Fe.current),!0}function Tc(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=Zd(e,t,zn),r.__reactInternalMemoizedMergedChildContext=e,ne(Fe),ne(Le),ee(Le,e)):ne(Fe),ee(Fe,n)}var $t=null,ql=!1,fu=!1;function qd(e){$t===null?$t=[e]:$t.push(e)}function oy(e){ql=!0,qd(e)}function xn(){if(!fu&&$t!==null){fu=!0;var e=0,t=G;try{var n=$t;for(G=1;e>=i,o-=i,jt=1<<32-mt(t)+o|n<M?(j=O,O=null):j=O.sibling;var $=h(c,O,m[M],w);if($===null){O===null&&(O=j);break}e&&O&&$.alternate===null&&t(c,O),d=l($,d,M),_===null?C=$:_.sibling=$,_=$,O=j}if(M===m.length)return n(c,O),le&&Pn(c,M),C;if(O===null){for(;MM?(j=O,O=null):j=O.sibling;var fe=h(c,O,$.value,w);if(fe===null){O===null&&(O=j);break}e&&O&&fe.alternate===null&&t(c,O),d=l(fe,d,M),_===null?C=fe:_.sibling=fe,_=fe,O=j}if($.done)return n(c,O),le&&Pn(c,M),C;if(O===null){for(;!$.done;M++,$=m.next())$=p(c,$.value,w),$!==null&&(d=l($,d,M),_===null?C=$:_.sibling=$,_=$);return le&&Pn(c,M),C}for(O=r(c,O);!$.done;M++,$=m.next())$=v(O,c,M,$.value,w),$!==null&&(e&&$.alternate!==null&&O.delete($.key===null?M:$.key),d=l($,d,M),_===null?C=$:_.sibling=$,_=$);return e&&O.forEach(function(ut){return t(c,ut)}),le&&Pn(c,M),C}function E(c,d,m,w){if(typeof m=="object"&&m!==null&&m.type===Yn&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Uo:e:{for(var C=m.key,_=d;_!==null;){if(_.key===C){if(C=m.type,C===Yn){if(_.tag===7){n(c,_.sibling),d=o(_,m.props.children),d.return=c,c=d;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Xt&&Uc(C)===_.type){n(c,_.sibling),d=o(_,m.props),d.ref=Ar(c,_,m),d.return=c,c=d;break e}n(c,_);break}else t(c,_);_=_.sibling}m.type===Yn?(d=Tn(m.props.children,c.mode,w,m.key),d.return=c,c=d):(w=pl(m.type,m.key,m.props,null,c.mode,w),w.ref=Ar(c,d,m),w.return=c,c=w)}return i(c);case Kn:e:{for(_=m.key;d!==null;){if(d.key===_)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(c,d.sibling),d=o(d,m.children||[]),d.return=c,c=d;break e}else{n(c,d);break}else t(c,d);d=d.sibling}d=wu(m,c.mode,w),d.return=c,c=d}return i(c);case Xt:return _=m._init,E(c,d,_(m._payload),w)}if(Qr(m))return y(c,d,m,w);if(zr(m))return g(c,d,m,w);Jo(c,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(c,d.sibling),d=o(d,m),d.return=c,c=d):(n(c,d),d=gu(m,c.mode,w),d.return=c,c=d),i(c)):n(c,d)}return E}var wr=up(!0),ap=up(!1),Lo={},Pt=Sn(Lo),yo=Sn(Lo),go=Sn(Lo);function Dn(e){if(e===Lo)throw Error(N(174));return e}function us(e,t){switch(ee(go,t),ee(yo,e),ee(Pt,Lo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wu(t,e)}ne(Pt),ee(Pt,t)}function Sr(){ne(Pt),ne(yo),ne(go)}function sp(e){Dn(go.current);var t=Dn(Pt.current),n=Wu(t,e.type);t!==n&&(ee(yo,e),ee(Pt,n))}function as(e){yo.current===e&&(ne(Pt),ne(yo))}var ue=Sn(0);function Ml(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 du=[];function ss(){for(var e=0;en?n:4,e(!0);var r=pu.transition;pu.transition={};try{e(!1),t()}finally{G=n,pu.transition=r}}function Pp(){return lt().memoizedState}function ay(e,t,n){var r=sn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rp(e))Np(t,n);else if(n=rp(e,t,n,r),n!==null){var o=Te();vt(n,e,r,o),_p(n,t,r)}}function sy(e,t,n){var r=sn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rp(e))Np(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,u=l(i,n);if(o.hasEagerState=!0,o.eagerState=u,gt(u,i)){var a=t.interleaved;a===null?(o.next=o,ls(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=rp(e,t,o,r),n!==null&&(o=Te(),vt(n,e,r,o),_p(n,t,r))}}function Rp(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function Np(e,t){eo=Tl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _p(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qa(e,n)}}var zl={readContext:ot,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useInsertionEffect:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useDeferredValue:Ne,useTransition:Ne,useMutableSource:Ne,useSyncExternalStore:Ne,useId:Ne,unstable_isNewReconciler:!1},cy={readContext:ot,useCallback:function(e,t){return Et().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:Wc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,sl(4194308,4,Sp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return sl(4194308,4,e,t)},useInsertionEffect:function(e,t){return sl(4,2,e,t)},useMemo:function(e,t){var n=Et();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Et();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=ay.bind(null,ae,e),[r.memoizedState,e]},useRef:function(e){var t=Et();return e={current:e},t.memoizedState=e},useState:Bc,useDebugValue:hs,useDeferredValue:function(e){return Et().memoizedState=e},useTransition:function(){var e=Bc(!1),t=e[0];return e=uy.bind(null,e[1]),Et().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ae,o=Et();if(le){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),xe===null)throw Error(N(349));$n&30||dp(r,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,Wc(hp.bind(null,r,l,e),[e]),r.flags|=2048,xo(9,pp.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Et(),t=xe.identifierPrefix;if(le){var n=Ft,r=jt;n=(r&~(1<<32-mt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wo++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[kt]=t,e[vo]=r,jp(e,t,!1,!1),t.stateNode=e;e:{switch(i=Hu(n,r),n){case"dialog":te("cancel",e),te("close",e),o=r;break;case"iframe":case"object":case"embed":te("load",e),o=r;break;case"video":case"audio":for(o=0;oEr&&(t.flags|=128,r=!0,Ur(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ml(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ur(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!le)return _e(t),null}else 2*de()-l.renderingStartTime>Er&&n!==1073741824&&(t.flags|=128,r=!0,Ur(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(n=l.last,n!==null?n.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=de(),t.sibling=null,n=ue.current,ee(ue,r?n&1|2:n&1),t):(_e(t),null);case 22:case 23:return Ss(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?We&1073741824&&(_e(t),t.subtreeFlags&6&&(t.flags|=8192)):_e(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function gy(e,t){switch(es(t),t.tag){case 1:return Ae(t.type)&&Pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sr(),ne(Fe),ne(Le),ss(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return as(t),null;case 13:if(ne(ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));gr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(ue),null;case 4:return Sr(),null;case 10:return os(t.type._context),null;case 22:case 23:return Ss(),null;case 24:return null;default:return null}}var qo=!1,De=!1,wy=typeof WeakSet=="function"?WeakSet:Set,L=null;function rr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ce(e,t,r)}else n.current=null}function ya(e,t,n){try{n()}catch(r){ce(e,t,r)}}var Jc=!1;function Sy(e,t){if(ea=xl,e=Vd(),Za(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,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,u=-1,a=-1,s=0,f=0,p=e,h=null;t:for(;;){for(var v;p!==n||o!==0&&p.nodeType!==3||(u=i+o),p!==l||r!==0&&p.nodeType!==3||(a=i+r),p.nodeType===3&&(i+=p.nodeValue.length),(v=p.firstChild)!==null;)h=p,p=v;for(;;){if(p===e)break t;if(h===n&&++s===o&&(u=i),h===l&&++f===r&&(a=i),(v=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=v}n=u===-1||a===-1?null:{start:u,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(ta={focusedElem:e,selectionRange:n},xl=!1,L=t;L!==null;)if(t=L,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,L=e;else for(;L!==null;){t=L;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 g=y.memoizedProps,E=y.memoizedState,c=t.stateNode,d=c.getSnapshotBeforeUpdate(t.elementType===t.type?g:ct(t.type,g),E);c.__reactInternalSnapshotBeforeUpdate=d}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(N(163))}}catch(w){ce(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}return y=Jc,Jc=!1,y}function to(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 l=o.destroy;o.destroy=void 0,l!==void 0&&ya(t,n,l)}o=o.next}while(o!==r)}}function ni(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 ga(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 Up(e){var t=e.alternate;t!==null&&(e.alternate=null,Up(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kt],delete t[vo],delete t[oa],delete t[ny],delete t[ry])),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 Bp(e){return e.tag===5||e.tag===3||e.tag===4}function Zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bp(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 wa(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=Cl));else if(r!==4&&(e=e.child,e!==null))for(wa(e,t,n),e=e.sibling;e!==null;)wa(e,t,n),e=e.sibling}function Sa(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(Sa(e,t,n),e=e.sibling;e!==null;)Sa(e,t,n),e=e.sibling}var ke=null,dt=!1;function Yt(e,t,n){for(n=n.child;n!==null;)Wp(e,t,n),n=n.sibling}function Wp(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Yl,n)}catch{}switch(n.tag){case 5:De||rr(n,t);case 6:var r=ke,o=dt;ke=null,Yt(e,t,n),ke=r,dt=o,ke!==null&&(dt?(e=ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ke.removeChild(n.stateNode));break;case 18:ke!==null&&(dt?(e=ke,n=n.stateNode,e.nodeType===8?cu(e.parentNode,n):e.nodeType===1&&cu(e,n),co(e)):cu(ke,n.stateNode));break;case 4:r=ke,o=dt,ke=n.stateNode.containerInfo,dt=!0,Yt(e,t,n),ke=r,dt=o;break;case 0:case 11:case 14:case 15:if(!De&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var l=o,i=l.destroy;l=l.tag,i!==void 0&&(l&2||l&4)&&ya(n,t,i),o=o.next}while(o!==r)}Yt(e,t,n);break;case 1:if(!De&&(rr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){ce(n,t,u)}Yt(e,t,n);break;case 21:Yt(e,t,n);break;case 22:n.mode&1?(De=(r=De)||n.memoizedState!==null,Yt(e,t,n),De=r):Yt(e,t,n);break;default:Yt(e,t,n)}}function qc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new wy),t.forEach(function(r){var o=Oy.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function st(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~l}if(r=o,r=de()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ey(r/1960))-r,10e?16:e,tn===null)var r=!1;else{if(e=tn,tn=null,jl=0,K&6)throw Error(N(331));var o=K;for(K|=4,L=e.current;L!==null;){var l=L,i=l.child;if(L.flags&16){var u=l.deletions;if(u!==null){for(var a=0;ade()-gs?Mn(e,0):ys|=n),Ue(e,t)}function Gp(e,t){t===0&&(e.mode&1?(t=Ho,Ho<<=1,!(Ho&130023424)&&(Ho=4194304)):t=1);var n=Te();e=Wt(e,t),e!==null&&(_o(e,t,n),Ue(e,n))}function _y(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gp(e,n)}function Oy(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(N(314))}r!==null&&r.delete(t),Gp(e,n)}var Jp;Jp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fe.current)je=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return je=!1,vy(e,t,n);je=!!(e.flags&131072)}else je=!1,le&&t.flags&1048576&&ep(t,_l,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cl(e,t),e=t.pendingProps;var o=yr(t,Le.current);fr(t,n),o=fs(null,t,r,e,o,n);var l=ds();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,Ae(r)?(l=!0,Rl(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,is(t),o.updater=ei,t.stateNode=o,o._reactInternals=t,ca(t,r,e,n),t=pa(null,t,r,!0,l,n)):(t.tag=0,le&&l&&qa(t),Me(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ly(r),e=ct(r,e),o){case 0:t=da(null,t,r,e,n);break e;case 1:t=Yc(null,t,r,e,n);break e;case 11:t=bc(null,t,r,e,n);break e;case 14:t=Kc(null,t,r,ct(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),da(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Yc(e,t,r,o,n);case 3:e:{if(zp(t),e===null)throw Error(N(387));r=t.pendingProps,l=t.memoizedState,o=l.element,op(e,t),Ll(t,r,null,n);var i=t.memoizedState;if(r=i.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=xr(Error(N(423)),t),t=Xc(e,t,r,n,o);break e}else if(r!==o){o=xr(Error(N(424)),t),t=Xc(e,t,r,n,o);break e}else for(Ve=ln(t.stateNode.containerInfo.firstChild),He=t,le=!0,pt=null,n=ap(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gr(),r===o){t=Vt(e,t,n);break e}Me(e,t,r,n)}t=t.child}return t;case 5:return sp(t),e===null&&ua(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,i=o.children,na(r,o)?i=null:l!==null&&na(r,l)&&(t.flags|=32),Tp(e,t),Me(e,t,i,n),t.child;case 6:return e===null&&ua(t),null;case 13:return Ip(e,t,n);case 4:return us(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wr(t,null,r,n):Me(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),bc(e,t,r,o,n);case 7:return Me(e,t,t.pendingProps,n),t.child;case 8:return Me(e,t,t.pendingProps.children,n),t.child;case 12:return Me(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,l=t.memoizedProps,i=o.value,ee(Ol,r._currentValue),r._currentValue=i,l!==null)if(gt(l.value,i)){if(l.children===o.children&&!Fe.current){t=Vt(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var u=l.dependencies;if(u!==null){i=l.child;for(var a=u.firstContext;a!==null;){if(a.context===r){if(l.tag===1){a=At(-1,n&-n),a.tag=2;var s=l.updateQueue;if(s!==null){s=s.shared;var f=s.pending;f===null?a.next=a:(a.next=f.next,f.next=a),s.pending=a}}l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),aa(l.return,n,t),u.lanes|=n;break}a=a.next}}else if(l.tag===10)i=l.type===t.type?null:l.child;else if(l.tag===18){if(i=l.return,i===null)throw Error(N(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),aa(i,n,t),i=l.sibling}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===t){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}Me(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,fr(t,n),o=ot(o),r=r(o),t.flags|=1,Me(e,t,r,n),t.child;case 14:return r=t.type,o=ct(r,t.pendingProps),o=ct(r.type,o),Kc(e,t,r,o,n);case 15:return Lp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),cl(e,t),t.tag=1,Ae(r)?(e=!0,Rl(t)):e=!1,fr(t,n),ip(t,r,o),ca(t,r,o,n),pa(null,t,r,!0,e,n);case 19:return $p(e,t,n);case 22:return Mp(e,t,n)}throw Error(N(156,t.tag))};function Zp(e,t){return Cd(e,t)}function Dy(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 nt(e,t,n,r){return new Dy(e,t,n,r)}function Es(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ly(e){if(typeof e=="function")return Es(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ba)return 11;if(e===Wa)return 14}return 2}function cn(e,t){var n=e.alternate;return n===null?(n=nt(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 pl(e,t,n,r,o,l){var i=2;if(r=e,typeof e=="function")Es(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Yn:return Tn(n.children,o,l,t);case Ua:i=8,o|=8;break;case zu:return e=nt(12,n,t,o|2),e.elementType=zu,e.lanes=l,e;case Iu:return e=nt(13,n,t,o),e.elementType=Iu,e.lanes=l,e;case $u:return e=nt(19,n,t,o),e.elementType=$u,e.lanes=l,e;case ud:return oi(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ld:i=10;break e;case id:i=9;break e;case Ba:i=11;break e;case Wa:i=14;break e;case Xt:i=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=nt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=l,t}function Tn(e,t,n,r){return e=nt(7,e,r,t),e.lanes=n,e}function oi(e,t,n,r){return e=nt(22,e,r,t),e.elementType=ud,e.lanes=n,e.stateNode={isHidden:!1},e}function gu(e,t,n){return e=nt(6,e,null,t),e.lanes=n,e}function wu(e,t,n){return t=nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function My(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=qi(0),this.expirationTimes=qi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qi(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ks(e,t,n,r,o,l,i,u,a){return e=new My(e,t,n,u,a),t===1?(t=1,l===!0&&(t|=8)):t=0,l=nt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},is(l),e}function Ty(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nh)}catch(e){console.error(e)}}nh(),ed.exports=Ke;var rh=ed.exports,af=rh;Mu.createRoot=af.createRoot,Mu.hydrateRoot=af.hydrateRoot;/** + * @remix-run/router v1.6.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function kr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ay(){return Math.random().toString(36).substr(2,8)}function cf(e,t){return{usr:e.state,key:e.key,idx:t}}function ko(e,t,n,r){return n===void 0&&(n=null),X({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bt(t):t,{state:n,key:t&&t.key||r||Ay()})}function vn(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 bt(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 Uy(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:l=!1}=r,i=o.history,u=pe.Pop,a=null,s=f();s==null&&(s=0,i.replaceState(X({},i.state,{idx:s}),""));function f(){return(i.state||{idx:null}).idx}function p(){u=pe.Pop;let E=f(),c=E==null?null:E-s;s=E,a&&a({action:u,location:g.location,delta:c})}function h(E,c){u=pe.Push;let d=ko(g.location,E,c);n&&n(d,E),s=f()+1;let m=cf(d,s),w=g.createHref(d);try{i.pushState(m,"",w)}catch{o.location.assign(w)}l&&a&&a({action:u,location:g.location,delta:1})}function v(E,c){u=pe.Replace;let d=ko(g.location,E,c);n&&n(d,E),s=f();let m=cf(d,s),w=g.createHref(d);i.replaceState(m,"",w),l&&a&&a({action:u,location:g.location,delta:0})}function y(E){let c=o.location.origin!=="null"?o.location.origin:o.location.href,d=typeof E=="string"?E:vn(E);return B(c,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,c)}let g={get action(){return u},get location(){return e(o,i)},listen(E){if(a)throw new Error("A history only accepts one active listener");return o.addEventListener(sf,p),a=E,()=>{o.removeEventListener(sf,p),a=null}},createHref(E){return t(o,E)},createURL:y,encodeLocation(E){let c=y(E);return{pathname:c.pathname,search:c.search,hash:c.hash}},push:h,replace:v,go(E){return i.go(E)}};return g}var me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(me||(me={}));const By=new Set(["lazy","caseSensitive","path","id","index","children"]);function Wy(e){return e.index===!0}function oh(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,l)=>{let i=[...n,l],u=typeof o.id=="string"?o.id:i.join("-");if(B(o.index!==!0||!o.children,"Cannot specify children on an index route"),B(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),Wy(o)){let a=X({},o,t(o),{id:u});return r[u]=a,a}else{let a=X({},o,t(o),{id:u,children:void 0});return r[u]=a,o.children&&(a.children=oh(o.children,t,i,r)),a}})}function lr(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?bt(t):t,o=An(r.pathname||"/",n);if(o==null)return null;let l=lh(e);Vy(l);let i=null;for(let u=0;i==null&&u{let a={relativePath:u===void 0?l.path||"":u,caseSensitive:l.caseSensitive===!0,childrenIndex:i,route:l};a.relativePath.startsWith("/")&&(B(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let s=Rt([r,a.relativePath]),f=n.concat(a);l.children&&l.children.length>0&&(B(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),lh(l.children,t,f,s)),!(l.path==null&&!l.index)&&t.push({path:s,score:Gy(s,l.index),routesMeta:f})};return e.forEach((l,i)=>{var u;if(l.path===""||!((u=l.path)!=null&&u.includes("?")))o(l,i);else for(let a of ih(l.path))o(l,i,a)}),t}function ih(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return o?[l,""]:[l];let i=ih(r.join("/")),u=[];return u.push(...i.map(a=>a===""?l:[l,a].join("/"))),o&&u.push(...i),u.map(a=>e.startsWith("/")&&a===""?"/":a)}function Vy(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Jy(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Hy=/^:\w+$/,Qy=3,by=2,Ky=1,Yy=10,Xy=-2,ff=e=>e==="*";function Gy(e,t){let n=e.split("/"),r=n.length;return n.some(ff)&&(r+=Xy),t&&(r+=by),n.filter(o=>!ff(o)).reduce((o,l)=>o+(Hy.test(l)?Qy:l===""?Ky:Yy),r)}function Jy(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 Zy(e,t){let{routesMeta:n}=e,r={},o="/",l=[];for(let i=0;i{if(f==="*"){let h=u[p]||"";i=l.slice(0,l.length-h.length).replace(/(.)\/+$/,"$1")}return s[f]=ng(u[p]||"",f),s},{}),pathname:l,pathnameBase:i,pattern:e}}function eg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),kr(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,(i,u)=>(r.push(u),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function tg(e){try{return decodeURI(e)}catch(t){return kr(!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 ng(e,t){try{return decodeURIComponent(e)}catch(n){return kr(!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 rg(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?bt(e):e;return{pathname:n?n.startsWith("/")?n:og(n,t):t,search:ig(r),hash:ug(o)}}function og(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 Su(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 si(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ns(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=bt(e):(o=X({},e),B(!o.pathname||!o.pathname.includes("?"),Su("?","pathname","search",o)),B(!o.pathname||!o.pathname.includes("#"),Su("#","pathname","hash",o)),B(!o.search||!o.search.includes("#"),Su("#","search","hash",o)));let l=e===""||o.pathname==="",i=l?"/":o.pathname,u;if(r||i==null)u=n;else{let p=t.length-1;if(i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),p-=1;o.pathname=h.join("/")}u=p>=0?t[p]:"/"}let a=rg(o,u),s=i&&i!=="/"&&i.endsWith("/"),f=(l||i===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(s||f)&&(a.pathname+="/"),a}const Rt=e=>e.join("/").replace(/\/\/+/g,"/"),lg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ig=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ug=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ag=function(t,n){n===void 0&&(n=302);let r=n;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let o=new Headers(r.headers);return o.set("Location",t),new Response(null,X({},r,{headers:o}))};class _s{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 uh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ah=["post","put","patch","delete"],sg=new Set(ah),cg=["get",...ah],fg=new Set(cg),dg=new Set([301,302,303,307,308]),pg=new Set([307,308]),xu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},hg={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},df={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},sh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ch=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mg=!ch,vg=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function yg(e){B(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t;if(e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){let S=e.detectErrorBoundary;t=x=>({hasErrorBoundary:S(x)})}else t=vg;let n={},r=oh(e.routes,t,void 0,n),o,l=e.basename||"/",i=X({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),u=null,a=new Set,s=null,f=null,p=null,h=e.hydrationData!=null,v=lr(r,e.history.location,l),y=null;if(v==null){let S=ft(404,{pathname:e.history.location.pathname}),{matches:x,route:P}=wf(r);v=x,y={[P.id]:S}}let g=!v.some(S=>S.route.lazy)&&(!v.some(S=>S.route.loader)||e.hydrationData!=null),E,c={historyAction:e.history.action,location:e.history.location,matches:v,initialized:g,navigation:xu,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||y,fetchers:new Map,blockers:new Map},d=pe.Pop,m=!1,w,C=!1,_=!1,O=[],M=[],j=new Map,$=0,fe=-1,ut=new Map,at=new Set,Dt=new Map,Lt=new Map,Ge=new Map,kn=!1;function D(){return u=e.history.listen(S=>{let{action:x,location:P,delta:T}=S;if(kn){kn=!1;return}kr(Ge.size===0||T!=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 z=Gs({currentLocation:c.location,nextLocation:P,historyAction:x});if(z&&T!=null){kn=!0,e.history.go(T*-1),Io(z,{state:"blocked",location:P,proceed(){Io(z,{state:"proceeding",proceed:void 0,reset:void 0,location:P}),e.history.go(T)},reset(){Mr(z),Q({blockers:new Map(E.state.blockers)})}});return}return Je(x,P)}),c.initialized||Je(pe.Pop,c.location),E}function W(){u&&u(),a.clear(),w&&w.abort(),c.fetchers.forEach((S,x)=>Ui(x)),c.blockers.forEach((S,x)=>Mr(x))}function H(S){return a.add(S),()=>a.delete(S)}function Q(S){c=X({},c,S),a.forEach(x=>x(c))}function re(S,x){var P,T;let z=c.actionData!=null&&c.navigation.formMethod!=null&&It(c.navigation.formMethod)&&c.navigation.state==="loading"&&((P=S.state)==null?void 0:P._isRedirect)!==!0,U;x.actionData?Object.keys(x.actionData).length>0?U=x.actionData:U=null:z?U=c.actionData:U=null;let V=x.loaderData?gf(c.loaderData,x.loaderData,x.matches||[],x.errors):c.loaderData;for(let[I]of Ge)Mr(I);let F=m===!0||c.navigation.formMethod!=null&&It(c.navigation.formMethod)&&((T=S.state)==null?void 0:T._isRedirect)!==!0;o&&(r=o,o=void 0),Q(X({},x,{actionData:U,loaderData:V,historyAction:d,location:S,initialized:!0,navigation:xu,revalidation:"idle",restoreScrollPosition:Js(S,x.matches||c.matches),preventScrollReset:F,blockers:new Map(c.blockers)})),C||d===pe.Pop||(d===pe.Push?e.history.push(S,S.state):d===pe.Replace&&e.history.replace(S,S.state)),d=pe.Pop,m=!1,C=!1,_=!1,O=[],M=[]}async function Cn(S,x){if(typeof S=="number"){e.history.go(S);return}let P=Pa(c.location,c.matches,l,i.v7_prependBasename,S,x==null?void 0:x.fromRouteId,x==null?void 0:x.relative),{path:T,submission:z,error:U}=pf(i.v7_normalizeFormMethod,!1,P,x),V=c.location,F=ko(c.location,T,x&&x.state);F=X({},F,e.history.encodeLocation(F));let I=x&&x.replace!=null?x.replace:void 0,Y=pe.Push;I===!0?Y=pe.Replace:I===!1||z!=null&&It(z.formMethod)&&z.formAction===c.location.pathname+c.location.search&&(Y=pe.Replace);let Z=x&&"preventScrollReset"in x?x.preventScrollReset===!0:void 0,Re=Gs({currentLocation:V,nextLocation:F,historyAction:Y});if(Re){Io(Re,{state:"blocked",location:F,proceed(){Io(Re,{state:"proceeding",proceed:void 0,reset:void 0,location:F}),Cn(S,x)},reset(){Mr(Re),Q({blockers:new Map(c.blockers)})}});return}return await Je(Y,F,{submission:z,pendingError:U,preventScrollReset:Z,replace:x&&x.replace})}function Mt(){if(Fi(),Q({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){Je(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}Je(d||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function Je(S,x,P){w&&w.abort(),w=null,d=S,C=(P&&P.startUninterruptedRevalidation)===!0,cm(c.location,c.matches),m=(P&&P.preventScrollReset)===!0;let T=o||r,z=P&&P.overrideNavigation,U=lr(T,x,l);if(!U){let ge=ft(404,{pathname:x.pathname}),{matches:we,route:Ze}=wf(T);Bi(),re(x,{matches:we,loaderData:{},errors:{[Ze.id]:ge}});return}if(Eg(c.location,x)&&!(P&&P.submission&&It(P.submission.formMethod))){re(x,{matches:U});return}w=new AbortController;let V=Vr(e.history,x,w.signal,P&&P.submission),F,I;if(P&&P.pendingError)I={[ir(U).route.id]:P.pendingError};else if(P&&P.submission&&It(P.submission.formMethod)){let ge=await Tt(V,x,P.submission,U,{replace:P.replace});if(ge.shortCircuited)return;F=ge.pendingActionData,I=ge.pendingActionError,z=X({state:"loading",location:x},P.submission),V=new Request(V.url,{signal:V.signal})}let{shortCircuited:Y,loaderData:Z,errors:Re}=await Vn(V,x,U,z,P&&P.submission,P&&P.fetcherSubmission,P&&P.replace,F,I);Y||(w=null,re(x,X({matches:U},F?{actionData:F}:{},{loaderData:Z,errors:Re})))}async function Tt(S,x,P,T,z){Fi();let U=X({state:"submitting",location:x},P);Q({navigation:U});let V,F=Ra(T,x);if(!F.route.action&&!F.route.lazy)V={type:me.error,error:ft(405,{method:S.method,pathname:x.pathname,routeId:F.route.id})};else if(V=await Wr("action",S,F,T,n,t,l),S.signal.aborted)return{shortCircuited:!0};if(pr(V)){let I;return z&&z.replace!=null?I=z.replace:I=V.location===c.location.pathname+c.location.search,await Lr(c,V,{submission:P,replace:I}),{shortCircuited:!0}}if(oo(V)){let I=ir(T,F.route.id);return(z&&z.replace)!==!0&&(d=pe.Push),{pendingActionData:{},pendingActionError:{[I.route.id]:V.error}}}if(Ln(V))throw ft(400,{type:"defer-action"});return{pendingActionData:{[F.route.id]:V.data}}}async function Vn(S,x,P,T,z,U,V,F,I){let Y=T;Y||(Y=X({state:"loading",location:x,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},z));let Z=z||U?z||U:Y.formMethod&&Y.formAction&&Y.formData&&Y.formEncType?{formMethod:Y.formMethod,formAction:Y.formAction,formData:Y.formData,formEncType:Y.formEncType}:void 0,Re=o||r,[ge,we]=hf(e.history,c,P,Z,x,_,O,M,Dt,Re,l,F,I);if(Bi(ie=>!(P&&P.some(qe=>qe.route.id===ie))||ge&&ge.some(qe=>qe.route.id===ie)),ge.length===0&&we.length===0){let ie=Ys();return re(x,X({matches:P,loaderData:{},errors:I||null},F?{actionData:F}:{},ie?{fetchers:new Map(c.fetchers)}:{})),{shortCircuited:!0}}if(!C){we.forEach(qe=>{let Qn=c.fetchers.get(qe.key),bi={state:"loading",data:Qn&&Qn.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(qe.key,bi)});let ie=F||c.actionData;Q(X({navigation:Y},ie?Object.keys(ie).length===0?{actionData:null}:{actionData:ie}:{},we.length>0?{fetchers:new Map(c.fetchers)}:{}))}fe=++$,we.forEach(ie=>{ie.controller&&j.set(ie.key,ie.controller)});let Ze=()=>we.forEach(ie=>Hn(ie.key));w&&w.signal.addEventListener("abort",Ze);let{results:Tr,loaderResults:Wi,fetcherResults:$o}=await bs(c.matches,P,ge,we,S);if(S.signal.aborted)return{shortCircuited:!0};w&&w.signal.removeEventListener("abort",Ze),we.forEach(ie=>j.delete(ie.key));let Kt=Sf(Tr);if(Kt)return await Lr(c,Kt,{replace:V}),{shortCircuited:!0};let{loaderData:jo,errors:Vi}=yf(c,P,ge,Wi,I,we,$o,Lt);Lt.forEach((ie,qe)=>{ie.subscribe(Qn=>{(Qn||ie.done)&&Lt.delete(qe)})});let Hi=Ys(),Qi=Xs(fe),Fo=Hi||Qi||we.length>0;return X({loaderData:jo,errors:Vi},Fo?{fetchers:new Map(c.fetchers)}:{})}function Qs(S){return c.fetchers.get(S)||hg}function lm(S,x,P,T){if(mg)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.");j.has(S)&&Hn(S);let z=o||r,U=Pa(c.location,c.matches,l,i.v7_prependBasename,P,x,T==null?void 0:T.relative),V=lr(z,U,l);if(!V){Ai(S,x,ft(404,{pathname:U}));return}let{path:F,submission:I}=pf(i.v7_normalizeFormMethod,!0,U,T),Y=Ra(V,F);if(m=(T&&T.preventScrollReset)===!0,I&&It(I.formMethod)){im(S,x,F,Y,V,I);return}Dt.set(S,{routeId:x,path:F}),um(S,x,F,Y,V,I)}async function im(S,x,P,T,z,U){if(Fi(),Dt.delete(S),!T.route.action&&!T.route.lazy){let Be=ft(405,{method:U.formMethod,pathname:P,routeId:x});Ai(S,x,Be);return}let V=c.fetchers.get(S),F=X({state:"submitting"},U,{data:V&&V.data," _hasFetcherDoneAnything ":!0});c.fetchers.set(S,F),Q({fetchers:new Map(c.fetchers)});let I=new AbortController,Y=Vr(e.history,P,I.signal,U);j.set(S,I);let Z=await Wr("action",Y,T,z,n,t,l);if(Y.signal.aborted){j.get(S)===I&&j.delete(S);return}if(pr(Z)){j.delete(S),at.add(S);let Be=X({state:"loading"},U,{data:void 0," _hasFetcherDoneAnything ":!0});return c.fetchers.set(S,Be),Q({fetchers:new Map(c.fetchers)}),Lr(c,Z,{submission:U,isFetchActionRedirect:!0})}if(oo(Z)){Ai(S,x,Z.error);return}if(Ln(Z))throw ft(400,{type:"defer-action"});let Re=c.navigation.location||c.location,ge=Vr(e.history,Re,I.signal),we=o||r,Ze=c.navigation.state!=="idle"?lr(we,c.navigation.location,l):c.matches;B(Ze,"Didn't find any matches after fetcher action");let Tr=++$;ut.set(S,Tr);let Wi=X({state:"loading",data:Z.data},U,{" _hasFetcherDoneAnything ":!0});c.fetchers.set(S,Wi);let[$o,Kt]=hf(e.history,c,Ze,U,Re,_,O,M,Dt,we,l,{[T.route.id]:Z.data},void 0);Kt.filter(Be=>Be.key!==S).forEach(Be=>{let Ki=Be.key,Zs=c.fetchers.get(Ki),dm={state:"loading",data:Zs&&Zs.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(Ki,dm),Be.controller&&j.set(Ki,Be.controller)}),Q({fetchers:new Map(c.fetchers)});let jo=()=>Kt.forEach(Be=>Hn(Be.key));I.signal.addEventListener("abort",jo);let{results:Vi,loaderResults:Hi,fetcherResults:Qi}=await bs(c.matches,Ze,$o,Kt,ge);if(I.signal.aborted)return;I.signal.removeEventListener("abort",jo),ut.delete(S),j.delete(S),Kt.forEach(Be=>j.delete(Be.key));let Fo=Sf(Vi);if(Fo)return Lr(c,Fo);let{loaderData:ie,errors:qe}=yf(c,c.matches,$o,Hi,void 0,Kt,Qi,Lt),Qn={state:"idle",data:Z.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(S,Qn);let bi=Xs(Tr);c.navigation.state==="loading"&&Tr>fe?(B(d,"Expected pending action"),w&&w.abort(),re(c.navigation.location,{matches:Ze,loaderData:ie,errors:qe,fetchers:new Map(c.fetchers)})):(Q(X({errors:qe,loaderData:gf(c.loaderData,ie,Ze,qe)},bi?{fetchers:new Map(c.fetchers)}:{})),_=!1)}async function um(S,x,P,T,z,U){let V=c.fetchers.get(S),F=X({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},U,{data:V&&V.data," _hasFetcherDoneAnything ":!0});c.fetchers.set(S,F),Q({fetchers:new Map(c.fetchers)});let I=new AbortController,Y=Vr(e.history,P,I.signal);j.set(S,I);let Z=await Wr("loader",Y,T,z,n,t,l);if(Ln(Z)&&(Z=await hh(Z,Y.signal,!0)||Z),j.get(S)===I&&j.delete(S),Y.signal.aborted)return;if(pr(Z)){at.add(S),await Lr(c,Z);return}if(oo(Z)){let ge=ir(c.matches,x);c.fetchers.delete(S),Q({fetchers:new Map(c.fetchers),errors:{[ge.route.id]:Z.error}});return}B(!Ln(Z),"Unhandled fetcher deferred data");let Re={state:"idle",data:Z.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(S,Re),Q({fetchers:new Map(c.fetchers)})}async function Lr(S,x,P){var T;let{submission:z,replace:U,isFetchActionRedirect:V}=P===void 0?{}:P;x.revalidate&&(_=!0);let F=ko(S.location,x.location,X({_isRedirect:!0},V?{_isFetchActionRedirect:!0}:{}));if(B(F,"Expected a location on the redirect navigation"),sh.test(x.location)&&ch&&typeof((T=window)==null?void 0:T.location)<"u"){let we=e.history.createURL(x.location),Ze=An(we.pathname,l)==null;if(window.location.origin!==we.origin||Ze){U?window.location.replace(x.location):window.location.assign(x.location);return}}w=null;let I=U===!0?pe.Replace:pe.Push,{formMethod:Y,formAction:Z,formEncType:Re,formData:ge}=S.navigation;!z&&Y&&Z&&ge&&Re&&(z={formMethod:Y,formAction:Z,formEncType:Re,formData:ge}),pg.has(x.status)&&z&&It(z.formMethod)?await Je(I,F,{submission:X({},z,{formAction:x.location}),preventScrollReset:m}):V?await Je(I,F,{overrideNavigation:{state:"loading",location:F,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:z,preventScrollReset:m}):await Je(I,F,{overrideNavigation:{state:"loading",location:F,formMethod:z?z.formMethod:void 0,formAction:z?z.formAction:void 0,formEncType:z?z.formEncType:void 0,formData:z?z.formData:void 0},preventScrollReset:m})}async function bs(S,x,P,T,z){let U=await Promise.all([...P.map(I=>Wr("loader",z,I,x,n,t,l)),...T.map(I=>I.matches&&I.match&&I.controller?Wr("loader",Vr(e.history,I.path,I.controller.signal),I.match,I.matches,n,t,l):{type:me.error,error:ft(404,{pathname:I.path})})]),V=U.slice(0,P.length),F=U.slice(P.length);return await Promise.all([xf(S,P,V,V.map(()=>z.signal),!1,c.loaderData),xf(S,T.map(I=>I.match),F,T.map(I=>I.controller?I.controller.signal:null),!0)]),{results:U,loaderResults:V,fetcherResults:F}}function Fi(){_=!0,O.push(...Bi()),Dt.forEach((S,x)=>{j.has(x)&&(M.push(x),Hn(x))})}function Ai(S,x,P){let T=ir(c.matches,x);Ui(S),Q({errors:{[T.route.id]:P},fetchers:new Map(c.fetchers)})}function Ui(S){j.has(S)&&Hn(S),Dt.delete(S),ut.delete(S),at.delete(S),c.fetchers.delete(S)}function Hn(S){let x=j.get(S);B(x,"Expected fetch controller: "+S),x.abort(),j.delete(S)}function Ks(S){for(let x of S){let T={state:"idle",data:Qs(x).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(x,T)}}function Ys(){let S=[],x=!1;for(let P of at){let T=c.fetchers.get(P);B(T,"Expected fetcher: "+P),T.state==="loading"&&(at.delete(P),S.push(P),x=!0)}return Ks(S),x}function Xs(S){let x=[];for(let[P,T]of ut)if(T0}function am(S,x){let P=c.blockers.get(S)||df;return Ge.get(S)!==x&&Ge.set(S,x),P}function Mr(S){c.blockers.delete(S),Ge.delete(S)}function Io(S,x){let P=c.blockers.get(S)||df;B(P.state==="unblocked"&&x.state==="blocked"||P.state==="blocked"&&x.state==="blocked"||P.state==="blocked"&&x.state==="proceeding"||P.state==="blocked"&&x.state==="unblocked"||P.state==="proceeding"&&x.state==="unblocked","Invalid blocker state transition: "+P.state+" -> "+x.state),c.blockers.set(S,x),Q({blockers:new Map(c.blockers)})}function Gs(S){let{currentLocation:x,nextLocation:P,historyAction:T}=S;if(Ge.size===0)return;Ge.size>1&&kr(!1,"A router only supports one blocker at a time");let z=Array.from(Ge.entries()),[U,V]=z[z.length-1],F=c.blockers.get(U);if(!(F&&F.state==="proceeding")&&V({currentLocation:x,nextLocation:P,historyAction:T}))return U}function Bi(S){let x=[];return Lt.forEach((P,T)=>{(!S||S(T))&&(P.cancel(),x.push(T),Lt.delete(T))}),x}function sm(S,x,P){if(s=S,p=x,f=P||(T=>T.key),!h&&c.navigation===xu){h=!0;let T=Js(c.location,c.matches);T!=null&&Q({restoreScrollPosition:T})}return()=>{s=null,p=null,f=null}}function cm(S,x){if(s&&f&&p){let P=x.map(z=>Ef(z,c.loaderData)),T=f(S,P)||S.key;s[T]=p()}}function Js(S,x){if(s&&f&&p){let P=x.map(U=>Ef(U,c.loaderData)),T=f(S,P)||S.key,z=s[T];if(typeof z=="number")return z}return null}function fm(S){o=S}return E={get basename(){return l},get state(){return c},get routes(){return r},initialize:D,subscribe:H,enableScrollRestoration:sm,navigate:Cn,fetch:lm,revalidate:Mt,createHref:S=>e.history.createHref(S),encodeLocation:S=>e.history.encodeLocation(S),getFetcher:Qs,deleteFetcher:Ui,dispose:W,getBlocker:am,deleteBlocker:Mr,_internalFetchControllers:j,_internalActiveDeferreds:Lt,_internalSetRoutes:fm},E}function gg(e){return e!=null&&"formData"in e}function Pa(e,t,n,r,o,l,i){let u,a;if(l!=null&&i!=="path"){u=[];for(let f of t)if(u.push(f),f.route.id===l){a=f;break}}else u=t,a=t[t.length-1];let s=Ns(o||".",si(u).map(f=>f.pathnameBase),e.pathname,i==="path");return o==null&&(s.search=e.search,s.hash=e.hash),(o==null||o===""||o===".")&&a&&a.route.index&&!Os(s.search)&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(s.pathname=s.pathname==="/"?n:Rt([n,s.pathname])),vn(s)}function pf(e,t,n,r){if(!r||!gg(r))return{path:n};if(r.formMethod&&!Pg(r.formMethod))return{path:n,error:ft(405,{method:r.formMethod})};let o;if(r.formData){let u=r.formMethod||"get";if(o={formMethod:e?u.toUpperCase():u.toLowerCase(),formAction:ph(n),formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:r.formData},It(o.formMethod))return{path:n,submission:o}}let l=bt(n),i=dh(r.formData);return t&&l.search&&Os(l.search)&&i.append("index",""),l.search="?"+i,{path:vn(l),submission:o}}function wg(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 hf(e,t,n,r,o,l,i,u,a,s,f,p,h){let v=h?Object.values(h)[0]:p?Object.values(p)[0]:void 0,y=e.createURL(t.location),g=e.createURL(o),E=h?Object.keys(h)[0]:void 0,d=wg(n,E).filter((w,C)=>{if(w.route.lazy)return!0;if(w.route.loader==null)return!1;if(Sg(t.loaderData,t.matches[C],w)||i.some(M=>M===w.route.id))return!0;let _=t.matches[C],O=w;return mf(w,X({currentUrl:y,currentParams:_.params,nextUrl:g,nextParams:O.params},r,{actionResult:v,defaultShouldRevalidate:l||y.toString()===g.toString()||y.search!==g.search||fh(_,O)}))}),m=[];return a.forEach((w,C)=>{if(!n.some(j=>j.route.id===w.routeId))return;let _=lr(s,w.path,f);if(!_){m.push({key:C,routeId:w.routeId,path:w.path,matches:null,match:null,controller:null});return}let O=Ra(_,w.path);if(u.includes(C)){m.push({key:C,routeId:w.routeId,path:w.path,matches:_,match:O,controller:new AbortController});return}mf(O,X({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},r,{actionResult:v,defaultShouldRevalidate:l}))&&m.push({key:C,routeId:w.routeId,path:w.path,matches:_,match:O,controller:new AbortController})}),[d,m]}function Sg(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function fh(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function mf(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function vf(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];B(o,"No route found in manifest");let l={};for(let i in r){let a=o[i]!==void 0&&i!=="hasErrorBoundary";kr(!a,'Route "'+o.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!a&&!By.has(i)&&(l[i]=r[i])}Object.assign(o,l),Object.assign(o,X({},t(o),{lazy:void 0}))}async function Wr(e,t,n,r,o,l,i,u,a,s){u===void 0&&(u=!1),a===void 0&&(a=!1);let f,p,h,v=E=>{let c,d=new Promise((m,w)=>c=w);return h=()=>c(),t.signal.addEventListener("abort",h),Promise.race([E({request:t,params:n.params,context:s}),d])};try{let E=n.route[e];if(n.route.lazy)if(E)p=(await Promise.all([v(E),vf(n.route,l,o)]))[0];else if(await vf(n.route,l,o),E=n.route[e],E)p=await v(E);else if(e==="action"){let c=new URL(t.url),d=c.pathname+c.search;throw ft(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:me.data,data:void 0};else if(E)p=await v(E);else{let c=new URL(t.url),d=c.pathname+c.search;throw ft(404,{pathname:d})}B(p!==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(E){f=me.error,p=E}finally{h&&t.signal.removeEventListener("abort",h)}if(Cg(p)){let E=p.status;if(dg.has(E)){let m=p.headers.get("Location");if(B(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!sh.test(m))m=Pa(new URL(t.url),r.slice(0,r.indexOf(n)+1),i,!0,m);else if(!u){let w=new URL(t.url),C=m.startsWith("//")?new URL(w.protocol+m):new URL(m),_=An(C.pathname,i)!=null;C.origin===w.origin&&_&&(m=C.pathname+C.search+C.hash)}if(u)throw p.headers.set("Location",m),p;return{type:me.redirect,status:E,location:m,revalidate:p.headers.get("X-Remix-Revalidate")!==null}}if(a)throw{type:f||me.data,response:p};let c,d=p.headers.get("Content-Type");return d&&/\bapplication\/json\b/.test(d)?c=await p.json():c=await p.text(),f===me.error?{type:f,error:new _s(E,p.statusText,c),headers:p.headers}:{type:me.data,data:c,statusCode:p.status,headers:p.headers}}if(f===me.error)return{type:f,error:p};if(kg(p)){var y,g;return{type:me.deferred,deferredData:p,statusCode:(y=p.init)==null?void 0:y.status,headers:((g=p.init)==null?void 0:g.headers)&&new Headers(p.init.headers)}}return{type:me.data,data:p}}function Vr(e,t,n,r){let o=e.createURL(ph(t)).toString(),l={signal:n};if(r&&It(r.formMethod)){let{formMethod:i,formEncType:u,formData:a}=r;l.method=i.toUpperCase(),l.body=u==="application/x-www-form-urlencoded"?dh(a):a}return new Request(o,l)}function dh(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,r instanceof File?r.name:r);return t}function xg(e,t,n,r,o){let l={},i=null,u,a=!1,s={};return n.forEach((f,p)=>{let h=t[p].route.id;if(B(!pr(f),"Cannot handle redirect results in processLoaderData"),oo(f)){let v=ir(e,h),y=f.error;r&&(y=Object.values(r)[0],r=void 0),i=i||{},i[v.route.id]==null&&(i[v.route.id]=y),l[h]=void 0,a||(a=!0,u=uh(f.error)?f.error.status:500),f.headers&&(s[h]=f.headers)}else Ln(f)?(o.set(h,f.deferredData),l[h]=f.deferredData.data):l[h]=f.data,f.statusCode!=null&&f.statusCode!==200&&!a&&(u=f.statusCode),f.headers&&(s[h]=f.headers)}),r&&(i=r,l[Object.keys(r)[0]]=void 0),{loaderData:l,errors:i,statusCode:u||200,loaderHeaders:s}}function yf(e,t,n,r,o,l,i,u){let{loaderData:a,errors:s}=xg(t,n,r,o,u);for(let f=0;fr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function wf(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ft(e,t){let{pathname:n,routeId:r,method:o,type:l}=t===void 0?{}:t,i="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(i="Bad Request",o&&n&&r?u="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.":l==="defer-action"&&(u="defer() is not supported in actions")):e===403?(i="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(i="Not Found",u='No route matches URL "'+n+'"'):e===405&&(i="Method Not Allowed",o&&n&&r?u="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&&(u='Invalid request method "'+o.toUpperCase()+'"')),new _s(e||500,i,new Error(u),!0)}function Sf(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(pr(n))return n}}function ph(e){let t=typeof e=="string"?bt(e):e;return vn(X({},t,{hash:""}))}function Eg(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}function Ln(e){return e.type===me.deferred}function oo(e){return e.type===me.error}function pr(e){return(e&&e.type)===me.redirect}function kg(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 Cg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Pg(e){return fg.has(e.toLowerCase())}function It(e){return sg.has(e.toLowerCase())}async function xf(e,t,n,r,o,l){for(let i=0;ip.route.id===a.route.id),f=s!=null&&!fh(s,a)&&(l&&l[a.route.id])!==void 0;if(Ln(u)&&(o||f)){let p=r[i];B(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await hh(u,p,o).then(h=>{h&&(n[i]=h||n[i])})}}}async function hh(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:me.data,data:e.deferredData.unwrappedData}}catch(o){return{type:me.error,error:o}}return{type:me.data,data:e.deferredData.data}}}function Os(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ef(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function Ra(e,t){let n=typeof t=="string"?bt(t).search:t.search;if(e[e.length-1].route.index&&Os(n||""))return e[e.length-1];let r=si(e);return r[r.length-1]}/** + * React Router v6.11.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ul(){return Ul=Object.assign?Object.assign.bind():function(e){for(var t=1;tu.pathnameBase)),l=k.useRef(!1);return yh(()=>{l.current=!0}),k.useCallback(function(u,a){if(a===void 0&&(a={}),!l.current)return;if(typeof u=="number"){t.go(u);return}let s=Ns(u,JSON.parse(o),r,a.relative==="path");e!=="/"&&(s.pathname=s.pathname==="/"?e:Rt([e,s.pathname])),(a.replace?t.replace:t.push)(s,a.state,a)},[e,t,o,r])}const _g=k.createContext(null);function Og(e){let t=k.useContext(Ot).outlet;return t&&k.createElement(_g.Provider,{value:e},t)}function Ds(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=k.useContext(Ot),{pathname:o}=zo(),l=JSON.stringify(si(r).map(i=>i.pathnameBase));return k.useMemo(()=>Ns(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Dg(e,t,n){To()||B(!1);let{navigator:r}=k.useContext(En),{matches:o}=k.useContext(Ot),l=o[o.length-1],i=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let a=zo(),s;if(t){var f;let g=typeof t=="string"?bt(t):t;u==="/"||(f=g.pathname)!=null&&f.startsWith(u)||B(!1),s=g}else s=a;let p=s.pathname||"/",h=u==="/"?p:p.slice(u.length)||"/",v=lr(e,{pathname:h}),y=Ig(v&&v.map(g=>Object.assign({},g,{params:Object.assign({},i,g.params),pathname:Rt([u,r.encodeLocation?r.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Rt([u,r.encodeLocation?r.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n);return t&&y?k.createElement(ci.Provider,{value:{location:Ul({pathname:"/",search:"",hash:"",state:null,key:"default"},s),navigationType:pe.Pop}},y):y}function Lg(){let e=Sh(),t=uh(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)"},l=null;return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:o},n):null,l)}const Mg=k.createElement(Lg,null);class Tg extends k.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||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?k.createElement(Ot.Provider,{value:this.props.routeContext},k.createElement(vh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function zg(e){let{routeContext:t,match:n,children:r}=e,o=k.useContext(Mo);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Ot.Provider,{value:t},r)}function Ig(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let l=e,i=(r=n)==null?void 0:r.errors;if(i!=null){let u=l.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));u>=0||B(!1),l=l.slice(0,Math.min(l.length,u+1))}return l.reduceRight((u,a,s)=>{let f=a.route.id?i==null?void 0:i[a.route.id]:null,p=null;n&&(p=a.route.errorElement||Mg);let h=t.concat(l.slice(0,s+1)),v=()=>{let y;return f?y=p:a.route.element?y=a.route.element:y=u,k.createElement(zg,{match:a,routeContext:{outlet:u,matches:h},children:y})};return n&&(a.route.ErrorBoundary||a.route.errorElement||s===0)?k.createElement(Tg,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:v(),routeContext:{outlet:null,matches:h}}):v()},null)}var Na;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(Na||(Na={}));var _t;(function(e){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"})(_t||(_t={}));function $g(e){let t=k.useContext(Mo);return t||B(!1),t}function di(e){let t=k.useContext(mh);return t||B(!1),t}function jg(e){let t=k.useContext(Ot);return t||B(!1),t}function pi(e){let t=jg(),n=t.matches[t.matches.length-1];return n.route.id||B(!1),n.route.id}function Fg(){return pi(_t.UseRouteId)}function gh(){return di(_t.UseNavigation).navigation}function wh(){let e=di(_t.UseLoaderData),t=pi(_t.UseLoaderData);if(e.errors&&e.errors[t]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")");return}return e.loaderData[t]}function Ag(){let e=di(_t.UseActionData);return k.useContext(Ot)||B(!1),Object.values((e==null?void 0:e.actionData)||{})[0]}function Sh(){var e;let t=k.useContext(vh),n=di(_t.UseRouteError),r=pi(_t.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Ug(){let{router:e}=$g(Na.UseNavigateStable),t=pi(_t.UseNavigateStable),n=k.useRef(!1);return yh(()=>{n.current=!0}),k.useCallback(function(o,l){l===void 0&&(l={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ul({fromRouteId:t},l)))},[e,t])}function Bg(e){let{fallbackElement:t,router:n}=e,[r,o]=k.useState(n.state);k.useLayoutEffect(()=>n.subscribe(o),[n,o]);let l=k.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:a=>n.navigate(a),push:(a,s,f)=>n.navigate(a,{state:s,preventScrollReset:f==null?void 0:f.preventScrollReset}),replace:(a,s,f)=>n.navigate(a,{replace:!0,state:s,preventScrollReset:f==null?void 0:f.preventScrollReset})}),[n]),i=n.basename||"/",u=k.useMemo(()=>({router:n,navigator:l,static:!1,basename:i}),[n,l,i]);return k.createElement(k.Fragment,null,k.createElement(Mo.Provider,{value:u},k.createElement(mh.Provider,{value:r},k.createElement(Hg,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:l},n.state.initialized?k.createElement(Wg,{routes:n.routes,state:r}):t))),null)}function Wg(e){let{routes:t,state:n}=e;return Dg(t,void 0,n)}function Vg(e){return Og(e.context)}function Hg(e){let{basename:t="/",children:n=null,location:r,navigationType:o=pe.Pop,navigator:l,static:i=!1}=e;To()&&B(!1);let u=t.replace(/^\/*/,"/"),a=k.useMemo(()=>({basename:u,navigator:l,static:i}),[u,l,i]);typeof r=="string"&&(r=bt(r));let{pathname:s="/",search:f="",hash:p="",state:h=null,key:v="default"}=r,y=k.useMemo(()=>{let g=An(s,u);return g==null?null:{location:{pathname:g,search:f,hash:p,state:h,key:v},navigationType:o}},[u,s,f,p,h,v,o]);return y==null?null:k.createElement(En.Provider,{value:a},k.createElement(ci.Provider,{children:n,value:y}))}var kf;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(kf||(kf={}));new Promise(()=>{});function Qg(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:k.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:k.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.11.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}const hl="get",Eu="application/x-www-form-urlencoded";function hi(e){return e!=null&&typeof e.tagName=="string"}function bg(e){return hi(e)&&e.tagName.toLowerCase()==="button"}function Kg(e){return hi(e)&&e.tagName.toLowerCase()==="form"}function Yg(e){return hi(e)&&e.tagName.toLowerCase()==="input"}function Xg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gg(e,t){return e.button===0&&(!t||t==="_self")&&!Xg(e)}function Jg(e,t,n){let r,o=null,l,i;if(Kg(e)){let u=t.submissionTrigger;if(t.action)o=t.action;else{let a=e.getAttribute("action");o=a?An(a,n):null}r=t.method||e.getAttribute("method")||hl,l=t.encType||e.getAttribute("enctype")||Eu,i=new FormData(e),u&&u.name&&i.append(u.name,u.value)}else if(bg(e)||Yg(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a - - - - - ); -} - -export default Cart; diff --git a/src/features/cart/CartItem.jsx b/src/features/cart/CartItem.jsx deleted file mode 100644 index 51bf2fd..0000000 --- a/src/features/cart/CartItem.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import { useSelector } from 'react-redux'; -import { formatCurrency } from '../../utils/helpers'; -import DeleteItem from './DeleteItem'; -import UpdateItemQuantity from './UpdateItemQuantity'; -import { getCurrentQuantityById } from './cartSlice'; - -function CartItem({ item }) { - const { pizzaId, name, quantity, totalPrice } = item; - - const currentQuantity = useSelector(getCurrentQuantityById(pizzaId)); - - return ( -
  • -

    - {quantity}× {name} -

    -
    -

    {formatCurrency(totalPrice)}

    - - - -
    -
  • - ); -} - -export default CartItem; diff --git a/src/features/cart/CartOverview.jsx b/src/features/cart/CartOverview.jsx deleted file mode 100644 index 10c82f6..0000000 --- a/src/features/cart/CartOverview.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import { useSelector } from 'react-redux'; -import { Link } from 'react-router-dom'; -import { getTotalCartPrice, getTotalCartQuantity } from './cartSlice'; -import { formatCurrency } from '../../utils/helpers'; - -function CartOverview() { - const totalCartQuantity = useSelector(getTotalCartQuantity); - const totalCartPrice = useSelector(getTotalCartPrice); - - if (!totalCartQuantity) return null; - - return ( -
    -

    - {totalCartQuantity} pizzas - {formatCurrency(totalCartPrice)} -

    - Open cart → -
    - ); -} - -export default CartOverview; diff --git a/src/features/cart/DeleteItem.jsx b/src/features/cart/DeleteItem.jsx deleted file mode 100644 index ee93e2a..0000000 --- a/src/features/cart/DeleteItem.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import { useDispatch } from 'react-redux'; -import Button from '../../ui/Button'; -import { deleteItem } from './cartSlice'; - -function DeleteItem({ pizzaId }) { - const dispatch = useDispatch(); - - return ( - - ); -} - -export default DeleteItem; diff --git a/src/features/cart/EmptyCart.jsx b/src/features/cart/EmptyCart.jsx deleted file mode 100644 index e742071..0000000 --- a/src/features/cart/EmptyCart.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import LinkButton from '../../ui/LinkButton'; - -function EmptyCart() { - return ( -
    - ← Back to menu - -

    - Your cart is still empty. Start adding some pizzas :) -

    -
    - ); -} - -export default EmptyCart; diff --git a/src/features/cart/UpdateItemQuantity.jsx b/src/features/cart/UpdateItemQuantity.jsx deleted file mode 100644 index 24d2234..0000000 --- a/src/features/cart/UpdateItemQuantity.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import { useDispatch } from 'react-redux'; -import Button from '../../ui/Button'; -import { decreaseItemQuantity, increaseItemQuantity } from './cartSlice'; - -function UpdateItemQuantity({ pizzaId, currentQuantity }) { - const dispatch = useDispatch(); - - return ( -
    - - {currentQuantity} - -
    - ); -} - -export default UpdateItemQuantity; diff --git a/src/features/cart/cartSlice.js b/src/features/cart/cartSlice.js deleted file mode 100644 index d0f6061..0000000 --- a/src/features/cart/cartSlice.js +++ /dev/null @@ -1,72 +0,0 @@ -import { createSlice } from '@reduxjs/toolkit'; - -const initialState = { - cart: [], - - // cart: [ - // { - // pizzaId: 12, - // name: 'Mediterranean', - // quantity: 2, - // unitPrice: 16, - // totalPrice: 32, - // }, - // ], -}; - -const cartSlice = createSlice({ - name: 'cart', - initialState, - reducers: { - addItem(state, action) { - // payload = newItem - state.cart.push(action.payload); - }, - deleteItem(state, action) { - // payload = pizzaId - state.cart = state.cart.filter((item) => item.pizzaId !== action.payload); - }, - increaseItemQuantity(state, action) { - // payload = pizzaId - const item = state.cart.find((item) => item.pizzaId === action.payload); - - item.quantity++; - item.totalPrice = item.quantity * item.unitPrice; - }, - decreaseItemQuantity(state, action) { - // payload = pizzaId - const item = state.cart.find((item) => item.pizzaId === action.payload); - - item.quantity--; - item.totalPrice = item.quantity * item.unitPrice; - - if (item.quantity === 0) cartSlice.caseReducers.deleteItem(state, action); - }, - clearCart(state) { - state.cart = []; - }, - }, -}); - -export const { - addItem, - deleteItem, - increaseItemQuantity, - decreaseItemQuantity, - clearCart, -} = cartSlice.actions; - -export default cartSlice.reducer; - -export const getCart = (state) => state.cart.cart; - -export const getTotalCartQuantity = (state) => - state.cart.cart.reduce((sum, item) => sum + item.quantity, 0); - -export const getTotalCartPrice = (state) => - state.cart.cart.reduce((sum, item) => sum + item.totalPrice, 0); - -export const getCurrentQuantityById = (id) => (state) => - state.cart.cart.find((item) => item.pizzaId === id)?.quantity ?? 0; - -// 'reselect' diff --git a/src/features/menu/Menu.jsx b/src/features/menu/Menu.jsx deleted file mode 100644 index d5a2840..0000000 --- a/src/features/menu/Menu.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useLoaderData } from 'react-router-dom'; -import { getMenu } from '../../services/apiRestaurant'; -import MenuItem from './MenuItem'; - -function Menu() { - const menu = useLoaderData(); - - return ( -
      - {menu.map((pizza) => ( - - ))} -
    - ); -} - -export async function loader() { - const menu = await getMenu(); - return menu; -} - -export default Menu; diff --git a/src/features/menu/MenuItem.jsx b/src/features/menu/MenuItem.jsx deleted file mode 100644 index 8a83f50..0000000 --- a/src/features/menu/MenuItem.jsx +++ /dev/null @@ -1,69 +0,0 @@ -import { useDispatch, useSelector } from 'react-redux'; -import Button from '../../ui/Button'; -import DeleteItem from '../cart/DeleteItem'; -import UpdateItemQuantity from '../cart/UpdateItemQuantity'; -import { formatCurrency } from '../../utils/helpers'; -import { addItem, getCurrentQuantityById } from '../cart/cartSlice'; - -function MenuItem({ pizza }) { - const dispatch = useDispatch(); - - const { id, name, unitPrice, ingredients, soldOut, imageUrl } = pizza; - - const currentQuantity = useSelector(getCurrentQuantityById(id)); - const isInCart = currentQuantity > 0; - - function handleAddToCart() { - const newItem = { - pizzaId: id, - name, - quantity: 1, - unitPrice, - totalPrice: unitPrice * 1, - }; - dispatch(addItem(newItem)); - } - - return ( -
  • - {name} -
    -

    {name}

    -

    - {ingredients.join(', ')} -

    -
    - {!soldOut ? ( -

    {formatCurrency(unitPrice)}

    - ) : ( -

    - Sold out -

    - )} - - {isInCart && ( -
    - - -
    - )} - - {!soldOut && !isInCart && ( - - )} -
    -
    -
  • - ); -} - -export default MenuItem; diff --git a/src/features/order/CreateOrder.jsx b/src/features/order/CreateOrder.jsx deleted file mode 100644 index f2b6810..0000000 --- a/src/features/order/CreateOrder.jsx +++ /dev/null @@ -1,170 +0,0 @@ -import { useState } from 'react'; -import { Form, redirect, useActionData, useNavigation } from 'react-router-dom'; -import { createOrder } from '../../services/apiRestaurant'; -import Button from '../../ui/Button'; -import EmptyCart from '../cart/EmptyCart'; -import { useDispatch, useSelector } from 'react-redux'; -import { clearCart, getCart, getTotalCartPrice } from '../cart/cartSlice'; -import store from '../../store'; -import { formatCurrency } from '../../utils/helpers'; -import { fetchAddress } from '../user/userSlice'; - -// https://uibakery.io/regex-library/phone-number -const isValidPhone = (str) => - /^\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}$/.test( - str - ); - -function CreateOrder() { - const [withPriority, setWithPriority] = useState(false); - const { - username, - status: addressStatus, - position, - address, - error: errorAddress, - } = useSelector((state) => state.user); - const isLoadingAddress = addressStatus === 'loading'; - - const navigation = useNavigation(); - const isSubmitting = navigation.state === 'submitting'; - - const formErrors = useActionData(); - const dispatch = useDispatch(); - - const cart = useSelector(getCart); - const totalCartPrice = useSelector(getTotalCartPrice); - const priorityPrice = withPriority ? totalCartPrice * 0.2 : 0; - const totalPrice = totalCartPrice + priorityPrice; - - if (!cart.length) return ; - - return ( -
    -

    Ready to order? Let's go!

    - - {/* */} - -
    - - -
    - -
    - -
    - - {formErrors?.phone && ( -

    - {formErrors.phone} -

    - )} -
    -
    - -
    - -
    - - {addressStatus === 'error' && ( -

    - {errorAddress} -

    - )} -
    - - {!position.latitude && !position.longitude && ( - - - - )} -
    - -
    - setWithPriority(e.target.checked)} - /> - -
    - -
    - - - - -
    - -
    - ); -} - -export async function action({ request }) { - const formData = await request.formData(); - const data = Object.fromEntries(formData); - - const order = { - ...data, - cart: JSON.parse(data.cart), - priority: data.priority === 'true', - }; - - console.log(order); - - const errors = {}; - if (!isValidPhone(order.phone)) - errors.phone = - 'Please give us your correct phone number. We might need it to contact you.'; - - if (Object.keys(errors).length > 0) return errors; - - // If everything is okay, create new order and redirect - const newOrder = await createOrder(order); - - // Do NOT overuse - store.dispatch(clearCart()); - - return redirect(`/order/${newOrder.id}`); -} - -export default CreateOrder; diff --git a/src/features/order/Order.jsx b/src/features/order/Order.jsx deleted file mode 100644 index c925927..0000000 --- a/src/features/order/Order.jsx +++ /dev/null @@ -1,105 +0,0 @@ -// Test ID: IIDSAT -import { useFetcher, useLoaderData } from 'react-router-dom'; - -import OrderItem from './OrderItem'; - -import { getOrder } from '../../services/apiRestaurant'; -import { - calcMinutesLeft, - formatCurrency, - formatDate, -} from '../../utils/helpers'; -import { useEffect } from 'react'; -import UpdateOrder from './UpdateOrder'; - -function Order() { - const order = useLoaderData(); - const fetcher = useFetcher(); - - useEffect( - function () { - if (!fetcher.data && fetcher.state === 'idle') fetcher.load('/menu'); - }, - [fetcher] - ); - - // Everyone can search for all orders, so for privacy reasons we're gonna gonna exclude names or address, these are only for the restaurant staff - const { - id, - status, - priority, - priorityPrice, - orderPrice, - estimatedDelivery, - cart, - } = order; - - const deliveryIn = calcMinutesLeft(estimatedDelivery); - - return ( -
    -
    -

    Order #{id} status

    - -
    - {priority && ( - - Priority - - )} - - {status} order - -
    -
    - -
    -

    - {deliveryIn >= 0 - ? `Only ${calcMinutesLeft(estimatedDelivery)} minutes left 😃` - : 'Order should have arrived'} -

    -

    - (Estimated delivery: {formatDate(estimatedDelivery)}) -

    -
    - -
      - {cart.map((item) => ( - el.id === item.pizzaId) - ?.ingredients ?? [] - } - /> - ))} -
    - -
    -

    - Price pizza: {formatCurrency(orderPrice)} -

    - {priority && ( -

    - Price priority: {formatCurrency(priorityPrice)} -

    - )} -

    - To pay on delivery: {formatCurrency(orderPrice + priorityPrice)} -

    -
    - - {!priority && } -
    - ); -} - -export async function loader({ params }) { - const order = await getOrder(params.orderId); - return order; -} - -export default Order; diff --git a/src/features/order/OrderItem.jsx b/src/features/order/OrderItem.jsx deleted file mode 100644 index e2045d1..0000000 --- a/src/features/order/OrderItem.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import { formatCurrency } from '../../utils/helpers'; - -function OrderItem({ item, isLoadingIngredients, ingredients }) { - const { quantity, name, totalPrice } = item; - - return ( -
  • -
    -

    - {quantity}× {name} -

    -

    {formatCurrency(totalPrice)}

    -
    -

    - {isLoadingIngredients ? 'Loading...' : ingredients.join(', ')} -

    -
  • - ); -} - -export default OrderItem; diff --git a/src/features/order/SearchOrder.jsx b/src/features/order/SearchOrder.jsx deleted file mode 100644 index 0991b7b..0000000 --- a/src/features/order/SearchOrder.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import { useState } from 'react'; -import { useNavigate } from 'react-router-dom'; - -function SearchOrder() { - const [query, setQuery] = useState(''); - const navigate = useNavigate(); - - function handleSubmit(e) { - e.preventDefault(); - if (!query) return; - navigate(`/order/${query}`); - setQuery(''); - } - - return ( -
    - setQuery(e.target.value)} - className="w-28 rounded-full bg-yellow-100 px-4 py-2 text-sm transition-all duration-300 placeholder:text-stone-400 focus:outline-none focus:ring focus:ring-yellow-500 focus:ring-opacity-50 sm:w-64 sm:focus:w-72" - /> -
    - ); -} - -export default SearchOrder; diff --git a/src/features/order/UpdateOrder.jsx b/src/features/order/UpdateOrder.jsx deleted file mode 100644 index acb28c8..0000000 --- a/src/features/order/UpdateOrder.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import { useFetcher } from 'react-router-dom'; -import Button from '../../ui/Button'; -import { updateOrder } from '../../services/apiRestaurant'; - -function UpdateOrder({ order }) { - const fetcher = useFetcher(); - - return ( - - - - ); -} - -export default UpdateOrder; - -export async function action({ request, params }) { - const data = { priority: true }; - await updateOrder(params.orderId, data); - return null; -} diff --git a/src/features/user/CreateUser.jsx b/src/features/user/CreateUser.jsx deleted file mode 100644 index 03fcf0b..0000000 --- a/src/features/user/CreateUser.jsx +++ /dev/null @@ -1,43 +0,0 @@ -import { useState } from 'react'; -import Button from '../../ui/Button'; -import { useDispatch } from 'react-redux'; -import { updateName } from './userSlice'; -import { useNavigate } from 'react-router-dom'; - -function CreateUser() { - const [username, setUsername] = useState(''); - const dispatch = useDispatch(); - const navigate = useNavigate(); - - function handleSubmit(e) { - e.preventDefault(); - - if (!username) return; - dispatch(updateName(username)); - navigate('/menu'); - } - - return ( -
    -

    - 👋 Welcome! Please start by telling us your name: -

    - - setUsername(e.target.value)} - className="input mb-8 w-72" - /> - - {username !== '' && ( -
    - -
    - )} -
    - ); -} - -export default CreateUser; diff --git a/src/features/user/Username.jsx b/src/features/user/Username.jsx deleted file mode 100644 index b760f5d..0000000 --- a/src/features/user/Username.jsx +++ /dev/null @@ -1,13 +0,0 @@ -import { useSelector } from 'react-redux'; - -function Username() { - const username = useSelector((state) => state.user.username); - - if (!username) return null; - - return ( -
    {username}
    - ); -} - -export default Username; diff --git a/src/features/user/userSlice.js b/src/features/user/userSlice.js deleted file mode 100644 index d08c8e3..0000000 --- a/src/features/user/userSlice.js +++ /dev/null @@ -1,65 +0,0 @@ -import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'; -import { getAddress } from '../../services/apiGeocoding'; - -function getPosition() { - return new Promise(function (resolve, reject) { - navigator.geolocation.getCurrentPosition(resolve, reject); - }); -} - -export const fetchAddress = createAsyncThunk( - 'user/fetchAddress', - async function () { - // 1) We get the user's geolocation position - const positionObj = await getPosition(); - const position = { - latitude: positionObj.coords.latitude, - longitude: positionObj.coords.longitude, - }; - - // 2) Then we use a reverse geocoding API to get a description of the user's address, so we can display it the order form, so that the user can correct it if wrong - const addressObj = await getAddress(position); - const address = `${addressObj?.locality}, ${addressObj?.city} ${addressObj?.postcode}, ${addressObj?.countryName}`; - - // 3) Then we return an object with the data that we are interested in. - // Payload of the FULFILLED state - return { position, address }; - } -); - -const initialState = { - username: '', - status: 'idle', - position: {}, - address: '', - error: '', -}; - -const userSlice = createSlice({ - name: 'user', - initialState, - reducers: { - updateName(state, action) { - state.username = action.payload; - }, - }, - extraReducers: (builder) => - builder - .addCase(fetchAddress.pending, (state, action) => { - state.status = 'loading'; - }) - .addCase(fetchAddress.fulfilled, (state, action) => { - state.position = action.payload.position; - state.address = action.payload.address; - state.status = 'idle'; - }) - .addCase(fetchAddress.rejected, (state, action) => { - state.status = 'error'; - state.error = - 'There was a problem getting your address. Make sure to fill this field!'; - }), -}); - -export const { updateName } = userSlice.actions; - -export default userSlice.reducer; diff --git a/src/index.css b/src/index.css deleted file mode 100644 index b185cdd..0000000 --- a/src/index.css +++ /dev/null @@ -1,34 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer components { - .input { - @apply rounded-full border border-stone-200 px-4 py-2 text-sm transition-all duration-300 placeholder:text-stone-400 focus:outline-none focus:ring focus:ring-yellow-400 md:px-6 md:py-3; - } - - /* https://dev.to/afif/i-made-100-css-loaders-for-your-next-project-4eje */ - .loader { - width: 45px; - aspect-ratio: 0.75; - --c: no-repeat linear-gradient(theme(colors.stone.800) 0 0); - background: var(--c) 0% 50%, var(--c) 50% 50%, var(--c) 100% 50%; - background-size: 20% 50%; - animation: loading 1s infinite linear; - } - - @keyframes loading { - 20% { - background-position: 0% 0%, 50% 50%, 100% 50%; - } - 40% { - background-position: 0% 100%, 50% 0%, 100% 50%; - } - 60% { - background-position: 0% 50%, 50% 100%, 100% 0%; - } - 80% { - background-position: 0% 50%, 50% 50%, 100% 100%; - } - } -} diff --git a/src/main.jsx b/src/main.jsx deleted file mode 100644 index e4639ad..0000000 --- a/src/main.jsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import App from './App'; -import './index.css'; -import { Provider } from 'react-redux'; -import store from './store'; - -ReactDOM.createRoot(document.getElementById('root')).render( - - - - - -); diff --git a/src/services/apiGeocoding.js b/src/services/apiGeocoding.js deleted file mode 100644 index ee0a4fc..0000000 --- a/src/services/apiGeocoding.js +++ /dev/null @@ -1,9 +0,0 @@ -export async function getAddress({ latitude, longitude }) { - const res = await fetch( - `https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=${latitude}&longitude=${longitude}` - ); - if (!res.ok) throw Error("Failed getting address"); - - const data = await res.json(); - return data; -} diff --git a/src/services/apiRestaurant.js b/src/services/apiRestaurant.js deleted file mode 100644 index f5d0105..0000000 --- a/src/services/apiRestaurant.js +++ /dev/null @@ -1,54 +0,0 @@ -const API_URL = "https://react-fast-pizza-api.onrender.com/api"; - -export async function getMenu() { - const res = await fetch(`${API_URL}/menu`); - - // fetch won't throw error on 400 errors (e.g. when URL is wrong), so we need to do it manually. This will then go into the catch block, where the message is set - if (!res.ok) throw Error("Failed getting menu"); - - const { data } = await res.json(); - return data; -} - -export async function getOrder(id) { - const res = await fetch(`${API_URL}/order/${id}`); - if (!res.ok) throw Error(`Couldn't find order #${id}`); - - const { data } = await res.json(); - return data; -} - -export async function createOrder(newOrder) { - try { - const res = await fetch(`${API_URL}/order`, { - method: "POST", - body: JSON.stringify(newOrder), - headers: { - "Content-Type": "application/json", - }, - }); - - if (!res.ok) throw Error(); - const { data } = await res.json(); - return data; - } catch { - throw Error("Failed creating your order"); - } -} - -export async function updateOrder(id, updateObj) { - try { - const res = await fetch(`${API_URL}/order/${id}`, { - method: "PATCH", - body: JSON.stringify(updateObj), - headers: { - "Content-Type": "application/json", - }, - }); - - if (!res.ok) throw Error(); - // We don't need the data, so we don't return anything - } catch (err) { - throw Error("Failed updating your order"); - } -} diff --git a/src/store.js b/src/store.js deleted file mode 100644 index 3f6557f..0000000 --- a/src/store.js +++ /dev/null @@ -1,12 +0,0 @@ -import { configureStore } from '@reduxjs/toolkit'; -import userReducer from './features/user/userSlice'; -import cartReducer from './features/cart/cartSlice'; - -const store = configureStore({ - reducer: { - user: userReducer, - cart: cartReducer, - }, -}); - -export default store; diff --git a/src/ui/AppLayout.jsx b/src/ui/AppLayout.jsx deleted file mode 100644 index 5875e18..0000000 --- a/src/ui/AppLayout.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import Header from './Header'; -import Loader from './Loader'; -import CartOverview from '../features/cart/CartOverview'; -import { Outlet, useNavigation } from 'react-router-dom'; - -function AppLayout() { - const navigation = useNavigation(); - const isLoading = navigation.state === 'loading'; - - return ( -
    - {isLoading && } - -
    - -
    -
    - -
    -
    - - -
    - ); -} - -export default AppLayout; diff --git a/src/ui/Button.jsx b/src/ui/Button.jsx deleted file mode 100644 index 6a6a46a..0000000 --- a/src/ui/Button.jsx +++ /dev/null @@ -1,36 +0,0 @@ -import { Link } from 'react-router-dom'; - -function Button({ children, disabled, to, type, onClick }) { - const base = - 'inline-block text-sm rounded-full bg-yellow-400 font-semibold uppercase tracking-wide text-stone-800 transition-colors duration-300 hover:bg-yellow-300 focus:bg-yellow-300 focus:outline-none focus:ring focus:ring-yellow-300 focus:ring-offset-2 disabled:cursor-not-allowed'; - - const styles = { - primary: base + ' px-4 py-3 md:px-6 md:py-4', - small: base + ' px-4 py-2 md:px-5 md:py-2.5 text-xs', - round: base + ' px-2.5 py-1 md:px-3.5 md:py-2 text-sm', - secondary: - 'inline-block text-sm rounded-full border-2 border-stone-300 font-semibold uppercase tracking-wide text-stone-400 transition-colors duration-300 hover:bg-stone-300 hover:text-stone-800 focus:bg-stone-300 focus:text-stone-800 focus:outline-none focus:ring focus:ring-stone-200 focus:ring-offset-2 disabled:cursor-not-allowed px-4 py-2.5 md:px-6 md:py-3.5', - }; - - if (to) - return ( - - {children} - - ); - - if (onClick) - return ( - - ); - - return ( - - ); -} - -export default Button; diff --git a/src/ui/Error.jsx b/src/ui/Error.jsx deleted file mode 100644 index 1eb764a..0000000 --- a/src/ui/Error.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import { useRouteError } from 'react-router-dom'; -import LinkButton from './LinkButton'; - -function Error() { - const error = useRouteError(); - console.log(error); - - return ( -
    -

    Something went wrong 😢

    -

    {error.data || error.message}

    - - ← Go back -
    - ); -} - -export default Error; diff --git a/src/ui/Header.jsx b/src/ui/Header.jsx deleted file mode 100644 index e32b644..0000000 --- a/src/ui/Header.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Link } from 'react-router-dom'; -import SearchOrder from '../features/order/SearchOrder'; -import Username from '../features/user/Username'; - -function Header() { - return ( -
    -
    - - Fast React Pizza Co. - - - -
    -
    - ); -} - -export default Header; diff --git a/src/ui/Home.jsx b/src/ui/Home.jsx deleted file mode 100644 index 66208ec..0000000 --- a/src/ui/Home.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import { useSelector } from 'react-redux'; -import CreateUser from '../features/user/CreateUser'; -import Button from './Button'; - -function Home() { - const username = useSelector((state) => state.user.username); - - return ( -
    -

    - The best pizza. -
    - - Straight out of the oven, straight to you. - -

    - - {username === '' ? ( - - ) : ( - - )} -
    - ); -} - -export default Home; diff --git a/src/ui/LinkButton.jsx b/src/ui/LinkButton.jsx deleted file mode 100644 index 208c561..0000000 --- a/src/ui/LinkButton.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Link, useNavigate } from 'react-router-dom'; - -function LinkButton({ children, to }) { - const navigate = useNavigate(); - const className = 'text-sm text-blue-500 hover:text-blue-600 hover:underline'; - - if (to === '-1') - return ( - - ); - - return ( - - {children} - - ); -} - -export default LinkButton; diff --git a/src/ui/Loader.jsx b/src/ui/Loader.jsx deleted file mode 100644 index 71fdaaf..0000000 --- a/src/ui/Loader.jsx +++ /dev/null @@ -1,9 +0,0 @@ -function Loader() { - return ( -
    -
    -
    - ); -} - -export default Loader; diff --git a/src/utils/helpers.js b/src/utils/helpers.js deleted file mode 100644 index 9ba414f..0000000 --- a/src/utils/helpers.js +++ /dev/null @@ -1,21 +0,0 @@ -export function formatCurrency(value) { - return new Intl.NumberFormat("en", { - style: "currency", - currency: "EUR", - }).format(value); -} - -export function formatDate(dateStr) { - return new Intl.DateTimeFormat("en", { - day: "numeric", - month: "short", - hour: "2-digit", - minute: "2-digit", - }).format(new Date(dateStr)); -} - -export function calcMinutesLeft(dateStr) { - const d1 = new Date().getTime(); - const d2 = new Date(dateStr).getTime(); - return Math.round((d2 - d1) / 60000); -} diff --git a/tailwind.config.js b/tailwind.config.js deleted file mode 100644 index 5193bf9..0000000 --- a/tailwind.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -// eslint-disable-next-line -export default { - content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], - theme: { - fontFamily: { - sans: 'Roboto Mono, monospace', - }, - - extend: {}, - }, - plugins: [], -}; diff --git a/vite.config.js b/vite.config.js deleted file mode 100644 index ac39438..0000000 --- a/vite.config.js +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "vite"; -import react from "@vitejs/plugin-react"; -import eslint from "vite-plugin-eslint"; - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react(), eslint()], -});