1import{$ as e,C as t,D as n,E as r,G as i,H as a,J as o,R as s,T as c,W as l,X as u,Y as d,Z as f,f as p,h as m,m as h,p as g,q as _,u as v,v as y,w as b,x,z as S}from"./components-Dzujj9Az.js";import{_ as C,a as w,c as T,n as E,s as D}from"./errorBoundaries-BSyRzubt.js";var O=`application/x-www-form-urlencoded`;function k(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function A(e){return k(e)&&e.tagName.toLowerCase()===`button`}function j(e){return k(e)&&e.tagName.toLowerCase()===`form`}function M(e){return k(e)&&e.tagName.toLowerCase()===`input`}function N(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function P(e,t){return e.button===0&&(!t||t===`_self`)&&!N(e)}function F(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function I(e,t){let n=F(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var L=null;function R(){if(L===null)try{new FormData(document.createElement(`form`),0),L=!1}catch{L=!0}return L}var z=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function B(e){return e!=null&&!z.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${O}"`),null):e}function ee(e,t){let n,r,a,o,s;if(j(e)){let s=e.getAttribute(`action`);r=s?i(s,t):null,n=e.getAttribute(`method`)||`get`,a=B(e.getAttribute(`enctype`))||O,o=new FormData(e)}else if(A(e)||M(e)&&(e.type===`submit`||e.type===`image`)){let s=e.form;if(s==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let c=e.getAttribute(`formaction`)||s.getAttribute(`action`);if(r=c?i(c,t):null,n=e.getAttribute(`formmethod`)||s.getAttribute(`method`)||`get`,a=B(e.getAttribute(`formenctype`))||B(s.getAttribute(`enctype`))||O,o=new FormData(s,e),!R()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;o.append(`${e}x`,`0`),o.append(`${e}y`,`0`)}else t&&o.append(t,r)}}else if(k(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,a=O,s=e;return o&&a===`text/plain`&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:s}}var V=e(f(),1),te=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{te&&(window.__reactRouterVersion=`8.3.0`)}catch{}var H=V.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:o,mask:d,state:f,target:m,to:h,preventScrollReset:g,viewTransition:_,defaultShouldRevalidate:y,...b},x){let{basename:S,navigator:C,useTransitions:E}=V.useContext(c),O=typeof h==`string`&&u.test(h),k=a(h,S);h=k.to;let A=v(h,{relative:r}),j=p(),M=null;if(d){let e=l(d,[],j.mask?j.mask.pathname:`/`,!0);S!==`/`&&(e.pathname=e.pathname===`/`?S:s([S,e.pathname])),M=C.createHref(e)}let[N,P,F]=T(n,b),I=ie(h,{replace:o,mask:d,state:f,target:m,preventScrollReset:g,relative:r,viewTransition:_,defaultShouldRevalidate:y,useTransitions:E});function L(t){e&&e(t),t.defaultPrevented||I(t)}let R=!(k.isExternal||i),z=V.createElement(`a`,{...b,...F,href:(R?M:void 0)||k.absoluteURL||A,onClick:R?L:e,ref:D(x,P),target:m,"data-discover":!O&&t===`render`?`true`:void 0});return N&&!O?V.createElement(V.Fragment,null,z,V.createElement(w,{page:A})):z});H.displayName=`Link`;var ne=V.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:a,to:o,viewTransition:s,children:l,...u},d){let f=y(o,{relative:u.relative}),m=p(),h=V.useContext(b),{navigator:g,basename:_}=V.useContext(c),v=h!=null&&ce(f)&&s===!0,x=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,S=m.pathname,C=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;t||(S=S.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&_&&(C=i(C,_)||C);let w=x!==`/`&&x.endsWith(`/`)?x.length-1:x.length,T=S===x||!r&&S.startsWith(x)&&S.charAt(w)===`/`,E=C!=null&&(C===x||!r&&C.startsWith(x)&&C.charAt(w)===`/`),D={isActive:T,isPending:E,isTransitioning:v},O=T?e:void 0,k;k=typeof n==`function`?n(D):[n,T?`active`:null,E?`pending`:null,v?`transitioning`:null].filter(
1Boolean).join(` `);let A=typeof a==`function`?a(D):a;return V.createElement(H,{...u,"aria-current":O,className:k,ref:d,style:A,to:o,viewTransition:s},typeof l==`function`?l(D):l)});ne.displayName=`NavLink`;var U=V.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:l,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=V.useContext(c),v=Y(),y=X(s,{relative:d}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&u.test(s);return V.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,c=()=>v(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?V.startTransition(()=>c()):c()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});U.displayName=`Form`;function W({getKey:e,storageKey:t,...n}){let r=V.useContext(E),{basename:i}=V.useContext(c),a=p(),o=g();oe({getKey:e,storageKey:t});let s=V.useMemo(()=>{if(!r||!e)return null;let t=$(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];
1typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),V.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${C(JSON.stringify(t||Z))}, ${C(JSON.stringify(s))})`}})}W.displayName=`ScrollRestoration`;function G(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K(e){let n=V.useContext(t);return o(n,G(e)),n}function re(e){let t=V.useContext(b);return o(t,G(e)),t}function ie(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=h(),d=p(),f=y(e,{relative:o});return V.useCallback(p=>{if(P(p,t)){p.preventDefault();let t=n===void 0?_(d)===_(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?V.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function q(e){d(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=V.useRef(F(e)),n=V.useRef(!1),r=p(),i=V.useMemo(()=>I(r.search,n.current?null:t.current),[r.search]),a=h();return[i,V.useCallback((e,t)=>{let r=F(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var J=0,ae=()=>`__${String(++J)}__`;function Y(){let{router:e}=K(`useSubmit`),{basename:t}=V.useContext(c),n=x(),r=e.fetch,i=e.navigate;return V.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ee(e,t);a.navigate===!1?await r(a.fetcherKey||ae(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function X(e,{relative:t}={}){let{basename:n}=V.useContext(c),i=V.useContext(r);o(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),l={...y(e||`.`,{relative:t})},u=p();if(e==null){l.search=u.search;let e=new URLSearchParams(l.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();l.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(l.pathname=l.pathname===`/`?n:s([n,l.pathname])),_(l)}var Z=`react-router-scroll-positions`,Q={};function $(e,t,n,r){let a=null;return r&&(a=r(n===`/`?e:{...e,pathname:i(e.pathname,n)||e.pathname},t)),a??=e.key,a}function oe({getKey:e,storageKey:t}={}){let{router:n}=K(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=re(`useScrollRestoration`),{basename:a}=V.useContext(c),o=p(),s=g(),l=m();V.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),se(V.useCallback(()=>{if(l.state===`idle`){let t=$(o,s,a,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||Z,JSON.stringify(Q))}catch(e){d(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,o,s,t])),typeof document<`u`&&(V.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Z);e&&(Q=JSON.parse(e))}catch{}},[t]),V.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>$(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),V.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{d(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function se(e,t){let{capture:n}=t||{};V.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ce(e,{relative:t}={}){let r=V.useContext(n);o(r!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=K(`useViewTransitionState`),s=y(e,{relative:t});if(!r.isTransitioning)return!1;let c=i(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=i(r.nextLocation.pathname,a)||r.nextLocation.pathname;return S(s.pathname,l)!=null||S(s.pathname,c)!=null}export{Y as a,q as i,H as n,W as r,U as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.