This commit is contained in:
1 parent
b9655a5ab1
commit
e292824161
122 files changed
+90002
-69
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import{r as i}from"./react-vendor-jWT2yUdV.js";/**
|
||||
* react-router v7.9.5
|
||||
*
|
||||
* 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
|
||||
*/var oe="popstate";function ke(e={}){function t(n,a){let{pathname:o,search:l,hash:s}=n.location;return G("",{pathname:o,search:l,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:B(a)}return Fe(t,r,null,e)}function x(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function P(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $e(){return Math.random().toString(36).substring(2,10)}function le(e,t){return{usr:e.state,key:e.key,idx:t}}function G(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?N(t):t,state:r,key:t&&t.key||n||$e()}}function B({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function N(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function Fe(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,s="POP",u=null,c=f();c==null&&(c=0,l.replaceState({...l.state,idx:c},""));function f(){return(l.state||{idx:null}).idx}function h(){s="POP";let d=f(),y=d==null?null:d-c;c=d,u&&u({action:s,location:w.location,delta:y})}function m(d,y){s="PUSH";let R=G(w.location,d,y);c=f()+1;let p=le(R,c),E=w.createHref(R);try{l.pushState(p,"",E)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;a.location.assign(E)}o&&u&&u({action:s,location:w.location,delta:1})}function g(d,y){s="REPLACE";let R=G(w.location,d,y);c=f();let p=le(R,c),E=w.createHref(R);l.replaceState(p,"",E),o&&u&&u({action:s,location:w.location,delta:0})}function v(d){return Ie(d)}let w={get action(){return s},get location(){return e(a,l)},listen(d){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(oe,h),u=d,()=>{a.removeEventListener(oe,h),u=null}},createHref(d){return t(a,d)},createURL:v,encodeLocation(d){let y=v(d);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:m,replace:g,go(d){return l.go(d)}};return w}function Ie(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),x(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:B(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function ce(e,t,r="/"){return Ne(e,t,r,!1)}function Ne(e,t,r,n){let a=typeof t=="string"?N(t):t,o=$(a.pathname||"/",r);if(o==null)return null;let l=fe(e);Te(l);let s=null;for(let u=0;s==null&&u<l.length;++u){let c=Ve(o);s=_e(l[u],c,n)}return s}function fe(e,t=[],r=[],n="",a=!1){let o=(l,s,u=a,c)=>{let f={relativePath:c===void 0?l.path||"":c,caseSensitive:l.caseSensitive===!0,childrenIndex:s,route:l};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(n)&&u)return;x(f.relativePath.startsWith(n),`Absolute route path "${f.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(n.length)}let h=k([n,f.relativePath]),m=r.concat(f);l.children&&l.children.length>0&&(x(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),fe(l.children,t,m,h,u)),!(l.path==null&&!l.index)&&t.push({path:h,score:We(h,l.index),routesMeta:m})};return e.forEach((l,s)=>{var u;if(l.path===""||!((u=l.path)!=null&&u.includes("?")))o(l,s);else for(let c of he(l.path))o(l,s,!0,c)}),t}function he(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let l=he(n.join("/")),s=[];return s.push(...l.map(u=>u===""?o:[o,u].join("/"))),a&&s.push(...l),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Te(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:He(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var De=/^:[\w-]+$/,Me=3,Be=2,Oe=1,Ae=10,Ue=-2,ie=e=>e==="*";function We(e,t){let r=e.split("/"),n=r.length;return r.some(ie)&&(n+=Ue),t&&(n+=Be),r.filter(a=>!ie(a)).reduce((a,o)=>a+(De.test(o)?Me:o===""?Oe:Ae),n)}function He(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function _e(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let s=0;s<n.length;++s){let u=n[s],c=s===n.length-1,f=o==="/"?t:t.slice(o.length)||"/",h=z({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},f),m=u.route;if(!h&&c&&r&&!n[n.length-1].route.index&&(h=z({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!h)return null;Object.assign(a,h.params),l.push({params:a,pathname:k([o,h.pathname]),pathnameBase:Ye(k([o,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(o=k([o,h.pathnameBase]))}return l}function z(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end
Line truncated
|
||||
|
||||
Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let m=F(),g;if(t){let p=typeof t=="string"?N(t):t;x(f==="/"||((R=p.pathname)==null?void 0:R.startsWith(f)),`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 "${f}" but pathname "${p.pathname}" was given in the \`location\` prop.`),g=p}else g=m;let v=g.pathname||"/",w=v;if(f!=="/"){let p=f.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(p.length).join("/")}let d=ce(e,{pathname:w});P(h||d!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),P(d==null||d[d.length-1].route.element!==void 0||d[d.length-1].route.Component!==void 0||d[d.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=ct(d&&d.map(p=>Object.assign({},p,{params:Object.assign({},u,p.params),pathname:k([f,o.encodeLocation?o.encodeLocation(p.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?f:k([f,o.encodeLocation?o.encodeLocation(p.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),l,r,n,a);return t&&y?i.createElement(O.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},y):y}function lt(){let e=mt(),t=Xe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:o},"ErrorBoundary")," or"," ",i.createElement("code",{style:o},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:a},r):null,l)}var it=i.createElement(lt,null),ut=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}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?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?i.createElement(L.Provider,{value:this.props.routeContext},i.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function st({routeContext:e,match:t,children:r}){let n=i.useContext(T);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(L.Provider,{value:e},r)}function ct(e,t=[],r=null,n=null,a=null){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 o=e,l=r==null?void 0:r.errors;if(l!=null){let c=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);x(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,c+1))}let s=!1,u=-1;if(r)for(let c=0;c<o.length;c++){let f=o[c];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=c),f.route.id){let{loaderData:h,errors:m}=r,g=f.route.loader&&!h.hasOwnProperty(f.route.id)&&(!m||m[f.route.id]===void 0);if(f.route.lazy||g){s=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,f,h)=>{let m,g=!1,v=null,w=null;r&&(m=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||it,s&&(u<0&&h===0?(xe("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,w=null):u===h&&(g=!0,w=f.route.hydrateFallbackElement||null)));let d=t.concat(o.slice(0,h+1)),y=()=>{let R;return m?R=v:g?R=w:f.route.Component?R=i.createElement(f.route.Component,null):f.route.element?R=f.route.element:R=c,i.createElement(st,{match:f,routeContext:{outlet:c,matches:d,isDataRoute:r!=null},children:R})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?i.createElement(ut,{location:r.location,revaliLine truncated
|
||||
Reference in new issue
Block a user