https://play.funbridge.com/fb_js/vendors/[email protected]_react-…[email protected][email protected]
1import{o as e}from"../rolldown-runtime-C0FnF6B9.js";import{o as t}from"./@[email protected][email protected][email protected][email protected]";import{vt as n}from"./@[email protected]";var r=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,i=/^[\\/]{2}/;function a(e,t){return t+e.replace(/\\/g,`/`)}var o=`popstate`;function s(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function c(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return p(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:m(t)}return g(t,n,null,e)}function l(e,t){if(e===!1||e==null)throw Error(t)}function u(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function d(){return Math.random().toString(36).substring(2,10)}function f(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function p(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?h(t):t,state:n,key:t&&t.key||r||d(),mask:i}}function m({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function h(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function g(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,c=i.history,l=`POP`,u=null,d=m();d??(d=0,c.replaceState({...c.state,idx:d},``));function m(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=m(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=s(e)?e:p(b.location,e,t);n&&n(r,e),d=m()+1;let o=f(r,d),h=b.createHref(r.mask||r);try{c.pushState(o,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function v(e,t){l=`REPLACE`;let r=s(e)?e:p(b.location,e,t);n&&n(r,e),d=m();let i=f(r,d),o=b.createHref(r.mask||r);c.replaceState(i,``,o),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return _(i,e)}let b={get action(){return l},get location(){return e(i,c)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(o,h),u=e,()=>{i.removeEventListener(o,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:v,go(e){return c.go(e)}};return b}function _(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),l(r,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:m(t);return a=a.replace(/ $/,`%20`),!n&&i.test(a)&&(a=r+a),new URL(a,r)}var v=e(t(),1);function y(e,t,n=`/`){return b(e,t,n,!1)}function b(e,t,n,r,i){let a=A((typeof t==`string`?h(t):t).pathname||`/`,n);if(a==null)return null;let o=i??x(e),s=null,c=ue(a);for(let e=0;s==null&&e<o.length;++e)s=se(o[e],c,r);return s}function x(e){let t=S(e);return w(t),t}function S(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;l(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let u=P([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(l(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),S(e.children,t,d,u,o)),(e.path!=null||e.index)&&t.push({path:u,score:ae(u,e.index),routesMeta:d.map((e,t)=>
1{let[n,r]=le(e.relativePath,e.caseSensitive,t===d.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of C(e.path))a(e,t,!0,n)}),t}function C(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=C(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function w(e){e.sort((e,t)=>e.score===t.score?oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var T=/^:[\w-]+$/,E=/^:[\w-]+/,ee=3.5,te=3,ne=2,D=1,O=10,re=-2,ie=e=>e===`*`;function ae(e,t){let n=e.split(`/`),r=n.length;return n.some(ie)&&(r+=re),t&&(r+=ne),n.filter(e=>!ie(e)).reduce((e,t)=>e+(T.test(t)?te:E.test(t)?ee:t===``?D:O),r)}function oe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function se(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ce(u,l,s.matcher,s.compiledParams):k(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=k({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;
1Object.assign(i,d.params),o.push({params:i,pathname:P([a,d.pathname]),pathnameBase:he(P([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=P([a,d.pathnameBase]))}return o}function k(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=le(e.path,e.caseSensitive,e.end);return ce(e,t,n,r)}function ce(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=F(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=F(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function le(e,t=!1,n=!0){u(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ue(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return u(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function A(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 de(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?h(e):e,a;return n?(n=me(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?fe(n.substring(1),`/`):fe(n,t)):a=t,{pathname:a,search:ge(r),hash:_e(i)}}function fe(e,t){let n=F(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function j(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 <Link to="..."> and the router will parse it for you.`}function pe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function M(e){let t=pe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function N(e,t,n,r=!1){let i;typeof e==`string`?i=h(e):(i={...e},l(!i.pathname||!i.pathname.includes(`?`),j(`?`,`pathname`,`search`,i)),l(!i.pathname||!i.pathname.includes(`#`),j(`#`,`pathname`,`hash`,i)),l(!i.search||!i.search.includes(`#`),j(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=de(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(u||d)&&(c.pathname+=`/`),c}var me=e=>e.replace(/[\\/]{2,}/g,`/`),P=e=>me(e.join(`/`));function F(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var he=e=>F(e).replace(/^\/*/,`/`),ge=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,_e=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ve=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ye(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function be(e){return P(e.map(e=>e.route.path).filter(Boolean))||`/`}var xe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Se(e,t){let n=e;if(typeof n!=`string`||!r.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,s=!1;if(xe)try{let e=new URL(window.location.href),r=i.test(n)?new URL(a(n,e.protocol)):new URL(n),o=A(r.pathname,t);r.origin===e.origin&&o!=null?n=o+r.search+r.hash:s=!0}catch{u(!1,`<Link to="${n}">
1 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:n}}var Ce=new URL(`http://localhost`);function I(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ce)}catch{return Ce}}function L(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function we(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function R(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!L(i,n),s=!L(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!we(e,i)||!L(i,a)))throw Error(`External navigation is not allowed`)}var Te=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Te);var Ee=[`GET`,...Te];new Set(Ee);var De=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Oe(e){try{return De.includes(new URL(e).protocol)}catch{return!1}}var z=v.createContext(null);z.displayName=`DataRouter`;var B=v.createContext(null);B.displayName=`DataRouterState`;var ke=v.createContext(!1);function Ae(){return v.useContext(ke)}var je=v.createContext({isTransitioning:!1});je.displayName=`ViewTransition`;var Me=v.createContext(new Map);Me.displayName=`Fetchers`;var Ne=v.createContext(null);Ne.displayName=`Await`;var V=v.createContext(null);V.displayName=`Navigation`;var H=v.createContext(null);H.displayName=`Location`;var U=v.createContext({outlet:null,matches:[],isDataRoute:!1});U.displayName=`Route`;var W=v.createContext(null);W.displayName=`RouteError`;var Pe=`REACT_ROUTER_ERROR`,Fe=`REDIRECT`,Ie=`ROUTE_ERROR_RESPONSE`;function Le(e){if(e.startsWith(`${Pe}:${Fe}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Re(e){if(e.startsWith(`${Pe}:${Ie}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ve(t.status,t.statusText,t.data)}catch{}}function ze(e,{relative:t}={}){l(G(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(V),{hash:i,pathname:a,search:o}=J(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:P([n,a])),r.createHref({pathname:s,search:o,hash:i})}function G(){return v.useContext(H)!=null}function K(){return l(G(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(H).location}function Be(){return v.useContext(H).navigationType}function Ve(e){l(G(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=K();return v.useMemo(()=>k(e,ue(t)),[t,e])}var He=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function q(){let{isDataRoute:e}=v.useContext(U);return e?lt():Ue()}function Ue(){l(G(),`useNavigate() may be used only in the context of a <Router> component.`);
1let e=v.useContext(z),{basename:t,navigator:n}=v.useContext(V),{matches:r}=v.useContext(U),{pathname:i}=K(),a=JSON.stringify(M(r)),o=v.useRef(!1);return v.useLayoutEffect(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(u(o.current,He),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=N(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:P([t,c.pathname])),R(typeof r==`string`?r:m(r),n.createHref(c),I(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var We=v.createContext(null);function Ge(){return v.useContext(We)}function Ke(e){let t=v.useContext(U).outlet;return v.useMemo(()=>t&&v.createElement(We.Provider,{value:e},t),[t,e])}function qe(){let{matches:e}=v.useContext(U);return e[e.length-1]?.params??{}}function J(e,{relative:t}={}){let{matches:n}=v.useContext(U),{pathname:r}=K(),i=JSON.stringify(M(n));return v.useMemo(()=>N(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Je(e,t){return Ye(e,t)}function Ye(e,t,n){l(G(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(V),{matches:i}=v.useContext(U),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=K(),u;if(t){let e=typeof t==`string`?h(t):t;l(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=c;let d=u.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):y(e,{pathname:f}),m=tt(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:P([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:P([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&m?v.createElement(H.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},m):m}function Xe(){let e=ct(),t=ye(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Ze=v.createElement(Xe,null),Qe=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=ke;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Re(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(U.Provider,{value:this.props.routeContext},v.createElement(W.Provider,{value:e,children:this.props.component}));return this.context?v.createElement($e,{error:e},t):t}},Y=new WeakMap;function $e({children:e,error:t}){let{basename:n,navigator:r}=v.useContext(V);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Le(t.digest);if(e){let i=Y.get(t);if(i)throw i;let a=Se(e.location,n),o=a.absoluteURL||a.to;if(R(e.location,o,I(r),`allow-explicit`),Oe(o))throw Error(`Invalid redirect location`);if(xe&&!Y.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Y.set(t,n),n}}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function et({routeContext:e,match:t,children:n}){let r=v.useContext(z);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(U.Provider,{value:e},n)}function tt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);l(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}
1=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,u=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:be(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let l,d=!1,f=null,p=null;r&&(l=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Ze,o&&(s<0&&c===0?(dt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=l?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(et,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(Qe,{location:r.location,revalidation:r.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):h()},null)}function nt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rt(e){let t=v.useContext(z);return l(t,nt(e)),t}function it(e){let t=v.useContext(B);return l(t,nt(e)),t}function at(e){let t=v.useContext(U);return l(t,nt(e)),t}function ot(e){let t=at(e),n=t.matches[t.matches.length-1];return l(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function st(){return ot(`useRouteId`)}function ct(){let e=v.useContext(W),t=it(`useRouteError`),n=ot(`useRouteError`);return e===void 0?t.errors?.[n]:e}function lt(){let{router:e}=rt(`useNavigate`),t=ot(`useNavigate`),n=v.useRef(!1);return v.useLayoutEffect(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{u(n.current,He),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ut={};function dt(e,t,n){!t&&!ut[e]&&(ut[e]=!0,u(!1,n))}v.memo(ft);function ft({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Ye(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function pt({to:e,replace:t,state:n,relative:r}){l(G(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=v.useContext(V);u(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=v.useContext(U),{pathname:s}=K(),c=q(),d=N(e,M(o),s,r===`path`);R(typeof e==`string`?e:m(e),a.createHref(d),I(a),`reject`);let f=JSON.stringify(d);return v.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function mt(e){return Ke(e.context)}function ht(e){l(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function gt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){l(!G(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=h(n));let{pathname:d=`/`,search:f=``,hash:p=``,state:m=null,key:g=`default`,mask:_}=n,y=v.useMemo(()=>{let e=A(d,s);return e==null?null:{location:{pathname:e,search:f,hash:p,state:m,key:g,mask:_},navigationType:r}},[s,d,f,p,m,g,r,_]);
1return u(y!=null,`<Router basename="${s}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:v.createElement(V.Provider,{value:c},v.createElement(H.Provider,{children:t,value:y}))}function _t({children:e,location:t}){return Je(vt(e),t)}v.Component;function vt(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,vt(e.props.children,i));return}l(e.type===ht,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;l(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=vt(a.children,i)),n.push(o)}),n}var X=`application/x-www-form-urlencoded`;function Z(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function yt(e){return Z(e)&&e.tagName.toLowerCase()===`button`}function bt(e){return Z(e)&&e.tagName.toLowerCase()===`form`}function xt(e){return Z(e)&&e.tagName.toLowerCase()===`input`}function St(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ct(e,t){return e.button===0&&(!t||t===`_self`)&&!St(e)}function wt(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 Tt(e,t){let n=wt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Q=null;function Et(){if(Q===null)try{new FormData(document.createElement(`form`),0),Q=!1}catch{Q=!0}return Q}var Dt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ot(e){return e!=null&&!Dt.has(e)?(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${X}"`),null):e}function kt(e,t){let n,r,i,a,o;if(bt(e)){let o=e.getAttribute(`action`);r=o?A(o,t):null,n=e.getAttribute(`method`)||`get`,i=Ot(e.getAttribute(`enctype`))||X,a=new FormData(e)}else if(yt(e)||xt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?A(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Ot(e.getAttribute(`formenctype`))||Ot(o.getAttribute(`enctype`))||X,a=new FormData(o,e),!Et()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Z(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=X,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function At(e,t){if(e===!1||e==null)throw Error(t)}function jt(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}async function Mt(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Nt(e){return e!=null&&typeof e.page==`string`}function Pt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ft(e,t,n){return Bt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Mt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Pt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function It(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>
1o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Lt(e,t,{includeHydrateFallback:n}={}){return Rt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Rt(e){return[...new Set(e)]}function zt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Bt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Nt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(zt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Vt(){let e=v.useContext(z);return At(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Ht(){let e=v.useContext(B);return At(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ut=v.createContext(void 0);Ut.displayName=`FrameworkContext`;function Wt(){let e=v.useContext(Ut);return At(e,`You must render this element inside a <HydratedRouter> element`),e}function Gt(e,t){let n=v.useContext(Ut),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:$(s,p),onBlur:$(c,m),onMouseEnter:$(l,p),onMouseLeave:$(u,m),onTouchStart:$(d,p)}]:[a,f,{}]:[!1,f,{}]}function $(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Kt({page:e,...t}){let n=Ae(),{nonce:r}=Wt(),{router:i}=Vt(),a=v.useMemo(()=>y(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(Jt,{page:e,matches:a,...t}):v.createElement(Yt,{page:e,matches:a,...t})):null}function qt(e){let{manifest:t,routeModules:n}=Wt(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return Ft(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Jt({page:e,matches:t,...n}){let r=K(),i=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=jt(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return v.createElement(v.Fragment,null,i.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Yt({page:e,matches:t,...n}){let r=K(),{manifest:i,routeModules:a}=Wt(),{loaderData:o,matches:s}=Ht(),c=v.useMemo(()=>It(e,t,s,i,r,`data`),[e,t,s,i,r]),l=v.useMemo(()=>It(e,t,s,i,r,`assets`),[e,t,s,i,r]),u=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in o&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let l=jt(e,`data`);return s&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[o,r,i,c,t,e,a]),d=v.useMemo(()=>Lt(l,i),[l,i]),f=qt(l);return v.createElement(v.Fragment,null,u.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Xt(...e){return t=>
1{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Zt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Zt&&(window.__reactRouterVersion=`8`)}catch{}function Qt({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef(null);i.current??=c({window:r,v5Compat:!0});let a=i.current,[o,s]=v.useState({action:a.action,location:a.location}),l=v.useCallback(e=>{n===!1?s(e):v.startTransition(()=>s(e))},[n]);return v.useLayoutEffect(()=>a.listen(l),[a,l]),v.createElement(gt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var $t=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:y}=v.useContext(V),b=typeof u==`string`&&r.test(u),x=Se(u,g);u=x.to;let S=ze(u,{relative:i}),C=K(),w=null;if(s){let e=N(s,[],C.mask?C.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:P([g,e.pathname])),w=_.createHref(e)}let[T,E,ee]=Gt(n,m),te=an(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:y});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let D=!(x.isExternal||a),O=v.createElement(`a`,{...m,...ee,href:(D?w:void 0)||x.absoluteURL||S,onClick:D?ne:e,ref:Xt(h,E),target:l,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?v.createElement(v.Fragment,null,O,v.createElement(Kt,{page:S})):O});$t.displayName=`Link`;var en=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=J(a,{relative:c.relative}),d=K(),f=v.useContext(B),{navigator:p,basename:m}=v.useContext(V),h=f!=null&&dn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=A(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement($t,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});en.displayName=`NavLink`;var tn=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=`get`,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=v.useContext(V),_=ln(),y=un(c,{relative:u}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&r.test(c);return v.createElement(`form`,{ref:h,method:b,action:y,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute(`formmethod`)||s,c=()=>_(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?v.startTransition(()=>c()):c()},...m,"data-discover":!x&&e===`render`?`true`:void 0})});tn.displayName=`Form`;function nn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rn(e){let t=v.useContext(z);return l(t,nn(e)),t}function an(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=q(),d=K(),f=J(e,{relative:o});return v.useCallback(p=>{if(Ct(p,t)){p.preventDefault();let t=n===void 0?m(d)===m(f):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>h()):h()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function on(e){u(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(wt(e)),n=v.useRef(!1),r=K(),i=v.useMemo(()=>Tt(r.search,n.current?null:t.current),[r.search]),a=q();return[i,v.useCallback((e,t)=>{let r=wt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var sn=0,cn=()=>`__${String(++sn)}__`;function ln(){let{router:e}
1=rn(`useSubmit`),{basename:t}=v.useContext(V),n=st(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=kt(e,t);a.navigate===!1?await r(a.fetcherKey||cn(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,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,relative:a.relative,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 un(e,{relative:t}={}){let{basename:n}=v.useContext(V),r=v.useContext(U);l(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...J(e||`.`,{relative:t})},o=K();if(e==null){a.search=o.search;let e=new URLSearchParams(a.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();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:P([n,a.pathname])),m(a)}function dn(e,{relative:t}={}){let n=v.useContext(je);l(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=rn(`useViewTransitionState`),i=J(e,{relative:t});if(!n.isTransitioning)return!1;let a=A(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=A(n.nextLocation.pathname,r)||n.nextLocation.pathname;return k(i.pathname,o)!=null||k(i.pathname,a)!=null}export{pt as a,_t as c,q as d,Be as f,on as i,K as l,qe as m,$t as n,mt as o,Ge as p,en as r,ht as s,Qt as t,Ve as u};
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.