@eliseubatista99/react-scaffold-core 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -21
- package/dist/components/index.d.ts +1 -0
- package/dist/components/pageLayout/index.d.ts +1 -0
- package/dist/components/pageLayout/pageLayout.d.ts +14 -0
- package/dist/components/pageLayout/stories/pageLayout.stories.d.ts +19 -0
- package/dist/components/pageLayout/stories/setup.d.ts +2 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +222 -122
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<h1 align="center">Core</h1>
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
A library which provides basic components, hooks, helpers and providers to easily build a React application and avoid repeating the usual code.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```shell
|
|
10
|
-
npm i @eliseubatista99/react-scaffold-core
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Content
|
|
14
|
-
|
|
15
|
-
- [Providers](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/providers): Useful providers to handle complex actions like navigation and showing, hiding and managing feedback components;
|
|
16
|
-
|
|
17
|
-
- [Hooks](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/hooks): Hooks that handle atomic actions, like fetching and endpoint.
|
|
18
|
-
|
|
19
|
-
- [Helpers](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/helpers): Classes to help with generic repetitive tasks, like transforming a string into Pascal Case.
|
|
20
|
-
|
|
21
|
-
- [Components](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/components): Basic, customizable components with pre-configured styles and behaviors.
|
|
1
|
+
<h1 align="center">Core</h1>
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
A library which provides basic components, hooks, helpers and providers to easily build a React application and avoid repeating the usual code.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm i @eliseubatista99/react-scaffold-core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Content
|
|
14
|
+
|
|
15
|
+
- [Providers](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/providers): Useful providers to handle complex actions like navigation and showing, hiding and managing feedback components;
|
|
16
|
+
|
|
17
|
+
- [Hooks](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/hooks): Hooks that handle atomic actions, like fetching and endpoint.
|
|
18
|
+
|
|
19
|
+
- [Helpers](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/helpers): Classes to help with generic repetitive tasks, like transforming a string into Pascal Case.
|
|
20
|
+
|
|
21
|
+
- [Components](https://github.com/eliseubatista99/react-scaffold/tree/main/src/packages/core/src/components): Basic, customizable components with pre-configured styles and behaviors.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pageLayout';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PageLayoutHeaderAndFooterProps {
|
|
2
|
+
content: React.ReactNode;
|
|
3
|
+
visibility?: "always" | "fixed";
|
|
4
|
+
styles?: React.CSSProperties;
|
|
5
|
+
}
|
|
6
|
+
export interface PageLayoutProps {
|
|
7
|
+
header?: PageLayoutHeaderAndFooterProps;
|
|
8
|
+
footer?: PageLayoutHeaderAndFooterProps;
|
|
9
|
+
floatingContent?: React.ReactNode;
|
|
10
|
+
containerStyles?: React.CSSProperties;
|
|
11
|
+
pageStyles?: React.CSSProperties;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const PageLayout: ({ header, containerStyles, pageStyles, children, footer, floatingContent, }: PageLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { PageLayoutProps } from '../pageLayout';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ children, ...props }: PageLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
args: PageLayoutProps;
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const WithHeaderAlwaysVisible: Story;
|
|
16
|
+
export declare const WithFixedHeader: Story;
|
|
17
|
+
export declare const WithFooterAlwaysVisible: Story;
|
|
18
|
+
export declare const WithFixedFooter: Story;
|
|
19
|
+
export declare const NoHeaderAndNoFooter: Story;
|
package/dist/index.cjs.js
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Le;function ft(){return Le||(Le=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===
|
|
17
|
+
*/var Le;function ft(){return Le||(Le=1,process.env.NODE_ENV!=="production"&&function(){function e(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===D?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case y:return"Fragment";case f:return"Profiler";case x:return"StrictMode";case T:return"Suspense";case U:return"SuspenseList";case O:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case p:return"Portal";case R:return(m.displayName||"Context")+".Provider";case b:return(m._context.displayName||"Context")+".Consumer";case k:var w=m.render;return m=m.displayName,m||(m=w.displayName||w.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case $:return w=m.displayName||null,w!==null?w:e(m.type)||"Memo";case _:w=m._payload,m=m._init;try{return e(m(w))}catch{}}return null}function t(m){return""+m}function r(m){try{t(m);var w=!1}catch{w=!0}if(w){w=console;var C=w.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return C.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),t(m)}}function a(m){if(m===y)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===_)return"<...>";try{var w=e(m);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function n(){var m=W.A;return m===null?null:m.getOwner()}function o(){return Error("react-stack-top-frame")}function i(m){if(Ee.call(m,"key")){var w=Object.getOwnPropertyDescriptor(m,"key").get;if(w&&w.isReactWarning)return!1}return m.key!==void 0}function u(m,w){function C(){Ce||(Ce=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",w))}C.isReactWarning=!0,Object.defineProperty(m,"key",{get:C,configurable:!0})}function l(){var m=e(this.type);return Se[m]||(Se[m]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),m=this.props.ref,m!==void 0?m:null}function s(m,w,C,I,B,A,fe,de){return C=A.ref,m={$$typeof:v,type:m,key:w,props:A,_owner:B},(C!==void 0?C:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:l}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:fe}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function h(m,w,C,I,B,A,fe,de){var L=w.children;if(L!==void 0)if(I)if(lt(L)){for(I=0;I<L.length;I++)g(L[I]);Object.freeze&&Object.freeze(L)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(L);if(Ee.call(w,"key")){L=e(m);var V=Object.keys(w).filter(function(st){return st!=="key"});I=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",Te[L+I]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,I,L,
|
|
22
|
+
<%s key={someKey} {...props} />`,I,L,V,L),Te[L+I]=!0)}if(L=null,C!==void 0&&(r(C),L=""+C),i(w)&&(r(w.key),L=""+w.key),"key"in w){C={};for(var he in w)he!=="key"&&(C[he]=w[he])}else C=w;return L&&u(C,typeof m=="function"?m.displayName||m.name||"Unknown":m),s(m,L,A,B,n(),C,fe,de)}function g(m){typeof m=="object"&&m!==null&&m.$$typeof===v&&m._store&&(m._store.validated=1)}var d=E,v=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),R=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),W=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee=Object.prototype.hasOwnProperty,lt=Array.isArray,ce=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(m){return m()}};var Ce,Se={},Pe=d["react-stack-bottom-frame"].bind(d,o)(),ke=ce(a(o)),Te={};G.Fragment=y,G.jsx=function(m,w,C,I,B){var A=1e4>W.recentlyCreatedOwnerStacks++;return h(m,w,C,!1,I,B,A?Error("react-stack-top-frame"):Pe,A?ce(a(m)):ke)},G.jsxs=function(m,w,C,I,B){var A=1e4>W.recentlyCreatedOwnerStacks++;return h(m,w,C,!0,I,B,A?Error("react-stack-top-frame"):Pe,A?ce(a(m)):ke)}}()),G}var Oe;function dt(){return Oe||(Oe=1,process.env.NODE_ENV==="production"?re.exports=ct():re.exports=ft()),re.exports}var S=dt(),K={},$e;function ht(){if($e)return K;$e=1,Object.defineProperty(K,"__esModule",{value:!0}),K.parse=i,K.serialize=s;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,o=(()=>{const d=function(){};return d.prototype=Object.create(null),d})();function i(d,v){const p=new o,y=d.length;if(y<2)return p;const x=v?.decode||h;let f=0;do{const b=d.indexOf("=",f);if(b===-1)break;const R=d.indexOf(";",f),k=R===-1?y:R;if(b>k){f=d.lastIndexOf(";",b-1)+1;continue}const T=u(d,f,b),U=l(d,b,T),$=d.slice(T,U);if(p[$]===void 0){let _=u(d,b+1,k),O=l(d,k,_);const D=x(d.slice(_,O));p[$]=D}f=k+1}while(f<y);return p}function u(d,v,p){do{const y=d.charCodeAt(v);if(y!==32&&y!==9)return v}while(++v<p);return p}function l(d,v,p){for(;v>p;){const y=d.charCodeAt(--v);if(y!==32&&y!==9)return v+1}return p}function s(d,v,p){const y=p?.encode||encodeURIComponent;if(!e.test(d))throw new TypeError(`argument name is invalid: ${d}`);const x=y(v);if(!t.test(x))throw new TypeError(`argument val is invalid: ${v}`);let f=d+"="+x;if(!p)return f;if(p.maxAge!==void 0){if(!Number.isInteger(p.maxAge))throw new TypeError(`option maxAge is invalid: ${p.maxAge}`);f+="; Max-Age="+p.maxAge}if(p.domain){if(!r.test(p.domain))throw new TypeError(`option domain is invalid: ${p.domain}`);f+="; Domain="+p.domain}if(p.path){if(!a.test(p.path))throw new TypeError(`option path is invalid: ${p.path}`);f+="; Path="+p.path}if(p.expires){if(!g(p.expires)||!Number.isFinite(p.expires.valueOf()))throw new TypeError(`option expires is invalid: ${p.expires}`);f+="; Expires="+p.expires.toUTCString()}if(p.httpOnly&&(f+="; HttpOnly"),p.secure&&(f+="; Secure"),p.partitioned&&(f+="; Partitioned"),p.priority)switch(typeof p.priority=="string"?p.priority.toLowerCase():void 0){case"low":f+="; Priority=Low";break;case"medium":f+="; Priority=Medium";break;case"high":f+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${p.priority}`)}if(p.sameSite)switch(typeof p.sameSite=="string"?p.sameSite.toLowerCase():p.sameSite){case!0:case"strict":f+="; SameSite=Strict";break;case"lax":f+="; SameSite=Lax";break;case"none":f+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${p.sameSite}`)}return f}function h(d){if(d.indexOf("%")===-1)return d;try{return decodeURIComponent(d)}catch{return d}}function g(d){return n.call(d)==="[object Date]"}return K}ht();/**
|
|
23
23
|
* react-router v7.6.3
|
|
24
24
|
*
|
|
25
25
|
* Copyright (c) Remix Software Inc.
|
|
@@ -28,6 +28,6 @@ React keys must be passed directly to JSX without using spread:
|
|
|
28
28
|
* LICENSE.md file in the root directory of this source tree.
|
|
29
29
|
*
|
|
30
30
|
* @license MIT
|
|
31
|
-
*/var _e="popstate";function mt(e={}){function t(a,n){let{pathname:o,search:i,hash:u}=a.location;return ge("",{pathname:o,search:i,hash:u},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:Z(n)}return gt(t,r,null,e)}function S(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function N(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pt(){return Math.random().toString(36).substring(2,10)}function Ae(e,t){return{usr:e.state,key:e.key,idx:t}}function ge(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Y(t):t,state:r,key:t&&t.key||a||pt()}}function Z({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 Y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function gt(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,u="POP",l=null,s=h();s==null&&(s=0,i.replaceState({...i.state,idx:s},""));function h(){return(i.state||{idx:null}).idx}function g(){u="POP";let w=h(),f=w==null?null:w-s;s=w,l&&l({action:u,location:y.location,delta:f})}function d(w,f){u="PUSH";let b=ge(y.location,w,f);s=h()+1;let R=Ae(b,s),k=y.createHref(b);try{i.pushState(R,"",k)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;n.location.assign(k)}o&&l&&l({action:u,location:y.location,delta:1})}function v(w,f){u="REPLACE";let b=ge(y.location,w,f);s=h();let R=Ae(b,s),k=y.createHref(b);i.replaceState(R,"",k),o&&l&&l({action:u,location:y.location,delta:0})}function p(w){return yt(w)}let y={get action(){return u},get location(){return e(n,i)},listen(w){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(_e,g),l=w,()=>{n.removeEventListener(_e,g),l=null}},createHref(w){return t(n,w)},createURL:p,encodeLocation(w){let f=p(w);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:d,replace:v,go(w){return i.go(w)}};return y}function yt(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),S(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Z(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function Me(e,t,r="/"){return vt(e,t,r,!1)}function vt(e,t,r,a){let n=typeof t=="string"?Y(t):t,o=M(n.pathname||"/",r);if(o==null)return null;let i=He(e);wt(i);let u=null;for(let l=0;u==null&&l<i.length;++l){let s=Lt(o);u=Tt(i[l],s,a)}return u}function He(e,t=[],r=[],a=""){let n=(o,i,u)=>{let l={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};l.relativePath.startsWith("/")&&(S(l.relativePath.startsWith(a),`Absolute route path "${l.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(a.length));let s=j([a,l.relativePath]),h=r.concat(l);o.children&&o.children.length>0&&(S(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),He(o.children,t,h,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:kt(s,o.index),routesMeta:h})};return e.forEach((o,i)=>{if(o.path===""||!o.path?.includes("?"))n(o,i);else for(let u of Ue(o.path))n(o,i,u)}),t}function Ue(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Ue(a.join("/")),u=[];return u.push(...i.map(l=>l===""?o:[o,l].join("/"))),n&&u.push(...i),u.map(l=>e.startsWith("/")&&l===""?"/":l)}function wt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Pt(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var xt=/^:[\w-]+$/,bt=3,Rt=2,Et=1,Ct=10,St=-2,De=e=>e==="*";function kt(e,t){let r=e.split("/"),a=r.length;return r.some(De)&&(a+=St),t&&(a+=Rt),r.filter(n=>!De(n)).reduce((n,o)=>n+(xt.test(o)?bt:o===""?Et:Ct),a)}function Pt(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Tt(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let u=0;u<a.length;++u){let l=a[u],s=u===a.length-1,h=o==="/"?t:t.slice(o.length)||"/",g=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},h),d=l.route;if(!g&&s&&r&&!a[a.length-1].route.index&&(g=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},h)),!g)return null;Object.assign(n,g.params),i.push({params:n,pathname:j([o,g.pathname]),pathnameBase:At(j([o,g.pathnameBase])),route:d}),g.pathnameBase!=="/"&&(o=j([o,g.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=It(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),u=n.slice(1);return{params:a.reduce((s,{paramName:h,isOptional:g},d)=>{if(h==="*"){let p=u[d]||"";i=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const v=u[d];return g&&!v?s[h]=void 0:s[h]=(v||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:i,pattern:e}}function It(e,t=!1,r=!0){N(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 a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,l)=>(a.push({paramName:u,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Lt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return N(!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 M(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Ot(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Y(e):e;return{pathname:r?r.startsWith("/")?r:$t(r,t):t,search:Dt(a),hash:Nt(n)}}function $t(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function me(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 _t(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Be(e){let t=_t(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Ve(e,t,r,a=!1){let n;typeof e=="string"?n=Y(e):(n={...e},S(!n.pathname||!n.pathname.includes("?"),me("?","pathname","search",n)),S(!n.pathname||!n.pathname.includes("#"),me("#","pathname","hash",n)),S(!n.search||!n.search.includes("#"),me("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,u;if(i==null)u=r;else{let g=t.length-1;if(!a&&i.startsWith("..")){let d=i.split("/");for(;d[0]==="..";)d.shift(),g-=1;n.pathname=d.join("/")}u=g>=0?t[g]:"/"}let l=Ot(n,u),s=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(s||h)&&(l.pathname+="/"),l}var j=e=>e.join("/").replace(/\/\/+/g,"/"),At=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Dt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ft(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var We=["POST","PUT","PATCH","DELETE"];new Set(We);var jt=["GET",...We];new Set(jt);var J=c.createContext(null);J.displayName="DataRouter";var le=c.createContext(null);le.displayName="DataRouterState";var ze=c.createContext({isTransitioning:!1});ze.displayName="ViewTransition";var Mt=c.createContext(new Map);Mt.displayName="Fetchers";var Ht=c.createContext(null);Ht.displayName="Await";var F=c.createContext(null);F.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";function Ut(e,{relative:t}={}){S(ee(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=c.useContext(F),{hash:n,pathname:o,search:i}=te(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:j([r,o])),a.createHref({pathname:u,search:i,hash:n})}function ee(){return c.useContext(Q)!=null}function V(){return S(ee(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(Q).location}var Ye="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Je(e){c.useContext(F).static||c.useLayoutEffect(e)}function qe(){let{isDataRoute:e}=c.useContext(H);return e?er():Bt()}function Bt(){S(ee(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(J),{basename:t,navigator:r}=c.useContext(F),{matches:a}=c.useContext(H),{pathname:n}=V(),o=JSON.stringify(Be(a)),i=c.useRef(!1);return Je(()=>{i.current=!0}),c.useCallback((l,s={})=>{if(N(i.current,Ye),!i.current)return;if(typeof l=="number"){r.go(l);return}let h=Ve(l,JSON.parse(o),n,s.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:j([t,h.pathname])),(s.replace?r.replace:r.push)(h,s.state,s)},[t,r,o,n,e])}c.createContext(null);function te(e,{relative:t}={}){let{matches:r}=c.useContext(H),{pathname:a}=V(),n=JSON.stringify(Be(r));return c.useMemo(()=>Ve(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Vt(e,t){return Ge(e,t)}function Ge(e,t,r,a){S(ee(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=c.useContext(F),{matches:o}=c.useContext(H),i=o[o.length-1],u=i?i.params:{},l=i?i.pathname:"/",s=i?i.pathnameBase:"/",h=i&&i.route;{let f=h&&h.path||"";Ke(l,!h||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) 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.
|
|
31
|
+
*/var _e="popstate";function mt(e={}){function t(a,n){let{pathname:o,search:i,hash:u}=a.location;return ge("",{pathname:o,search:i,hash:u},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:Z(n)}return gt(t,r,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function j(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pt(){return Math.random().toString(36).substring(2,10)}function De(e,t){return{usr:e.state,key:e.key,idx:t}}function ge(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Y(t):t,state:r,key:t&&t.key||a||pt()}}function Z({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 Y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function gt(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,u="POP",l=null,s=h();s==null&&(s=0,i.replaceState({...i.state,idx:s},""));function h(){return(i.state||{idx:null}).idx}function g(){u="POP";let x=h(),f=x==null?null:x-s;s=x,l&&l({action:u,location:y.location,delta:f})}function d(x,f){u="PUSH";let b=ge(y.location,x,f);s=h()+1;let R=De(b,s),k=y.createHref(b);try{i.pushState(R,"",k)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;n.location.assign(k)}o&&l&&l({action:u,location:y.location,delta:1})}function v(x,f){u="REPLACE";let b=ge(y.location,x,f);s=h();let R=De(b,s),k=y.createHref(b);i.replaceState(R,"",k),o&&l&&l({action:u,location:y.location,delta:0})}function p(x){return yt(x)}let y={get action(){return u},get location(){return e(n,i)},listen(x){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(_e,g),l=x,()=>{n.removeEventListener(_e,g),l=null}},createHref(x){return t(n,x)},createURL:p,encodeLocation(x){let f=p(x);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:d,replace:v,go(x){return i.go(x)}};return y}function yt(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),P(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Z(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function He(e,t,r="/"){return vt(e,t,r,!1)}function vt(e,t,r,a){let n=typeof t=="string"?Y(t):t,o=H(n.pathname||"/",r);if(o==null)return null;let i=Me(e);xt(i);let u=null;for(let l=0;u==null&&l<i.length;++l){let s=Lt(o);u=Tt(i[l],s,a)}return u}function Me(e,t=[],r=[],a=""){let n=(o,i,u)=>{let l={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};l.relativePath.startsWith("/")&&(P(l.relativePath.startsWith(a),`Absolute route path "${l.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(a.length));let s=F([a,l.relativePath]),h=r.concat(l);o.children&&o.children.length>0&&(P(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),Me(o.children,t,h,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:Pt(s,o.index),routesMeta:h})};return e.forEach((o,i)=>{if(o.path===""||!o.path?.includes("?"))n(o,i);else for(let u of Ue(o.path))n(o,i,u)}),t}function Ue(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Ue(a.join("/")),u=[];return u.push(...i.map(l=>l===""?o:[o,l].join("/"))),n&&u.push(...i),u.map(l=>e.startsWith("/")&&l===""?"/":l)}function xt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:kt(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var wt=/^:[\w-]+$/,bt=3,Rt=2,Et=1,Ct=10,St=-2,Ae=e=>e==="*";function Pt(e,t){let r=e.split("/"),a=r.length;return r.some(Ae)&&(a+=St),t&&(a+=Rt),r.filter(n=>!Ae(n)).reduce((n,o)=>n+(wt.test(o)?bt:o===""?Et:Ct),a)}function kt(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Tt(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let u=0;u<a.length;++u){let l=a[u],s=u===a.length-1,h=o==="/"?t:t.slice(o.length)||"/",g=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},h),d=l.route;if(!g&&s&&r&&!a[a.length-1].route.index&&(g=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},h)),!g)return null;Object.assign(n,g.params),i.push({params:n,pathname:F([o,g.pathname]),pathnameBase:Dt(F([o,g.pathnameBase])),route:d}),g.pathnameBase!=="/"&&(o=F([o,g.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=It(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),u=n.slice(1);return{params:a.reduce((s,{paramName:h,isOptional:g},d)=>{if(h==="*"){let p=u[d]||"";i=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const v=u[d];return g&&!v?s[h]=void 0:s[h]=(v||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:i,pattern:e}}function It(e,t=!1,r=!0){j(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 a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,l)=>(a.push({paramName:u,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Lt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return j(!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 H(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Ot(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Y(e):e;return{pathname:r?r.startsWith("/")?r:$t(r,t):t,search:At(a),hash:jt(n)}}function $t(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function me(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 _t(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Be(e){let t=_t(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function ze(e,t,r,a=!1){let n;typeof e=="string"?n=Y(e):(n={...e},P(!n.pathname||!n.pathname.includes("?"),me("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),me("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),me("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,u;if(i==null)u=r;else{let g=t.length-1;if(!a&&i.startsWith("..")){let d=i.split("/");for(;d[0]==="..";)d.shift(),g-=1;n.pathname=d.join("/")}u=g>=0?t[g]:"/"}let l=Ot(n,u),s=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(s||h)&&(l.pathname+="/"),l}var F=e=>e.join("/").replace(/\/\/+/g,"/"),Dt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),At=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Nt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var We=["POST","PUT","PATCH","DELETE"];new Set(We);var Ft=["GET",...We];new Set(Ft);var J=c.createContext(null);J.displayName="DataRouter";var le=c.createContext(null);le.displayName="DataRouterState";var Ve=c.createContext({isTransitioning:!1});Ve.displayName="ViewTransition";var Ht=c.createContext(new Map);Ht.displayName="Fetchers";var Mt=c.createContext(null);Mt.displayName="Await";var N=c.createContext(null);N.displayName="Navigation";var Q=c.createContext(null);Q.displayName="Location";var M=c.createContext({outlet:null,matches:[],isDataRoute:!1});M.displayName="Route";var ve=c.createContext(null);ve.displayName="RouteError";function Ut(e,{relative:t}={}){P(ee(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=c.useContext(N),{hash:n,pathname:o,search:i}=te(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:F([r,o])),a.createHref({pathname:u,search:i,hash:n})}function ee(){return c.useContext(Q)!=null}function z(){return P(ee(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(Q).location}var Ye="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Je(e){c.useContext(N).static||c.useLayoutEffect(e)}function qe(){let{isDataRoute:e}=c.useContext(M);return e?er():Bt()}function Bt(){P(ee(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(J),{basename:t,navigator:r}=c.useContext(N),{matches:a}=c.useContext(M),{pathname:n}=z(),o=JSON.stringify(Be(a)),i=c.useRef(!1);return Je(()=>{i.current=!0}),c.useCallback((l,s={})=>{if(j(i.current,Ye),!i.current)return;if(typeof l=="number"){r.go(l);return}let h=ze(l,JSON.parse(o),n,s.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:F([t,h.pathname])),(s.replace?r.replace:r.push)(h,s.state,s)},[t,r,o,n,e])}c.createContext(null);function te(e,{relative:t}={}){let{matches:r}=c.useContext(M),{pathname:a}=z(),n=JSON.stringify(Be(r));return c.useMemo(()=>ze(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function zt(e,t){return Ge(e,t)}function Ge(e,t,r,a){P(ee(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=c.useContext(N),{matches:o}=c.useContext(M),i=o[o.length-1],u=i?i.params:{},l=i?i.pathname:"/",s=i?i.pathnameBase:"/",h=i&&i.route;{let f=h&&h.path||"";Ke(l,!h||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) 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.
|
|
32
32
|
|
|
33
|
-
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let g=V(),d;if(t){let f=typeof t=="string"?Y(t):t;S(s==="/"||f.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 "${f.pathname}" was given in the \`location\` prop.`),d=f}else d=g;let v=d.pathname||"/",p=v;if(s!=="/"){let f=s.replace(/^\//,"").split("/");p="/"+v.replace(/^\//,"").split("/").slice(f.length).join("/")}let y=Me(e,{pathname:p});N(h||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),N(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 w=qt(y&&y.map(f=>Object.assign({},f,{params:Object.assign({},u,f.params),pathname:j([s,n.encodeLocation?n.encodeLocation(f.pathname).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?s:j([s,n.encodeLocation?n.encodeLocation(f.pathnameBase).pathname:f.pathnameBase])})),o,r,a);return t&&w?c.createElement(Q.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...d},navigationType:"POP"}},w):w}function Wt(){let e=Qt(),t=Ft(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=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:o},"ErrorBoundary")," or"," ",c.createElement("code",{style:o},"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:n},r):null,i)}var zt=c.createElement(Wt,null),Yt=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){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?c.createElement(H.Provider,{value:this.props.routeContext},c.createElement(ve.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Jt({routeContext:e,match:t,children:r}){let a=c.useContext(J);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(H.Provider,{value:e},r)}function qt(e,t=[],r=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 n=e,o=r?.errors;if(o!=null){let l=n.findIndex(s=>s.route.id&&o?.[s.route.id]!==void 0);S(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,l+1))}let i=!1,u=-1;if(r)for(let l=0;l<n.length;l++){let s=n[l];if((s.route.HydrateFallback||s.route.hydrateFallbackElement)&&(u=l),s.route.id){let{loaderData:h,errors:g}=r,d=s.route.loader&&!h.hasOwnProperty(s.route.id)&&(!g||g[s.route.id]===void 0);if(s.route.lazy||d){i=!0,u>=0?n=n.slice(0,u+1):n=[n[0]];break}}}return n.reduceRight((l,s,h)=>{let g,d=!1,v=null,p=null;r&&(g=o&&s.route.id?o[s.route.id]:void 0,v=s.route.errorElement||zt,i&&(u<0&&h===0?(Ke("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):u===h&&(d=!0,p=s.route.hydrateFallbackElement||null)));let y=t.concat(n.slice(0,h+1)),w=()=>{let f;return g?f=v:d?f=p:s.route.Component?f=c.createElement(s.route.Component,null):s.route.element?f=s.route.element:f=l,c.createElement(Jt,{match:s,routeContext:{outlet:l,matches:y,isDataRoute:r!=null},children:f})};return r&&(s.route.ErrorBoundary||s.route.errorElement||h===0)?c.createElement(Yt,{location:r.location,revalidation:r.revalidation,component:v,error:g,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}function we(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gt(e){let t=c.useContext(J);return S(t,we(e)),t}function Kt(e){let t=c.useContext(le);return S(t,we(e)),t}function Xt(e){let t=c.useContext(H);return S(t,we(e)),t}function xe(e){let t=Xt(e),r=t.matches[t.matches.length-1];return S(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Zt(){return xe("useRouteId")}function Qt(){let e=c.useContext(ve),t=Kt("useRouteError"),r=xe("useRouteError");return e!==void 0?e:t.errors?.[r]}function er(){let{router:e}=Gt("useNavigate"),t=xe("useNavigate"),r=c.useRef(!1);return Je(()=>{r.current=!0}),c.useCallback(async(n,o={})=>{N(r.current,Ye),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Ne={};function Ke(e,t,r){!t&&!Ne[e]&&(Ne[e]=!0,N(!1,r))}c.memo(tr);function tr({routes:e,future:t,state:r}){return Ge(e,void 0,r,t)}function Xe(e){S(!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 rr({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){S(!ee(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),u=c.useMemo(()=>({basename:i,navigator:n,static:o,future:{}}),[i,n,o]);typeof r=="string"&&(r=Y(r));let{pathname:l="/",search:s="",hash:h="",state:g=null,key:d="default"}=r,v=c.useMemo(()=>{let p=M(l,i);return p==null?null:{location:{pathname:p,search:s,hash:h,state:g,key:d},navigationType:a}},[i,l,s,h,g,d,a]);return N(v!=null,`<Router basename="${i}"> is not able to match the URL "${l}${s}${h}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:c.createElement(F.Provider,{value:u},c.createElement(Q.Provider,{children:t,value:v}))}function nr({children:e,location:t}){return Vt(ye(e),t)}function ye(e,t=[]){let r=[];return c.Children.forEach(e,(a,n)=>{if(!c.isValidElement(a))return;let o=[...t,n];if(a.type===c.Fragment){r.push.apply(r,ye(a.props.children,o));return}S(a.type===Xe,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),S(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=ye(a.props.children,o)),r.push(i)}),r}var ae="get",oe="application/x-www-form-urlencoded";function se(e){return e!=null&&typeof e.tagName=="string"}function ar(e){return se(e)&&e.tagName.toLowerCase()==="button"}function or(e){return se(e)&&e.tagName.toLowerCase()==="form"}function ir(e){return se(e)&&e.tagName.toLowerCase()==="input"}function lr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sr(e,t){return e.button===0&&(!t||t==="_self")&&!lr(e)}var ne=null;function ur(){if(ne===null)try{new FormData(document.createElement("form"),0),ne=!1}catch{ne=!0}return ne}var cr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pe(e){return e!=null&&!cr.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oe}"`),null):e}function fr(e,t){let r,a,n,o,i;if(or(e)){let u=e.getAttribute("action");a=u?M(u,t):null,r=e.getAttribute("method")||ae,n=pe(e.getAttribute("enctype"))||oe,o=new FormData(e)}else if(ar(e)||ir(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||u.getAttribute("action");if(a=l?M(l,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||ae,n=pe(e.getAttribute("formenctype"))||pe(u.getAttribute("enctype"))||oe,o=new FormData(u,e),!ur()){let{name:s,type:h,value:g}=e;if(h==="image"){let d=s?`${s}.`:"";o.append(`${d}x`,"0"),o.append(`${d}y`,"0")}else s&&o.append(s,g)}}else{if(se(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ae,a=null,n=oe,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function dr(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 hr(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 mr(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await dr(o,r);return i.links?i.links():[]}return[]}));return vr(a.flat(1).filter(hr).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Fe(e,t,r,a,n,o){let i=(l,s)=>r[s]?l.route.id!==r[s].route.id:!0,u=(l,s)=>r[s].pathname!==l.pathname||r[s].route.path?.endsWith("*")&&r[s].params["*"]!==l.params["*"];return o==="assets"?t.filter((l,s)=>i(l,s)||u(l,s)):o==="data"?t.filter((l,s)=>{let h=a.routes[l.route.id];if(!h||!h.hasLoader)return!1;if(i(l,s)||u(l,s))return!0;if(l.route.shouldRevalidate){let g=l.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function pr(e,t,{includeHydrateFallback:r}={}){return gr(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function gr(e){return[...new Set(e)]}function yr(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function vr(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(yr(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var wr=new Set([100,101,204,205]);function xr(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&M(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function Ze(){let e=c.useContext(J);return be(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function br(){let e=c.useContext(le);return be(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Re=c.createContext(void 0);Re.displayName="FrameworkContext";function Qe(){let e=c.useContext(Re);return be(e,"You must render this element inside a <HydratedRouter> element"),e}function Rr(e,t){let r=c.useContext(Re),[a,n]=c.useState(!1),[o,i]=c.useState(!1),{onFocus:u,onBlur:l,onMouseEnter:s,onMouseLeave:h,onTouchStart:g}=t,d=c.useRef(null);c.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let y=f=>{f.forEach(b=>{i(b.isIntersecting)})},w=new IntersectionObserver(y,{threshold:.5});return d.current&&w.observe(d.current),()=>{w.disconnect()}}},[e]),c.useEffect(()=>{if(a){let y=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(y)}}},[a]);let v=()=>{n(!0)},p=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,d,{}]:[o,d,{onFocus:X(u,v),onBlur:X(l,p),onMouseEnter:X(s,v),onMouseLeave:X(h,p),onTouchStart:X(g,v)}]:[!1,d,{}]}function X(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Er({page:e,...t}){let{router:r}=Ze(),a=c.useMemo(()=>Me(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?c.createElement(Sr,{page:e,matches:a,...t}):null}function Cr(e){let{manifest:t,routeModules:r}=Qe(),[a,n]=c.useState([]);return c.useEffect(()=>{let o=!1;return mr(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Sr({page:e,matches:t,...r}){let a=V(),{manifest:n,routeModules:o}=Qe(),{basename:i}=Ze(),{loaderData:u,matches:l}=br(),s=c.useMemo(()=>Fe(e,t,l,n,a,"data"),[e,t,l,n,a]),h=c.useMemo(()=>Fe(e,t,l,n,a,"assets"),[e,t,l,n,a]),g=c.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let p=new Set,y=!1;if(t.forEach(f=>{let b=n.routes[f.route.id];!b||!b.hasLoader||(!s.some(R=>R.route.id===f.route.id)&&f.route.id in u&&o[f.route.id]?.shouldRevalidate||b.hasClientLoader?y=!0:p.add(f.route.id))}),p.size===0)return[];let w=xr(e,i);return y&&p.size>0&&w.searchParams.set("_routes",t.filter(f=>p.has(f.route.id)).map(f=>f.route.id).join(",")),[w.pathname+w.search]},[i,u,a,n,s,t,e,o]),d=c.useMemo(()=>pr(h,n),[h,n]),v=Cr(h);return c.createElement(c.Fragment,null,g.map(p=>c.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...r})),d.map(p=>c.createElement("link",{key:p,rel:"modulepreload",href:p,...r})),v.map(({key:p,link:y})=>c.createElement("link",{key:p,...y})))}function kr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{et&&(window.__reactRouterVersion="7.6.3")}catch{}function Pr({basename:e,children:t,window:r}){let a=c.useRef();a.current==null&&(a.current=mt({window:r,v5Compat:!0}));let n=a.current,[o,i]=c.useState({action:n.action,location:n.location}),u=c.useCallback(l=>{c.startTransition(()=>i(l))},[i]);return c.useLayoutEffect(()=>n.listen(u),[n,u]),c.createElement(rr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:n})}var tt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rt=c.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,state:u,target:l,to:s,preventScrollReset:h,viewTransition:g,...d},v){let{basename:p}=c.useContext(F),y=typeof s=="string"&&tt.test(s),w,f=!1;if(typeof s=="string"&&y&&(w=s,et))try{let O=new URL(window.location.href),A=s.startsWith("//")?new URL(O.protocol+s):new URL(s),W=M(A.pathname,p);A.origin===O.origin&&W!=null?s=W+A.search+A.hash:f=!0}catch{N(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=Ut(s,{relative:n}),[R,k,T]=Rr(a,d),U=Or(s,{replace:i,state:u,target:l,preventScrollReset:h,relative:n,viewTransition:g});function $(O){t&&t(O),O.defaultPrevented||U(O)}let _=c.createElement("a",{...d,...T,href:w||b,onClick:f||o?t:$,ref:kr(v,k),target:l,"data-discover":!y&&r==="render"?"true":void 0});return R&&!y?c.createElement(c.Fragment,null,_,c.createElement(Er,{page:b})):_});rt.displayName="Link";var Tr=c.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:u,children:l,...s},h){let g=te(i,{relative:s.relative}),d=V(),v=c.useContext(le),{navigator:p,basename:y}=c.useContext(F),w=v!=null&&Nr(g)&&u===!0,f=p.encodeLocation?p.encodeLocation(g).pathname:g.pathname,b=d.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(b=b.toLowerCase(),R=R?R.toLowerCase():null,f=f.toLowerCase()),R&&y&&(R=M(R,y)||R);const k=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let T=b===f||!n&&b.startsWith(f)&&b.charAt(k)==="/",U=R!=null&&(R===f||!n&&R.startsWith(f)&&R.charAt(f.length)==="/"),$={isActive:T,isPending:U,isTransitioning:w},_=T?t:void 0,O;typeof a=="function"?O=a($):O=[a,T?"active":null,U?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A=typeof o=="function"?o($):o;return c.createElement(rt,{...s,"aria-current":_,className:O,ref:h,style:A,to:i,viewTransition:u},typeof l=="function"?l($):l)});Tr.displayName="NavLink";var Ir=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=ae,action:u,onSubmit:l,relative:s,preventScrollReset:h,viewTransition:g,...d},v)=>{let p=Ar(),y=Dr(u,{relative:s}),w=i.toLowerCase()==="get"?"get":"post",f=typeof u=="string"&&tt.test(u),b=R=>{if(l&&l(R),R.defaultPrevented)return;R.preventDefault();let k=R.nativeEvent.submitter,T=k?.getAttribute("formmethod")||i;p(k||R.currentTarget,{fetcherKey:t,method:T,navigate:r,replace:n,state:o,relative:s,preventScrollReset:h,viewTransition:g})};return c.createElement("form",{ref:v,method:w,action:y,onSubmit:a?l:b,...d,"data-discover":!f&&e==="render"?"true":void 0})});Ir.displayName="Form";function Lr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nt(e){let t=c.useContext(J);return S(t,Lr(e)),t}function Or(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:i}={}){let u=qe(),l=V(),s=te(e,{relative:o});return c.useCallback(h=>{if(sr(h,t)){h.preventDefault();let g=r!==void 0?r:Z(l)===Z(s);u(e,{replace:g,state:a,preventScrollReset:n,relative:o,viewTransition:i})}},[l,u,s,r,a,t,e,n,o,i])}var $r=0,_r=()=>`__${String(++$r)}__`;function Ar(){let{router:e}=nt("useSubmit"),{basename:t}=c.useContext(F),r=Zt();return c.useCallback(async(a,n={})=>{let{action:o,method:i,encType:u,formData:l,body:s}=fr(a,t);if(n.navigate===!1){let h=n.fetcherKey||_r();await e.fetch(h,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:l,body:s,formMethod:n.method||i,formEncType:n.encType||u,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:l,body:s,formMethod:n.method||i,formEncType:n.encType||u,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function Dr(e,{relative:t}={}){let{basename:r}=c.useContext(F),a=c.useContext(H);S(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...te(e||".",{relative:t})},i=V();if(e==null){o.search=i.search;let u=new URLSearchParams(o.search),l=u.getAll("index");if(l.some(h=>h==="")){u.delete("index"),l.filter(g=>g).forEach(g=>u.append("index",g));let h=u.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:j([r,o.pathname])),Z(o)}function Nr(e,t={}){let r=c.useContext(ze);S(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=nt("useViewTransitionState"),n=te(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=M(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=M(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ie(n.pathname,i)!=null||ie(n.pathname,o)!=null}[...wr];const at=E.createContext({history:[],addToHistory:()=>{},popFromHistory:()=>"",replaceHistory:()=>{}}),Fr=({routes:e,children:t})=>{const r=E.useRef(["/"]),[a,n]=E.useState(["/"]),o=E.useCallback(h=>{r.current=h,n(h)},[]),i=h=>{o([...r.current,h])},u=h=>{let g="",d=[];return r.current.length===0?"/":(r.current.length<=h?(g=r.current[0],d=[g]):(d=r.current.slice(0,r.current.length-h),g=d[d.length-1]),o(d),g)},l=h=>{o(h)},s=e.map(h=>P.jsx(Xe,{path:h.path,element:h.render}));return P.jsx(at.Provider,{value:{history:a,addToHistory:i,popFromHistory:u,replaceHistory:l},children:P.jsxs(Pr,{children:[t,P.jsx(nr,{children:s})]})})},jr=()=>{const e=qe(),t=V(),r=E.useContext(at),a=E.useCallback((i,u=!0)=>{i!==t.pathname&&e(i,{replace:!0}),u&&r.addToHistory(i)},[t.pathname,e,r]),n=E.useCallback(i=>{const u=i||1,l=r.popFromHistory(u);a(l,!1)},[a,r]),o=E.useCallback(i=>{r.replaceHistory(i)},[r]);return{currentPath:t.pathname,history:r.history,goBack:n,goTo:a,replaceHistory:o}},ot=E.createContext({visibleItems:[],isItemVisible:()=>!1,showItem:()=>{},hideItem:()=>{}}),Mr=({children:e})=>{const t=E.useRef([]),[r,a]=E.useState([]),n=E.useCallback(l=>{console.log("ZAU UPDATING VISIBLE ITEMS",l),t.current=l,a(l)},[]),o=E.useCallback(l=>t.current.some(s=>s===l),[]),i=E.useCallback(l=>{o(l)||n([...t.current,l])},[o,n]),u=E.useCallback(l=>{o(l)&&n(t.current.filter(h=>h!==l))},[o,n]);return P.jsx(ot.Provider,{value:{visibleItems:r,isItemVisible:o,showItem:i,hideItem:u},children:e})},ue=()=>{const e=E.useContext(ot),t=n=>e.visibleItems.some(o=>o===n),r=n=>{e.showItem(n)},a=n=>{e.hideItem(n)};return{visibleItems:e.visibleItems,isItemVisible:t,showItem:r,hideItem:a}},Hr=({id:e,onCloseDrawer:t,drawerCloseOffset:r=15})=>{const{isItemVisible:a}=ue(),n=E.useRef(!1),o=E.useRef(null),i=E.useRef(null),u=E.useRef(null),[l,s]=E.useState(0),h=E.useRef(void 0),g=p=>{n.current=!0;const y=p.clientY;h.current=y},d=p=>{n.current=!1,h.current=void 0,s(0)},v=p=>{if(!(!o||!i||!u)&&n.current&&h.current!==void 0){const y=p.clientY,w=i.current?.clientHeight||0;let f=h.current-y;f=-f,s(f<0?0:-f),f>=w-r&&(t?.(),d())}};return{isVisible:a(e),drawerParentRef:o,drawerRef:i,drawerBottomDistance:l,handleRef:u,onDragStart:g,onDrag:v,onDragEnd:d}},Ur=e=>{const{children:t,backgroundStyles:r,contentStyles:a,handle:n}=e,{isVisible:o,drawerParentRef:i,drawerRef:u,handleRef:l,drawerBottomDistance:s,onDragStart:h,onDrag:g,onDragEnd:d}=Hr(e);return P.jsx(P.Fragment,{children:o&&P.jsx("div",{ref:i,style:{width:"100%",height:"100%",minHeight:"100vh",left:0,top:0,background:"#00000068",position:"fixed",zIndex:1e3,display:"flex",flexDirection:"column",touchAction:"none",...r},onPointerUp:d,onPointerMoveCapture:g,children:P.jsxs("div",{ref:u,style:{width:"100%",height:"fit-content",minHeight:"80px",maxHeight:"90%",background:"#ffffff",borderTopLeftRadius:"16px",borderTopRightRadius:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px",zIndex:1001,position:"absolute",bottom:`${s}px`,...a},onClick:v=>{v.stopPropagation()},children:[P.jsx("div",{ref:l,style:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0px",height:"24px",width:"100%",cursor:"pointer",...n?.styles},onPointerDown:h,children:n?.render}),t]})})})},Br=({id:e,children:t,backgroundStyles:r,contentStyles:a,onClickOutsideModal:n})=>{const{isItemVisible:o}=ue();return P.jsx(P.Fragment,{children:o(e)&&P.jsx("div",{style:{width:"100%",height:"100%",minHeight:"100vh",background:"#00000068",position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...r},onClick:()=>{n?.()},children:P.jsx("div",{style:{width:"90%",maxWidth:"375px",height:"fit-content",minHeight:"80px",maxHeight:"50%",background:"#ffffff",borderRadius:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:1001,position:"relative",padding:"24px",...a},onClick:i=>{i.stopPropagation()},children:t})})})},Vr=({id:e,children:t,styles:r,durationInSeconds:a=3})=>{const n=E.useRef(!1),{isItemVisible:o,hideItem:i}=ue();return E.useEffect(()=>{const u=o(e);n.current!==u&&(n.current=u,u&&setTimeout(()=>i(e),a*1e3))},[n,o,i]),P.jsx(P.Fragment,{children:o(e)&&P.jsx("div",{style:{width:"100px",height:"40px",background:"#534a4aff",color:"#ffffff",position:"fixed",top:"10px",left:"50%",transform:"translateX(-50%)",zIndex:1e3,borderRadius:"20px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"solid 3px #000000ff",...r},onClick:u=>{u.stopPropagation()},children:t})})},Wr=({overflowEllipsis:e,children:t,styles:r})=>P.jsx("p",{style:{maxWidth:"100%",overflow:"hidden",whiteSpace:e?"nowrap":"normal",textOverflow:"ellipsis",fontSize:"16px",fontStyle:"normal",lineHeight:"normal",color:"inherit",...r},children:t});class zr{static isScrollEnabled=()=>document.body.style.overflow==="unset"||document.body.style.overflow==="auto";static disableScroll=()=>{document.body.style.overflow="hidden"};static enableScroll=()=>{document.body.style.overflow="unset"}}class Yr{static getPascalCase=t=>t.replace(/\w+/g,function(r){return r[0].toUpperCase()+r.slice(1).toLowerCase()});static isEqual=(t,r,a=!0)=>a?t===r:t.toUpperCase()===r.toUpperCase()}const Jr=e=>E.useEffect(e,[]),qr=()=>{const e=(r,a)=>{let n=0,o=`${r}?`;for(const i in a){const u=a[i];n>0&&(o=`${o}&`),o=`${o}${i}=${u}`,n++}return o};return async(r,a)=>{const n=e(r,a);return await(await fetch(n)).json()}},it={xs:0,sm:420,md:768,lg:991,xl:1200,xxl:1440},Gr=e=>{const t={...it,...e?.breakpointConfiguration},[r,a]=E.useState(je(t)),n=()=>{a(je(t))};return E.useEffect(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[]),E.useMemo(()=>r,[r])},Kr=(e,t)=>e<t.sm?"xs":e<t.md?"sm":e<t.lg?"md":e<t.xl?"lg":e<t.xxl?"xl":"xxl",Xr=(e,t)=>e<=t.sm?"mobile":e<=t.md?"tablet":"desktop",je=e=>{const t=window.innerWidth,r=Kr(t,e),a=Xr(t,e);return{currentWidth:t,currentBreakpoint:r,currentSize:a}},Zr=e=>{const t=e.translations,r=e.language,a=o=>o[r];return{t:o=>t[o]?a(t[o]):o,getTranslation:a}};exports.Drawer=Ur;exports.FeedbackProvider=Mr;exports.Modal=Br;exports.NavigationProvider=Fr;exports.ScrollHelper=zr;exports.TextHelper=Yr;exports.Toast=Vr;exports.Typography=Wr;exports.defaultBreakpoints=it;exports.useDidMount=Jr;exports.useFeedback=ue;exports.useFetch=qr;exports.useNavigation=jr;exports.useResponsive=Gr;exports.useTranslations=Zr;
|
|
33
|
+
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let g=z(),d;if(t){let f=typeof t=="string"?Y(t):t;P(s==="/"||f.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 "${f.pathname}" was given in the \`location\` prop.`),d=f}else d=g;let v=d.pathname||"/",p=v;if(s!=="/"){let f=s.replace(/^\//,"").split("/");p="/"+v.replace(/^\//,"").split("/").slice(f.length).join("/")}let y=He(e,{pathname:p});j(h||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),j(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 x=qt(y&&y.map(f=>Object.assign({},f,{params:Object.assign({},u,f.params),pathname:F([s,n.encodeLocation?n.encodeLocation(f.pathname).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?s:F([s,n.encodeLocation?n.encodeLocation(f.pathnameBase).pathname:f.pathnameBase])})),o,r,a);return t&&x?c.createElement(Q.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...d},navigationType:"POP"}},x):x}function Wt(){let e=Qt(),t=Nt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=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:o},"ErrorBoundary")," or"," ",c.createElement("code",{style:o},"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:n},r):null,i)}var Vt=c.createElement(Wt,null),Yt=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){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?c.createElement(M.Provider,{value:this.props.routeContext},c.createElement(ve.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Jt({routeContext:e,match:t,children:r}){let a=c.useContext(J);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(M.Provider,{value:e},r)}function qt(e,t=[],r=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 n=e,o=r?.errors;if(o!=null){let l=n.findIndex(s=>s.route.id&&o?.[s.route.id]!==void 0);P(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,l+1))}let i=!1,u=-1;if(r)for(let l=0;l<n.length;l++){let s=n[l];if((s.route.HydrateFallback||s.route.hydrateFallbackElement)&&(u=l),s.route.id){let{loaderData:h,errors:g}=r,d=s.route.loader&&!h.hasOwnProperty(s.route.id)&&(!g||g[s.route.id]===void 0);if(s.route.lazy||d){i=!0,u>=0?n=n.slice(0,u+1):n=[n[0]];break}}}return n.reduceRight((l,s,h)=>{let g,d=!1,v=null,p=null;r&&(g=o&&s.route.id?o[s.route.id]:void 0,v=s.route.errorElement||Vt,i&&(u<0&&h===0?(Ke("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):u===h&&(d=!0,p=s.route.hydrateFallbackElement||null)));let y=t.concat(n.slice(0,h+1)),x=()=>{let f;return g?f=v:d?f=p:s.route.Component?f=c.createElement(s.route.Component,null):s.route.element?f=s.route.element:f=l,c.createElement(Jt,{match:s,routeContext:{outlet:l,matches:y,isDataRoute:r!=null},children:f})};return r&&(s.route.ErrorBoundary||s.route.errorElement||h===0)?c.createElement(Yt,{location:r.location,revalidation:r.revalidation,component:v,error:g,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}function xe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gt(e){let t=c.useContext(J);return P(t,xe(e)),t}function Kt(e){let t=c.useContext(le);return P(t,xe(e)),t}function Xt(e){let t=c.useContext(M);return P(t,xe(e)),t}function we(e){let t=Xt(e),r=t.matches[t.matches.length-1];return P(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Zt(){return we("useRouteId")}function Qt(){let e=c.useContext(ve),t=Kt("useRouteError"),r=we("useRouteError");return e!==void 0?e:t.errors?.[r]}function er(){let{router:e}=Gt("useNavigate"),t=we("useNavigate"),r=c.useRef(!1);return Je(()=>{r.current=!0}),c.useCallback(async(n,o={})=>{j(r.current,Ye),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var je={};function Ke(e,t,r){!t&&!je[e]&&(je[e]=!0,j(!1,r))}c.memo(tr);function tr({routes:e,future:t,state:r}){return Ge(e,void 0,r,t)}function Xe(e){P(!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 rr({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){P(!ee(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),u=c.useMemo(()=>({basename:i,navigator:n,static:o,future:{}}),[i,n,o]);typeof r=="string"&&(r=Y(r));let{pathname:l="/",search:s="",hash:h="",state:g=null,key:d="default"}=r,v=c.useMemo(()=>{let p=H(l,i);return p==null?null:{location:{pathname:p,search:s,hash:h,state:g,key:d},navigationType:a}},[i,l,s,h,g,d,a]);return j(v!=null,`<Router basename="${i}"> is not able to match the URL "${l}${s}${h}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:c.createElement(N.Provider,{value:u},c.createElement(Q.Provider,{children:t,value:v}))}function nr({children:e,location:t}){return zt(ye(e),t)}function ye(e,t=[]){let r=[];return c.Children.forEach(e,(a,n)=>{if(!c.isValidElement(a))return;let o=[...t,n];if(a.type===c.Fragment){r.push.apply(r,ye(a.props.children,o));return}P(a.type===Xe,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),P(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=ye(a.props.children,o)),r.push(i)}),r}var ae="get",oe="application/x-www-form-urlencoded";function se(e){return e!=null&&typeof e.tagName=="string"}function ar(e){return se(e)&&e.tagName.toLowerCase()==="button"}function or(e){return se(e)&&e.tagName.toLowerCase()==="form"}function ir(e){return se(e)&&e.tagName.toLowerCase()==="input"}function lr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sr(e,t){return e.button===0&&(!t||t==="_self")&&!lr(e)}var ne=null;function ur(){if(ne===null)try{new FormData(document.createElement("form"),0),ne=!1}catch{ne=!0}return ne}var cr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pe(e){return e!=null&&!cr.has(e)?(j(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oe}"`),null):e}function fr(e,t){let r,a,n,o,i;if(or(e)){let u=e.getAttribute("action");a=u?H(u,t):null,r=e.getAttribute("method")||ae,n=pe(e.getAttribute("enctype"))||oe,o=new FormData(e)}else if(ar(e)||ir(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||u.getAttribute("action");if(a=l?H(l,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||ae,n=pe(e.getAttribute("formenctype"))||pe(u.getAttribute("enctype"))||oe,o=new FormData(u,e),!ur()){let{name:s,type:h,value:g}=e;if(h==="image"){let d=s?`${s}.`:"";o.append(`${d}x`,"0"),o.append(`${d}y`,"0")}else s&&o.append(s,g)}}else{if(se(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ae,a=null,n=oe,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function dr(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 hr(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 mr(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await dr(o,r);return i.links?i.links():[]}return[]}));return vr(a.flat(1).filter(hr).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Ne(e,t,r,a,n,o){let i=(l,s)=>r[s]?l.route.id!==r[s].route.id:!0,u=(l,s)=>r[s].pathname!==l.pathname||r[s].route.path?.endsWith("*")&&r[s].params["*"]!==l.params["*"];return o==="assets"?t.filter((l,s)=>i(l,s)||u(l,s)):o==="data"?t.filter((l,s)=>{let h=a.routes[l.route.id];if(!h||!h.hasLoader)return!1;if(i(l,s)||u(l,s))return!0;if(l.route.shouldRevalidate){let g=l.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function pr(e,t,{includeHydrateFallback:r}={}){return gr(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function gr(e){return[...new Set(e)]}function yr(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function vr(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(yr(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var xr=new Set([100,101,204,205]);function wr(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&H(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function Ze(){let e=c.useContext(J);return be(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function br(){let e=c.useContext(le);return be(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Re=c.createContext(void 0);Re.displayName="FrameworkContext";function Qe(){let e=c.useContext(Re);return be(e,"You must render this element inside a <HydratedRouter> element"),e}function Rr(e,t){let r=c.useContext(Re),[a,n]=c.useState(!1),[o,i]=c.useState(!1),{onFocus:u,onBlur:l,onMouseEnter:s,onMouseLeave:h,onTouchStart:g}=t,d=c.useRef(null);c.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let y=f=>{f.forEach(b=>{i(b.isIntersecting)})},x=new IntersectionObserver(y,{threshold:.5});return d.current&&x.observe(d.current),()=>{x.disconnect()}}},[e]),c.useEffect(()=>{if(a){let y=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(y)}}},[a]);let v=()=>{n(!0)},p=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,d,{}]:[o,d,{onFocus:X(u,v),onBlur:X(l,p),onMouseEnter:X(s,v),onMouseLeave:X(h,p),onTouchStart:X(g,v)}]:[!1,d,{}]}function X(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Er({page:e,...t}){let{router:r}=Ze(),a=c.useMemo(()=>He(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?c.createElement(Sr,{page:e,matches:a,...t}):null}function Cr(e){let{manifest:t,routeModules:r}=Qe(),[a,n]=c.useState([]);return c.useEffect(()=>{let o=!1;return mr(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Sr({page:e,matches:t,...r}){let a=z(),{manifest:n,routeModules:o}=Qe(),{basename:i}=Ze(),{loaderData:u,matches:l}=br(),s=c.useMemo(()=>Ne(e,t,l,n,a,"data"),[e,t,l,n,a]),h=c.useMemo(()=>Ne(e,t,l,n,a,"assets"),[e,t,l,n,a]),g=c.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let p=new Set,y=!1;if(t.forEach(f=>{let b=n.routes[f.route.id];!b||!b.hasLoader||(!s.some(R=>R.route.id===f.route.id)&&f.route.id in u&&o[f.route.id]?.shouldRevalidate||b.hasClientLoader?y=!0:p.add(f.route.id))}),p.size===0)return[];let x=wr(e,i);return y&&p.size>0&&x.searchParams.set("_routes",t.filter(f=>p.has(f.route.id)).map(f=>f.route.id).join(",")),[x.pathname+x.search]},[i,u,a,n,s,t,e,o]),d=c.useMemo(()=>pr(h,n),[h,n]),v=Cr(h);return c.createElement(c.Fragment,null,g.map(p=>c.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...r})),d.map(p=>c.createElement("link",{key:p,rel:"modulepreload",href:p,...r})),v.map(({key:p,link:y})=>c.createElement("link",{key:p,...y})))}function Pr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{et&&(window.__reactRouterVersion="7.6.3")}catch{}function kr({basename:e,children:t,window:r}){let a=c.useRef();a.current==null&&(a.current=mt({window:r,v5Compat:!0}));let n=a.current,[o,i]=c.useState({action:n.action,location:n.location}),u=c.useCallback(l=>{c.startTransition(()=>i(l))},[i]);return c.useLayoutEffect(()=>n.listen(u),[n,u]),c.createElement(rr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:n})}var tt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rt=c.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,state:u,target:l,to:s,preventScrollReset:h,viewTransition:g,...d},v){let{basename:p}=c.useContext(N),y=typeof s=="string"&&tt.test(s),x,f=!1;if(typeof s=="string"&&y&&(x=s,et))try{let O=new URL(window.location.href),D=s.startsWith("//")?new URL(O.protocol+s):new URL(s),W=H(D.pathname,p);D.origin===O.origin&&W!=null?s=W+D.search+D.hash:f=!0}catch{j(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=Ut(s,{relative:n}),[R,k,T]=Rr(a,d),U=Or(s,{replace:i,state:u,target:l,preventScrollReset:h,relative:n,viewTransition:g});function $(O){t&&t(O),O.defaultPrevented||U(O)}let _=c.createElement("a",{...d,...T,href:x||b,onClick:f||o?t:$,ref:Pr(v,k),target:l,"data-discover":!y&&r==="render"?"true":void 0});return R&&!y?c.createElement(c.Fragment,null,_,c.createElement(Er,{page:b})):_});rt.displayName="Link";var Tr=c.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:u,children:l,...s},h){let g=te(i,{relative:s.relative}),d=z(),v=c.useContext(le),{navigator:p,basename:y}=c.useContext(N),x=v!=null&&jr(g)&&u===!0,f=p.encodeLocation?p.encodeLocation(g).pathname:g.pathname,b=d.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(b=b.toLowerCase(),R=R?R.toLowerCase():null,f=f.toLowerCase()),R&&y&&(R=H(R,y)||R);const k=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let T=b===f||!n&&b.startsWith(f)&&b.charAt(k)==="/",U=R!=null&&(R===f||!n&&R.startsWith(f)&&R.charAt(f.length)==="/"),$={isActive:T,isPending:U,isTransitioning:x},_=T?t:void 0,O;typeof a=="function"?O=a($):O=[a,T?"active":null,U?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let D=typeof o=="function"?o($):o;return c.createElement(rt,{...s,"aria-current":_,className:O,ref:h,style:D,to:i,viewTransition:u},typeof l=="function"?l($):l)});Tr.displayName="NavLink";var Ir=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=ae,action:u,onSubmit:l,relative:s,preventScrollReset:h,viewTransition:g,...d},v)=>{let p=Dr(),y=Ar(u,{relative:s}),x=i.toLowerCase()==="get"?"get":"post",f=typeof u=="string"&&tt.test(u),b=R=>{if(l&&l(R),R.defaultPrevented)return;R.preventDefault();let k=R.nativeEvent.submitter,T=k?.getAttribute("formmethod")||i;p(k||R.currentTarget,{fetcherKey:t,method:T,navigate:r,replace:n,state:o,relative:s,preventScrollReset:h,viewTransition:g})};return c.createElement("form",{ref:v,method:x,action:y,onSubmit:a?l:b,...d,"data-discover":!f&&e==="render"?"true":void 0})});Ir.displayName="Form";function Lr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nt(e){let t=c.useContext(J);return P(t,Lr(e)),t}function Or(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:i}={}){let u=qe(),l=z(),s=te(e,{relative:o});return c.useCallback(h=>{if(sr(h,t)){h.preventDefault();let g=r!==void 0?r:Z(l)===Z(s);u(e,{replace:g,state:a,preventScrollReset:n,relative:o,viewTransition:i})}},[l,u,s,r,a,t,e,n,o,i])}var $r=0,_r=()=>`__${String(++$r)}__`;function Dr(){let{router:e}=nt("useSubmit"),{basename:t}=c.useContext(N),r=Zt();return c.useCallback(async(a,n={})=>{let{action:o,method:i,encType:u,formData:l,body:s}=fr(a,t);if(n.navigate===!1){let h=n.fetcherKey||_r();await e.fetch(h,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:l,body:s,formMethod:n.method||i,formEncType:n.encType||u,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:l,body:s,formMethod:n.method||i,formEncType:n.encType||u,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function Ar(e,{relative:t}={}){let{basename:r}=c.useContext(N),a=c.useContext(M);P(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...te(e||".",{relative:t})},i=z();if(e==null){o.search=i.search;let u=new URLSearchParams(o.search),l=u.getAll("index");if(l.some(h=>h==="")){u.delete("index"),l.filter(g=>g).forEach(g=>u.append("index",g));let h=u.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:F([r,o.pathname])),Z(o)}function jr(e,t={}){let r=c.useContext(Ve);P(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=nt("useViewTransitionState"),n=te(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=H(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ie(n.pathname,i)!=null||ie(n.pathname,o)!=null}[...xr];const at=E.createContext({history:[],addToHistory:()=>{},popFromHistory:()=>"",replaceHistory:()=>{}}),Nr=({routes:e,children:t})=>{const r=E.useRef(["/"]),[a,n]=E.useState(["/"]),o=E.useCallback(h=>{r.current=h,n(h)},[]),i=h=>{o([...r.current,h])},u=h=>{let g="",d=[];return r.current.length===0?"/":(r.current.length<=h?(g=r.current[0],d=[g]):(d=r.current.slice(0,r.current.length-h),g=d[d.length-1]),o(d),g)},l=h=>{o(h)},s=e.map(h=>S.jsx(Xe,{path:h.path,element:h.render}));return S.jsx(at.Provider,{value:{history:a,addToHistory:i,popFromHistory:u,replaceHistory:l},children:S.jsxs(kr,{children:[t,S.jsx(nr,{children:s})]})})},Fr=()=>{const e=qe(),t=z(),r=E.useContext(at),a=E.useCallback((i,u=!0)=>{i!==t.pathname&&e(i,{replace:!0}),u&&r.addToHistory(i)},[t.pathname,e,r]),n=E.useCallback(i=>{const u=i||1,l=r.popFromHistory(u);a(l,!1)},[a,r]),o=E.useCallback(i=>{r.replaceHistory(i)},[r]);return{currentPath:t.pathname,history:r.history,goBack:n,goTo:a,replaceHistory:o}},ot=E.createContext({visibleItems:[],isItemVisible:()=>!1,showItem:()=>{},hideItem:()=>{}}),Hr=({children:e})=>{const t=E.useRef([]),[r,a]=E.useState([]),n=E.useCallback(l=>{console.log("ZAU UPDATING VISIBLE ITEMS",l),t.current=l,a(l)},[]),o=E.useCallback(l=>t.current.some(s=>s===l),[]),i=E.useCallback(l=>{o(l)||n([...t.current,l])},[o,n]),u=E.useCallback(l=>{o(l)&&n(t.current.filter(h=>h!==l))},[o,n]);return S.jsx(ot.Provider,{value:{visibleItems:r,isItemVisible:o,showItem:i,hideItem:u},children:e})},ue=()=>{const e=E.useContext(ot),t=n=>e.visibleItems.some(o=>o===n),r=n=>{e.showItem(n)},a=n=>{e.hideItem(n)};return{visibleItems:e.visibleItems,isItemVisible:t,showItem:r,hideItem:a}},Mr=({id:e,onCloseDrawer:t,drawerCloseOffset:r=15})=>{const{isItemVisible:a}=ue(),n=E.useRef(!1),o=E.useRef(null),i=E.useRef(null),u=E.useRef(null),[l,s]=E.useState(0),h=E.useRef(void 0),g=p=>{n.current=!0;const y=p.clientY;h.current=y},d=p=>{n.current=!1,h.current=void 0,s(0)},v=p=>{if(!(!o||!i||!u)&&n.current&&h.current!==void 0){const y=p.clientY,x=i.current?.clientHeight||0;let f=h.current-y;f=-f,s(f<0?0:-f),f>=x-r&&(t?.(),d())}};return{isVisible:a(e),drawerParentRef:o,drawerRef:i,drawerBottomDistance:l,handleRef:u,onDragStart:g,onDrag:v,onDragEnd:d}},Ur=e=>{const{children:t,backgroundStyles:r,contentStyles:a,handle:n}=e,{isVisible:o,drawerParentRef:i,drawerRef:u,handleRef:l,drawerBottomDistance:s,onDragStart:h,onDrag:g,onDragEnd:d}=Mr(e);return S.jsx(S.Fragment,{children:o&&S.jsx("div",{ref:i,style:{width:"100%",height:"100%",minHeight:"100vh",left:0,top:0,background:"#00000068",position:"fixed",zIndex:1e3,display:"flex",flexDirection:"column",touchAction:"none",...r},onPointerUp:d,onPointerMoveCapture:g,children:S.jsxs("div",{ref:u,style:{width:"100%",height:"fit-content",minHeight:"80px",maxHeight:"90%",background:"#ffffff",borderTopLeftRadius:"16px",borderTopRightRadius:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px",zIndex:1001,position:"absolute",bottom:`${s}px`,...a},onClick:v=>{v.stopPropagation()},children:[S.jsx("div",{ref:l,style:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0px",height:"24px",width:"100%",cursor:"pointer",...n?.styles},onPointerDown:h,children:n?.render}),t]})})})},Br=({id:e,children:t,backgroundStyles:r,contentStyles:a,onClickOutsideModal:n})=>{const{isItemVisible:o}=ue();return S.jsx(S.Fragment,{children:o(e)&&S.jsx("div",{style:{width:"100%",height:"100%",minHeight:"100vh",background:"#00000068",position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...r},onClick:()=>{n?.()},children:S.jsx("div",{style:{width:"90%",maxWidth:"375px",height:"fit-content",minHeight:"80px",maxHeight:"50%",background:"#ffffff",borderRadius:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:1001,position:"relative",padding:"24px",...a},onClick:i=>{i.stopPropagation()},children:t})})})},zr=({header:e,containerStyles:t,pageStyles:r,children:a,footer:n,floatingContent:o})=>S.jsxs("div",{"data-testid":"page-container",style:{minHeight:"100vh",width:"100%",minWidth:"100%",overflow:"hidden",position:"relative",boxSizing:"border-box",top:0,bottom:0,left:0,right:0,display:"flex",flexDirection:"column",...t},children:[S.jsxs("div",{"data-testid":"page-layout",style:{minHeight:"100%",width:"100%",overflowY:"auto",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[e&&S.jsx("div",{"data-testid":"page-header",style:{width:"100%",zIndex:99,position:e.visibility==="fixed"?"relative":"fixed",top:0,left:0,right:0,display:"flex",flexDirection:"row",height:"fit-content",boxSizing:"border-box",...e.styles},children:e.content}),S.jsx("div",{style:{width:"100%",flex:1,minHeight:"fit-content",padding:"24px",boxSizing:"border-box",...r},children:a})]}),n&&S.jsx("div",{"data-testid":"page-footer",style:{width:"100%",zIndex:99,position:n.visibility==="fixed"?"relative":"fixed",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",height:"fit-content",boxSizing:"border-box",...n.styles},children:n.content})]}),Wr=({id:e,children:t,styles:r,durationInSeconds:a=3})=>{const n=E.useRef(!1),{isItemVisible:o,hideItem:i}=ue();return E.useEffect(()=>{const u=o(e);n.current!==u&&(n.current=u,u&&setTimeout(()=>i(e),a*1e3))},[n,o,i]),S.jsx(S.Fragment,{children:o(e)&&S.jsx("div",{style:{width:"100px",height:"40px",background:"#534a4aff",color:"#ffffff",position:"fixed",top:"10px",left:"50%",transform:"translateX(-50%)",zIndex:1e3,borderRadius:"20px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"solid 3px #000000ff",...r},onClick:u=>{u.stopPropagation()},children:t})})},Vr=({overflowEllipsis:e,children:t,styles:r})=>S.jsx("p",{style:{maxWidth:"100%",overflow:"hidden",whiteSpace:e?"nowrap":"normal",textOverflow:"ellipsis",fontSize:"16px",fontStyle:"normal",lineHeight:"normal",color:"inherit",...r},children:t});class Yr{static isScrollEnabled=()=>document.body.style.overflow==="unset"||document.body.style.overflow==="auto";static disableScroll=()=>{document.body.style.overflow="hidden"};static enableScroll=()=>{document.body.style.overflow="unset"}}class Jr{static getPascalCase=t=>t.replace(/\w+/g,function(r){return r[0].toUpperCase()+r.slice(1).toLowerCase()});static isEqual=(t,r,a=!0)=>a?t===r:t.toUpperCase()===r.toUpperCase()}const qr=e=>E.useEffect(e,[]),Gr=()=>{const e=(r,a)=>{let n=0,o=`${r}?`;for(const i in a){const u=a[i];n>0&&(o=`${o}&`),o=`${o}${i}=${u}`,n++}return o};return async(r,a)=>{const n=e(r,a);return await(await fetch(n)).json()}},it={xs:0,sm:420,md:768,lg:991,xl:1200,xxl:1440},Kr=e=>{const t={...it,...e?.breakpointConfiguration},[r,a]=E.useState(Fe(t)),n=()=>{a(Fe(t))};return E.useEffect(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[]),E.useMemo(()=>r,[r])},Xr=(e,t)=>e<t.sm?"xs":e<t.md?"sm":e<t.lg?"md":e<t.xl?"lg":e<t.xxl?"xl":"xxl",Zr=(e,t)=>e<=t.sm?"mobile":e<=t.md?"tablet":"desktop",Fe=e=>{const t=window.innerWidth,r=Xr(t,e),a=Zr(t,e);return{currentWidth:t,currentBreakpoint:r,currentSize:a}},Qr=e=>{const t=e.translations,r=e.language,a=o=>o[r];return{t:o=>t[o]?a(t[o]):o,getTranslation:a}};exports.Drawer=Ur;exports.FeedbackProvider=Hr;exports.Modal=Br;exports.NavigationProvider=Nr;exports.PageLayout=zr;exports.ScrollHelper=Yr;exports.TextHelper=Jr;exports.Toast=Wr;exports.Typography=Vr;exports.defaultBreakpoints=it;exports.useDidMount=qr;exports.useFeedback=ue;exports.useFetch=Gr;exports.useNavigation=Fr;exports.useResponsive=Kr;exports.useTranslations=Qr;
|
package/dist/index.es.js
CHANGED
|
@@ -74,7 +74,7 @@ function ht() {
|
|
|
74
74
|
return (m.displayName || "Context") + ".Provider";
|
|
75
75
|
case b:
|
|
76
76
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
77
|
-
case
|
|
77
|
+
case P:
|
|
78
78
|
var w = m.render;
|
|
79
79
|
return m = m.displayName, m || (m = w.displayName || w.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
80
80
|
case O:
|
|
@@ -198,10 +198,10 @@ function ht() {
|
|
|
198
198
|
else g(L);
|
|
199
199
|
if (Ee.call(w, "key")) {
|
|
200
200
|
L = e(m);
|
|
201
|
-
var
|
|
201
|
+
var V = Object.keys(w).filter(function(ut) {
|
|
202
202
|
return ut !== "key";
|
|
203
203
|
});
|
|
204
|
-
I = 0 <
|
|
204
|
+
I = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", Te[L + I] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
@@ -210,7 +210,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
211
|
I,
|
|
212
212
|
L,
|
|
213
|
-
|
|
213
|
+
V,
|
|
214
214
|
L
|
|
215
215
|
), Te[L + I] = !0);
|
|
216
216
|
}
|
|
@@ -236,7 +236,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
236
236
|
function g(m) {
|
|
237
237
|
typeof m == "object" && m !== null && m.$$typeof === v && m._store && (m._store.validated = 1);
|
|
238
238
|
}
|
|
239
|
-
var d = C, v = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), R = Symbol.for("react.context"),
|
|
239
|
+
var d = C, v = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), R = Symbol.for("react.context"), P = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), A = Symbol.for("react.client.reference"), W = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Ee = Object.prototype.hasOwnProperty, st = Array.isArray, ue = console.createTask ? console.createTask : function() {
|
|
240
240
|
return null;
|
|
241
241
|
};
|
|
242
242
|
d = {
|
|
@@ -279,7 +279,7 @@ var $e;
|
|
|
279
279
|
function mt() {
|
|
280
280
|
return $e || ($e = 1, process.env.NODE_ENV === "production" ? re.exports = dt() : re.exports = ht()), re.exports;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var S = mt(), K = {}, Oe;
|
|
283
283
|
function pt() {
|
|
284
284
|
if (Oe) return K;
|
|
285
285
|
Oe = 1, Object.defineProperty(K, "__esModule", { value: !0 }), K.parse = i, K.serialize = s;
|
|
@@ -298,18 +298,18 @@ function pt() {
|
|
|
298
298
|
const b = d.indexOf("=", f);
|
|
299
299
|
if (b === -1)
|
|
300
300
|
break;
|
|
301
|
-
const R = d.indexOf(";", f),
|
|
302
|
-
if (b >
|
|
301
|
+
const R = d.indexOf(";", f), P = R === -1 ? y : R;
|
|
302
|
+
if (b > P) {
|
|
303
303
|
f = d.lastIndexOf(";", b - 1) + 1;
|
|
304
304
|
continue;
|
|
305
305
|
}
|
|
306
306
|
const T = u(d, f, b), U = l(d, b, T), O = d.slice(T, U);
|
|
307
307
|
if (p[O] === void 0) {
|
|
308
|
-
let _ = u(d, b + 1,
|
|
308
|
+
let _ = u(d, b + 1, P), $ = l(d, P, _);
|
|
309
309
|
const A = x(d.slice(_, $));
|
|
310
310
|
p[O] = A;
|
|
311
311
|
}
|
|
312
|
-
f =
|
|
312
|
+
f = P + 1;
|
|
313
313
|
} while (f < y);
|
|
314
314
|
return p;
|
|
315
315
|
}
|
|
@@ -437,7 +437,7 @@ function gt(e = {}) {
|
|
|
437
437
|
e
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function k(e, t) {
|
|
441
441
|
if (e === !1 || e === null || typeof e > "u")
|
|
442
442
|
throw new Error(t);
|
|
443
443
|
}
|
|
@@ -506,13 +506,13 @@ function vt(e, t, r, a = {}) {
|
|
|
506
506
|
u = "PUSH";
|
|
507
507
|
let b = pe(y.location, x, f);
|
|
508
508
|
s = h() + 1;
|
|
509
|
-
let R = Ae(b, s),
|
|
509
|
+
let R = Ae(b, s), P = y.createHref(b);
|
|
510
510
|
try {
|
|
511
|
-
i.pushState(R, "",
|
|
511
|
+
i.pushState(R, "", P);
|
|
512
512
|
} catch (T) {
|
|
513
513
|
if (T instanceof DOMException && T.name === "DataCloneError")
|
|
514
514
|
throw T;
|
|
515
|
-
n.location.assign(
|
|
515
|
+
n.location.assign(P);
|
|
516
516
|
}
|
|
517
517
|
o && l && l({ action: u, location: y.location, delta: 1 });
|
|
518
518
|
}
|
|
@@ -520,8 +520,8 @@ function vt(e, t, r, a = {}) {
|
|
|
520
520
|
u = "REPLACE";
|
|
521
521
|
let b = pe(y.location, x, f);
|
|
522
522
|
s = h();
|
|
523
|
-
let R = Ae(b, s),
|
|
524
|
-
i.replaceState(R, "",
|
|
523
|
+
let R = Ae(b, s), P = y.createHref(b);
|
|
524
|
+
i.replaceState(R, "", P), o && l && l({ action: u, location: y.location, delta: 0 });
|
|
525
525
|
}
|
|
526
526
|
function p(x) {
|
|
527
527
|
return xt(x);
|
|
@@ -562,7 +562,7 @@ function vt(e, t, r, a = {}) {
|
|
|
562
562
|
}
|
|
563
563
|
function xt(e, t = !1) {
|
|
564
564
|
let r = "http://localhost";
|
|
565
|
-
typeof window < "u" && (r = window.location.origin !== "null" ? window.location.origin : window.location.href),
|
|
565
|
+
typeof window < "u" && (r = window.location.origin !== "null" ? window.location.origin : window.location.href), k(r, "No window.location.(origin|href) available to create URL");
|
|
566
566
|
let a = typeof e == "string" ? e : Z(e);
|
|
567
567
|
return a = a.replace(/ $/, "%20"), !t && a.startsWith("//") && (a = r + a), new URL(a, r);
|
|
568
568
|
}
|
|
@@ -594,12 +594,12 @@ function Be(e, t = [], r = [], a = "") {
|
|
|
594
594
|
childrenIndex: i,
|
|
595
595
|
route: o
|
|
596
596
|
};
|
|
597
|
-
l.relativePath.startsWith("/") && (
|
|
597
|
+
l.relativePath.startsWith("/") && (k(
|
|
598
598
|
l.relativePath.startsWith(a),
|
|
599
599
|
`Absolute route path "${l.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
600
600
|
), l.relativePath = l.relativePath.slice(a.length));
|
|
601
|
-
let s =
|
|
602
|
-
o.children && o.children.length > 0 && (
|
|
601
|
+
let s = F([a, l.relativePath]), h = r.concat(l);
|
|
602
|
+
o.children && o.children.length > 0 && (k(
|
|
603
603
|
// Our types know better, but runtime JS may not!
|
|
604
604
|
// @ts-expect-error
|
|
605
605
|
o.index !== !0,
|
|
@@ -614,17 +614,17 @@ function Be(e, t = [], r = [], a = "") {
|
|
|
614
614
|
if (o.path === "" || !o.path?.includes("?"))
|
|
615
615
|
n(o, i);
|
|
616
616
|
else
|
|
617
|
-
for (let u of
|
|
617
|
+
for (let u of ze(o.path))
|
|
618
618
|
n(o, i, u);
|
|
619
619
|
}), t;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function ze(e) {
|
|
622
622
|
let t = e.split("/");
|
|
623
623
|
if (t.length === 0) return [];
|
|
624
624
|
let [r, ...a] = t, n = r.endsWith("?"), o = r.replace(/\?$/, "");
|
|
625
625
|
if (a.length === 0)
|
|
626
626
|
return n ? [o, ""] : [o];
|
|
627
|
-
let i =
|
|
627
|
+
let i = ze(a.join("/")), u = [];
|
|
628
628
|
return u.push(
|
|
629
629
|
...i.map(
|
|
630
630
|
(l) => l === "" ? o : [o, l].join("/")
|
|
@@ -681,12 +681,12 @@ function Lt(e, t, r = !1) {
|
|
|
681
681
|
Object.assign(n, g.params), i.push({
|
|
682
682
|
// TODO: Can this as be avoided?
|
|
683
683
|
params: n,
|
|
684
|
-
pathname:
|
|
684
|
+
pathname: F([o, g.pathname]),
|
|
685
685
|
pathnameBase: Nt(
|
|
686
|
-
|
|
686
|
+
F([o, g.pathnameBase])
|
|
687
687
|
),
|
|
688
688
|
route: d
|
|
689
|
-
}), g.pathnameBase !== "/" && (o =
|
|
689
|
+
}), g.pathnameBase !== "/" && (o = F([o, g.pathnameBase]));
|
|
690
690
|
}
|
|
691
691
|
return i;
|
|
692
692
|
}
|
|
@@ -752,8 +752,8 @@ function _t(e, t = "/") {
|
|
|
752
752
|
} = typeof e == "string" ? Y(e) : e;
|
|
753
753
|
return {
|
|
754
754
|
pathname: r ? r.startsWith("/") ? r : At(r, t) : t,
|
|
755
|
-
search:
|
|
756
|
-
hash:
|
|
755
|
+
search: jt(a),
|
|
756
|
+
hash: Ft(n)
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
759
|
function At(e, t) {
|
|
@@ -778,15 +778,15 @@ function We(e) {
|
|
|
778
778
|
(r, a) => a === t.length - 1 ? r.pathname : r.pathnameBase
|
|
779
779
|
);
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function Ve(e, t, r, a = !1) {
|
|
782
782
|
let n;
|
|
783
|
-
typeof e == "string" ? n = Y(e) : (n = { ...e },
|
|
783
|
+
typeof e == "string" ? n = Y(e) : (n = { ...e }, k(
|
|
784
784
|
!n.pathname || !n.pathname.includes("?"),
|
|
785
785
|
he("?", "pathname", "search", n)
|
|
786
|
-
),
|
|
786
|
+
), k(
|
|
787
787
|
!n.pathname || !n.pathname.includes("#"),
|
|
788
788
|
he("#", "pathname", "hash", n)
|
|
789
|
-
),
|
|
789
|
+
), k(
|
|
790
790
|
!n.search || !n.search.includes("#"),
|
|
791
791
|
he("#", "search", "hash", n)
|
|
792
792
|
));
|
|
@@ -806,7 +806,7 @@ function ze(e, t, r, a = !1) {
|
|
|
806
806
|
let l = _t(n, u), s = i && i !== "/" && i.endsWith("/"), h = (o || i === ".") && r.endsWith("/");
|
|
807
807
|
return !l.pathname.endsWith("/") && (s || h) && (l.pathname += "/"), l;
|
|
808
808
|
}
|
|
809
|
-
var
|
|
809
|
+
var F = (e) => e.join("/").replace(/\/\/+/g, "/"), Nt = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), jt = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Ft = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
810
810
|
function Ht(e) {
|
|
811
811
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
812
812
|
}
|
|
@@ -838,10 +838,10 @@ var Ut = c.createContext(
|
|
|
838
838
|
Ut.displayName = "Fetchers";
|
|
839
839
|
var Bt = c.createContext(null);
|
|
840
840
|
Bt.displayName = "Await";
|
|
841
|
-
var
|
|
841
|
+
var j = c.createContext(
|
|
842
842
|
null
|
|
843
843
|
);
|
|
844
|
-
|
|
844
|
+
j.displayName = "Navigation";
|
|
845
845
|
var Q = c.createContext(
|
|
846
846
|
null
|
|
847
847
|
);
|
|
@@ -854,21 +854,21 @@ var M = c.createContext({
|
|
|
854
854
|
M.displayName = "Route";
|
|
855
855
|
var ye = c.createContext(null);
|
|
856
856
|
ye.displayName = "RouteError";
|
|
857
|
-
function
|
|
858
|
-
|
|
857
|
+
function zt(e, { relative: t } = {}) {
|
|
858
|
+
k(
|
|
859
859
|
ee(),
|
|
860
860
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
861
861
|
// router loaded. We can help them understand how to avoid that.
|
|
862
862
|
"useHref() may be used only in the context of a <Router> component."
|
|
863
863
|
);
|
|
864
|
-
let { basename: r, navigator: a } = c.useContext(
|
|
865
|
-
return r !== "/" && (u = o === "/" ? r :
|
|
864
|
+
let { basename: r, navigator: a } = c.useContext(j), { hash: n, pathname: o, search: i } = te(e, { relative: t }), u = o;
|
|
865
|
+
return r !== "/" && (u = o === "/" ? r : F([r, o])), a.createHref({ pathname: u, search: i, hash: n });
|
|
866
866
|
}
|
|
867
867
|
function ee() {
|
|
868
868
|
return c.useContext(Q) != null;
|
|
869
869
|
}
|
|
870
|
-
function
|
|
871
|
-
return
|
|
870
|
+
function z() {
|
|
871
|
+
return k(
|
|
872
872
|
ee(),
|
|
873
873
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
874
874
|
// router loaded. We can help them understand how to avoid that.
|
|
@@ -877,20 +877,20 @@ function V() {
|
|
|
877
877
|
}
|
|
878
878
|
var qe = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
879
879
|
function Ge(e) {
|
|
880
|
-
c.useContext(
|
|
880
|
+
c.useContext(j).static || c.useLayoutEffect(e);
|
|
881
881
|
}
|
|
882
882
|
function Ke() {
|
|
883
883
|
let { isDataRoute: e } = c.useContext(M);
|
|
884
884
|
return e ? rr() : Wt();
|
|
885
885
|
}
|
|
886
886
|
function Wt() {
|
|
887
|
-
|
|
887
|
+
k(
|
|
888
888
|
ee(),
|
|
889
889
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
890
890
|
// router loaded. We can help them understand how to avoid that.
|
|
891
891
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
892
892
|
);
|
|
893
|
-
let e = c.useContext(J), { basename: t, navigator: r } = c.useContext(
|
|
893
|
+
let e = c.useContext(J), { basename: t, navigator: r } = c.useContext(j), { matches: a } = c.useContext(M), { pathname: n } = z(), o = JSON.stringify(We(a)), i = c.useRef(!1);
|
|
894
894
|
return Ge(() => {
|
|
895
895
|
i.current = !0;
|
|
896
896
|
}), c.useCallback(
|
|
@@ -900,13 +900,13 @@ function Wt() {
|
|
|
900
900
|
r.go(l);
|
|
901
901
|
return;
|
|
902
902
|
}
|
|
903
|
-
let h =
|
|
903
|
+
let h = Ve(
|
|
904
904
|
l,
|
|
905
905
|
JSON.parse(o),
|
|
906
906
|
n,
|
|
907
907
|
s.relative === "path"
|
|
908
908
|
);
|
|
909
|
-
e == null && t !== "/" && (h.pathname = h.pathname === "/" ? t :
|
|
909
|
+
e == null && t !== "/" && (h.pathname = h.pathname === "/" ? t : F([t, h.pathname])), (s.replace ? r.replace : r.push)(
|
|
910
910
|
h,
|
|
911
911
|
s.state,
|
|
912
912
|
s
|
|
@@ -923,9 +923,9 @@ function Wt() {
|
|
|
923
923
|
}
|
|
924
924
|
c.createContext(null);
|
|
925
925
|
function te(e, { relative: t } = {}) {
|
|
926
|
-
let { matches: r } = c.useContext(M), { pathname: a } =
|
|
926
|
+
let { matches: r } = c.useContext(M), { pathname: a } = z(), n = JSON.stringify(We(r));
|
|
927
927
|
return c.useMemo(
|
|
928
|
-
() =>
|
|
928
|
+
() => Ve(
|
|
929
929
|
e,
|
|
930
930
|
JSON.parse(n),
|
|
931
931
|
a,
|
|
@@ -934,17 +934,17 @@ function te(e, { relative: t } = {}) {
|
|
|
934
934
|
[e, n, a, t]
|
|
935
935
|
);
|
|
936
936
|
}
|
|
937
|
-
function
|
|
937
|
+
function Vt(e, t) {
|
|
938
938
|
return Xe(e, t);
|
|
939
939
|
}
|
|
940
940
|
function Xe(e, t, r, a) {
|
|
941
|
-
|
|
941
|
+
k(
|
|
942
942
|
ee(),
|
|
943
943
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
944
944
|
// router loaded. We can help them understand how to avoid that.
|
|
945
945
|
"useRoutes() may be used only in the context of a <Router> component."
|
|
946
946
|
);
|
|
947
|
-
let { navigator: n } = c.useContext(
|
|
947
|
+
let { navigator: n } = c.useContext(j), { matches: o } = c.useContext(M), i = o[o.length - 1], u = i ? i.params : {}, l = i ? i.pathname : "/", s = i ? i.pathnameBase : "/", h = i && i.route;
|
|
948
948
|
{
|
|
949
949
|
let f = h && h.path || "";
|
|
950
950
|
Ze(
|
|
@@ -955,10 +955,10 @@ function Xe(e, t, r, a) {
|
|
|
955
955
|
Please change the parent <Route path="${f}"> to <Route path="${f === "/" ? "*" : `${f}/*`}">.`
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
let g =
|
|
958
|
+
let g = z(), d;
|
|
959
959
|
if (t) {
|
|
960
960
|
let f = typeof t == "string" ? Y(t) : t;
|
|
961
|
-
|
|
961
|
+
k(
|
|
962
962
|
s === "/" || f.pathname?.startsWith(s),
|
|
963
963
|
`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 "${f.pathname}" was given in the \`location\` prop.`
|
|
964
964
|
), d = f;
|
|
@@ -981,12 +981,12 @@ Please change the parent <Route path="${f}"> to <Route path="${f === "/" ? "*" :
|
|
|
981
981
|
y && y.map(
|
|
982
982
|
(f) => Object.assign({}, f, {
|
|
983
983
|
params: Object.assign({}, u, f.params),
|
|
984
|
-
pathname:
|
|
984
|
+
pathname: F([
|
|
985
985
|
s,
|
|
986
986
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
987
987
|
n.encodeLocation ? n.encodeLocation(f.pathname).pathname : f.pathname
|
|
988
988
|
]),
|
|
989
|
-
pathnameBase: f.pathnameBase === "/" ? s :
|
|
989
|
+
pathnameBase: f.pathnameBase === "/" ? s : F([
|
|
990
990
|
s,
|
|
991
991
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
992
992
|
n.encodeLocation ? n.encodeLocation(f.pathnameBase).pathname : f.pathnameBase
|
|
@@ -1082,7 +1082,7 @@ function Kt(e, t = [], r = null, a = null) {
|
|
|
1082
1082
|
let l = n.findIndex(
|
|
1083
1083
|
(s) => s.route.id && o?.[s.route.id] !== void 0
|
|
1084
1084
|
);
|
|
1085
|
-
|
|
1085
|
+
k(
|
|
1086
1086
|
l >= 0,
|
|
1087
1087
|
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
1088
1088
|
o
|
|
@@ -1144,19 +1144,19 @@ function ve(e) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
function Xt(e) {
|
|
1146
1146
|
let t = c.useContext(J);
|
|
1147
|
-
return
|
|
1147
|
+
return k(t, ve(e)), t;
|
|
1148
1148
|
}
|
|
1149
1149
|
function Zt(e) {
|
|
1150
1150
|
let t = c.useContext(le);
|
|
1151
|
-
return
|
|
1151
|
+
return k(t, ve(e)), t;
|
|
1152
1152
|
}
|
|
1153
1153
|
function Qt(e) {
|
|
1154
1154
|
let t = c.useContext(M);
|
|
1155
|
-
return
|
|
1155
|
+
return k(t, ve(e)), t;
|
|
1156
1156
|
}
|
|
1157
1157
|
function xe(e) {
|
|
1158
1158
|
let t = Qt(e), r = t.matches[t.matches.length - 1];
|
|
1159
|
-
return
|
|
1159
|
+
return k(
|
|
1160
1160
|
r.route.id,
|
|
1161
1161
|
`${e} can only be used on routes that contain a unique "id"`
|
|
1162
1162
|
), r.route.id;
|
|
@@ -1207,7 +1207,7 @@ function nr({
|
|
|
1207
1207
|
return Xe(e, void 0, r, t);
|
|
1208
1208
|
}
|
|
1209
1209
|
function Qe(e) {
|
|
1210
|
-
|
|
1210
|
+
k(
|
|
1211
1211
|
!1,
|
|
1212
1212
|
"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."
|
|
1213
1213
|
);
|
|
@@ -1220,7 +1220,7 @@ function ar({
|
|
|
1220
1220
|
navigator: n,
|
|
1221
1221
|
static: o = !1
|
|
1222
1222
|
}) {
|
|
1223
|
-
|
|
1223
|
+
k(
|
|
1224
1224
|
!ee(),
|
|
1225
1225
|
"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
|
|
1226
1226
|
);
|
|
@@ -1256,13 +1256,13 @@ function ar({
|
|
|
1256
1256
|
return N(
|
|
1257
1257
|
v != null,
|
|
1258
1258
|
`<Router basename="${i}"> is not able to match the URL "${l}${s}${h}" because it does not start with the basename, so the <Router> won't render anything.`
|
|
1259
|
-
), v == null ? null : /* @__PURE__ */ c.createElement(
|
|
1259
|
+
), v == null ? null : /* @__PURE__ */ c.createElement(j.Provider, { value: u }, /* @__PURE__ */ c.createElement(Q.Provider, { children: t, value: v }));
|
|
1260
1260
|
}
|
|
1261
1261
|
function or({
|
|
1262
1262
|
children: e,
|
|
1263
1263
|
location: t
|
|
1264
1264
|
}) {
|
|
1265
|
-
return
|
|
1265
|
+
return Vt(ge(e), t);
|
|
1266
1266
|
}
|
|
1267
1267
|
function ge(e, t = []) {
|
|
1268
1268
|
let r = [];
|
|
@@ -1277,10 +1277,10 @@ function ge(e, t = []) {
|
|
|
1277
1277
|
);
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
1280
|
-
|
|
1280
|
+
k(
|
|
1281
1281
|
a.type === Qe,
|
|
1282
1282
|
`[${typeof a.type == "string" ? a.type : a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`
|
|
1283
|
-
),
|
|
1283
|
+
), k(
|
|
1284
1284
|
!a.props.index || !a.props.children,
|
|
1285
1285
|
"An index route cannot have child routes."
|
|
1286
1286
|
);
|
|
@@ -1423,7 +1423,7 @@ async function gr(e, t, r) {
|
|
|
1423
1423
|
)
|
|
1424
1424
|
);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function je(e, t, r, a, n, o) {
|
|
1427
1427
|
let i = (l, s) => r[s] ? l.route.id !== r[s].route.id : !0, u = (l, s) => (
|
|
1428
1428
|
// param change, /users/123 -> /users/456
|
|
1429
1429
|
r[s].pathname !== l.pathname || // splat param changed, which is not present in match.path
|
|
@@ -1588,8 +1588,8 @@ function Pr({
|
|
|
1588
1588
|
matches: t,
|
|
1589
1589
|
...r
|
|
1590
1590
|
}) {
|
|
1591
|
-
let a =
|
|
1592
|
-
() =>
|
|
1591
|
+
let a = z(), { manifest: n, routeModules: o } = tt(), { basename: i } = et(), { loaderData: u, matches: l } = Er(), s = c.useMemo(
|
|
1592
|
+
() => je(
|
|
1593
1593
|
e,
|
|
1594
1594
|
t,
|
|
1595
1595
|
l,
|
|
@@ -1599,7 +1599,7 @@ function Pr({
|
|
|
1599
1599
|
),
|
|
1600
1600
|
[e, t, l, n, a]
|
|
1601
1601
|
), h = c.useMemo(
|
|
1602
|
-
() =>
|
|
1602
|
+
() => je(
|
|
1603
1603
|
e,
|
|
1604
1604
|
t,
|
|
1605
1605
|
l,
|
|
@@ -1695,7 +1695,7 @@ var nt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, at = c.forwardRef(
|
|
|
1695
1695
|
viewTransition: g,
|
|
1696
1696
|
...d
|
|
1697
1697
|
}, v) {
|
|
1698
|
-
let { basename: p } = c.useContext(
|
|
1698
|
+
let { basename: p } = c.useContext(j), y = typeof s == "string" && nt.test(s), x, f = !1;
|
|
1699
1699
|
if (typeof s == "string" && y && (x = s, rt))
|
|
1700
1700
|
try {
|
|
1701
1701
|
let $ = new URL(window.location.href), A = s.startsWith("//") ? new URL($.protocol + s) : new URL(s), W = H(A.pathname, p);
|
|
@@ -1706,7 +1706,7 @@ var nt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, at = c.forwardRef(
|
|
|
1706
1706
|
`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1707
1707
|
);
|
|
1708
1708
|
}
|
|
1709
|
-
let b =
|
|
1709
|
+
let b = zt(s, { relative: n }), [R, P, T] = Cr(
|
|
1710
1710
|
a,
|
|
1711
1711
|
d
|
|
1712
1712
|
), U = _r(s, {
|
|
@@ -1729,7 +1729,7 @@ var nt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, at = c.forwardRef(
|
|
|
1729
1729
|
...T,
|
|
1730
1730
|
href: x || b,
|
|
1731
1731
|
onClick: f || o ? t : O,
|
|
1732
|
-
ref: Tr(v,
|
|
1732
|
+
ref: Tr(v, P),
|
|
1733
1733
|
target: l,
|
|
1734
1734
|
"data-discover": !y && r === "render" ? "true" : void 0
|
|
1735
1735
|
}
|
|
@@ -1751,12 +1751,12 @@ var Lr = c.forwardRef(
|
|
|
1751
1751
|
children: l,
|
|
1752
1752
|
...s
|
|
1753
1753
|
}, h) {
|
|
1754
|
-
let g = te(i, { relative: s.relative }), d =
|
|
1754
|
+
let g = te(i, { relative: s.relative }), d = z(), v = c.useContext(le), { navigator: p, basename: y } = c.useContext(j), x = v != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1755
1755
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1756
|
-
|
|
1756
|
+
Fr(g) && u === !0, f = p.encodeLocation ? p.encodeLocation(g).pathname : g.pathname, b = d.pathname, R = v && v.navigation && v.navigation.location ? v.navigation.location.pathname : null;
|
|
1757
1757
|
r || (b = b.toLowerCase(), R = R ? R.toLowerCase() : null, f = f.toLowerCase()), R && y && (R = H(R, y) || R);
|
|
1758
|
-
const
|
|
1759
|
-
let T = b === f || !n && b.startsWith(f) && b.charAt(
|
|
1758
|
+
const P = f !== "/" && f.endsWith("/") ? f.length - 1 : f.length;
|
|
1759
|
+
let T = b === f || !n && b.startsWith(f) && b.charAt(P) === "/", U = R != null && (R === f || !n && R.startsWith(f) && R.charAt(f.length) === "/"), O = {
|
|
1760
1760
|
isActive: T,
|
|
1761
1761
|
isPending: U,
|
|
1762
1762
|
isTransitioning: x
|
|
@@ -1800,11 +1800,11 @@ var $r = c.forwardRef(
|
|
|
1800
1800
|
viewTransition: g,
|
|
1801
1801
|
...d
|
|
1802
1802
|
}, v) => {
|
|
1803
|
-
let p = Nr(), y =
|
|
1803
|
+
let p = Nr(), y = jr(u, { relative: s }), x = i.toLowerCase() === "get" ? "get" : "post", f = typeof u == "string" && nt.test(u), b = (R) => {
|
|
1804
1804
|
if (l && l(R), R.defaultPrevented) return;
|
|
1805
1805
|
R.preventDefault();
|
|
1806
|
-
let
|
|
1807
|
-
p(
|
|
1806
|
+
let P = R.nativeEvent.submitter, T = P?.getAttribute("formmethod") || i;
|
|
1807
|
+
p(P || R.currentTarget, {
|
|
1808
1808
|
fetcherKey: t,
|
|
1809
1809
|
method: T,
|
|
1810
1810
|
navigate: r,
|
|
@@ -1834,7 +1834,7 @@ function Or(e) {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
function ot(e) {
|
|
1836
1836
|
let t = c.useContext(J);
|
|
1837
|
-
return
|
|
1837
|
+
return k(t, Or(e)), t;
|
|
1838
1838
|
}
|
|
1839
1839
|
function _r(e, {
|
|
1840
1840
|
target: t,
|
|
@@ -1844,7 +1844,7 @@ function _r(e, {
|
|
|
1844
1844
|
relative: o,
|
|
1845
1845
|
viewTransition: i
|
|
1846
1846
|
} = {}) {
|
|
1847
|
-
let u = Ke(), l =
|
|
1847
|
+
let u = Ke(), l = z(), s = te(e, { relative: o });
|
|
1848
1848
|
return c.useCallback(
|
|
1849
1849
|
(h) => {
|
|
1850
1850
|
if (cr(h, t)) {
|
|
@@ -1878,7 +1878,7 @@ function Nr() {
|
|
|
1878
1878
|
let { router: e } = ot(
|
|
1879
1879
|
"useSubmit"
|
|
1880
1880
|
/* UseSubmit */
|
|
1881
|
-
), { basename: t } = c.useContext(
|
|
1881
|
+
), { basename: t } = c.useContext(j), r = er();
|
|
1882
1882
|
return c.useCallback(
|
|
1883
1883
|
async (a, n = {}) => {
|
|
1884
1884
|
let { action: o, method: i, encType: u, formData: l, body: s } = hr(
|
|
@@ -1912,10 +1912,10 @@ function Nr() {
|
|
|
1912
1912
|
[e, t, r]
|
|
1913
1913
|
);
|
|
1914
1914
|
}
|
|
1915
|
-
function
|
|
1916
|
-
let { basename: r } = c.useContext(
|
|
1917
|
-
|
|
1918
|
-
let [n] = a.matches.slice(-1), o = { ...te(e || ".", { relative: t }) }, i =
|
|
1915
|
+
function jr(e, { relative: t } = {}) {
|
|
1916
|
+
let { basename: r } = c.useContext(j), a = c.useContext(M);
|
|
1917
|
+
k(a, "useFormAction must be used inside a RouteContext");
|
|
1918
|
+
let [n] = a.matches.slice(-1), o = { ...te(e || ".", { relative: t }) }, i = z();
|
|
1919
1919
|
if (e == null) {
|
|
1920
1920
|
o.search = i.search;
|
|
1921
1921
|
let u = new URLSearchParams(o.search), l = u.getAll("index");
|
|
@@ -1925,11 +1925,11 @@ function Fr(e, { relative: t } = {}) {
|
|
|
1925
1925
|
o.search = h ? `?${h}` : "";
|
|
1926
1926
|
}
|
|
1927
1927
|
}
|
|
1928
|
-
return (!e || e === ".") && n.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r :
|
|
1928
|
+
return (!e || e === ".") && n.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r : F([r, o.pathname])), Z(o);
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1930
|
+
function Fr(e, t = {}) {
|
|
1931
1931
|
let r = c.useContext(Je);
|
|
1932
|
-
|
|
1932
|
+
k(
|
|
1933
1933
|
r != null,
|
|
1934
1934
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1935
1935
|
);
|
|
@@ -1968,8 +1968,8 @@ const it = C.createContext({
|
|
|
1968
1968
|
), g = d[d.length - 1]), o(d), g);
|
|
1969
1969
|
}, l = (h) => {
|
|
1970
1970
|
o(h);
|
|
1971
|
-
}, s = e.map((h) => /* @__PURE__ */
|
|
1972
|
-
return /* @__PURE__ */
|
|
1971
|
+
}, s = e.map((h) => /* @__PURE__ */ S.jsx(Qe, { path: h.path, element: h.render }));
|
|
1972
|
+
return /* @__PURE__ */ S.jsx(
|
|
1973
1973
|
it.Provider,
|
|
1974
1974
|
{
|
|
1975
1975
|
value: {
|
|
@@ -1978,14 +1978,14 @@ const it = C.createContext({
|
|
|
1978
1978
|
popFromHistory: u,
|
|
1979
1979
|
replaceHistory: l
|
|
1980
1980
|
},
|
|
1981
|
-
children: /* @__PURE__ */
|
|
1981
|
+
children: /* @__PURE__ */ S.jsxs(Ir, { children: [
|
|
1982
1982
|
t,
|
|
1983
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ S.jsx(or, { children: s })
|
|
1984
1984
|
] })
|
|
1985
1985
|
}
|
|
1986
1986
|
);
|
|
1987
|
-
},
|
|
1988
|
-
const e = Ke(), t =
|
|
1987
|
+
}, Vr = () => {
|
|
1988
|
+
const e = Ke(), t = z(), r = He(it), a = C.useCallback(
|
|
1989
1989
|
(i, u = !0) => {
|
|
1990
1990
|
i !== t.pathname && e(i, { replace: !0 }), u && r.addToHistory(i);
|
|
1991
1991
|
},
|
|
@@ -2034,7 +2034,7 @@ const it = C.createContext({
|
|
|
2034
2034
|
},
|
|
2035
2035
|
[o, n]
|
|
2036
2036
|
);
|
|
2037
|
-
return /* @__PURE__ */
|
|
2037
|
+
return /* @__PURE__ */ S.jsx(
|
|
2038
2038
|
lt.Provider,
|
|
2039
2039
|
{
|
|
2040
2040
|
value: {
|
|
@@ -2099,7 +2099,7 @@ const it = C.createContext({
|
|
|
2099
2099
|
onDrag: g,
|
|
2100
2100
|
onDragEnd: d
|
|
2101
2101
|
} = Hr(e);
|
|
2102
|
-
return /* @__PURE__ */
|
|
2102
|
+
return /* @__PURE__ */ S.jsx(S.Fragment, { children: o && /* @__PURE__ */ S.jsx(
|
|
2103
2103
|
"div",
|
|
2104
2104
|
{
|
|
2105
2105
|
ref: i,
|
|
@@ -2119,7 +2119,7 @@ const it = C.createContext({
|
|
|
2119
2119
|
},
|
|
2120
2120
|
onPointerUp: d,
|
|
2121
2121
|
onPointerMoveCapture: g,
|
|
2122
|
-
children: /* @__PURE__ */
|
|
2122
|
+
children: /* @__PURE__ */ S.jsxs(
|
|
2123
2123
|
"div",
|
|
2124
2124
|
{
|
|
2125
2125
|
ref: u,
|
|
@@ -2145,7 +2145,7 @@ const it = C.createContext({
|
|
|
2145
2145
|
v.stopPropagation();
|
|
2146
2146
|
},
|
|
2147
2147
|
children: [
|
|
2148
|
-
/* @__PURE__ */
|
|
2148
|
+
/* @__PURE__ */ S.jsx(
|
|
2149
2149
|
"div",
|
|
2150
2150
|
{
|
|
2151
2151
|
ref: l,
|
|
@@ -2178,7 +2178,7 @@ const it = C.createContext({
|
|
|
2178
2178
|
onClickOutsideModal: n
|
|
2179
2179
|
}) => {
|
|
2180
2180
|
const { isItemVisible: o } = Re();
|
|
2181
|
-
return /* @__PURE__ */
|
|
2181
|
+
return /* @__PURE__ */ S.jsx(S.Fragment, { children: o(e) && /* @__PURE__ */ S.jsx(
|
|
2182
2182
|
"div",
|
|
2183
2183
|
{
|
|
2184
2184
|
style: {
|
|
@@ -2200,7 +2200,7 @@ const it = C.createContext({
|
|
|
2200
2200
|
onClick: () => {
|
|
2201
2201
|
n?.();
|
|
2202
2202
|
},
|
|
2203
|
-
children: /* @__PURE__ */
|
|
2203
|
+
children: /* @__PURE__ */ S.jsx(
|
|
2204
2204
|
"div",
|
|
2205
2205
|
{
|
|
2206
2206
|
style: {
|
|
@@ -2229,6 +2229,105 @@ const it = C.createContext({
|
|
|
2229
2229
|
}
|
|
2230
2230
|
) });
|
|
2231
2231
|
}, Gr = ({
|
|
2232
|
+
header: e,
|
|
2233
|
+
containerStyles: t,
|
|
2234
|
+
pageStyles: r,
|
|
2235
|
+
children: a,
|
|
2236
|
+
footer: n,
|
|
2237
|
+
floatingContent: o
|
|
2238
|
+
}) => /* @__PURE__ */ S.jsxs(
|
|
2239
|
+
"div",
|
|
2240
|
+
{
|
|
2241
|
+
"data-testid": "page-container",
|
|
2242
|
+
style: {
|
|
2243
|
+
minHeight: "100vh",
|
|
2244
|
+
width: "100%",
|
|
2245
|
+
minWidth: "100%",
|
|
2246
|
+
overflow: "hidden",
|
|
2247
|
+
position: "relative",
|
|
2248
|
+
boxSizing: "border-box",
|
|
2249
|
+
top: 0,
|
|
2250
|
+
bottom: 0,
|
|
2251
|
+
left: 0,
|
|
2252
|
+
right: 0,
|
|
2253
|
+
display: "flex",
|
|
2254
|
+
flexDirection: "column",
|
|
2255
|
+
...t
|
|
2256
|
+
},
|
|
2257
|
+
children: [
|
|
2258
|
+
/* @__PURE__ */ S.jsxs(
|
|
2259
|
+
"div",
|
|
2260
|
+
{
|
|
2261
|
+
"data-testid": "page-layout",
|
|
2262
|
+
style: {
|
|
2263
|
+
minHeight: "100%",
|
|
2264
|
+
width: "100%",
|
|
2265
|
+
overflowY: "auto",
|
|
2266
|
+
display: "flex",
|
|
2267
|
+
flexDirection: "column",
|
|
2268
|
+
boxSizing: "border-box"
|
|
2269
|
+
},
|
|
2270
|
+
children: [
|
|
2271
|
+
e && /* @__PURE__ */ S.jsx(
|
|
2272
|
+
"div",
|
|
2273
|
+
{
|
|
2274
|
+
"data-testid": "page-header",
|
|
2275
|
+
style: {
|
|
2276
|
+
width: "100%",
|
|
2277
|
+
zIndex: 99,
|
|
2278
|
+
position: e.visibility === "fixed" ? "relative" : "fixed",
|
|
2279
|
+
top: 0,
|
|
2280
|
+
left: 0,
|
|
2281
|
+
right: 0,
|
|
2282
|
+
display: "flex",
|
|
2283
|
+
flexDirection: "row",
|
|
2284
|
+
height: "fit-content",
|
|
2285
|
+
boxSizing: "border-box",
|
|
2286
|
+
...e.styles
|
|
2287
|
+
},
|
|
2288
|
+
children: e.content
|
|
2289
|
+
}
|
|
2290
|
+
),
|
|
2291
|
+
/* @__PURE__ */ S.jsx(
|
|
2292
|
+
"div",
|
|
2293
|
+
{
|
|
2294
|
+
style: {
|
|
2295
|
+
width: "100%",
|
|
2296
|
+
flex: 1,
|
|
2297
|
+
minHeight: "fit-content",
|
|
2298
|
+
padding: "24px",
|
|
2299
|
+
boxSizing: "border-box",
|
|
2300
|
+
...r
|
|
2301
|
+
},
|
|
2302
|
+
children: a
|
|
2303
|
+
}
|
|
2304
|
+
)
|
|
2305
|
+
]
|
|
2306
|
+
}
|
|
2307
|
+
),
|
|
2308
|
+
n && /* @__PURE__ */ S.jsx(
|
|
2309
|
+
"div",
|
|
2310
|
+
{
|
|
2311
|
+
"data-testid": "page-footer",
|
|
2312
|
+
style: {
|
|
2313
|
+
width: "100%",
|
|
2314
|
+
zIndex: 99,
|
|
2315
|
+
position: n.visibility === "fixed" ? "relative" : "fixed",
|
|
2316
|
+
bottom: 0,
|
|
2317
|
+
left: 0,
|
|
2318
|
+
right: 0,
|
|
2319
|
+
display: "flex",
|
|
2320
|
+
flexDirection: "row",
|
|
2321
|
+
height: "fit-content",
|
|
2322
|
+
boxSizing: "border-box",
|
|
2323
|
+
...n.styles
|
|
2324
|
+
},
|
|
2325
|
+
children: n.content
|
|
2326
|
+
}
|
|
2327
|
+
)
|
|
2328
|
+
]
|
|
2329
|
+
}
|
|
2330
|
+
), Kr = ({
|
|
2232
2331
|
id: e,
|
|
2233
2332
|
children: t,
|
|
2234
2333
|
styles: r,
|
|
@@ -2238,7 +2337,7 @@ const it = C.createContext({
|
|
|
2238
2337
|
return C.useEffect(() => {
|
|
2239
2338
|
const u = o(e);
|
|
2240
2339
|
n.current !== u && (n.current = u, u && setTimeout(() => i(e), a * 1e3));
|
|
2241
|
-
}, [n, o, i]), /* @__PURE__ */
|
|
2340
|
+
}, [n, o, i]), /* @__PURE__ */ S.jsx(S.Fragment, { children: o(e) && /* @__PURE__ */ S.jsx(
|
|
2242
2341
|
"div",
|
|
2243
2342
|
{
|
|
2244
2343
|
style: {
|
|
@@ -2265,11 +2364,11 @@ const it = C.createContext({
|
|
|
2265
2364
|
children: t
|
|
2266
2365
|
}
|
|
2267
2366
|
) });
|
|
2268
|
-
},
|
|
2367
|
+
}, Xr = ({
|
|
2269
2368
|
overflowEllipsis: e,
|
|
2270
2369
|
children: t,
|
|
2271
2370
|
styles: r
|
|
2272
|
-
}) => /* @__PURE__ */
|
|
2371
|
+
}) => /* @__PURE__ */ S.jsx(
|
|
2273
2372
|
"p",
|
|
2274
2373
|
{
|
|
2275
2374
|
style: {
|
|
@@ -2286,7 +2385,7 @@ const it = C.createContext({
|
|
|
2286
2385
|
children: t
|
|
2287
2386
|
}
|
|
2288
2387
|
);
|
|
2289
|
-
class
|
|
2388
|
+
class Zr {
|
|
2290
2389
|
static isScrollEnabled = () => document.body.style.overflow === "unset" || document.body.style.overflow === "auto";
|
|
2291
2390
|
static disableScroll = () => {
|
|
2292
2391
|
document.body.style.overflow = "hidden";
|
|
@@ -2295,13 +2394,13 @@ class Xr {
|
|
|
2295
2394
|
document.body.style.overflow = "unset";
|
|
2296
2395
|
};
|
|
2297
2396
|
}
|
|
2298
|
-
class
|
|
2397
|
+
class Qr {
|
|
2299
2398
|
static getPascalCase = (t) => t.replace(/\w+/g, function(r) {
|
|
2300
2399
|
return r[0].toUpperCase() + r.slice(1).toLowerCase();
|
|
2301
2400
|
});
|
|
2302
2401
|
static isEqual = (t, r, a = !0) => a ? t === r : t.toUpperCase() === r.toUpperCase();
|
|
2303
2402
|
}
|
|
2304
|
-
const
|
|
2403
|
+
const en = (e) => Me(e, []), tn = () => {
|
|
2305
2404
|
const e = (r, a) => {
|
|
2306
2405
|
let n = 0, o = `${r}?`;
|
|
2307
2406
|
for (const i in a) {
|
|
@@ -2321,22 +2420,22 @@ const Qr = (e) => Me(e, []), en = () => {
|
|
|
2321
2420
|
lg: 991,
|
|
2322
2421
|
xl: 1200,
|
|
2323
2422
|
xxl: 1440
|
|
2324
|
-
},
|
|
2423
|
+
}, rn = (e) => {
|
|
2325
2424
|
const t = {
|
|
2326
2425
|
...Mr,
|
|
2327
2426
|
...e?.breakpointConfiguration
|
|
2328
2427
|
}, [r, a] = ct(
|
|
2329
|
-
|
|
2428
|
+
Fe(t)
|
|
2330
2429
|
), n = () => {
|
|
2331
|
-
a(
|
|
2430
|
+
a(Fe(t));
|
|
2332
2431
|
};
|
|
2333
2432
|
return Me(() => (window.addEventListener("resize", n), () => {
|
|
2334
2433
|
window.removeEventListener("resize", n);
|
|
2335
2434
|
}), []), ft(() => r, [r]);
|
|
2336
|
-
}, Ur = (e, t) => e < t.sm ? "xs" : e < t.md ? "sm" : e < t.lg ? "md" : e < t.xl ? "lg" : e < t.xxl ? "xl" : "xxl", Br = (e, t) => e <= t.sm ? "mobile" : e <= t.md ? "tablet" : "desktop",
|
|
2435
|
+
}, Ur = (e, t) => e < t.sm ? "xs" : e < t.md ? "sm" : e < t.lg ? "md" : e < t.xl ? "lg" : e < t.xxl ? "xl" : "xxl", Br = (e, t) => e <= t.sm ? "mobile" : e <= t.md ? "tablet" : "desktop", Fe = (e) => {
|
|
2337
2436
|
const t = window.innerWidth, r = Ur(t, e), a = Br(t, e);
|
|
2338
2437
|
return { currentWidth: t, currentBreakpoint: r, currentSize: a };
|
|
2339
|
-
},
|
|
2438
|
+
}, nn = (e) => {
|
|
2340
2439
|
const t = e.translations, r = e.language, a = (o) => o[r];
|
|
2341
2440
|
return {
|
|
2342
2441
|
t: (o) => t[o] ? a(t[o]) : o,
|
|
@@ -2348,15 +2447,16 @@ export {
|
|
|
2348
2447
|
Yr as FeedbackProvider,
|
|
2349
2448
|
qr as Modal,
|
|
2350
2449
|
Wr as NavigationProvider,
|
|
2351
|
-
|
|
2352
|
-
Zr as
|
|
2353
|
-
|
|
2354
|
-
Kr as
|
|
2450
|
+
Gr as PageLayout,
|
|
2451
|
+
Zr as ScrollHelper,
|
|
2452
|
+
Qr as TextHelper,
|
|
2453
|
+
Kr as Toast,
|
|
2454
|
+
Xr as Typography,
|
|
2355
2455
|
Mr as defaultBreakpoints,
|
|
2356
|
-
|
|
2456
|
+
en as useDidMount,
|
|
2357
2457
|
Re as useFeedback,
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2458
|
+
tn as useFetch,
|
|
2459
|
+
Vr as useNavigation,
|
|
2460
|
+
rn as useResponsive,
|
|
2461
|
+
nn as useTranslations
|
|
2362
2462
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eliseubatista99/react-scaffold-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library which provides basic components, hooks, helpers and providers to easily build a React application and avoid repeating the usual code.",
|
|
6
6
|
"main": "dist/index.cjs.js",
|