mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
5 lines
46 KiB
JavaScript
5 lines
46 KiB
JavaScript
function lt(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const u=Object.getOwnPropertyDescriptor(n,i);u&&Object.defineProperty(e,i,u.get?u:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se={exports:{}},w={};var Se;function st(){if(Se)return w;Se=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),a=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function E(o){return o===null||typeof o!="object"?null:(o=m&&o[m]||o["@@iterator"],typeof o=="function"?o:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,g={};function y(o,h,_){this.props=o,this.context=h,this.refs=g,this.updater=_||R}y.prototype.isReactComponent={},y.prototype.setState=function(o,h){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,h,"setState")},y.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function v(){}v.prototype=y.prototype;function S(o,h,_){this.props=o,this.context=h,this.refs=g,this.updater=_||R}var A=S.prototype=new v;A.constructor=S,x(A,y.prototype),A.isPureReactComponent=!0;var $=Array.isArray;function M(){}var b={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function U(o,h,_){var C=_.ref;return{$$typeof:e,type:o,key:h,ref:C!==void 0?C:null,props:_}}function z(o,h){return U(o.type,h,o.props)}function ue(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function nt(o){var h={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(_){return h[_]})}var _e=/\/+/g;function le(o,h){return typeof o=="object"&&o!==null&&o.key!=null?nt(""+o.key):h.toString(36)}function ot(o){switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:switch(typeof o.status=="string"?o.then(M,M):(o.status="pending",o.then(function(h){o.status==="pending"&&(o.status="fulfilled",o.value=h)},function(h){o.status==="pending"&&(o.status="rejected",o.reason=h)})),o.status){case"fulfilled":return o.value;case"rejected":throw o.reason}}throw o}function q(o,h,_,C,P){var T=typeof o;(T==="undefined"||T==="boolean")&&(o=null);var O=!1;if(o===null)O=!0;else switch(T){case"bigint":case"string":case"number":O=!0;break;case"object":switch(o.$$typeof){case e:case t:O=!0;break;case d:return O=o._init,q(O(o._payload),h,_,C,P)}}if(O)return P=P(o),O=C===""?"."+le(o,0):C,$(P)?(_="",O!=null&&(_=O.replace(_e,"$&/")+"/"),q(P,h,_,"",function(ut){return ut})):P!=null&&(ue(P)&&(P=z(P,_+(P.key==null||o&&o.key===P.key?"":(""+P.key).replace(_e,"$&/")+"/")+O)),h.push(P)),1;O=0;var F=C===""?".":C+":";if($(o))for(var N=0;N<o.length;N++)C=o[N],T=F+le(C,N),O+=q(C,h,_,T,P);else if(N=E(o),typeof N=="function")for(o=N.call(o),N=0;!(C=o.next()).done;)C=C.value,T=F+le(C,N++),O+=q(C,h,_,T,P);else if(T==="object"){if(typeof o.then=="function")return q(ot(o),h,_,C,P);throw h=String(o),Error("Objects are not valid as a React child (found: "+(h==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":h)+"). If you meant to render a collection of children, use an array instead.")}return O}function ee(o,h,_){if(o==null)return o;var C=[],P=0;return q(o,C,"","",function(T){return h.call(_,T,P++)}),C}function at(o){if(o._status===-1){var h=o._result;h=h(),h.then(function(_){(o._status===0||o._status===-1)&&(o._status=1,o._result=_)},function(_){(o._status===0||o._status===-1)&&(o._status=2,o._result=_)}),o._status===-1&&(o._status=0,o._result=h)}if(o._status===1)return o._result.default;throw o._result}var xe=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(h))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},it={map:ee,forEach:function(o,h,_){ee(o,function(){h.apply(this,arguments)},_)},count:function(o){var h=0;return ee(o,function(){h++}),h},toArray:function(o){return ee(o,function(h){return h})||[]},only:function(o){if(!ue(o))throw Error("React.Children.only expected to receive a single React element child.");return o}};return w.Activity=p,w.Children=it,w.Component=y,w.Fragment=r,w.Profiler=i,w.PureComponent=S,w.StrictMode=n,w.Suspense=s,w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,w.__COMPILER_RUNTIME={__proto__:null,c:function(o){return b.H.useMemoCache(o)}},w.cache=function(o){return function(){return o.apply(null,arguments)}},w.cacheSignal=function(){return null},w.cloneElement=function(o,h,_){if(o==null)throw Error("The argument must be a React element, but you passed "+o+".");var C=x({},o.props),P=o.key;if(h!=null)for(T in h.key!==void 0&&(P=""+h.key),h)!j.call(h,T)||T==="key"||T==="__self"||T==="__source"||T==="ref"&&h.ref===void 0||(C[T]=h[T]);var T=arguments.length-2;if(T===1)C.children=_;else if(1<T){for(var O=Array(T),F=0;F<T;F++)O[F]=arguments[F+2];C.children=O}return U(o.type,P,C)},w.createContext=function(o){return o={$$typeof:l,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null},o.Provider=o,o.Consumer={$$typeof:u,_context:o},o},w.createElement=function(o,h,_){var C,P={},T=null;if(h!=null)for(C in h.key!==void 0&&(T=""+h.key),h)j.call(h,C)&&C!=="key"&&C!=="__self"&&C!=="__source"&&(P[C]=h[C]);var O=arguments.length-2;if(O===1)P.children=_;else if(1<O){for(var F=Array(O),N=0;N<O;N++)F[N]=arguments[N+2];P.children=F}if(o&&o.defaultProps)for(C in O=o.defaultProps,O)P[C]===void 0&&(P[C]=O[C]);return U(o,T,P)},w.createRef=function(){return{current:null}},w.forwardRef=function(o){return{$$typeof:f,render:o}},w.isValidElement=ue,w.lazy=function(o){return{$$typeof:d,_payload:{_status:-1,_result:o},_init:at}},w.memo=function(o,h){return{$$typeof:a,type:o,compare:h===void 0?null:h}},w.startTransition=function(o){var h=b.T,_={};b.T=_;try{var C=o(),P=b.S;P!==null&&P(_,C),typeof C=="object"&&C!==null&&typeof C.then=="function"&&C.then(M,xe)}catch(T){xe(T)}finally{h!==null&&_.types!==null&&(h.types=_.types),b.T=h}},w.unstable_useCacheRefresh=function(){return b.H.useCacheRefresh()},w.use=function(o){return b.H.use(o)},w.useActionState=function(o,h,_){return b.H.useActionState(o,h,_)},w.useCallback=function(o,h){return b.H.useCallback(o,h)},w.useContext=function(o){return b.H.useContext(o)},w.useDebugValue=function(){},w.useDeferredValue=function(o,h){return b.H.useDeferredValue(o,h)},w.useEffect=function(o,h){return b.H.useEffect(o,h)},w.useEffectEvent=function(o){return b.H.useEffectEvent(o)},w.useId=function(){return b.H.useId()},w.useImperativeHandle=function(o,h,_){return b.H.useImperativeHandle(o,h,_)},w.useInsertionEffect=function(o,h){return b.H.useInsertionEffect(o,h)},w.useLayoutEffect=function(o,h){return b.H.useLayoutEffect(o,h)},w.useMemo=function(o,h){return b.H.useMemo(o,h)},w.useOptimistic=function(o,h){return b.H.useOptimistic(o,h)},w.useReducer=function(o,h,_){return b.H.useReducer(o,h,_)},w.useRef=function(o){return b.H.useRef(o)},w.useState=function(o){return b.H.useState(o)},w.useSyncExternalStore=function(o,h,_){return b.H.useSyncExternalStore(o,h,_)},w.useTransition=function(){return b.H.useTransition()},w.version="19.2.3",w}var be;function Ie(){return be||(be=1,se.exports=st()),se.exports}var c=Ie();const ct=De(c),qr=lt({__proto__:null,default:ct},[c]);var ce={exports:{}},k={};var Pe;function ft(){if(Pe)return k;Pe=1;var e=Ie();function t(s){var a="https://react.dev/errors/"+s;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function u(s,a,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:s,containerInfo:a,implementation:d}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(s,a){if(s==="font")return"";if(typeof a=="string")return a==="use-credentials"?a:""}return k.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,k.createPortal=function(s,a){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)throw Error(t(299));return u(s,a,null,d)},k.flushSync=function(s){var a=l.T,d=n.p;try{if(l.T=null,n.p=2,s)return s()}finally{l.T=a,n.p=d,n.d.f()}},k.preconnect=function(s,a){typeof s=="string"&&(a?(a=a.crossOrigin,a=typeof a=="string"?a==="use-credentials"?a:"":void 0):a=null,n.d.C(s,a))},k.prefetchDNS=function(s){typeof s=="string"&&n.d.D(s)},k.preinit=function(s,a){if(typeof s=="string"&&a&&typeof a.as=="string"){var d=a.as,p=f(d,a.crossOrigin),m=typeof a.integrity=="string"?a.integrity:void 0,E=typeof a.fetchPriority=="string"?a.fetchPriority:void 0;d==="style"?n.d.S(s,typeof a.precedence=="string"?a.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:E}):d==="script"&&n.d.X(s,{crossOrigin:p,integrity:m,fetchPriority:E,nonce:typeof a.nonce=="string"?a.nonce:void 0})}},k.preinitModule=function(s,a){if(typeof s=="string")if(typeof a=="object"&&a!==null){if(a.as==null||a.as==="script"){var d=f(a.as,a.crossOrigin);n.d.M(s,{crossOrigin:d,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0})}}else a==null&&n.d.M(s)},k.preload=function(s,a){if(typeof s=="string"&&typeof a=="object"&&a!==null&&typeof a.as=="string"){var d=a.as,p=f(d,a.crossOrigin);n.d.L(s,d,{crossOrigin:p,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0,type:typeof a.type=="string"?a.type:void 0,fetchPriority:typeof a.fetchPriority=="string"?a.fetchPriority:void 0,referrerPolicy:typeof a.referrerPolicy=="string"?a.referrerPolicy:void 0,imageSrcSet:typeof a.imageSrcSet=="string"?a.imageSrcSet:void 0,imageSizes:typeof a.imageSizes=="string"?a.imageSizes:void 0,media:typeof a.media=="string"?a.media:void 0})}},k.preloadModule=function(s,a){if(typeof s=="string")if(a){var d=f(a.as,a.crossOrigin);n.d.m(s,{as:typeof a.as=="string"&&a.as!=="script"?a.as:void 0,crossOrigin:d,integrity:typeof a.integrity=="string"?a.integrity:void 0})}else n.d.m(s)},k.requestFormReset=function(s){n.d.r(s)},k.unstable_batchedUpdates=function(s,a){return s(a)},k.useFormState=function(s,a,d){return l.H.useFormState(s,a,d)},k.useFormStatus=function(){return l.H.useHostTransitionStatus()},k.version="19.2.3",k}var Te;function dt(){if(Te)return ce.exports;Te=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ce.exports=ft(),ce.exports}var pt=dt();const Gr=De(pt);var Oe="popstate";function ht(e={}){function t(n,i){let{pathname:u,search:l,hash:f}=n.location;return he("",{pathname:u,search:l,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:X(i)}return yt(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function I(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mt(){return Math.random().toString(36).substring(2,10)}function Le(e,t){return{usr:e.state,key:e.key,idx:t}}function he(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?G(t):t,state:r,key:t&&t.key||n||mt()}}function X({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 G(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 yt(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:u=!1}=n,l=i.history,f="POP",s=null,a=d();a==null&&(a=0,l.replaceState({...l.state,idx:a},""));function d(){return(l.state||{idx:null}).idx}function p(){f="POP";let g=d(),y=g==null?null:g-a;a=g,s&&s({action:f,location:x.location,delta:y})}function m(g,y){f="PUSH";let v=he(x.location,g,y);a=d()+1;let S=Le(v,a),A=x.createHref(v);try{l.pushState(S,"",A)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;i.location.assign(A)}u&&s&&s({action:f,location:x.location,delta:1})}function E(g,y){f="REPLACE";let v=he(x.location,g,y);a=d();let S=Le(v,a),A=x.createHref(v);l.replaceState(S,"",A),u&&s&&s({action:f,location:x.location,delta:0})}function R(g){return gt(g)}let x={get action(){return f},get location(){return e(i,l)},listen(g){if(s)throw new Error("A history only accepts one active listener");return i.addEventListener(Oe,p),s=g,()=>{i.removeEventListener(Oe,p),s=null}},createHref(g){return t(i,g)},createURL:R,encodeLocation(g){let y=R(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:m,replace:E,go(g){return l.go(g)}};return x}function gt(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),L(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:X(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function Me(e,t,r="/"){return vt(e,t,r,!1)}function vt(e,t,r,n){let i=typeof t=="string"?G(t):t,u=W(i.pathname||"/",r);if(u==null)return null;let l=He(e);Et(l);let f=null;for(let s=0;f==null&&s<l.length;++s){let a=Lt(u);f=Tt(l[s],a,n)}return f}function He(e,t=[],r=[],n="",i=!1){let u=(l,f,s=i,a)=>{let d={relativePath:a===void 0?l.path||"":a,caseSensitive:l.caseSensitive===!0,childrenIndex:f,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&s)return;L(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let p=B([n,d.relativePath]),m=r.concat(d);l.children&&l.children.length>0&&(L(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),He(l.children,t,m,p,s)),!(l.path==null&&!l.index)&&t.push({path:p,score:bt(p,l.index),routesMeta:m})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))u(l,f);else for(let s of Ue(l.path))u(l,f,!0,s)}),t}function Ue(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),u=r.replace(/\?$/,"");if(n.length===0)return i?[u,""]:[u];let l=Ue(n.join("/")),f=[];return f.push(...l.map(s=>s===""?u:[u,s].join("/"))),i&&f.push(...l),f.map(s=>e.startsWith("/")&&s===""?"/":s)}function Et(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Pt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Rt=/^:[\w-]+$/,wt=3,Ct=2,_t=1,xt=10,St=-2,$e=e=>e==="*";function bt(e,t){let r=e.split("/"),n=r.length;return r.some($e)&&(n+=St),t&&(n+=Ct),r.filter(i=>!$e(i)).reduce((i,u)=>i+(Rt.test(u)?wt:u===""?_t:xt),n)}function Pt(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function Tt(e,t,r=!1){let{routesMeta:n}=e,i={},u="/",l=[];for(let f=0;f<n.length;++f){let s=n[f],a=f===n.length-1,d=u==="/"?t:t.slice(u.length)||"/",p=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:a},d),m=s.route;if(!p&&a&&r&&!n[n.length-1].route.index&&(p=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},d)),!p)return null;Object.assign(i,p.params),l.push({params:i,pathname:B([u,p.pathname]),pathnameBase:Nt(B([u,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(u=B([u,p.pathnameBase]))}return l}function oe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ot(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let u=i[0],l=u.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:n.reduce((a,{paramName:d,isOptional:p},m)=>{if(d==="*"){let R=f[m]||"";l=u.slice(0,u.length-R.length).replace(/(.)\/+$/,"$1")}const E=f[m];return p&&!E?a[d]=void 0:a[d]=(E||"").replace(/%2F/g,"/"),a},{}),pathname:u,pathnameBase:l,pattern:e}}function Ot(e,t=!1,r=!0){I(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,f,s)=>(n.push({paramName:f,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Lt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return I(!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 W(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}var Fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$t=e=>Fe.test(e);function kt(e,t="/"){let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?G(e):e,u;if(r)if($t(r))u=r;else{if(r.includes("//")){let l=r;r=r.replace(/\/\/+/g,"/"),I(!1,`Pathnames cannot have embedded double slashes - normalizing ${l} -> ${r}`)}r.startsWith("/")?u=ke(r.substring(1),"/"):u=ke(r,t)}else u=t;return{pathname:u,search:Dt(n),hash:It(i)}}function ke(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function fe(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function At(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ye(e){let t=At(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function ge(e,t,r,n=!1){let i;typeof e=="string"?i=G(e):(i={...e},L(!i.pathname||!i.pathname.includes("?"),fe("?","pathname","search",i)),L(!i.pathname||!i.pathname.includes("#"),fe("#","pathname","hash",i)),L(!i.search||!i.search.includes("#"),fe("#","search","hash",i)));let u=e===""||i.pathname==="",l=u?"/":i.pathname,f;if(l==null)f=r;else{let p=t.length-1;if(!n&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),p-=1;i.pathname=m.join("/")}f=p>=0?t[p]:"/"}let s=kt(i,f),a=l&&l!=="/"&&l.endsWith("/"),d=(u||l===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(a||d)&&(s.pathname+="/"),s}var B=e=>e.join("/").replace(/\/\/+/g,"/"),Nt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Dt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,It=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Mt=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ht(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ut(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Be(e,t){let r=e;if(typeof r!="string"||!Fe.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(je)try{let u=new URL(window.location.href),l=r.startsWith("//")?new URL(u.protocol+r):new URL(r),f=W(l.pathname,t);l.origin===u.origin&&f!=null?r=f+l.search+l.hash:i=!0}catch{I(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:i,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var We=["POST","PUT","PATCH","DELETE"];new Set(We);var Ft=["GET",...We];new Set(Ft);var K=c.createContext(null);K.displayName="DataRouter";var ae=c.createContext(null);ae.displayName="DataRouterState";var jt=c.createContext(!1),Ye=c.createContext({isTransitioning:!1});Ye.displayName="ViewTransition";var Bt=c.createContext(new Map);Bt.displayName="Fetchers";var Wt=c.createContext(null);Wt.displayName="Await";var D=c.createContext(null);D.displayName="Navigation";var Q=c.createContext(null);Q.displayName="Location";var H=c.createContext({outlet:null,matches:[],isDataRoute:!1});H.displayName="Route";var ve=c.createContext(null);ve.displayName="RouteError";var ze="REACT_ROUTER_ERROR",Yt="REDIRECT",zt="ROUTE_ERROR_RESPONSE";function qt(e){if(e.startsWith(`${ze}:${Yt}:{`))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 Gt(e){if(e.startsWith(`${ze}:${zt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Mt(t.status,t.statusText,t.data)}catch{}}function Kt(e,{relative:t}={}){L(V(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=c.useContext(D),{hash:i,pathname:u,search:l}=Z(e,{relative:t}),f=u;return r!=="/"&&(f=u==="/"?r:B([r,u])),n.createHref({pathname:f,search:l,hash:i})}function V(){return c.useContext(Q)!=null}function Y(){return L(V(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(Q).location}var qe="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ge(e){c.useContext(D).static||c.useLayoutEffect(e)}function Ke(){let{isDataRoute:e}=c.useContext(H);return e?sr():Vt()}function Vt(){L(V(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(K),{basename:t,navigator:r}=c.useContext(D),{matches:n}=c.useContext(H),{pathname:i}=Y(),u=JSON.stringify(ye(n)),l=c.useRef(!1);return Ge(()=>{l.current=!0}),c.useCallback((s,a={})=>{if(I(l.current,qe),!l.current)return;if(typeof s=="number"){r.go(s);return}let d=ge(s,JSON.parse(u),i,a.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:B([t,d.pathname])),(a.replace?r.replace:r.push)(d,a.state,a)},[t,r,u,i,e])}var Jt=c.createContext(null);function Xt(e){let t=c.useContext(H).outlet;return c.useMemo(()=>t&&c.createElement(Jt.Provider,{value:e},t),[t,e])}function Z(e,{relative:t}={}){let{matches:r}=c.useContext(H),{pathname:n}=Y(),i=JSON.stringify(ye(r));return c.useMemo(()=>ge(e,JSON.parse(i),n,t==="path"),[e,i,n,t])}function Qt(e,t){return Ve(e,t)}function Ve(e,t,r,n,i){L(V(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=c.useContext(D),{matches:l}=c.useContext(H),f=l[l.length-1],s=f?f.params:{},a=f?f.pathname:"/",d=f?f.pathnameBase:"/",p=f&&f.route;{let v=p&&p.path||"";Xe(a,!p||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
|
|
Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let m=Y(),E;if(t){let v=typeof t=="string"?G(t):t;L(d==="/"||v.pathname?.startsWith(d),`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 "${d}" but pathname "${v.pathname}" was given in the \`location\` prop.`),E=v}else E=m;let R=E.pathname||"/",x=R;if(d!=="/"){let v=d.replace(/^\//,"").split("/");x="/"+R.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=Me(e,{pathname:x});I(p||g!=null,`No routes matched location "${E.pathname}${E.search}${E.hash}" `),I(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${E.pathname}${E.search}${E.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=nr(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},s,v.params),pathname:B([d,u.encodeLocation?u.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?d:B([d,u.encodeLocation?u.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),l,r,n,i);return t&&y?c.createElement(Q.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...E},navigationType:"POP"}},y):y}function Zt(){let e=lr(),t=Ht(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)",i={padding:"0.5rem",backgroundColor:n},u={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:u},"ErrorBoundary")," or"," ",c.createElement("code",{style:u},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),r?c.createElement("pre",{style:i},r):null,l)}var er=c.createElement(Zt,null),Je=class extends c.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.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"){const r=Gt(e.digest);r&&(e=r)}let t=e!==void 0?c.createElement(H.Provider,{value:this.props.routeContext},c.createElement(ve.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?c.createElement(tr,{error:e},t):t}};Je.contextType=jt;var de=new WeakMap;function tr({children:e,error:t}){let{basename:r}=c.useContext(D);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=qt(t.digest);if(n){let i=de.get(t);if(i)throw i;let u=Be(n.location,r);if(je&&!de.get(t))if(u.isExternal||n.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:n.replace}));throw de.set(t,l),l}return c.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function rr({routeContext:e,match:t,children:r}){let n=c.useContext(K);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(H.Provider,{value:e},r)}function nr(e,t=[],r=null,n=null,i=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 u=e,l=r?.errors;if(l!=null){let d=u.findIndex(p=>p.route.id&&l?.[p.route.id]!==void 0);L(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),u=u.slice(0,Math.min(u.length,d+1))}let f=!1,s=-1;if(r)for(let d=0;d<u.length;d++){let p=u[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(s=d),p.route.id){let{loaderData:m,errors:E}=r,R=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!E||E[p.route.id]===void 0);if(p.route.lazy||R){f=!0,s>=0?u=u.slice(0,s+1):u=[u[0]];break}}}let a=r&&n?(d,p)=>{n(d,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Ut(r.matches),errorInfo:p})}:void 0;return u.reduceRight((d,p,m)=>{let E,R=!1,x=null,g=null;r&&(E=l&&p.route.id?l[p.route.id]:void 0,x=p.route.errorElement||er,f&&(s<0&&m===0?(Xe("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,g=null):s===m&&(R=!0,g=p.route.hydrateFallbackElement||null)));let y=t.concat(u.slice(0,m+1)),v=()=>{let S;return E?S=x:R?S=g:p.route.Component?S=c.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=d,c.createElement(rr,{match:p,routeContext:{outlet:d,matches:y,isDataRoute:r!=null},children:S})};return r&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?c.createElement(Je,{location:r.location,revalidation:r.revalidation,component:x,error:E,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:a}):v()},null)}function Ee(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function or(e){let t=c.useContext(K);return L(t,Ee(e)),t}function ar(e){let t=c.useContext(ae);return L(t,Ee(e)),t}function ir(e){let t=c.useContext(H);return L(t,Ee(e)),t}function Re(e){let t=ir(e),r=t.matches[t.matches.length-1];return L(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ur(){return Re("useRouteId")}function lr(){let e=c.useContext(ve),t=ar("useRouteError"),r=Re("useRouteError");return e!==void 0?e:t.errors?.[r]}function sr(){let{router:e}=or("useNavigate"),t=Re("useNavigate"),r=c.useRef(!1);return Ge(()=>{r.current=!0}),c.useCallback(async(i,u={})=>{I(r.current,qe),r.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...u}))},[e,t])}var Ae={};function Xe(e,t,r){!t&&!Ae[e]&&(Ae[e]=!0,I(!1,r))}c.memo(cr);function cr({routes:e,future:t,state:r,onError:n}){return Ve(e,void 0,r,n,t)}function Kr({to:e,replace:t,state:r,relative:n}){L(V(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=c.useContext(D);I(!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:u}=c.useContext(H),{pathname:l}=Y(),f=Ke(),s=ge(e,ye(u),l,n==="path"),a=JSON.stringify(s);return c.useEffect(()=>{f(JSON.parse(a),{replace:t,state:r,relative:n})},[f,a,n,t,r]),null}function Vr(e){return Xt(e.context)}function fr(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 dr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:i,static:u=!1,unstable_useTransitions:l}){L(!V(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),s=c.useMemo(()=>({basename:f,navigator:i,static:u,unstable_useTransitions:l,future:{}}),[f,i,u,l]);typeof r=="string"&&(r=G(r));let{pathname:a="/",search:d="",hash:p="",state:m=null,key:E="default"}=r,R=c.useMemo(()=>{let x=W(a,f);return x==null?null:{location:{pathname:x,search:d,hash:p,state:m,key:E},navigationType:n}},[f,a,d,p,m,E,n]);return I(R!=null,`<Router basename="${f}"> is not able to match the URL "${a}${d}${p}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:c.createElement(D.Provider,{value:s},c.createElement(Q.Provider,{children:t,value:R}))}function Jr({children:e,location:t}){return Qt(me(e),t)}function me(e,t=[]){let r=[];return c.Children.forEach(e,(n,i)=>{if(!c.isValidElement(n))return;let u=[...t,i];if(n.type===c.Fragment){r.push.apply(r,me(n.props.children,u));return}L(n.type===fr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),L(!n.props.index||!n.props.children,"An index route cannot have child routes.");let l={id:n.props.id||u.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=me(n.props.children,u)),r.push(l)}),r}var re="get",ne="application/x-www-form-urlencoded";function ie(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function pr(e){return ie(e)&&e.tagName.toLowerCase()==="button"}function hr(e){return ie(e)&&e.tagName.toLowerCase()==="form"}function mr(e){return ie(e)&&e.tagName.toLowerCase()==="input"}function yr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gr(e,t){return e.button===0&&(!t||t==="_self")&&!yr(e)}var te=null;function vr(){if(te===null)try{new FormData(document.createElement("form"),0),te=!1}catch{te=!0}return te}var Er=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pe(e){return e!=null&&!Er.has(e)?(I(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ne}"`),null):e}function Rr(e,t){let r,n,i,u,l;if(hr(e)){let f=e.getAttribute("action");n=f?W(f,t):null,r=e.getAttribute("method")||re,i=pe(e.getAttribute("enctype"))||ne,u=new FormData(e)}else if(pr(e)||mr(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||f.getAttribute("action");if(n=s?W(s,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||re,i=pe(e.getAttribute("formenctype"))||pe(f.getAttribute("enctype"))||ne,u=new FormData(f,e),!vr()){let{name:a,type:d,value:p}=e;if(d==="image"){let m=a?`${a}.`:"";u.append(`${m}x`,"0"),u.append(`${m}y`,"0")}else a&&u.append(a,p)}}else{if(ie(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=re,n=null,i=ne,l=e}return u&&i==="text/plain"&&(l=u,u=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:u,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wr(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&W(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function Cr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _r(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 xr(e,t,r){let n=await Promise.all(e.map(async i=>{let u=t.routes[i.route.id];if(u){let l=await Cr(u,r);return l.links?l.links():[]}return[]}));return Tr(n.flat(1).filter(_r).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Ne(e,t,r,n,i,u){let l=(s,a)=>r[a]?s.route.id!==r[a].route.id:!0,f=(s,a)=>r[a].pathname!==s.pathname||r[a].route.path?.endsWith("*")&&r[a].params["*"]!==s.params["*"];return u==="assets"?t.filter((s,a)=>l(s,a)||f(s,a)):u==="data"?t.filter((s,a)=>{let d=n.routes[s.route.id];if(!d||!d.hasLoader)return!1;if(l(s,a)||f(s,a))return!0;if(s.route.shouldRevalidate){let p=s.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Sr(e,t,{includeHydrateFallback:r}={}){return br(e.map(n=>{let i=t.routes[n.route.id];if(!i)return[];let u=[i.module];return i.clientActionModule&&(u=u.concat(i.clientActionModule)),i.clientLoaderModule&&(u=u.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(u=u.concat(i.hydrateFallbackModule)),i.imports&&(u=u.concat(i.imports)),u}).flat(1))}function br(e){return[...new Set(e)]}function Pr(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Tr(e,t){let r=new Set;return new Set(t),e.reduce((n,i)=>{let u=JSON.stringify(Pr(i));return r.has(u)||(r.add(u),n.push({key:u,link:i})),n},[])}function Qe(){let e=c.useContext(K);return we(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Or(){let e=c.useContext(ae);return we(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ce=c.createContext(void 0);Ce.displayName="FrameworkContext";function Ze(){let e=c.useContext(Ce);return we(e,"You must render this element inside a <HydratedRouter> element"),e}function Lr(e,t){let r=c.useContext(Ce),[n,i]=c.useState(!1),[u,l]=c.useState(!1),{onFocus:f,onBlur:s,onMouseEnter:a,onMouseLeave:d,onTouchStart:p}=t,m=c.useRef(null);c.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let x=y=>{y.forEach(v=>{l(v.isIntersecting)})},g=new IntersectionObserver(x,{threshold:.5});return m.current&&g.observe(m.current),()=>{g.disconnect()}}},[e]),c.useEffect(()=>{if(n){let x=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(x)}}},[n]);let E=()=>{i(!0)},R=()=>{i(!1),l(!1)};return r?e!=="intent"?[u,m,{}]:[u,m,{onFocus:J(f,E),onBlur:J(s,R),onMouseEnter:J(a,E),onMouseLeave:J(d,R),onTouchStart:J(p,E)}]:[!1,m,{}]}function J(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function $r({page:e,...t}){let{router:r}=Qe(),n=c.useMemo(()=>Me(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?c.createElement(Ar,{page:e,matches:n,...t}):null}function kr(e){let{manifest:t,routeModules:r}=Ze(),[n,i]=c.useState([]);return c.useEffect(()=>{let u=!1;return xr(e,t,r).then(l=>{u||i(l)}),()=>{u=!0}},[e,t,r]),n}function Ar({page:e,matches:t,...r}){let n=Y(),{manifest:i,routeModules:u}=Ze(),{basename:l}=Qe(),{loaderData:f,matches:s}=Or(),a=c.useMemo(()=>Ne(e,t,s,i,n,"data"),[e,t,s,i,n]),d=c.useMemo(()=>Ne(e,t,s,i,n,"assets"),[e,t,s,i,n]),p=c.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let R=new Set,x=!1;if(t.forEach(y=>{let v=i.routes[y.route.id];!v||!v.hasLoader||(!a.some(S=>S.route.id===y.route.id)&&y.route.id in f&&u[y.route.id]?.shouldRevalidate||v.hasClientLoader?x=!0:R.add(y.route.id))}),R.size===0)return[];let g=wr(e,l,"data");return x&&R.size>0&&g.searchParams.set("_routes",t.filter(y=>R.has(y.route.id)).map(y=>y.route.id).join(",")),[g.pathname+g.search]},[l,f,n,i,a,t,e,u]),m=c.useMemo(()=>Sr(d,i),[d,i]),E=kr(d);return c.createElement(c.Fragment,null,p.map(R=>c.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...r})),m.map(R=>c.createElement("link",{key:R,rel:"modulepreload",href:R,...r})),E.map(({key:R,link:x})=>c.createElement("link",{key:R,nonce:r.nonce,...x})))}function Nr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Dr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Dr&&(window.__reactRouterVersion="7.11.0")}catch{}function Xr({basename:e,children:t,unstable_useTransitions:r,window:n}){let i=c.useRef();i.current==null&&(i.current=ht({window:n,v5Compat:!0}));let u=i.current,[l,f]=c.useState({action:u.action,location:u.location}),s=c.useCallback(a=>{r===!1?f(a):c.startTransition(()=>f(a))},[r]);return c.useLayoutEffect(()=>u.listen(s),[u,s]),c.createElement(dr,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:u,unstable_useTransitions:r})}var et=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tt=c.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:i,reloadDocument:u,replace:l,state:f,target:s,to:a,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:m,...E},R){let{basename:x,unstable_useTransitions:g}=c.useContext(D),y=typeof a=="string"&&et.test(a),v=Be(a,x);a=v.to;let S=Kt(a,{relative:i}),[A,$,M]=Lr(n,E),b=Ur(a,{replace:l,state:f,target:s,preventScrollReset:d,relative:i,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g});function j(z){t&&t(z),z.defaultPrevented||b(z)}let U=c.createElement("a",{...E,...M,href:v.absoluteURL||S,onClick:v.isExternal||u?t:j,ref:Nr(R,$),target:s,"data-discover":!y&&r==="render"?"true":void 0});return A&&!y?c.createElement(c.Fragment,null,U,c.createElement($r,{page:S})):U});tt.displayName="Link";var Ir=c.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:i=!1,style:u,to:l,viewTransition:f,children:s,...a},d){let p=Z(l,{relative:a.relative}),m=Y(),E=c.useContext(ae),{navigator:R,basename:x}=c.useContext(D),g=E!=null&&Yr(p)&&f===!0,y=R.encodeLocation?R.encodeLocation(p).pathname:p.pathname,v=m.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;r||(v=v.toLowerCase(),S=S?S.toLowerCase():null,y=y.toLowerCase()),S&&x&&(S=W(S,x)||S);const A=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let $=v===y||!i&&v.startsWith(y)&&v.charAt(A)==="/",M=S!=null&&(S===y||!i&&S.startsWith(y)&&S.charAt(y.length)==="/"),b={isActive:$,isPending:M,isTransitioning:g},j=$?t:void 0,U;typeof n=="function"?U=n(b):U=[n,$?"active":null,M?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let z=typeof u=="function"?u(b):u;return c.createElement(tt,{...a,"aria-current":j,className:U,ref:d,style:z,to:l,viewTransition:f},typeof s=="function"?s(b):s)});Ir.displayName="NavLink";var Mr=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:i,state:u,method:l=re,action:f,onSubmit:s,relative:a,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:m,...E},R)=>{let{unstable_useTransitions:x}=c.useContext(D),g=Br(),y=Wr(f,{relative:a}),v=l.toLowerCase()==="get"?"get":"post",S=typeof f=="string"&&et.test(f),A=$=>{if(s&&s($),$.defaultPrevented)return;$.preventDefault();let M=$.nativeEvent.submitter,b=M?.getAttribute("formmethod")||l,j=()=>g(M||$.currentTarget,{fetcherKey:t,method:b,navigate:r,replace:i,state:u,relative:a,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:m});x&&r!==!1?c.startTransition(()=>j()):j()};return c.createElement("form",{ref:R,method:v,action:y,onSubmit:n?s:A,...E,"data-discover":!S&&e==="render"?"true":void 0})});Mr.displayName="Form";function Hr(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=c.useContext(K);return L(t,Hr(e)),t}function Ur(e,{target:t,replace:r,state:n,preventScrollReset:i,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:s}={}){let a=Ke(),d=Y(),p=Z(e,{relative:u});return c.useCallback(m=>{if(gr(m,t)){m.preventDefault();let E=r!==void 0?r:X(d)===X(p),R=()=>a(e,{replace:E,state:n,preventScrollReset:i,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f});s?c.startTransition(()=>R()):R()}},[d,a,p,r,n,t,e,i,u,l,f,s])}var Fr=0,jr=()=>`__${String(++Fr)}__`;function Br(){let{router:e}=rt("useSubmit"),{basename:t}=c.useContext(D),r=ur(),n=e.fetch,i=e.navigate;return c.useCallback(async(u,l={})=>{let{action:f,method:s,encType:a,formData:d,body:p}=Rr(u,t);if(l.navigate===!1){let m=l.fetcherKey||jr();await n(m,r,l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||s,formEncType:l.encType||a,flushSync:l.flushSync})}else await i(l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||s,formEncType:l.encType||a,replace:l.replace,state:l.state,fromRouteId:r,flushSync:l.flushSync,viewTransition:l.viewTransition})},[n,i,t,r])}function Wr(e,{relative:t}={}){let{basename:r}=c.useContext(D),n=c.useContext(H);L(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),u={...Z(e||".",{relative:t})},l=Y();if(e==null){u.search=l.search;let f=new URLSearchParams(u.search),s=f.getAll("index");if(s.some(d=>d==="")){f.delete("index"),s.filter(p=>p).forEach(p=>f.append("index",p));let d=f.toString();u.search=d?`?${d}`:""}}return(!e||e===".")&&i.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:B([r,u.pathname])),X(u)}function Yr(e,{relative:t}={}){let r=c.useContext(Ye);L(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=rt("useViewTransitionState"),i=Z(e,{relative:t});if(!r.isTransitioning)return!1;let u=W(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=W(r.nextLocation.pathname,n)||r.nextLocation.pathname;return oe(i.pathname,l)!=null||oe(i.pathname,u)!=null}export{Xr as B,tt as L,Ir as N,Vr as O,ct as R,Gr as a,Ie as b,dt as c,qr as d,pt as e,Kr as f,zr as g,Ke as h,Jr as i,fr as j,c as r,Y as u};
|
|
//# sourceMappingURL=react-v1TLhXpT.js.map
|