@eliseubatista99/react-scaffold-core 0.1.0
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 -0
- package/dist/components/drawer/drawer.d.ts +15 -0
- package/dist/components/drawer/drawer.hook.d.ts +12 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/stories/drawer.stories.d.ts +20 -0
- package/dist/components/drawer/stories/setup.d.ts +2 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/modal.d.ts +9 -0
- package/dist/components/modal/stories/modal.stories.d.ts +16 -0
- package/dist/components/modal/stories/setup.d.ts +2 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/stories/setup.d.ts +2 -0
- package/dist/components/toast/stories/toast.stories.d.ts +17 -0
- package/dist/components/toast/toast.d.ts +8 -0
- package/dist/components/typography/index.d.ts +1 -0
- package/dist/components/typography/stories/typography.stories.d.ts +21 -0
- package/dist/components/typography/typography.d.ts +7 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/scrollHelper/index.d.ts +1 -0
- package/dist/helpers/scrollHelper/scrollHelper.d.ts +5 -0
- package/dist/helpers/scrollHelper/stories/scrollHelper.stories.d.ts +13 -0
- package/dist/helpers/scrollHelper/stories/setup.d.ts +1 -0
- package/dist/helpers/text/index.d.ts +1 -0
- package/dist/helpers/text/stories/setup.d.ts +5 -0
- package/dist/helpers/text/stories/textHelper.stories.d.ts +16 -0
- package/dist/helpers/text/textHelper.d.ts +4 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useDidMount/index.d.ts +1 -0
- package/dist/hooks/useDidMount/useDidMount.d.ts +1 -0
- package/dist/hooks/useFetch/index.d.ts +1 -0
- package/dist/hooks/useFetch/stories/setup.d.ts +5 -0
- package/dist/hooks/useFetch/stories/useFetch.stories.d.ts +16 -0
- package/dist/hooks/useFetch/useFetch.d.ts +3 -0
- package/dist/hooks/useResponsive/index.d.ts +1 -0
- package/dist/hooks/useResponsive/stories/setup.d.ts +1 -0
- package/dist/hooks/useResponsive/stories/useResponsive.stories.d.ts +13 -0
- package/dist/hooks/useResponsive/useResponsive.d.ts +4 -0
- package/dist/index.cjs.js +33 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +2344 -0
- package/dist/providers/feedback/feedbackContext.d.ts +8 -0
- package/dist/providers/feedback/feedbackProvider.d.ts +5 -0
- package/dist/providers/feedback/index.d.ts +2 -0
- package/dist/providers/feedback/stories/feedback.stories.d.ts +13 -0
- package/dist/providers/feedback/stories/setup.d.ts +4 -0
- package/dist/providers/feedback/useFeedback.d.ts +6 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/navigation/index.d.ts +2 -0
- package/dist/providers/navigation/navigationContext.d.ts +8 -0
- package/dist/providers/navigation/navigationProvider.d.ts +10 -0
- package/dist/providers/navigation/stories/navigation.stories.d.ts +18 -0
- package/dist/providers/navigation/stories/setup.d.ts +5 -0
- package/dist/providers/navigation/useNavigation.d.ts +7 -0
- package/dist/vite.svg +1 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +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.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
export interface DrawerHandleProps {
|
|
3
|
+
render: React.ReactNode;
|
|
4
|
+
styles?: CSSProperties;
|
|
5
|
+
}
|
|
6
|
+
export interface DrawerProps {
|
|
7
|
+
id: string;
|
|
8
|
+
drawerCloseOffset?: number;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
backgroundStyles?: CSSProperties;
|
|
11
|
+
contentStyles?: CSSProperties;
|
|
12
|
+
handle?: DrawerHandleProps;
|
|
13
|
+
onCloseDrawer?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const Drawer: (props: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DrawerProps } from './drawer';
|
|
3
|
+
export declare const useDrawerHelper: ({ id, onCloseDrawer, drawerCloseOffset, }: DrawerProps) => {
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
drawerParentRef: React.RefObject<HTMLDivElement | null>;
|
|
6
|
+
drawerRef: React.RefObject<HTMLDivElement | null>;
|
|
7
|
+
drawerBottomDistance: number;
|
|
8
|
+
handleRef: React.RefObject<HTMLDivElement | null>;
|
|
9
|
+
onDragStart: (e: React.PointerEvent<HTMLDivElement>) => void;
|
|
10
|
+
onDrag: (e: React.PointerEvent<HTMLDivElement>) => void;
|
|
11
|
+
onDragEnd: (_: React.PointerEvent<HTMLDivElement>) => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './drawer';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('../drawer').DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {
|
|
10
|
+
id: string;
|
|
11
|
+
drawerCloseOffset: number;
|
|
12
|
+
children: import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const Primary: Story;
|
|
18
|
+
export declare const WithCustomHandle: Story;
|
|
19
|
+
export declare const WithCustomOverlay: Story;
|
|
20
|
+
export declare const WithCustomContentStyles: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './modal';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
id: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
backgroundStyles?: React.CSSProperties;
|
|
6
|
+
contentStyles?: React.CSSProperties;
|
|
7
|
+
onClickOutsideModal?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Modal: ({ id, children, backgroundStyles, contentStyles, onClickOutsideModal, }: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('../modal').ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {
|
|
10
|
+
id: string;
|
|
11
|
+
children: import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './toast';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('../toast').ToastProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {
|
|
10
|
+
id: string;
|
|
11
|
+
children: import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Primary: Story;
|
|
17
|
+
export declare const WithCustomStyles: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ToastProps {
|
|
3
|
+
id: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
styles?: React.CSSProperties;
|
|
6
|
+
durationInSeconds?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const Toast: ({ id, children, styles, durationInSeconds, }: ToastProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './typography';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ overflowEllipsis, children, styles, }: import('../typography').TypographyProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {
|
|
10
|
+
overflowEllipsis: false;
|
|
11
|
+
children: string;
|
|
12
|
+
styles: {
|
|
13
|
+
maxWidth: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Base: Story;
|
|
20
|
+
export declare const WithEllipsis: Story;
|
|
21
|
+
export declare const WithCustomStyles: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface TypographyProps {
|
|
3
|
+
overflowEllipsis?: boolean;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
styles?: CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare const Typography: ({ overflowEllipsis, children, styles, }: TypographyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './scrollHelper';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ScrollHelperStoriesSetup: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './textHelper';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('./setup').TextHelperStoriesSetupProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {
|
|
10
|
+
text1: string;
|
|
11
|
+
text2: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDidMount';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDidMount: (arg: () => void) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useFetch';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('./setup').useFetchStoriesSetupProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const JsonPlaceholder: Story;
|
|
16
|
+
export declare const Pikachu: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useResponsive';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UseResponsiveStoriesSetup: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const JsonPlaceholder: Story;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react");function lt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const c=lt(E);var re={exports:{}},q={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ie;function st(){if(Ie)return q;Ie=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,n,o){var i=null;if(o!==void 0&&(i=""+o),n.key!==void 0&&(i=""+n.key),"key"in n){o={};for(var u in n)u!=="key"&&(o[u]=n[u])}else o=n;return n=o.ref,{$$typeof:e,type:a,key:i,ref:n!==void 0?n:null,props:o}}return q.Fragment=t,q.jsx=r,q.jsxs=r,q}var G={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Le;function ut(){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===A?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case g:return"Fragment";case f:return"Profiler";case w: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 x=m.render;return m=m.displayName,m||(m=x.displayName||x.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case $:return x=m.displayName||null,x!==null?x:e(m.type)||"Memo";case _:x=m._payload,m=m._init;try{return e(m(x))}catch{}}return null}function t(m){return""+m}function r(m){try{t(m);var x=!1}catch{x=!0}if(x){x=console;var C=x.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return C.call(x,"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===g)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===_)return"<...>";try{var x=e(m);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function n(){var m=V.A;return m===null?null:m.getOwner()}function o(){return Error("react-stack-top-frame")}function i(m){if(Ee.call(m,"key")){var x=Object.getOwnPropertyDescriptor(m,"key").get;if(x&&x.isReactWarning)return!1}return m.key!==void 0}function u(m,x){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)",x))}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,x,C,I,B,D,fe,de){return C=D.ref,m={$$typeof:v,type:m,key:x,props:D,_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,x,C,I,B,D,fe,de){var L=x.children;if(L!==void 0)if(I)if(ot(L)){for(I=0;I<L.length;I++)y(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 y(L);if(Ee.call(x,"key")){L=e(m);var z=Object.keys(x).filter(function(it){return it!=="key"});I=0<z.length?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}",Te[L+I]||(z=0<z.length?"{"+z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,I,L,z,L),Te[L+I]=!0)}if(L=null,C!==void 0&&(r(C),L=""+C),i(x)&&(r(x.key),L=""+x.key),"key"in x){C={};for(var he in x)he!=="key"&&(C[he]=x[he])}else C=x;return L&&u(C,typeof m=="function"?m.displayName||m.name||"Unknown":m),s(m,L,D,B,n(),C,fe,de)}function y(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"),g=Symbol.for("react.fragment"),w=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"),A=Symbol.for("react.client.reference"),V=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee=Object.prototype.hasOwnProperty,ot=Array.isArray,ce=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(m){return m()}};var Ce,Se={},ke=d["react-stack-bottom-frame"].bind(d,o)(),Pe=ce(a(o)),Te={};G.Fragment=g,G.jsx=function(m,x,C,I,B){var D=1e4>V.recentlyCreatedOwnerStacks++;return h(m,x,C,!1,I,B,D?Error("react-stack-top-frame"):ke,D?ce(a(m)):Pe)},G.jsxs=function(m,x,C,I,B){var D=1e4>V.recentlyCreatedOwnerStacks++;return h(m,x,C,!0,I,B,D?Error("react-stack-top-frame"):ke,D?ce(a(m)):Pe)}}()),G}var Oe;function ct(){return Oe||(Oe=1,process.env.NODE_ENV==="production"?re.exports=st():re.exports=ut()),re.exports}var P=ct(),K={},$e;function ft(){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,g=d.length;if(g<2)return p;const w=v?.decode||h;let f=0;do{const b=d.indexOf("=",f);if(b===-1)break;const R=d.indexOf(";",f),k=R===-1?g: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 A=w(d.slice(_,O));p[$]=A}f=k+1}while(f<g);return p}function u(d,v,p){do{const g=d.charCodeAt(v);if(g!==32&&g!==9)return v}while(++v<p);return p}function l(d,v,p){for(;v>p;){const g=d.charCodeAt(--v);if(g!==32&&g!==9)return v+1}return p}function s(d,v,p){const g=p?.encode||encodeURIComponent;if(!e.test(d))throw new TypeError(`argument name is invalid: ${d}`);const w=g(v);if(!t.test(w))throw new TypeError(`argument val is invalid: ${v}`);let f=d+"="+w;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(!y(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 y(d){return n.call(d)==="[object Date]"}return K}ft();/**
|
|
23
|
+
* react-router v7.6.3
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) Remix Software Inc.
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the MIT license found in the
|
|
28
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
29
|
+
*
|
|
30
|
+
* @license MIT
|
|
31
|
+
*/var _e="popstate";function dt(e={}){function t(a,n){let{pathname:o,search:i,hash:u}=a.location;return ye("",{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 mt(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 ht(){return Math.random().toString(36).substring(2,10)}function Ae(e,t){return{usr:e.state,key:e.key,idx:t}}function ye(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||ht()}}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 mt(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 y(){u="POP";let w=h(),f=w==null?null:w-s;s=w,l&&l({action:u,location:g.location,delta:f})}function d(w,f){u="PUSH";let b=ye(g.location,w,f);s=h()+1;let R=Ae(b,s),k=g.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:g.location,delta:1})}function v(w,f){u="REPLACE";let b=ye(g.location,w,f);s=h();let R=Ae(b,s),k=g.createHref(b);i.replaceState(R,"",k),o&&l&&l({action:u,location:g.location,delta:0})}function p(w){return pt(w)}let g={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,y),l=w,()=>{n.removeEventListener(_e,y),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 g}function pt(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 je(e,t,r="/"){return yt(e,t,r,!1)}function yt(e,t,r,a){let n=typeof t=="string"?Y(t):t,o=M(n.pathname||"/",r);if(o==null)return null;let i=Me(e);gt(i);let u=null;for(let l=0;u==null&&l<i.length;++l){let s=Tt(o);u=kt(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("/")&&(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}".`),Me(o.children,t,h,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:Ct(s,o.index),routesMeta:h})};return e.forEach((o,i)=>{if(o.path===""||!o.path?.includes("?"))n(o,i);else for(let u of He(o.path))n(o,i,u)}),t}function He(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=He(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 gt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:St(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var vt=/^:[\w-]+$/,wt=3,xt=2,bt=1,Rt=10,Et=-2,De=e=>e==="*";function Ct(e,t){let r=e.split("/"),a=r.length;return r.some(De)&&(a+=Et),t&&(a+=xt),r.filter(n=>!De(n)).reduce((n,o)=>n+(vt.test(o)?wt:o===""?bt:Rt),a)}function St(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 kt(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)||"/",y=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},h),d=l.route;if(!y&&s&&r&&!a[a.length-1].route.index&&(y=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},h)),!y)return null;Object.assign(n,y.params),i.push({params:n,pathname:j([o,y.pathname]),pathnameBase:$t(j([o,y.pathnameBase])),route:d}),y.pathnameBase!=="/"&&(o=j([o,y.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Pt(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:y},d)=>{if(h==="*"){let p=u[d]||"";i=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const v=u[d];return y&&!v?s[h]=void 0:s[h]=(v||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:i,pattern:e}}function Pt(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 Tt(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 It(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Y(e):e;return{pathname:r?r.startsWith("/")?r:Lt(r,t):t,search:_t(a),hash:At(n)}}function Lt(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 Ot(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ue(e){let t=Ot(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Be(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 y=t.length-1;if(!a&&i.startsWith("..")){let d=i.split("/");for(;d[0]==="..";)d.shift(),y-=1;n.pathname=d.join("/")}u=y>=0?t[y]:"/"}let l=It(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,"/"),$t=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_t=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,At=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Dt(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 Nt=["GET",...We];new Set(Nt);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 Ft=c.createContext(new Map);Ft.displayName="Fetchers";var jt=c.createContext(null);jt.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 Mt(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 W(){return S(ee(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(Q).location}var ze="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ye(e){c.useContext(F).static||c.useLayoutEffect(e)}function Je(){let{isDataRoute:e}=c.useContext(H);return e?Zt():Ht()}function Ht(){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}=W(),o=JSON.stringify(Ue(a)),i=c.useRef(!1);return Ye(()=>{i.current=!0}),c.useCallback((l,s={})=>{if(N(i.current,ze),!i.current)return;if(typeof l=="number"){r.go(l);return}let h=Be(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}=W(),n=JSON.stringify(Ue(r));return c.useMemo(()=>Be(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Ut(e,t){return qe(e,t)}function qe(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||"";Ge(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
|
+
|
|
33
|
+
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let y=W(),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=y;let v=d.pathname||"/",p=v;if(s!=="/"){let f=s.replace(/^\//,"").split("/");p="/"+v.replace(/^\//,"").split("/").slice(f.length).join("/")}let g=je(e,{pathname:p});N(h||g!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),N(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${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=Yt(g&&g.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 Bt(){let e=Xt(),t=Dt(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 Wt=c.createElement(Bt,null),Vt=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 zt({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 Yt(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:y}=r,d=s.route.loader&&!h.hasOwnProperty(s.route.id)&&(!y||y[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 y,d=!1,v=null,p=null;r&&(y=o&&s.route.id?o[s.route.id]:void 0,v=s.route.errorElement||Wt,i&&(u<0&&h===0?(Ge("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 g=t.concat(n.slice(0,h+1)),w=()=>{let f;return y?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(zt,{match:s,routeContext:{outlet:l,matches:g,isDataRoute:r!=null},children:f})};return r&&(s.route.ErrorBoundary||s.route.errorElement||h===0)?c.createElement(Vt,{location:r.location,revalidation:r.revalidation,component:v,error:y,children:w(),routeContext:{outlet:null,matches:g,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 Jt(e){let t=c.useContext(J);return S(t,we(e)),t}function qt(e){let t=c.useContext(le);return S(t,we(e)),t}function Gt(e){let t=c.useContext(H);return S(t,we(e)),t}function xe(e){let t=Gt(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 Kt(){return xe("useRouteId")}function Xt(){let e=c.useContext(ve),t=qt("useRouteError"),r=xe("useRouteError");return e!==void 0?e:t.errors?.[r]}function Zt(){let{router:e}=Jt("useNavigate"),t=xe("useNavigate"),r=c.useRef(!1);return Ye(()=>{r.current=!0}),c.useCallback(async(n,o={})=>{N(r.current,ze),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Ne={};function Ge(e,t,r){!t&&!Ne[e]&&(Ne[e]=!0,N(!1,r))}c.memo(Qt);function Qt({routes:e,future:t,state:r}){return qe(e,void 0,r,t)}function Ke(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 er({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:y=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:y,key:d},navigationType:a}},[i,l,s,h,y,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 tr({children:e,location:t}){return Ut(ge(e),t)}function ge(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,ge(a.props.children,o));return}S(a.type===Ke,`[${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=ge(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 rr(e){return se(e)&&e.tagName.toLowerCase()==="button"}function nr(e){return se(e)&&e.tagName.toLowerCase()==="form"}function ar(e){return se(e)&&e.tagName.toLowerCase()==="input"}function or(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ir(e,t){return e.button===0&&(!t||t==="_self")&&!or(e)}var ne=null;function lr(){if(ne===null)try{new FormData(document.createElement("form"),0),ne=!1}catch{ne=!0}return ne}var sr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pe(e){return e!=null&&!sr.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oe}"`),null):e}function ur(e,t){let r,a,n,o,i;if(nr(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(rr(e)||ar(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),!lr()){let{name:s,type:h,value:y}=e;if(h==="image"){let d=s?`${s}.`:"";o.append(`${d}x`,"0"),o.append(`${d}y`,"0")}else s&&o.append(s,y)}}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 cr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fr(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 dr(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await cr(o,r);return i.links?i.links():[]}return[]}));return yr(a.flat(1).filter(fr).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 y=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 y=="boolean")return y}return!0}):[]}function hr(e,t,{includeHydrateFallback:r}={}){return mr(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 mr(e){return[...new Set(e)]}function pr(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function yr(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(pr(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var gr=new Set([100,101,204,205]);function vr(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 Xe(){let e=c.useContext(J);return be(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wr(){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 Ze(){let e=c.useContext(Re);return be(e,"You must render this element inside a <HydratedRouter> element"),e}function xr(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:y}=t,d=c.useRef(null);c.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let g=f=>{f.forEach(b=>{i(b.isIntersecting)})},w=new IntersectionObserver(g,{threshold:.5});return d.current&&w.observe(d.current),()=>{w.disconnect()}}},[e]),c.useEffect(()=>{if(a){let g=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(g)}}},[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(y,v)}]:[!1,d,{}]}function X(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function br({page:e,...t}){let{router:r}=Xe(),a=c.useMemo(()=>je(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?c.createElement(Er,{page:e,matches:a,...t}):null}function Rr(e){let{manifest:t,routeModules:r}=Ze(),[a,n]=c.useState([]);return c.useEffect(()=>{let o=!1;return dr(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Er({page:e,matches:t,...r}){let a=W(),{manifest:n,routeModules:o}=Ze(),{basename:i}=Xe(),{loaderData:u,matches:l}=wr(),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]),y=c.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let p=new Set,g=!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?g=!0:p.add(f.route.id))}),p.size===0)return[];let w=vr(e,i);return g&&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(()=>hr(h,n),[h,n]),v=Rr(h);return c.createElement(c.Fragment,null,y.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:g})=>c.createElement("link",{key:p,...g})))}function Cr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Qe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qe&&(window.__reactRouterVersion="7.6.3")}catch{}function Sr({basename:e,children:t,window:r}){let a=c.useRef();a.current==null&&(a.current=dt({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(er,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:n})}var et=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tt=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:y,...d},v){let{basename:p}=c.useContext(F),g=typeof s=="string"&&et.test(s),w,f=!1;if(typeof s=="string"&&g&&(w=s,Qe))try{let O=new URL(window.location.href),A=s.startsWith("//")?new URL(O.protocol+s):new URL(s),V=M(A.pathname,p);A.origin===O.origin&&V!=null?s=V+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=Mt(s,{relative:n}),[R,k,T]=xr(a,d),U=Ir(s,{replace:i,state:u,target:l,preventScrollReset:h,relative:n,viewTransition:y});function $(O){t&&t(O),O.defaultPrevented||U(O)}let _=c.createElement("a",{...d,...T,href:w||b,onClick:f||o?t:$,ref:Cr(v,k),target:l,"data-discover":!g&&r==="render"?"true":void 0});return R&&!g?c.createElement(c.Fragment,null,_,c.createElement(br,{page:b})):_});tt.displayName="Link";var kr=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 y=te(i,{relative:s.relative}),d=W(),v=c.useContext(le),{navigator:p,basename:g}=c.useContext(F),w=v!=null&&Ar(y)&&u===!0,f=p.encodeLocation?p.encodeLocation(y).pathname:y.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&&g&&(R=M(R,g)||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(tt,{...s,"aria-current":_,className:O,ref:h,style:A,to:i,viewTransition:u},typeof l=="function"?l($):l)});kr.displayName="NavLink";var Pr=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:y,...d},v)=>{let p=$r(),g=_r(u,{relative:s}),w=i.toLowerCase()==="get"?"get":"post",f=typeof u=="string"&&et.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:y})};return c.createElement("form",{ref:v,method:w,action:g,onSubmit:a?l:b,...d,"data-discover":!f&&e==="render"?"true":void 0})});Pr.displayName="Form";function Tr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rt(e){let t=c.useContext(J);return S(t,Tr(e)),t}function Ir(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:i}={}){let u=Je(),l=W(),s=te(e,{relative:o});return c.useCallback(h=>{if(ir(h,t)){h.preventDefault();let y=r!==void 0?r:Z(l)===Z(s);u(e,{replace:y,state:a,preventScrollReset:n,relative:o,viewTransition:i})}},[l,u,s,r,a,t,e,n,o,i])}var Lr=0,Or=()=>`__${String(++Lr)}__`;function $r(){let{router:e}=rt("useSubmit"),{basename:t}=c.useContext(F),r=Kt();return c.useCallback(async(a,n={})=>{let{action:o,method:i,encType:u,formData:l,body:s}=ur(a,t);if(n.navigate===!1){let h=n.fetcherKey||Or();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 _r(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=W();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(y=>y).forEach(y=>u.append("index",y));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 Ar(e,t={}){let r=c.useContext(Ve);S(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=rt("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}[...gr];const nt=E.createContext({history:[],addToHistory:()=>{},popFromHistory:()=>"",replaceHistory:()=>{}}),Dr=({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 y="",d=[];return r.current.length===0?"/":(r.current.length<=h?(y=r.current[0],d=[y]):(d=r.current.slice(0,r.current.length-h),y=d[d.length-1]),o(d),y)},l=h=>{o(h)},s=e.map(h=>P.jsx(Ke,{path:h.path,element:h.render}));return P.jsx(nt.Provider,{value:{history:a,addToHistory:i,popFromHistory:u,replaceHistory:l},children:P.jsxs(Sr,{children:[t,P.jsx(tr,{children:s})]})})},Nr=()=>{const e=Je(),t=W(),r=E.useContext(nt),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}},at=E.createContext({visibleItems:[],isItemVisible:()=>!1,showItem:()=>{},hideItem:()=>{}}),Fr=({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(at.Provider,{value:{visibleItems:r,isItemVisible:o,showItem:i,hideItem:u},children:e})},ue=()=>{const e=E.useContext(at),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}},jr=({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),y=p=>{n.current=!0;const g=p.clientY;h.current=g},d=p=>{n.current=!1,h.current=void 0,s(0)},v=p=>{if(!(!o||!i||!u)&&n.current&&h.current!==void 0){const g=p.clientY,w=i.current?.clientHeight||0;let f=h.current-g;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:y,onDrag:v,onDragEnd:d}},Mr=e=>{const{children:t,backgroundStyles:r,contentStyles:a,handle:n}=e,{isVisible:o,drawerParentRef:i,drawerRef:u,handleRef:l,drawerBottomDistance:s,onDragStart:h,onDrag:y,onDragEnd:d}=jr(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:y,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]})})})},Hr=({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})})})},Ur=({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})})},Br=({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 Wr{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 Vr{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 zr=e=>E.useEffect(e,[]),Yr=()=>{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()}},Jr=480,qr=768,Gr=()=>{const[e,t]=E.useState("desktop");return E.useEffect(()=>{const r=()=>{window.innerWidth<=Jr?t("mobile"):window.innerWidth<=qr?t("tablet"):t("desktop")};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[]),{device:e}};exports.Drawer=Mr;exports.FeedbackProvider=Fr;exports.Modal=Hr;exports.NavigationProvider=Dr;exports.ScrollHelper=Wr;exports.TextHelper=Vr;exports.Toast=Ur;exports.Typography=Br;exports.useDidMount=zr;exports.useFeedback=ue;exports.useFetch=Yr;exports.useNavigation=Nr;exports.useResponsive=Gr;
|
package/dist/index.d.ts
ADDED