forstok-ui-lib 1.0.4 → 1.0.6
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/dist/index.d.ts +24 -2
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/rollup.config.js +16 -4
- package/src/components/index.ts +2 -1
- package/tsconfig.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent } from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent, Dispatch, SetStateAction, KeyboardEvent, FocusEvent, InputHTMLAttributes, ChangeEvent } from 'react';
|
|
3
3
|
import { Path } from 'react-router-dom';
|
|
4
4
|
|
|
5
5
|
type TText = HTMLAttributes<HTMLSpanElement> & {
|
|
@@ -31,4 +31,26 @@ type TLinkBase = {
|
|
|
31
31
|
}));
|
|
32
32
|
declare const LinkComponent: ({ children, mode, $activated, href, to, $elipsis, $shadow, disabled, ...props }: TLinkBase) => react_jsx_runtime.JSX.Element;
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
type TEnterEvent = (e: KeyboardEvent<HTMLInputElement | HTMLElement> | FocusEvent<HTMLInputElement | HTMLElement | Element> | MouseEvent<HTMLElement>) => void;
|
|
35
|
+
type TKeyboadEvent = (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
36
|
+
type TState<T> = Dispatch<SetStateAction<T>>;
|
|
37
|
+
|
|
38
|
+
type TInput = InputHTMLAttributes<HTMLInputElement> & {
|
|
39
|
+
mode?: string;
|
|
40
|
+
$isError?: boolean;
|
|
41
|
+
$iconLeft?: boolean;
|
|
42
|
+
$iconRight?: boolean;
|
|
43
|
+
reset?: boolean;
|
|
44
|
+
setReset?: TState<boolean>;
|
|
45
|
+
isForceUpdate?: boolean;
|
|
46
|
+
setForceUpdate?: TState<boolean>;
|
|
47
|
+
evChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
48
|
+
evBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
49
|
+
isField?: boolean;
|
|
50
|
+
evChangeCustom?: (key: string, value: any) => void;
|
|
51
|
+
evEnter?: TEnterEvent;
|
|
52
|
+
evKeyUp?: TKeyboadEvent;
|
|
53
|
+
};
|
|
54
|
+
declare const InputComponent: ({ mode, $isError, $iconLeft, $iconRight, reset, setReset, isForceUpdate, setForceUpdate, evChange, evBlur, isField, evChangeCustom, evEnter, evKeyUp, ...props }: TInput) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { InputComponent, LinkComponent, TextComponent };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/function f(){return u||(u=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===F?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case
|
|
10
|
+
*/function f(){return u||(u=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===F?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case C:return"Fragment";case S:return"Portal";case R:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case L:return"SuspenseList"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case _:return(t.displayName||"Context")+".Provider";case O:return(t._context.displayName||"Context")+".Consumer";case j:var r=t.render;return(t=t.displayName)||(t=""!==(t=r.displayName||r.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case T:return null!==(r=t.displayName||null)?r:e(t.type)||"Memo";case N:r=t._payload,t=t._init;try{return e(t(r))}catch(e){}}return null}function t(e){return""+e}function r(e){try{t(e);var r=!1}catch(e){r=!0}if(r){var n=(r=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function n(){}function a(e){if(void 0===H)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||"",K=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+H+e+K}function i(e,t){if(!e||Y)return"";var r=V.get(e);if(void 0!==r)return r;Y=!0,r=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var o;o=U.H,U.H=null,function(){if(0===B){m=console.log,v=console.info,y=console.warn,g=console.error,b=console.group,w=console.groupCollapsed,x=console.groupEnd;var e={configurable:!0,enumerable:!0,value:n,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}B++}();try{var i={DetermineComponentFrameRoot:function(){try{if(t){var r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(r,[])}catch(e){var n=e}Reflect.construct(e,[],r)}else{try{r.call()}catch(e){n=e}e.call(r.prototype)}}else{try{throw Error()}catch(e){n=e}(r=e())&&"function"==typeof r.catch&&r.catch((function(){}))}}catch(e){if(e&&n&&"string"==typeof e.stack)return[e.stack,n.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=i.DetermineComponentFrameRoot(),c=s[0],u=s[1];if(c&&u){var p=c.split("\n"),d=u.split("\n");for(s=l=0;l<p.length&&!p[l].includes("DetermineComponentFrameRoot");)l++;for(;s<d.length&&!d[s].includes("DetermineComponentFrameRoot");)s++;if(l===p.length||s===d.length)for(l=p.length-1,s=d.length-1;1<=l&&0<=s&&p[l]!==d[s];)s--;for(;1<=l&&0<=s;l--,s--)if(p[l]!==d[s]){if(1!==l||1!==s)do{if(l--,0>--s||p[l]!==d[s]){var f="\n"+p[l].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&V.set(e,f),f}}while(1<=l&&0<=s);break}}}finally{Y=!1,U.H=o,function(){if(0==--B){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:m}),info:I({},e,{value:v}),warn:I({},e,{value:y}),error:I({},e,{value:g}),group:I({},e,{value:b}),groupCollapsed:I({},e,{value:w}),groupEnd:I({},e,{value:x})})}0>B&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}return p=(p=e?e.displayName||e.name:"")?a(p):"","function"==typeof e&&V.set(e,p),p}function l(e){if(null==e)return"";if("function"==typeof e){var t=e.prototype;return i(e,!(!t||!t.isReactComponent))}if("string"==typeof e)return a(e);switch(e){case P:return a("Suspense");case L:return a("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case j:return e=i(e.render,!1);case T:return l(e.type);case N:t=e._payload,e=e._init;try{return l(e(t))}catch(e){}}return""}function s(){var e=U.A;return null===e?null:e.getOwner()}function c(){var t=e(this.type);return q[t]||(q[t]=!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.")),void 0!==(t=this.props.ref)?t:null}function u(t,n,o,a,i,l){if("string"==typeof t||"function"==typeof t||t===C||t===R||t===E||t===P||t===L||t===D||"object"==typeof t&&null!==t&&(t.$$typeof===N||t.$$typeof===T||t.$$typeof===_||t.$$typeof===O||t.$$typeof===j||t.$$typeof===W||void 0!==t.getModuleId)){var u=n.children;if(void 0!==u)if(a)if(z(u)){for(a=0;a<u.length;a++)p(u[a],t);Object.freeze&&Object.freeze(u)}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 p(u,t)}else u="",(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),null===t?a="null":z(t)?a="array":void 0!==t&&t.$$typeof===$?(a="<"+(e(t.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):a=typeof t,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,u);if(M.call(n,"key")){u=e(t);var d=Object.keys(n).filter((function(e){return"key"!==e}));a=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",G[u+a]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,u,d,u),G[u+a]=!0)}if(u=null,void 0!==o&&(r(o),u=""+o),function(e){if(M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(r(n.key),u=""+n.key),"key"in n)for(var f in o={},n)"key"!==f&&(o[f]=n[f]);else o=n;return u&&function(e,t){function r(){J||(J=!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)",t))}r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(o,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(e,t,r,n,o,a){return r=a.ref,e={$$typeof:$,type:e,key:t,props:a,_owner:o},null!==(void 0!==r?r:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:c}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,u,l,0,s(),o)}function p(e,t){if("object"==typeof e&&e&&e.$$typeof!==X)if(z(e))for(var r=0;r<e.length;r++){var n=e[r];f(n)&&h(n,t)}else if(f(e))e._store&&(e._store.validated=1);else if(null===e||"object"!=typeof e?r=null:r="function"==typeof(r=A&&e[A]||e["@@iterator"])?r:null,"function"==typeof r&&r!==e.entries&&(r=r.call(e))!==e)for(;!(e=r.next()).done;)f(e.value)&&h(e.value,t)}function f(e){return"object"==typeof e&&null!==e&&e.$$typeof===$}function h(t,r){if(t._store&&!t._store.validated&&null==t.key&&(t._store.validated=1,r=function(t){var r="",n=s();return n&&(n=e(n.type))&&(r="\n\nCheck the render method of `"+n+"`."),r||(t=e(t))&&(r="\n\nCheck the top-level render call using <"+t+">."),r}(r),!Q[r])){Q[r]=!0;var n="";t&&null!=t._owner&&t._owner!==s()&&(n=null,"number"==typeof t._owner.tag?n=e(t._owner.type):"string"==typeof t._owner.name&&(n=t._owner.name),n=" It was passed a child from "+n+".");var o=U.getCurrentStack;U.getCurrentStack=function(){var e=l(t.type);return o&&(e+=o()||""),e},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,n),U.getCurrentStack=o}}var m,v,y,g,b,w,x,k=o.default,$=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),A=Symbol.iterator,F=Symbol.for("react.client.reference"),U=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,I=Object.assign,W=Symbol.for("react.client.reference"),z=Array.isArray,B=0;n.__reactDisabledLog=!0;var H,K,J,Y=!1,V=new("function"==typeof WeakMap?WeakMap:Map),X=Symbol.for("react.client.reference"),q={},G={},Q={};d.Fragment=C,d.jsx=function(e,t,r,n,o){return u(e,t,r,!1,0,o)},d.jsxs=function(e,t,r,n,o){return u(e,t,r,!0,0,o)}}()),d}var h=(p||(p=1,"production"===process.env.NODE_ENV?s.exports=function(){if(l)return c;l=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(t,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var a in n={},r)"key"!==a&&(n[a]=r[a]);else n=r;return r=n.ref,{$$typeof:e,type:t,key:o,ref:void 0!==r?r:null,props:n}}return c.Fragment=t,c.jsx=r,c.jsxs=r,c}():s.exports=f()),s.exports);const m=t.css`
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
text-overflow: ellipsis;
|
|
13
13
|
white-space: nowrap;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
*
|
|
33
33
|
* @license MIT
|
|
34
34
|
*/
|
|
35
|
-
var b="popstate";function w(e={}){return function(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,l="POP",s=null,c=u();null==c&&(c=0,i.replaceState({...i.state,idx:c},""));function u(){return(i.state||{idx:null}).idx}function p(){l="POP";let e=u(),t=null==e?null:e-c;c=e,s&&s({action:l,location:m.location,delta:t})}function d(e,t){l="PUSH";let r=S(m.location,e,t);c=u()+1;let n=$(r,c),p=m.createHref(r);try{i.pushState(n,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(p)}a&&s&&s({action:l,location:m.location,delta:1})}function f(e,t){l="REPLACE";let r=S(m.location,e,t);c=u();let n=$(r,c),o=m.createHref(r);i.replaceState(n,"",o),a&&s&&s({action:l,location:m.location,delta:0})}function h(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:E(e);return r=r.replace(/ $/,"%20"),x(t,`No window.location.(origin|href) available to create URL for href: ${r}`),new URL(r,t)}let m={get action(){return l},get location(){return e(o,i)},listen(e){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(b,p),s=e,()=>{o.removeEventListener(b,p),s=null}},createHref:e=>t(o,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:d,replace:f,go:e=>i.go(e)};return m}((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return S("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:E(t)}),0,e)}function x(e,t){if(!1===e||null==e)throw new Error(t)}function k(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function $(e,t){return{usr:e.state,key:e.key,idx:t}}function S(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?C(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function E({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 C(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function R(e,t,r="/"){return function(e,t,r,n){let o="string"==typeof t?C(t):t,a=z(o.pathname||"/",r);if(null==a)return null;let i=O(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let l=null;for(let e=0;null==l&&e<i.length;++e){let t=W(a);l=M(i[e],t,n)}return l}(e,t,r,!1)}function O(e,t=[],r=[],n=""){let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(x(i.relativePath.startsWith(n),`Absolute route path "${i.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(n.length));let l=J([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(x(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),O(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:F(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of _(e.path))o(e,t,r);else o(e,t)})),t}function _(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=_(n.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}var j=/^:[\w-]+$/,P=3,T=2,L=1,N=10,D=-2,A=e=>"*"===e;function F(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=D),t&&(n+=T),r.filter((e=>!A(e))).reduce(((e,t)=>e+(j.test(t)?P:""===t?L:N)),n)}function M(e,t,r=!1){let{routesMeta:n}=e,o={},a="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,c="/"===a?t:t.slice(a.length)||"/",u=U({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},c),p=l.route;if(!u&&s&&r&&!n[n.length-1].route.index&&(u=U({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),i.push({params:o,pathname:J([a,u.pathname]),pathnameBase:Y(J([a,u.pathnameBase])),route:p}),"/"!==u.pathnameBase&&(a=J([a,u.pathnameBase]))}return i}function U(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){k("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce(((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const o=l[n];return e[t]=r&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function W(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return k(!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 z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function I(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function B(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,r)=>r===t.length-1?e.pathname:e.pathnameBase))}function H(e,t,r,n=!1){let o;"string"==typeof e?o=C(e):(o={...e},x(!o.pathname||!o.pathname.includes("?"),I("?","pathname","search",o)),x(!o.pathname||!o.pathname.includes("#"),I("#","pathname","hash",o)),x(!o.search||!o.search.includes("#"),I("#","search","hash",o)));let a,i=""===e||""===o.pathname,l=i?"/":o.pathname;if(null==l)a=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=function(e,t="/"){let{pathname:r,search:n="",hash:o=""}="string"==typeof e?C(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:K(n),hash:V(o)}}(o,a),c=l&&"/"!==l&&l.endsWith("/"),u=(i||"."===l)&&r.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}var J=e=>e.join("/").replace(/\/\/+/g,"/"),Y=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),K=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",V=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var X=["POST","PUT","PATCH","DELETE"];new Set(X);var q=["GET",...X];new Set(q);var G=o.createContext(null);G.displayName="DataRouter";var Q=o.createContext(null);Q.displayName="DataRouterState";var Z=o.createContext({isTransitioning:!1});Z.displayName="ViewTransition",o.createContext(new Map).displayName="Fetchers",o.createContext(null).displayName="Await";var ee=o.createContext(null);ee.displayName="Navigation";var te=o.createContext(null);te.displayName="Location";var re=o.createContext({outlet:null,matches:[],isDataRoute:!1});re.displayName="Route";var ne=o.createContext(null);function oe(){return null!=o.useContext(te)}function ae(){return x(oe(),"useLocation() may be used only in the context of a <Router> component."),o.useContext(te).location}ne.displayName="RouteError";var ie="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function le(e){o.useContext(ee).static||o.useLayoutEffect(e)}function se(){let{isDataRoute:e}=o.useContext(re);return e?function(){let{router:e}=function(e){let t=o.useContext(G);return x(t,me(e)),t}("useNavigate"),t=ve("useNavigate"),r=o.useRef(!1);return le((()=>{r.current=!0})),o.useCallback((async(n,o={})=>{k(r.current,ie),r.current&&("number"==typeof n?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))}),[e,t])}():function(){x(oe(),"useNavigate() may be used only in the context of a <Router> component.");let e=o.useContext(G),{basename:t,navigator:r}=o.useContext(ee),{matches:n}=o.useContext(re),{pathname:a}=ae(),i=JSON.stringify(B(n)),l=o.useRef(!1);return le((()=>{l.current=!0})),o.useCallback(((n,o={})=>{if(k(l.current,ie),!l.current)return;if("number"==typeof n)return void r.go(n);let s=H(n,JSON.parse(i),a,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:J([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)}),[t,r,i,a,e])}()}function ce(e,{relative:t}={}){let{matches:r}=o.useContext(re),{pathname:n}=ae(),a=JSON.stringify(B(r));return o.useMemo((()=>H(e,JSON.parse(a),n,"path"===t)),[e,a,n,t])}function ue(e,t,r,n){x(oe(),"useRoutes() may be used only in the context of a <Router> component.");let a,{navigator:i,static:l}=o.useContext(ee),{matches:s}=o.useContext(re),c=s[s.length-1],u=c?c.params:{},p=c?c.pathname:"/",d=c?c.pathnameBase:"/",f=c&&c.route;{let e=f&&f.path||"";ge(p,!f||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${e}">) 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.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}a=ae();let h=a.pathname||"/",m=h;if("/"!==d){let e=d.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=!l&&r&&r.matches&&r.matches.length>0?r.matches:R(e,{pathname:m});k(f||null!=v,`No routes matched location "${a.pathname}${a.search}${a.hash}" `),k(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,`Matched leaf route at location "${a.pathname}${a.search}${a.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=function(e,t=[],r=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let n=e,a=r?.errors;if(null!=a){let e=n.findIndex((e=>e.route.id&&void 0!==a?.[e.route.id]));x(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),n=n.slice(0,Math.min(n.length,e+1))}let i=!1,l=-1;if(r)for(let e=0;e<n.length;e++){let t=n[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:o}=r,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!o||void 0===o[t.route.id]);if(t.route.lazy||a){i=!0,n=l>=0?n.slice(0,l+1):[n[0]];break}}}return n.reduceRight(((e,s,c)=>{let u,p=!1,d=null,f=null;r&&(u=a&&s.route.id?a[s.route.id]:void 0,d=s.route.errorElement||de,i&&(l<0&&0===c?(ge("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,f=null):l===c&&(p=!0,f=s.route.hydrateFallbackElement||null)));let h=t.concat(n.slice(0,c+1)),m=()=>{let t;return t=u?d:p?f:s.route.Component?o.createElement(s.route.Component,null):s.route.element?s.route.element:e,o.createElement(he,{match:s,routeContext:{outlet:e,matches:h,isDataRoute:null!=r},children:t})};return r&&(s.route.ErrorBoundary||s.route.errorElement||0===c)?o.createElement(fe,{location:r.location,revalidation:r.revalidation,component:d,error:u,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()}),null)}(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:J([d,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:J([d,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,r,n);return y}function pe(){let e=function(){let e=o.useContext(ne),t=function(e){let t=o.useContext(Q);return x(t,me(e)),t}("useRouteError"),r=ve("useRouteError");if(void 0!==e)return e;return t.errors?.[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=o.createElement(o.Fragment,null,o.createElement("p",null,"💿 Hey developer 👋"),o.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",o.createElement("code",{style:i},"ErrorBoundary")," or"," ",o.createElement("code",{style:i},"errorElement")," prop on your route.")),o.createElement(o.Fragment,null,o.createElement("h2",null,"Unexpected Application Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},t),r?o.createElement("pre",{style:a},r):null,l)}o.createContext(null);var de=o.createElement(pe,null),fe=class extends o.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?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 void 0!==this.state.error?o.createElement(re.Provider,{value:this.props.routeContext},o.createElement(ne.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function he({routeContext:e,match:t,children:r}){let n=o.useContext(G);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(re.Provider,{value:e},r)}function me(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ve(e){let t=function(e){let t=o.useContext(re);return x(t,me(e)),t}(e),r=t.matches[t.matches.length-1];return x(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}var ye={};function ge(e,t,r){t||ye[e]||(ye[e]=!0,k(!1,r))}function be({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:i=!1}){x(!oe(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=o.useMemo((()=>({basename:l,navigator:a,static:i,future:{}})),[l,a,i]);"string"==typeof r&&(r=C(r));let{pathname:c="/",search:u="",hash:p="",state:d=null,key:f="default"}=r,h=o.useMemo((()=>{let e=z(c,l);return null==e?null:{location:{pathname:e,search:u,hash:p,state:d,key:f},navigationType:n}}),[l,c,u,p,d,f,n]);return k(null!=h,`<Router basename="${l}"> is not able to match the URL "${c}${u}${p}" because it does not start with the basename, so the <Router> won't render anything.`),null==h?null:o.createElement(ee.Provider,{value:s},o.createElement(te.Provider,{children:t,value:h}))}o.memo((function({routes:e,future:t,state:r}){return ue(e,0,r,t)}));var we="get",xe="application/x-www-form-urlencoded";function ke(e){return null!=e&&"string"==typeof e.tagName}var $e=null;var Se=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ee(e){return null==e||Se.has(e)?e:(k(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xe}"`),null)}function Ce(e,t){let r,n,o,a,i;if(ke(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?z(i,t):null,r=e.getAttribute("method")||we,o=Ee(e.getAttribute("enctype"))||xe,a=new FormData(e)}else if(function(e){return ke(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return ke(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?z(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||we,o=Ee(e.getAttribute("formenctype"))||Ee(i.getAttribute("enctype"))||xe,a=new FormData(i,e),!function(){if(null===$e)try{new FormData(document.createElement("form"),0),$e=!1}catch(e){$e=!0}return $e}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,n)}}else{if(ke(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=we,n=null,o=xe,i=e}var l;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}function Re(e,t){if(!1===e||null==e)throw new Error(t)}function Oe(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function _e(e,t,r){return function(e,t){let r=new Set;return new Set(t),e.reduce(((e,t)=>{let n=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(t));return r.has(n)||(r.add(n),e.push({key:n,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let n=t.routes[e.route.id];if(n){let e=await async function(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(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}(n,r);return e.links?e.links():[]}return[]})))).flat(1).filter(Oe).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function je(e,t,r,n,o,a){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===a?t.filter(((e,t)=>i(e,t)||l(e,t))):"data"===a?t.filter(((t,a)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,a)||l(t,a))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0})):[]}function Pe(e,t){return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1),[...new Set(r)];var r}var Te=o.createContext(void 0);function Le(){let e=o.useContext(Te);return Re(e,"You must render this element inside a <HydratedRouter> element"),e}function Ne(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function De({page:e,...t}){let{router:r}=function(){let e=o.useContext(G);return Re(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),n=o.useMemo((()=>R(r.routes,e,r.basename)),[r.routes,e,r.basename]);return n?o.createElement(Ae,{page:e,matches:n,...t}):null}function Ae({page:e,matches:t,...r}){let n=ae(),{manifest:a,routeModules:i}=Le(),{loaderData:l,matches:s}=function(){let e=o.useContext(Q);return Re(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=o.useMemo((()=>je(e,t,s,a,n,"data")),[e,t,s,a,n]),u=o.useMemo((()=>je(e,t,s,a,n,"assets")),[e,t,s,a,n]),p=o.useMemo((()=>{if(e===n.pathname+n.search+n.hash)return[];let r=new Set,o=!1;if(t.forEach((e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in l&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:r.add(e.route.id))})),0===r.size)return[];let s=function(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===t.pathname?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}(e);return o&&r.size>0&&s.searchParams.set("_routes",t.filter((e=>r.has(e.route.id))).map((e=>e.route.id)).join(",")),[s.pathname+s.search]}),[l,n,a,c,t,e,i]),d=o.useMemo((()=>Pe(u,a)),[u,a]),f=function(e){let{manifest:t,routeModules:r}=Le(),[n,a]=o.useState([]);return o.useEffect((()=>{let n=!1;return _e(e,t,r).then((e=>{n||a(e)})),()=>{n=!0}}),[e,t,r]),n}(u);return o.createElement(o.Fragment,null,p.map((e=>o.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r}))),d.map((e=>o.createElement("link",{key:e,rel:"modulepreload",href:e,...r}))),f.map((({key:e,link:t})=>o.createElement("link",{key:e,...t}))))}function Fe(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}Te.displayName="FrameworkContext";var Me="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Me&&(window.__reactRouterVersion="7.1.5")}catch(e){}function Ue({basename:e,children:t,window:r}){let n=o.useRef();null==n.current&&(n.current=w({window:r,v5Compat:!0}));let a=n.current,[i,l]=o.useState({action:a.action,location:a.location}),s=o.useCallback((e=>{o.startTransition((()=>l(e)))}),[l]);return o.useLayoutEffect((()=>a.listen(s)),[a,s]),o.createElement(be,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a})}var We=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ze=o.forwardRef((function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:i,state:l,target:s,to:c,preventScrollReset:u,viewTransition:p,...d},f){let h,{basename:m}=o.useContext(ee),v="string"==typeof c&&We.test(c),y=!1;if("string"==typeof c&&v&&(h=c,Me))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=z(t.pathname,m);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:y=!0}catch(e){k(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let g=function(e,{relative:t}={}){x(oe(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=o.useContext(ee),{hash:a,pathname:i,search:l}=ce(e,{relative:t}),s=i;return"/"!==r&&(s="/"===i?r:J([r,i])),n.createHref({pathname:s,search:l,hash:a})}(c,{relative:n}),[b,w,$]=function(e,t){let r=o.useContext(Te),[n,a]=o.useState(!1),[i,l]=o.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:u,onMouseLeave:p,onTouchStart:d}=t,f=o.useRef(null);o.useEffect((()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{l(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),o.useEffect((()=>{if(n){let e=setTimeout((()=>{l(!0)}),100);return()=>{clearTimeout(e)}}}),[n]);let h=()=>{a(!0)},m=()=>{a(!1),l(!1)};return r?"intent"!==e?[i,f,{}]:[i,f,{onFocus:Ne(s,h),onBlur:Ne(c,m),onMouseEnter:Ne(u,h),onMouseLeave:Ne(p,m),onTouchStart:Ne(d,h)}]:[!1,f,{}]}(r,d),S=function(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:i,viewTransition:l}={}){let s=se(),c=ae(),u=ce(e,{relative:i});return o.useCallback((o=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(o,t)){o.preventDefault();let t=void 0!==r?r:E(c)===E(u);s(e,{replace:t,state:n,preventScrollReset:a,relative:i,viewTransition:l})}}),[c,s,u,r,n,t,e,a,i,l])}(c,{replace:i,state:l,target:s,preventScrollReset:u,relative:n,viewTransition:p});let C=o.createElement("a",{...d,...$,href:h||g,onClick:y||a?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:Fe(f,w),target:s,"data-discover":v||"render"!==t?void 0:"true"});return b&&!v?o.createElement(o.Fragment,null,C,o.createElement(De,{page:g})):C}));function Ie(e){let t=o.useContext(G);return x(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}ze.displayName="Link",o.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:i,viewTransition:l,children:s,...c},u){let p=ce(i,{relative:c.relative}),d=ae(),f=o.useContext(Q),{navigator:h,basename:m}=o.useContext(ee),v=null!=f&&function(e,t={}){let r=o.useContext(Z);x(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ie("useViewTransitionState"),a=ce(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=z(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=z(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=U(a.pathname,l)||null!=U(a.pathname,i)}(p)&&!0===l,y=h.encodeLocation?h.encodeLocation(p).pathname:p.pathname,g=d.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(g=g.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&m&&(b=z(b,m)||b);const w="/"!==y&&y.endsWith("/")?y.length-1:y.length;let k,$=g===y||!n&&g.startsWith(y)&&"/"===g.charAt(w),S=null!=b&&(b===y||!n&&b.startsWith(y)&&"/"===b.charAt(y.length)),E={isActive:$,isPending:S,isTransitioning:v},C=$?e:void 0;k="function"==typeof r?r(E):[r,$?"active":null,S?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let R="function"==typeof a?a(E):a;return o.createElement(ze,{...c,"aria-current":C,className:k,ref:u,style:R,to:i,viewTransition:l},"function"==typeof s?s(E):s)})).displayName="NavLink",o.forwardRef((({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:i,method:l=we,action:s,onSubmit:c,relative:u,preventScrollReset:p,viewTransition:d,...f},h)=>{let m=function(){let{router:e}=Ie("useSubmit"),{basename:t}=o.useContext(ee),r=ve("useRouteId");return o.useCallback((async(n,o={})=>{let{action:a,method:i,encType:l,formData:s,body:c}=Ce(n,t);if(!1===o.navigate){let t=o.fetcherKey||He();await e.fetch(t,r,o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:c,formMethod:o.method||i,formEncType:o.encType||l,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:c,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,r])}(),v=function(e,{relative:t}={}){let{basename:r}=o.useContext(ee),n=o.useContext(re);x(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),i={...ce(e||".",{relative:t})},l=ae();if(null==e){i.search=l.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let r=e.toString();i.search=r?`?${r}`:""}}e&&"."!==e||!a.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(i.pathname="/"===i.pathname?r:J([r,i.pathname]));return E(i)}(s,{relative:u}),y="get"===l.toLowerCase()?"get":"post",g="string"==typeof s&&We.test(s);return o.createElement("form",{ref:h,method:y,action:v,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,o=n?.getAttribute("formmethod")||l;m(n||e.currentTarget,{fetcherKey:t,method:o,navigate:r,replace:a,state:i,relative:u,preventScrollReset:p,viewTransition:d})},...f,"data-discover":g||"render"!==e?void 0:"true"})})).displayName="Form";var Be=0,He=()=>`__${String(++Be)}__`;new TextEncoder,t.css`
|
|
35
|
+
var b="popstate";function w(e={}){return function(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,l="POP",s=null,c=u();null==c&&(c=0,i.replaceState({...i.state,idx:c},""));function u(){return(i.state||{idx:null}).idx}function p(){l="POP";let e=u(),t=null==e?null:e-c;c=e,s&&s({action:l,location:m.location,delta:t})}function d(e,t){l="PUSH";let r=S(m.location,e,t);c=u()+1;let n=$(r,c),p=m.createHref(r);try{i.pushState(n,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(p)}a&&s&&s({action:l,location:m.location,delta:1})}function f(e,t){l="REPLACE";let r=S(m.location,e,t);c=u();let n=$(r,c),o=m.createHref(r);i.replaceState(n,"",o),a&&s&&s({action:l,location:m.location,delta:0})}function h(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:C(e);return r=r.replace(/ $/,"%20"),x(t,`No window.location.(origin|href) available to create URL for href: ${r}`),new URL(r,t)}let m={get action(){return l},get location(){return e(o,i)},listen(e){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(b,p),s=e,()=>{o.removeEventListener(b,p),s=null}},createHref:e=>t(o,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:d,replace:f,go:e=>i.go(e)};return m}((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return S("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:C(t)}),0,e)}function x(e,t){if(!1===e||null==e)throw new Error(t)}function k(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function $(e,t){return{usr:e.state,key:e.key,idx:t}}function S(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?E(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function C({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 E(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function R(e,t,r="/"){return function(e,t,r,n){let o="string"==typeof t?E(t):t,a=W(o.pathname||"/",r);if(null==a)return null;let i=O(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let l=null;for(let e=0;null==l&&e<i.length;++e){let t=I(a);l=U(i[e],t,n)}return l}(e,t,r,!1)}function O(e,t=[],r=[],n=""){let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(x(i.relativePath.startsWith(n),`Absolute route path "${i.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(n.length));let l=K([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(x(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),O(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:F(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of _(e.path))o(e,t,r);else o(e,t)})),t}function _(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=_(n.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}var j=/^:[\w-]+$/,P=3,L=2,T=1,N=10,D=-2,A=e=>"*"===e;function F(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=D),t&&(n+=L),r.filter((e=>!A(e))).reduce(((e,t)=>e+(j.test(t)?P:""===t?T:N)),n)}function U(e,t,r=!1){let{routesMeta:n}=e,o={},a="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,c="/"===a?t:t.slice(a.length)||"/",u=M({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},c),p=l.route;if(!u&&s&&r&&!n[n.length-1].route.index&&(u=M({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),i.push({params:o,pathname:K([a,u.pathname]),pathnameBase:J(K([a,u.pathnameBase])),route:p}),"/"!==u.pathnameBase&&(a=K([a,u.pathnameBase]))}return i}function M(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){k("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce(((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const o=l[n];return e[t]=r&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function I(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return k(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function W(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function z(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function B(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,r)=>r===t.length-1?e.pathname:e.pathnameBase))}function H(e,t,r,n=!1){let o;"string"==typeof e?o=E(e):(o={...e},x(!o.pathname||!o.pathname.includes("?"),z("?","pathname","search",o)),x(!o.pathname||!o.pathname.includes("#"),z("#","pathname","hash",o)),x(!o.search||!o.search.includes("#"),z("#","search","hash",o)));let a,i=""===e||""===o.pathname,l=i?"/":o.pathname;if(null==l)a=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=function(e,t="/"){let{pathname:r,search:n="",hash:o=""}="string"==typeof e?E(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:Y(n),hash:V(o)}}(o,a),c=l&&"/"!==l&&l.endsWith("/"),u=(i||"."===l)&&r.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}var K=e=>e.join("/").replace(/\/\/+/g,"/"),J=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Y=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",V=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var X=["POST","PUT","PATCH","DELETE"];new Set(X);var q=["GET",...X];new Set(q);var G=o.createContext(null);G.displayName="DataRouter";var Q=o.createContext(null);Q.displayName="DataRouterState";var Z=o.createContext({isTransitioning:!1});Z.displayName="ViewTransition",o.createContext(new Map).displayName="Fetchers",o.createContext(null).displayName="Await";var ee=o.createContext(null);ee.displayName="Navigation";var te=o.createContext(null);te.displayName="Location";var re=o.createContext({outlet:null,matches:[],isDataRoute:!1});re.displayName="Route";var ne=o.createContext(null);function oe(){return null!=o.useContext(te)}function ae(){return x(oe(),"useLocation() may be used only in the context of a <Router> component."),o.useContext(te).location}ne.displayName="RouteError";var ie="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function le(e){o.useContext(ee).static||o.useLayoutEffect(e)}function se(){let{isDataRoute:e}=o.useContext(re);return e?function(){let{router:e}=function(e){let t=o.useContext(G);return x(t,me(e)),t}("useNavigate"),t=ve("useNavigate"),r=o.useRef(!1);return le((()=>{r.current=!0})),o.useCallback((async(n,o={})=>{k(r.current,ie),r.current&&("number"==typeof n?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))}),[e,t])}():function(){x(oe(),"useNavigate() may be used only in the context of a <Router> component.");let e=o.useContext(G),{basename:t,navigator:r}=o.useContext(ee),{matches:n}=o.useContext(re),{pathname:a}=ae(),i=JSON.stringify(B(n)),l=o.useRef(!1);return le((()=>{l.current=!0})),o.useCallback(((n,o={})=>{if(k(l.current,ie),!l.current)return;if("number"==typeof n)return void r.go(n);let s=H(n,JSON.parse(i),a,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:K([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)}),[t,r,i,a,e])}()}function ce(e,{relative:t}={}){let{matches:r}=o.useContext(re),{pathname:n}=ae(),a=JSON.stringify(B(r));return o.useMemo((()=>H(e,JSON.parse(a),n,"path"===t)),[e,a,n,t])}function ue(e,t,r,n){x(oe(),"useRoutes() may be used only in the context of a <Router> component.");let a,{navigator:i,static:l}=o.useContext(ee),{matches:s}=o.useContext(re),c=s[s.length-1],u=c?c.params:{},p=c?c.pathname:"/",d=c?c.pathnameBase:"/",f=c&&c.route;{let e=f&&f.path||"";ge(p,!f||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${e}">) 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.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}a=ae();let h=a.pathname||"/",m=h;if("/"!==d){let e=d.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=!l&&r&&r.matches&&r.matches.length>0?r.matches:R(e,{pathname:m});k(f||null!=v,`No routes matched location "${a.pathname}${a.search}${a.hash}" `),k(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,`Matched leaf route at location "${a.pathname}${a.search}${a.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=function(e,t=[],r=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let n=e,a=r?.errors;if(null!=a){let e=n.findIndex((e=>e.route.id&&void 0!==a?.[e.route.id]));x(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),n=n.slice(0,Math.min(n.length,e+1))}let i=!1,l=-1;if(r)for(let e=0;e<n.length;e++){let t=n[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:o}=r,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!o||void 0===o[t.route.id]);if(t.route.lazy||a){i=!0,n=l>=0?n.slice(0,l+1):[n[0]];break}}}return n.reduceRight(((e,s,c)=>{let u,p=!1,d=null,f=null;r&&(u=a&&s.route.id?a[s.route.id]:void 0,d=s.route.errorElement||de,i&&(l<0&&0===c?(ge("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,f=null):l===c&&(p=!0,f=s.route.hydrateFallbackElement||null)));let h=t.concat(n.slice(0,c+1)),m=()=>{let t;return t=u?d:p?f:s.route.Component?o.createElement(s.route.Component,null):s.route.element?s.route.element:e,o.createElement(he,{match:s,routeContext:{outlet:e,matches:h,isDataRoute:null!=r},children:t})};return r&&(s.route.ErrorBoundary||s.route.errorElement||0===c)?o.createElement(fe,{location:r.location,revalidation:r.revalidation,component:d,error:u,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()}),null)}(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:K([d,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:K([d,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,r,n);return y}function pe(){let e=function(){let e=o.useContext(ne),t=function(e){let t=o.useContext(Q);return x(t,me(e)),t}("useRouteError"),r=ve("useRouteError");if(void 0!==e)return e;return t.errors?.[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=o.createElement(o.Fragment,null,o.createElement("p",null,"💿 Hey developer 👋"),o.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",o.createElement("code",{style:i},"ErrorBoundary")," or"," ",o.createElement("code",{style:i},"errorElement")," prop on your route.")),o.createElement(o.Fragment,null,o.createElement("h2",null,"Unexpected Application Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},t),r?o.createElement("pre",{style:a},r):null,l)}o.createContext(null);var de=o.createElement(pe,null),fe=class extends o.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?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 void 0!==this.state.error?o.createElement(re.Provider,{value:this.props.routeContext},o.createElement(ne.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function he({routeContext:e,match:t,children:r}){let n=o.useContext(G);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(re.Provider,{value:e},r)}function me(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ve(e){let t=function(e){let t=o.useContext(re);return x(t,me(e)),t}(e),r=t.matches[t.matches.length-1];return x(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}var ye={};function ge(e,t,r){t||ye[e]||(ye[e]=!0,k(!1,r))}function be({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:i=!1}){x(!oe(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=o.useMemo((()=>({basename:l,navigator:a,static:i,future:{}})),[l,a,i]);"string"==typeof r&&(r=E(r));let{pathname:c="/",search:u="",hash:p="",state:d=null,key:f="default"}=r,h=o.useMemo((()=>{let e=W(c,l);return null==e?null:{location:{pathname:e,search:u,hash:p,state:d,key:f},navigationType:n}}),[l,c,u,p,d,f,n]);return k(null!=h,`<Router basename="${l}"> is not able to match the URL "${c}${u}${p}" because it does not start with the basename, so the <Router> won't render anything.`),null==h?null:o.createElement(ee.Provider,{value:s},o.createElement(te.Provider,{children:t,value:h}))}o.memo((function({routes:e,future:t,state:r}){return ue(e,0,r,t)}));var we="get",xe="application/x-www-form-urlencoded";function ke(e){return null!=e&&"string"==typeof e.tagName}var $e=null;var Se=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ce(e){return null==e||Se.has(e)?e:(k(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xe}"`),null)}function Ee(e,t){let r,n,o,a,i;if(ke(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?W(i,t):null,r=e.getAttribute("method")||we,o=Ce(e.getAttribute("enctype"))||xe,a=new FormData(e)}else if(function(e){return ke(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return ke(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?W(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||we,o=Ce(e.getAttribute("formenctype"))||Ce(i.getAttribute("enctype"))||xe,a=new FormData(i,e),!function(){if(null===$e)try{new FormData(document.createElement("form"),0),$e=!1}catch(e){$e=!0}return $e}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,n)}}else{if(ke(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=we,n=null,o=xe,i=e}var l;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}function Re(e,t){if(!1===e||null==e)throw new Error(t)}function Oe(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function _e(e,t,r){return function(e,t){let r=new Set;return new Set(t),e.reduce(((e,t)=>{let n=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(t));return r.has(n)||(r.add(n),e.push({key:n,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let n=t.routes[e.route.id];if(n){let e=await async function(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(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}(n,r);return e.links?e.links():[]}return[]})))).flat(1).filter(Oe).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function je(e,t,r,n,o,a){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===a?t.filter(((e,t)=>i(e,t)||l(e,t))):"data"===a?t.filter(((t,a)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,a)||l(t,a))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0})):[]}function Pe(e,t){return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1),[...new Set(r)];var r}var Le=o.createContext(void 0);function Te(){let e=o.useContext(Le);return Re(e,"You must render this element inside a <HydratedRouter> element"),e}function Ne(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function De({page:e,...t}){let{router:r}=function(){let e=o.useContext(G);return Re(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),n=o.useMemo((()=>R(r.routes,e,r.basename)),[r.routes,e,r.basename]);return n?o.createElement(Ae,{page:e,matches:n,...t}):null}function Ae({page:e,matches:t,...r}){let n=ae(),{manifest:a,routeModules:i}=Te(),{loaderData:l,matches:s}=function(){let e=o.useContext(Q);return Re(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=o.useMemo((()=>je(e,t,s,a,n,"data")),[e,t,s,a,n]),u=o.useMemo((()=>je(e,t,s,a,n,"assets")),[e,t,s,a,n]),p=o.useMemo((()=>{if(e===n.pathname+n.search+n.hash)return[];let r=new Set,o=!1;if(t.forEach((e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in l&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:r.add(e.route.id))})),0===r.size)return[];let s=function(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===t.pathname?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}(e);return o&&r.size>0&&s.searchParams.set("_routes",t.filter((e=>r.has(e.route.id))).map((e=>e.route.id)).join(",")),[s.pathname+s.search]}),[l,n,a,c,t,e,i]),d=o.useMemo((()=>Pe(u,a)),[u,a]),f=function(e){let{manifest:t,routeModules:r}=Te(),[n,a]=o.useState([]);return o.useEffect((()=>{let n=!1;return _e(e,t,r).then((e=>{n||a(e)})),()=>{n=!0}}),[e,t,r]),n}(u);return o.createElement(o.Fragment,null,p.map((e=>o.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r}))),d.map((e=>o.createElement("link",{key:e,rel:"modulepreload",href:e,...r}))),f.map((({key:e,link:t})=>o.createElement("link",{key:e,...t}))))}function Fe(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}Le.displayName="FrameworkContext";var Ue="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Ue&&(window.__reactRouterVersion="7.1.5")}catch(e){}function Me({basename:e,children:t,window:r}){let n=o.useRef();null==n.current&&(n.current=w({window:r,v5Compat:!0}));let a=n.current,[i,l]=o.useState({action:a.action,location:a.location}),s=o.useCallback((e=>{o.startTransition((()=>l(e)))}),[l]);return o.useLayoutEffect((()=>a.listen(s)),[a,s]),o.createElement(be,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a})}var Ie=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,We=o.forwardRef((function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:i,state:l,target:s,to:c,preventScrollReset:u,viewTransition:p,...d},f){let h,{basename:m}=o.useContext(ee),v="string"==typeof c&&Ie.test(c),y=!1;if("string"==typeof c&&v&&(h=c,Ue))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=W(t.pathname,m);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:y=!0}catch(e){k(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let g=function(e,{relative:t}={}){x(oe(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=o.useContext(ee),{hash:a,pathname:i,search:l}=ce(e,{relative:t}),s=i;return"/"!==r&&(s="/"===i?r:K([r,i])),n.createHref({pathname:s,search:l,hash:a})}(c,{relative:n}),[b,w,$]=function(e,t){let r=o.useContext(Le),[n,a]=o.useState(!1),[i,l]=o.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:u,onMouseLeave:p,onTouchStart:d}=t,f=o.useRef(null);o.useEffect((()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{l(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),o.useEffect((()=>{if(n){let e=setTimeout((()=>{l(!0)}),100);return()=>{clearTimeout(e)}}}),[n]);let h=()=>{a(!0)},m=()=>{a(!1),l(!1)};return r?"intent"!==e?[i,f,{}]:[i,f,{onFocus:Ne(s,h),onBlur:Ne(c,m),onMouseEnter:Ne(u,h),onMouseLeave:Ne(p,m),onTouchStart:Ne(d,h)}]:[!1,f,{}]}(r,d),S=function(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:i,viewTransition:l}={}){let s=se(),c=ae(),u=ce(e,{relative:i});return o.useCallback((o=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(o,t)){o.preventDefault();let t=void 0!==r?r:C(c)===C(u);s(e,{replace:t,state:n,preventScrollReset:a,relative:i,viewTransition:l})}}),[c,s,u,r,n,t,e,a,i,l])}(c,{replace:i,state:l,target:s,preventScrollReset:u,relative:n,viewTransition:p});let E=o.createElement("a",{...d,...$,href:h||g,onClick:y||a?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:Fe(f,w),target:s,"data-discover":v||"render"!==t?void 0:"true"});return b&&!v?o.createElement(o.Fragment,null,E,o.createElement(De,{page:g})):E}));function ze(e){let t=o.useContext(G);return x(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}We.displayName="Link",o.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:i,viewTransition:l,children:s,...c},u){let p=ce(i,{relative:c.relative}),d=ae(),f=o.useContext(Q),{navigator:h,basename:m}=o.useContext(ee),v=null!=f&&function(e,t={}){let r=o.useContext(Z);x(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=ze("useViewTransitionState"),a=ce(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=W(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=W(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=M(a.pathname,l)||null!=M(a.pathname,i)}(p)&&!0===l,y=h.encodeLocation?h.encodeLocation(p).pathname:p.pathname,g=d.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(g=g.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&m&&(b=W(b,m)||b);const w="/"!==y&&y.endsWith("/")?y.length-1:y.length;let k,$=g===y||!n&&g.startsWith(y)&&"/"===g.charAt(w),S=null!=b&&(b===y||!n&&b.startsWith(y)&&"/"===b.charAt(y.length)),C={isActive:$,isPending:S,isTransitioning:v},E=$?e:void 0;k="function"==typeof r?r(C):[r,$?"active":null,S?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let R="function"==typeof a?a(C):a;return o.createElement(We,{...c,"aria-current":E,className:k,ref:u,style:R,to:i,viewTransition:l},"function"==typeof s?s(C):s)})).displayName="NavLink",o.forwardRef((({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:i,method:l=we,action:s,onSubmit:c,relative:u,preventScrollReset:p,viewTransition:d,...f},h)=>{let m=function(){let{router:e}=ze("useSubmit"),{basename:t}=o.useContext(ee),r=ve("useRouteId");return o.useCallback((async(n,o={})=>{let{action:a,method:i,encType:l,formData:s,body:c}=Ee(n,t);if(!1===o.navigate){let t=o.fetcherKey||He();await e.fetch(t,r,o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:c,formMethod:o.method||i,formEncType:o.encType||l,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:c,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,r])}(),v=function(e,{relative:t}={}){let{basename:r}=o.useContext(ee),n=o.useContext(re);x(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),i={...ce(e||".",{relative:t})},l=ae();if(null==e){i.search=l.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let r=e.toString();i.search=r?`?${r}`:""}}e&&"."!==e||!a.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(i.pathname="/"===i.pathname?r:K([r,i.pathname]));return C(i)}(s,{relative:u}),y="get"===l.toLowerCase()?"get":"post",g="string"==typeof s&&Ie.test(s);return o.createElement("form",{ref:h,method:y,action:v,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,o=n?.getAttribute("formmethod")||l;m(n||e.currentTarget,{fetcherKey:t,method:o,navigate:r,replace:a,state:i,relative:u,preventScrollReset:p,viewTransition:d})},...f,"data-discover":g||"render"!==e?void 0:"true"})})).displayName="Form";var Be=0,He=()=>`__${String(++Be)}__`;new TextEncoder,t.css`
|
|
36
36
|
list-style: none;
|
|
37
37
|
padding: 0;
|
|
38
38
|
margin: 0;
|
|
@@ -45,7 +45,7 @@ var b="popstate";function w(e={}){return function(e,t,r,n={}){let{window:o=docum
|
|
|
45
45
|
display: block;
|
|
46
46
|
max-width: 100%;
|
|
47
47
|
width: auto;
|
|
48
|
-
`;const
|
|
48
|
+
`;const Ke=t.css`
|
|
49
49
|
display: -webkit-box !important;
|
|
50
50
|
-webkit-line-clamp: 2;
|
|
51
51
|
-webkit-box-orient: vertical;
|
|
@@ -83,7 +83,7 @@ var b="popstate";function w(e={}){return function(e,t,r,n={}){let{window:o=docum
|
|
|
83
83
|
font-weight: 600;
|
|
84
84
|
font-size: 13px;
|
|
85
85
|
text-transform: capitalize;
|
|
86
|
-
`;const
|
|
86
|
+
`;const Je=t.css`
|
|
87
87
|
color: var(--pri-clr-lnk);
|
|
88
88
|
&,
|
|
89
89
|
&:hover {
|
|
@@ -92,7 +92,7 @@ var b="popstate";function w(e={}){return function(e,t,r,n={}){let{window:o=docum
|
|
|
92
92
|
&:hover {
|
|
93
93
|
color: var(--pri-clr-lnk__hvr);
|
|
94
94
|
}
|
|
95
|
-
`,
|
|
95
|
+
`,Ye=t.css`
|
|
96
96
|
color: var(--pri-clr-lnk);
|
|
97
97
|
&,
|
|
98
98
|
&:hover {
|
|
@@ -115,7 +115,7 @@ var b="popstate";function w(e={}){return function(e,t,r,n={}){let{window:o=docum
|
|
|
115
115
|
&:hover {
|
|
116
116
|
text-decoration: none;
|
|
117
117
|
}
|
|
118
|
-
`,Xe=({mode:e,$elipsis:t,$activated:r,$shadow:n,disabled:o})=>{let a="";return"clear"===e?a+=
|
|
118
|
+
`,Xe=({mode:e,$elipsis:t,$activated:r,$shadow:n,disabled:o})=>{let a="";return"clear"===e?a+=Je:"clearR"===e?a+=Ye:"blue"===e?a+="\n &, &:hover {\n color: var(--pri-clr-lnk__hvr);\n text-decoration: none;\n }\n ":"trans"===e?a+=Ve+"\n height: auto;\n padding: 0;\n opacity: 1;\n &, \n &:hover { \n color: var(--pri-clr-lnk__hvr);\n text-decoration: none;\n } \n &:hover {\n opacity: .9; \n }\n ":"hover"===e?a+=Ve+"\n height: auto;\n width: max-content;\n padding: 3px 6px;\n position: relative;\n left: -6px;\n color: initial;\n grid-gap: 4px;\n &:hover { \n border-radius: var(--ter-rd);\n box-shadow: 1px 1px var(--pri-clr-ln);\n background-color: var(--mt-clr-bg__fc);\n text-decoration: none;\n }\n ":"whiteB"===e?a+=Ve+"\n color: var(--ter-clr);\n background-color: var(--cl-clr-bg);\n border: 1px solid var(--sec-clr-ln);\n &, \n &:hover { \n background-color: var(--cl-clr-bg__hvr);\n } \n ":"redB"===e?a+=Ve+"\n color: var(--act-clr);\n background-color: var(--act-clr-bg);\n &:hover {\n background-color: var(--act-clr-bg__hvr);\n } \n ":"greyB"===e&&(a+=Ve+"\n color: var(--act-clr);\n background-color: var(--mt-clr-bg__fc);\n &:hover {\n background-color: var(--cl-clr-bg__hvr);\n } \n "),r&&(a+="\n color: var(--sta-clr);\n font-weight: 400;\n ","clear"!==e&&"clearR"!==e||(a+="\n color: var(--pri-clr-lnk__act);\n font-weight: 600;\n ")),t&&(a+=`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n max-width: 100%;\n width: auto;\n ${Ke}\n `),n&&(a+="\n box-shadow: var(--act-shd-bx);\n "),o&&(a+="\n color: #A9A9A9;\n opacity: 0.7;\n pointer-events: none;\n "),a},qe=a.default(We)`
|
|
119
119
|
&._refHoverLink {
|
|
120
120
|
padding: 3px 0px 0px 6px;
|
|
121
121
|
position: relative;
|
|
@@ -127,5 +127,17 @@ var b="popstate";function w(e={}){return function(e,t,r,n={}){let{window:o=docum
|
|
|
127
127
|
`,Qe=a.default.span`
|
|
128
128
|
cursor:pointer;
|
|
129
129
|
${Xe}
|
|
130
|
-
`,Ze=e=>{var{children:t,mode:r,$activated:n,$elipsis:o,to:a,$shadow:l,disabled:s}=e,c=i(e,["children","mode","$activated","$elipsis","to","$shadow","disabled"]);return h.jsx(
|
|
130
|
+
`,Ze=e=>{var{children:t,mode:r,$activated:n,$elipsis:o,to:a,$shadow:l,disabled:s}=e,c=i(e,["children","mode","$activated","$elipsis","to","$shadow","disabled"]);return h.jsx(Me,{children:h.jsx(qe,Object.assign({className:"_refLink",to:a,mode:r,$activated:!!n,$elipsis:!!o,$shadow:!!l,disabled:!!s},c,{children:t}))})},et=t.css`
|
|
131
|
+
border: 0;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
font-weight: 400;
|
|
134
|
+
color: var(--sec-clr);
|
|
135
|
+
background-color: var(--act-clr-bg);
|
|
136
|
+
`,tt=a.default.input`
|
|
137
|
+
&._refQuantitiyInput {
|
|
138
|
+
width: 55px;
|
|
139
|
+
text-align: center;
|
|
140
|
+
}
|
|
141
|
+
${({width:e,height:t,$iconLeft:r,$iconRight:n,$isError:o,mode:a,type:i})=>{let l="";return r&&(l+=" \n padding-left: 35px; \n "),n&&(l+=" \n padding-right: 35px; \n "),o&&(l+=" \n border:1px solid var(--err-clr-ln) !important; \n "),t&&(l+=` \n height: ${t}px\n max-height: ${t}px\n `),"search"===a&&(l+=' \n background-color: transparent;\n &, &:not([type="submit"]):focus, &:active, &:active:focus {\n border: 1px solid transparent !important;\n outline: none !important;\n box-shadow: none !important;\n }\n ',r&&(l+=" \n padding-left: 39px; \n ")),"transaction"===a&&(l+="\n padding-left: 45px;\n "),e&&(l+=` \n width: ${e}px \n `),"submit"===i&&(l+=et),l}}
|
|
142
|
+
`;exports.InputComponent=t=>{var r,{mode:n,$isError:o,$iconLeft:a,$iconRight:l,reset:s,setReset:c,isForceUpdate:u,setForceUpdate:p,evChange:d,evBlur:f,isField:m,evChangeCustom:v,evEnter:y,evKeyUp:g}=t,b=i(t,["mode","$isError","$iconLeft","$iconRight","reset","setReset","isForceUpdate","setForceUpdate","evChange","evBlur","isField","evChangeCustom","evEnter","evKeyUp"]);const{type:w,name:x,defaultValue:k,defaultChecked:$}=b,S=null!==(r=null==k?void 0:k.toString())&&void 0!==r?r:"",[C,E]=e.useState(S),[R,O]=e.useState($||!1);e.useEffect((()=>{var e;if(u){const t=null!==(e=null==k?void 0:k.toString())&&void 0!==e?e:"";E(t),O($||!1),p&&p(!1)}s&&(E(""),O(!1),c&&c(!1))}),[u,p,s,c,k,$,O,n]);const _=e=>{const t=e.target.value;E(t)};let j=Object.assign({},b);delete j.defaultValue,delete j.defaultChecked;const P=h.jsx(tt,Object.assign({mode:n,$isError:o,$iconLeft:a,$iconRight:l,checked:R,value:C,onChange:e=>{_(e),d&&d(e)},onBlur:e=>{_(e),(e=>{if(f&&f(e),m&&y&&y(e),m&&x){const t="number"===w?parseInt(e.target.value):e.target.value.trim();v&&v(x,t)}})(e)},onKeyUp:e=>{g&&g(e),(e=>{"Enter"===e.key&&(e.preventDefault(),m&&y&&y(e))})(e)}},"number"===w&&{onKeyPress:e=>("number"===w&&(isNaN(Number(e.key))||void 0===e.key||""===e.key)&&e.preventDefault(),!0)},"number"===w&&{onPaste:e=>{const t=(e.clipboardData||window.clipboardData).getData("text").replace(/[^0-9]/g,"");e.preventDefault(),document.execCommand("insertText",!1,t)}},"number"===w&&{onFocus:e=>e.target.addEventListener("wheel",(function(e){e.preventDefault()}),{passive:!1})},"number"===w&&{min:"0"},j));return P},exports.LinkComponent=e=>{var{children:t,mode:r,$activated:n=!1,href:o,to:a,$elipsis:l=!1,$shadow:s=!1,disabled:c=!1}=e,u=i(e,["children","mode","$activated","href","to","$elipsis","$shadow","disabled"]);const{onClick:p}=u;return o?h.jsx(Ge,Object.assign({className:"_refLink",mode:r,$activated:!!n,$elipsis:!!l,$shadow:!!s,disabled:!!c,href:o},u,{children:t})):a?h.jsx(Ze,Object.assign({to:a,className:"_refLink",mode:r,$activated:n&&!0,$elipsis:!!l,$shadow:!!s,disabled:!!c},u,{children:t})):h.jsx(Qe,Object.assign({className:"_refLink",mode:r,$activated:!!n,$elipsis:!!l,$shadow:!!s,disabled:!!c,onClick:p},u,{children:t}))},exports.TextComponent=e=>{var{children:t,$color:r,$elipsis:n=!0}=e,o=i(e,["children","$color","$elipsis"]);return h.jsx(v,Object.assign({$elipsis:!!n,$color:r},o,{children:t}))};
|
|
131
143
|
//# sourceMappingURL=index.js.map
|