@isardsat/editorial-admin 6.3.3 → 6.4.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.
Files changed (56) hide show
  1. package/build/client/assets/{authSlice-DST6tNnU.js → authSlice-Ck6mjgyY.js} +163 -163
  2. package/build/client/assets/button-D_tNOZW3.js +1 -0
  3. package/build/client/assets/calendar-6ih_JEvR.js +6 -0
  4. package/build/client/assets/chunk-EF7DTUVF-MlADC7xe.js +51 -0
  5. package/build/client/assets/{createLucideIcon-BOhrmKcl.js → createLucideIcon-BJQzFwzJ.js} +1 -1
  6. package/build/client/assets/dashboard-CCf5hKPx.js +1 -0
  7. package/build/client/assets/dashboard._collection-wP1ZB_LW.js +26 -0
  8. package/build/client/assets/dashboard._collection._document-DIZN2iYh.js +1 -0
  9. package/build/client/assets/dashboard._collection.new-CwbH5p80.js +1 -0
  10. package/build/client/assets/dashboard._layout-DvaVEgFX.js +46 -0
  11. package/build/client/assets/dashboard.files-yiR8nzfC.js +1 -0
  12. package/build/client/assets/entry.client-BI4QA1ti.js +29 -0
  13. package/build/client/assets/external-link-D1If5twJ.js +6 -0
  14. package/build/client/assets/files-JeyUc7x_.js +26 -0
  15. package/build/client/assets/home-B0S_vIyA.js +1 -0
  16. package/build/client/assets/index-BCIQh_1v.js +55 -0
  17. package/build/client/assets/index-BKOWzfnu.js +1 -0
  18. package/build/client/assets/index-BkW3jRP3.js +22 -0
  19. package/build/client/assets/index-b67bZzAe.js +1 -0
  20. package/build/client/assets/{index-BnyqKVWo.js → index-xBXWoUIa.js} +1 -1
  21. package/build/client/assets/itemForm-Cmaxg87K.css +1 -0
  22. package/build/client/assets/itemForm-GgzEy97l.js +106 -0
  23. package/build/client/assets/manifest-4c29314e.js +1 -0
  24. package/build/client/assets/root-CB55qcm6.css +1 -0
  25. package/build/client/assets/root-CBzRfVLY.js +1 -0
  26. package/build/client/assets/spinner-C6NBcdtB.js +11 -0
  27. package/build/client/assets/trash-CN5HT_ZJ.js +11 -0
  28. package/build/client/assets/types-DI1nugUt.js +6 -0
  29. package/build/client/assets/upload-CopmcV94.js +11 -0
  30. package/build/client/assets/utils-DN8wQ0jG.js +9 -0
  31. package/build/client/index.html +3 -3
  32. package/package.json +7 -7
  33. package/build/client/assets/button-DjJX-cbR.js +0 -1
  34. package/build/client/assets/chevron-down-CYVLN3e-.js +0 -6
  35. package/build/client/assets/chunk-EF7DTUVF-CZaHNoTs.js +0 -51
  36. package/build/client/assets/dashboard-BjYHjaPP.js +0 -1
  37. package/build/client/assets/dashboard._collection-U37ELAZn.js +0 -16
  38. package/build/client/assets/dashboard._collection._document-Dt2belpf.js +0 -1
  39. package/build/client/assets/dashboard._collection.new-B-0plYyF.js +0 -1
  40. package/build/client/assets/dashboard._layout-CvH5YBY6.js +0 -61
  41. package/build/client/assets/dashboard.files-7tsycrA_.js +0 -36
  42. package/build/client/assets/editorialApi-CqxxtYzA.js +0 -9
  43. package/build/client/assets/entry.client-DxhHtLqO.js +0 -29
  44. package/build/client/assets/home-BkOGwoQz.js +0 -11
  45. package/build/client/assets/index-B0NebLYn.js +0 -1
  46. package/build/client/assets/index-CQvFoK7s.js +0 -22
  47. package/build/client/assets/index-b1VEd5BJ.js +0 -50
  48. package/build/client/assets/input-DA43W1bc.js +0 -6
  49. package/build/client/assets/itemForm-BVtnhZqg.css +0 -1
  50. package/build/client/assets/itemForm-CnzvRzeD.js +0 -95
  51. package/build/client/assets/manifest-e453e863.js +0 -1
  52. package/build/client/assets/root-Cuw5kjHy.js +0 -1
  53. package/build/client/assets/root-DdgoqUZJ.css +0 -1
  54. package/build/client/assets/trash-CYTPibS3.js +0 -6
  55. package/build/client/assets/tslib.es6-De9GV7Vy.js +0 -1
  56. package/build/client/assets/utils-BSDwSRl3.js +0 -1
@@ -0,0 +1 @@
1
+ import{p as a}from"./chunk-EF7DTUVF-MlADC7xe.js";import{S as o,c as d}from"./index-b67bZzAe.js";import{a as u}from"./utils-DN8wQ0jG.js";const c=d("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function b({className:e,variant:r,size:t,asChild:i=!1,...s}){const n=i?o:"button";return a.jsx(n,{"data-slot":"button",className:u(c({variant:r,size:t,className:e})),...s})}export{b as B,c as b};
@@ -0,0 +1,6 @@
1
+ import{c as e}from"./createLucideIcon-BJQzFwzJ.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const t=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],a=e("calendar",t);export{a as C};
@@ -0,0 +1,51 @@
1
+ function ya(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(n,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var wl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function va(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ut={exports:{}},tt={};/**
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 Ir;function ga(){if(Ir)return tt;Ir=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:l,ref:a!==void 0?a:null,props:o}}return tt.Fragment=t,tt.jsx=r,tt.jsxs=r,tt}var Fr;function wa(){return Fr||(Fr=1,Ut.exports=ga()),Ut.exports}var El=wa(),zt={exports:{}},B={};/**
10
+ * @license React
11
+ * react.production.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 jr;function Ea(){if(jr)return B;jr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),s=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),m=Symbol.iterator;function p(h){return h===null||typeof h!="object"?null:(h=m&&h[m]||h["@@iterator"],typeof h=="function"?h:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,b={};function S(h,x,N){this.props=h,this.context=x,this.refs=b,this.updater=N||w}S.prototype.isReactComponent={},S.prototype.setState=function(h,x){if(typeof h!="object"&&typeof h!="function"&&h!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,h,x,"setState")},S.prototype.forceUpdate=function(h){this.updater.enqueueForceUpdate(this,h,"forceUpdate")};function E(){}E.prototype=S.prototype;function _(h,x,N){this.props=h,this.context=x,this.refs=b,this.updater=N||w}var P=_.prototype=new E;P.constructor=_,R(P,S.prototype),P.isPureReactComponent=!0;var M=Array.isArray,L={H:null,A:null,T:null,S:null,V:null},y=Object.prototype.hasOwnProperty;function j(h,x,N,$,W,Z){return N=Z.ref,{$$typeof:e,type:h,key:x,ref:N!==void 0?N:null,props:Z}}function J(h,x){return j(h.type,x,void 0,void 0,void 0,h.props)}function U(h){return typeof h=="object"&&h!==null&&h.$$typeof===e}function q(h){var x={"=":"=0",":":"=2"};return"$"+h.replace(/[=:]/g,function(N){return x[N]})}var le=/\/+/g;function pe(h,x){return typeof h=="object"&&h!==null&&h.key!=null?q(""+h.key):x.toString(36)}function X(){}function Q(h){switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:switch(typeof h.status=="string"?h.then(X,X):(h.status="pending",h.then(function(x){h.status==="pending"&&(h.status="fulfilled",h.value=x)},function(x){h.status==="pending"&&(h.status="rejected",h.reason=x)})),h.status){case"fulfilled":return h.value;case"rejected":throw h.reason}}throw h}function ae(h,x,N,$,W){var Z=typeof h;(Z==="undefined"||Z==="boolean")&&(h=null);var z=!1;if(h===null)z=!0;else switch(Z){case"bigint":case"string":case"number":z=!0;break;case"object":switch(h.$$typeof){case e:case t:z=!0;break;case f:return z=h._init,ae(z(h._payload),x,N,$,W)}}if(z)return W=W(h),z=$===""?"."+pe(h,0):$,M(W)?(N="",z!=null&&(N=z.replace(le,"$&/")+"/"),ae(W,x,N,"",function($t){return $t})):W!=null&&(U(W)&&(W=J(W,N+(W.key==null||h&&h.key===W.key?"":(""+W.key).replace(le,"$&/")+"/")+z)),x.push(W)),1;z=0;var Se=$===""?".":$+":";if(M(h))for(var oe=0;oe<h.length;oe++)$=h[oe],Z=Se+pe($,oe),z+=ae($,x,N,Z,W);else if(oe=p(h),typeof oe=="function")for(h=oe.call(h),oe=0;!($=h.next()).done;)$=$.value,Z=Se+pe($,oe++),z+=ae($,x,N,Z,W);else if(Z==="object"){if(typeof h.then=="function")return ae(Q(h),x,N,$,W);throw x=String(h),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.")}return z}function Y(h,x,N){if(h==null)return h;var $=[],W=0;return ae(h,$,"","",function(Z){return x.call(N,Z,W++)}),$}function ye(h){if(h._status===-1){var x=h._result;x=x(),x.then(function(N){(h._status===0||h._status===-1)&&(h._status=1,h._result=N)},function(N){(h._status===0||h._status===-1)&&(h._status=2,h._result=N)}),h._status===-1&&(h._status=0,h._result=x)}if(h._status===1)return h._result.default;throw h._result}var se=typeof reportError=="function"?reportError:function(h){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var x=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof h=="object"&&h!==null&&typeof h.message=="string"?String(h.message):String(h),error:h});if(!window.dispatchEvent(x))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",h);return}console.error(h)};function ge(){}return B.Children={map:Y,forEach:function(h,x,N){Y(h,function(){x.apply(this,arguments)},N)},count:function(h){var x=0;return Y(h,function(){x++}),x},toArray:function(h){return Y(h,function(x){return x})||[]},only:function(h){if(!U(h))throw Error("React.Children.only expected to receive a single React element child.");return h}},B.Component=S,B.Fragment=r,B.Profiler=a,B.PureComponent=_,B.StrictMode=n,B.Suspense=i,B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,B.__COMPILER_RUNTIME={__proto__:null,c:function(h){return L.H.useMemoCache(h)}},B.cache=function(h){return function(){return h.apply(null,arguments)}},B.cloneElement=function(h,x,N){if(h==null)throw Error("The argument must be a React element, but you passed "+h+".");var $=R({},h.props),W=h.key,Z=void 0;if(x!=null)for(z in x.ref!==void 0&&(Z=void 0),x.key!==void 0&&(W=""+x.key),x)!y.call(x,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&x.ref===void 0||($[z]=x[z]);var z=arguments.length-2;if(z===1)$.children=N;else if(1<z){for(var Se=Array(z),oe=0;oe<z;oe++)Se[oe]=arguments[oe+2];$.children=Se}return j(h.type,W,void 0,void 0,Z,$)},B.createContext=function(h){return h={$$typeof:l,_currentValue:h,_currentValue2:h,_threadCount:0,Provider:null,Consumer:null},h.Provider=h,h.Consumer={$$typeof:o,_context:h},h},B.createElement=function(h,x,N){var $,W={},Z=null;if(x!=null)for($ in x.key!==void 0&&(Z=""+x.key),x)y.call(x,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(W[$]=x[$]);var z=arguments.length-2;if(z===1)W.children=N;else if(1<z){for(var Se=Array(z),oe=0;oe<z;oe++)Se[oe]=arguments[oe+2];W.children=Se}if(h&&h.defaultProps)for($ in z=h.defaultProps,z)W[$]===void 0&&(W[$]=z[$]);return j(h,Z,void 0,void 0,null,W)},B.createRef=function(){return{current:null}},B.forwardRef=function(h){return{$$typeof:u,render:h}},B.isValidElement=U,B.lazy=function(h){return{$$typeof:f,_payload:{_status:-1,_result:h},_init:ye}},B.memo=function(h,x){return{$$typeof:s,type:h,compare:x===void 0?null:x}},B.startTransition=function(h){var x=L.T,N={};L.T=N;try{var $=h(),W=L.S;W!==null&&W(N,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(ge,se)}catch(Z){se(Z)}finally{L.T=x}},B.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},B.use=function(h){return L.H.use(h)},B.useActionState=function(h,x,N){return L.H.useActionState(h,x,N)},B.useCallback=function(h,x){return L.H.useCallback(h,x)},B.useContext=function(h){return L.H.useContext(h)},B.useDebugValue=function(){},B.useDeferredValue=function(h,x){return L.H.useDeferredValue(h,x)},B.useEffect=function(h,x,N){var $=L.H;if(typeof N=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return $.useEffect(h,x)},B.useId=function(){return L.H.useId()},B.useImperativeHandle=function(h,x,N){return L.H.useImperativeHandle(h,x,N)},B.useInsertionEffect=function(h,x){return L.H.useInsertionEffect(h,x)},B.useLayoutEffect=function(h,x){return L.H.useLayoutEffect(h,x)},B.useMemo=function(h,x){return L.H.useMemo(h,x)},B.useOptimistic=function(h,x){return L.H.useOptimistic(h,x)},B.useReducer=function(h,x,N){return L.H.useReducer(h,x,N)},B.useRef=function(h){return L.H.useRef(h)},B.useState=function(h){return L.H.useState(h)},B.useSyncExternalStore=function(h,x,N){return L.H.useSyncExternalStore(h,x,N)},B.useTransition=function(){return L.H.useTransition()},B.version="19.1.0",B}var Hr;function Ra(){return Hr||(Hr=1,zt.exports=Ea()),zt.exports}var d=Ra();const ba=va(d),Rl=ya({__proto__:null,default:ba},[d]);/**
18
+ * react-router v7.7.0
19
+ *
20
+ * Copyright (c) Remix Software Inc.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE.md file in the root directory of this source tree.
24
+ *
25
+ * @license MIT
26
+ */var hn=e=>{throw TypeError(e)},Sa=(e,t,r)=>t.has(e)||hn("Cannot "+r),Bt=(e,t,r)=>(Sa(e,t,"read from private field"),r?r.call(e):t.get(e)),xa=(e,t,r)=>t.has(e)?hn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ur="popstate";function bl(e={}){function t(n,a){let{pathname:o,search:l,hash:u}=n.location;return ot("",{pathname:o,search:l,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Oe(a)}return La(t,r,null,e)}function V(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ne(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ca(){return Math.random().toString(36).substring(2,10)}function zr(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ae(t):t,state:r,key:t&&t.key||n||Ca()}}function Oe({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 Ae(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 La(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,u="POP",i=null,s=f();s==null&&(s=0,l.replaceState({...l.state,idx:s},""));function f(){return(l.state||{idx:null}).idx}function m(){u="POP";let S=f(),E=S==null?null:S-s;s=S,i&&i({action:u,location:b.location,delta:E})}function p(S,E){u="PUSH";let _=ot(b.location,S,E);s=f()+1;let P=zr(_,s),M=b.createHref(_);try{l.pushState(P,"",M)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(M)}o&&i&&i({action:u,location:b.location,delta:1})}function w(S,E){u="REPLACE";let _=ot(b.location,S,E);s=f();let P=zr(_,s),M=b.createHref(_);l.replaceState(P,"",M),o&&i&&i({action:u,location:b.location,delta:0})}function R(S){return mn(S)}let b={get action(){return u},get location(){return e(a,l)},listen(S){if(i)throw new Error("A history only accepts one active listener");return a.addEventListener(Ur,m),i=S,()=>{a.removeEventListener(Ur,m),i=null}},createHref(S){return t(a,S)},createURL:R,encodeLocation(S){let E=R(S);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:p,replace:w,go(S){return l.go(S)}};return b}function mn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),V(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Oe(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var at,Br=class{constructor(e){if(xa(this,at,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Bt(this,at).has(e))return Bt(this,at).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Bt(this,at).set(e,t)}};at=new WeakMap;var Pa=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ta(e){return Pa.has(e)}var Ma=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function _a(e){return Ma.has(e)}function Da(e){return e.index===!0}function it(e,t,r=[],n={},a=!1){return e.map((o,l)=>{let u=[...r,String(l)],i=typeof o.id=="string"?o.id:u.join("-");if(V(o.index!==!0||!o.children,"Cannot specify children on an index route"),V(a||!n[i],`Found a route id collision on id "${i}". Route id's must be globally unique within Data Router usages`),Da(o)){let s={...o,...t(o),id:i};return n[i]=s,s}else{let s={...o,...t(o),id:i,children:void 0};return n[i]=s,o.children&&(s.children=it(o.children,t,u,n,a)),s}})}function Te(e,t,r="/"){return St(e,t,r,!1)}function St(e,t,r,n){let a=typeof t=="string"?Ae(t):t,o=me(a.pathname||"/",r);if(o==null)return null;let l=yn(e);ka(l);let u=null;for(let i=0;u==null&&i<l.length;++i){let s=za(o);u=Ua(l[i],s,n)}return u}function pn(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function yn(e,t=[],r=[],n=""){let a=(o,l,u)=>{let i={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};i.relativePath.startsWith("/")&&(V(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 s=Ce([n,i.relativePath]),f=r.concat(i);o.children&&o.children.length>0&&(V(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),yn(o.children,t,f,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:ja(s,o.index),routesMeta:f})};return e.forEach((o,l)=>{if(o.path===""||!o.path?.includes("?"))a(o,l);else for(let u of vn(o.path))a(o,l,u)}),t}function vn(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let l=vn(n.join("/")),u=[];return u.push(...l.map(i=>i===""?o:[o,i].join("/"))),a&&u.push(...l),u.map(i=>e.startsWith("/")&&i===""?"/":i)}function ka(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ha(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Oa=/^:[\w-]+$/,Aa=3,Na=2,$a=1,Ia=10,Fa=-2,Wr=e=>e==="*";function ja(e,t){let r=e.split("/"),n=r.length;return r.some(Wr)&&(n+=Fa),t&&(n+=Na),r.filter(a=>!Wr(a)).reduce((a,o)=>a+(Oa.test(o)?Aa:o===""?$a:Ia),n)}function Ha(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Ua(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let u=0;u<n.length;++u){let i=n[u],s=u===n.length-1,f=o==="/"?t:t.slice(o.length)||"/",m=Mt({path:i.relativePath,caseSensitive:i.caseSensitive,end:s},f),p=i.route;if(!m&&s&&r&&!n[n.length-1].route.index&&(m=Mt({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},f)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:Ce([o,m.pathname]),pathnameBase:Va(Ce([o,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(o=Ce([o,m.pathnameBase]))}return l}function Mt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=gn(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:n.reduce((s,{paramName:f,isOptional:m},p)=>{if(f==="*"){let R=u[p]||"";l=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const w=u[p];return m&&!w?s[f]=void 0:s[f]=(w||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:l,pattern:e}}function gn(e,t=!1,r=!0){ne(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,i)=>(n.push({paramName:u,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function za(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ne(!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 me(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 Ba({basename:e,pathname:t}){return t==="/"?e:Ce([e,t])}function Wa(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ae(e):e;return{pathname:r?r.startsWith("/")?r:Ya(r,t):t,search:Ja(n),hash:Ga(a)}}function Ya(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Wt(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 wn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function sr(e){let t=wn(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function ur(e,t,r,n=!1){let a;typeof e=="string"?a=Ae(e):(a={...e},V(!a.pathname||!a.pathname.includes("?"),Wt("?","pathname","search",a)),V(!a.pathname||!a.pathname.includes("#"),Wt("#","pathname","hash",a)),V(!a.search||!a.search.includes("#"),Wt("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,u;if(l==null)u=r;else{let m=t.length-1;if(!n&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),m-=1;a.pathname=p.join("/")}u=m>=0?t[m]:"/"}let i=Wa(a,u),s=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(s||f)&&(i.pathname+="/"),i}var Ce=e=>e.join("/").replace(/\/\/+/g,"/"),Va=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ja=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ga=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Xa=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Ka(e,t){return new Xa(e,typeof t=="number"?{status:t}:t)}var qa=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},Ue=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function ze(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var En=["POST","PUT","PATCH","DELETE"],Qa=new Set(En),Za=["GET",...En],eo=new Set(Za),to=new Set([301,302,303,307,308]),ro=new Set([307,308]),Yt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},no={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ye={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ao=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cr=e=>ao.test(e),oo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Rn="remix-router-transitions",bn=Symbol("ResetLoaderData");function Sl(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";V(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||oo,o={},l=it(e.routes,a,void 0,o),u,i=e.basename||"/",s=e.dataStrategy||co,f={unstable_middleware:!1,...e.future},m=null,p=new Set,w=null,R=null,b=null,S=e.hydrationData!=null,E=Te(l,e.history.location,i),_=!1,P=null,M;if(E==null&&!e.patchRoutesOnNavigation){let c=Ee(404,{pathname:e.history.location.pathname}),{matches:v,route:g}=rn(l);M=!0,E=v,P={[g.id]:c}}else if(E&&!e.hydrationData&&ft(E,l,e.history.location.pathname).active&&(E=null),E)if(E.some(c=>c.route.lazy))M=!1;else if(!E.some(c=>c.route.loader))M=!0;else{let c=e.hydrationData?e.hydrationData.loaderData:null,v=e.hydrationData?e.hydrationData.errors:null;if(v){let g=E.findIndex(C=>v[C.route.id]!==void 0);M=E.slice(0,g+1).every(C=>!Qt(C.route,c,v))}else M=E.every(g=>!Qt(g.route,c,v))}else{M=!1,E=[];let c=ft(null,l,e.history.location.pathname);c.active&&c.matches&&(_=!0,E=c.matches)}let L,y={historyAction:e.history.action,location:e.history.location,matches:E,initialized:M,navigation:Yt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||P,fetchers:new Map,blockers:new Map},j="POP",J=!1,U,q=!1,le=new Map,pe=null,X=!1,Q=!1,ae=new Set,Y=new Map,ye=0,se=-1,ge=new Map,h=new Set,x=new Map,N=new Map,$=new Set,W=new Map,Z,z=null;function Se(){if(m=e.history.listen(({action:c,location:v,delta:g})=>{if(Z){Z(),Z=void 0;return}ne(W.size===0||g!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let C=Or({currentLocation:y.location,nextLocation:v,historyAction:c});if(C&&g!=null){let T=new Promise(k=>{Z=k});e.history.go(g*-1),dt(C,{state:"blocked",location:v,proceed(){dt(C,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),T.then(()=>e.history.go(g))},reset(){let k=new Map(y.blockers);k.set(C,Ye),ue({blockers:k})}});return}return Ne(c,v)}),r){bo(t,le);let c=()=>So(t,le);t.addEventListener("pagehide",c),pe=()=>t.removeEventListener("pagehide",c)}return y.initialized||Ne("POP",y.location,{initialHydration:!0}),L}function oe(){m&&m(),pe&&pe(),p.clear(),U&&U.abort(),y.fetchers.forEach((c,v)=>Ft(v)),y.blockers.forEach((c,v)=>kr(v))}function $t(c){return p.add(c),()=>p.delete(c)}function ue(c,v={}){c.matches&&(c.matches=c.matches.map(T=>{let k=o[T.route.id],O=T.route;return O.element!==k.element||O.errorElement!==k.errorElement||O.hydrateFallbackElement!==k.hydrateFallbackElement?{...T,route:k}:T})),y={...y,...c};let g=[],C=[];y.fetchers.forEach((T,k)=>{T.state==="idle"&&($.has(k)?g.push(k):C.push(k))}),$.forEach(T=>{!y.fetchers.has(T)&&!Y.has(T)&&g.push(T)}),[...p].forEach(T=>T(y,{deletedFetchers:g,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),g.forEach(T=>Ft(T)),C.forEach(T=>y.fetchers.delete(T))}function We(c,v,{flushSync:g}={}){let C=y.actionData!=null&&y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&y.navigation.state==="loading"&&c.state?._isRedirect!==!0,T;v.actionData?Object.keys(v.actionData).length>0?T=v.actionData:T=null:C?T=y.actionData:T=null;let k=v.loaderData?en(y.loaderData,v.loaderData,v.matches||[],v.errors):y.loaderData,O=y.blockers;O.size>0&&(O=new Map(O),O.forEach((A,F)=>O.set(F,Ye)));let D=X?!1:Nr(c,v.matches||y.matches),I=J===!0||y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&c.state?._isRedirect!==!0;u&&(l=u,u=void 0),X||j==="POP"||(j==="PUSH"?e.history.push(c,c.state):j==="REPLACE"&&e.history.replace(c,c.state));let H;if(j==="POP"){let A=le.get(y.location.pathname);A&&A.has(c.pathname)?H={currentLocation:y.location,nextLocation:c}:le.has(c.pathname)&&(H={currentLocation:c,nextLocation:y.location})}else if(q){let A=le.get(y.location.pathname);A?A.add(c.pathname):(A=new Set([c.pathname]),le.set(y.location.pathname,A)),H={currentLocation:y.location,nextLocation:c}}ue({...v,actionData:T,loaderData:k,historyAction:j,location:c,initialized:!0,navigation:Yt,revalidation:"idle",restoreScrollPosition:D,preventScrollReset:I,blockers:O},{viewTransitionOpts:H,flushSync:g===!0}),j="POP",J=!1,q=!1,X=!1,Q=!1,z?.resolve(),z=null}async function Cr(c,v){if(typeof c=="number"){e.history.go(c);return}let g=qt(y.location,y.matches,i,c,v?.fromRouteId,v?.relative),{path:C,submission:T,error:k}=Yr(!1,g,v),O=y.location,D=ot(y.location,C,v&&v.state);D={...D,...e.history.encodeLocation(D)};let I=v&&v.replace!=null?v.replace:void 0,H="PUSH";I===!0?H="REPLACE":I===!1||T!=null&&ve(T.formMethod)&&T.formAction===y.location.pathname+y.location.search&&(H="REPLACE");let A=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,F=(v&&v.flushSync)===!0,G=Or({currentLocation:O,nextLocation:D,historyAction:H});if(G){dt(G,{state:"blocked",location:D,proceed(){dt(G,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),Cr(c,v)},reset(){let te=new Map(y.blockers);te.set(G,Ye),ue({blockers:te})}});return}await Ne(H,D,{submission:T,pendingError:k,preventScrollReset:A,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:F})}function ra(){z||(z=xo()),It(),ue({revalidation:"loading"});let c=z.promise;return y.navigation.state==="submitting"?c:y.navigation.state==="idle"?(Ne(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),c):(Ne(j||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:q===!0}),c)}async function Ne(c,v,g){U&&U.abort(),U=null,j=c,X=(g&&g.startUninterruptedRevalidation)===!0,fa(y.location,y.matches),J=(g&&g.preventScrollReset)===!0,q=(g&&g.enableViewTransition)===!0;let C=u||l,T=g&&g.overrideNavigation,k=g?.initialHydration&&y.matches&&y.matches.length>0&&!_?y.matches:Te(C,v,i),O=(g&&g.flushSync)===!0;if(k&&y.initialized&&!Q&&vo(y.location,v)&&!(g&&g.submission&&ve(g.submission.formMethod))){We(v,{matches:k},{flushSync:O});return}let D=ft(k,C,v.pathname);if(D.active&&D.matches&&(k=D.matches),!k){let{error:fe,notFoundMatches:re,route:ee}=jt(v.pathname);We(v,{matches:re,loaderData:{},errors:{[ee.id]:fe}},{flushSync:O});return}U=new AbortController;let I=Ve(e.history,v,U.signal,g&&g.submission),H=new Br(e.unstable_getContext?await e.unstable_getContext():void 0),A;if(g&&g.pendingError)A=[je(k).route.id,{type:"error",error:g.pendingError}];else if(g&&g.submission&&ve(g.submission.formMethod)){let fe=await na(I,v,g.submission,k,H,D.active,g&&g.initialHydration===!0,{replace:g.replace,flushSync:O});if(fe.shortCircuited)return;if(fe.pendingActionResult){let[re,ee]=fe.pendingActionResult;if(we(ee)&&ze(ee.error)&&ee.error.status===404){U=null,We(v,{matches:fe.matches,loaderData:{},errors:{[re]:ee.error}});return}}k=fe.matches||k,A=fe.pendingActionResult,T=Vt(v,g.submission),O=!1,D.active=!1,I=Ve(e.history,I.url,I.signal)}let{shortCircuited:F,matches:G,loaderData:te,errors:ce}=await aa(I,v,k,H,D.active,T,g&&g.submission,g&&g.fetcherSubmission,g&&g.replace,g&&g.initialHydration===!0,O,A);F||(U=null,We(v,{matches:G||k,...tn(A),loaderData:te,errors:ce}))}async function na(c,v,g,C,T,k,O,D={}){It();let I=Eo(v,g);if(ue({navigation:I},{flushSync:D.flushSync===!0}),k){let F=await ht(C,v.pathname,c.signal);if(F.type==="aborted")return{shortCircuited:!0};if(F.type==="error"){let G=je(F.partialMatches).route.id;return{matches:F.partialMatches,pendingActionResult:[G,{type:"error",error:F.error}]}}else if(F.matches)C=F.matches;else{let{notFoundMatches:G,error:te,route:ce}=jt(v.pathname);return{matches:G,pendingActionResult:[ce.id,{type:"error",error:te}]}}}let H,A=xt(C,v);if(!A.route.action&&!A.route.lazy)H={type:"error",error:Ee(405,{method:c.method,pathname:v.pathname,routeId:A.route.id})};else{let F=Je(a,o,c,C,A,O?[]:n,T),G=await qe(c,F,T,null);if(H=G[A.route.id],!H){for(let te of C)if(G[te.route.id]){H=G[te.route.id];break}}if(c.signal.aborted)return{shortCircuited:!0}}if(He(H)){let F;return D&&D.replace!=null?F=D.replace:F=qr(H.response.headers.get("Location"),new URL(c.url),i)===y.location.pathname+y.location.search,await $e(c,H,!0,{submission:g,replace:F}),{shortCircuited:!0}}if(we(H)){let F=je(C,A.route.id);return(D&&D.replace)!==!0&&(j="PUSH"),{matches:C,pendingActionResult:[F.route.id,H,A.route.id]}}return{matches:C,pendingActionResult:[A.route.id,H]}}async function aa(c,v,g,C,T,k,O,D,I,H,A,F){let G=k||Vt(v,O),te=O||D||nn(G),ce=!X&&!H;if(T){if(ce){let de=Lr(F);ue({navigation:G,...de!==void 0?{actionData:de}:{}},{flushSync:A})}let K=await ht(g,v.pathname,c.signal);if(K.type==="aborted")return{shortCircuited:!0};if(K.type==="error"){let de=je(K.partialMatches).route.id;return{matches:K.partialMatches,loaderData:{},errors:{[de]:K.error}}}else if(K.matches)g=K.matches;else{let{error:de,notFoundMatches:yt,route:et}=jt(v.pathname);return{matches:yt,loaderData:{},errors:{[et.id]:de}}}}let fe=u||l,{dsMatches:re,revalidatingFetchers:ee}=Vr(c,C,a,o,e.history,y,g,te,v,H?[]:n,H===!0,Q,ae,$,x,h,fe,i,e.patchRoutesOnNavigation!=null,F);if(se=++ye,!e.dataStrategy&&!re.some(K=>K.shouldLoad)&&ee.length===0){let K=_r();return We(v,{matches:g,loaderData:{},errors:F&&we(F[1])?{[F[0]]:F[1].error}:null,...tn(F),...K?{fetchers:new Map(y.fetchers)}:{}},{flushSync:A}),{shortCircuited:!0}}if(ce){let K={};if(!T){K.navigation=G;let de=Lr(F);de!==void 0&&(K.actionData=de)}ee.length>0&&(K.fetchers=oa(ee)),ue(K,{flushSync:A})}ee.forEach(K=>{_e(K.key),K.controller&&Y.set(K.key,K.controller)});let Ie=()=>ee.forEach(K=>_e(K.key));U&&U.signal.addEventListener("abort",Ie);let{loaderResults:Qe,fetcherResults:De}=await Pr(re,ee,c,C);if(c.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Ie),ee.forEach(K=>Y.delete(K.key));let xe=gt(Qe);if(xe)return await $e(c,xe.result,!0,{replace:I}),{shortCircuited:!0};if(xe=gt(De),xe)return h.add(xe.key),await $e(c,xe.result,!0,{replace:I}),{shortCircuited:!0};let{loaderData:Ht,errors:Ze}=Zr(y,g,Qe,F,ee,De);H&&y.errors&&(Ze={...y.errors,...Ze});let Fe=_r(),mt=Dr(se),pt=Fe||mt||ee.length>0;return{matches:g,loaderData:Ht,errors:Ze,...pt?{fetchers:new Map(y.fetchers)}:{}}}function Lr(c){if(c&&!we(c[1]))return{[c[0]]:c[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function oa(c){return c.forEach(v=>{let g=y.fetchers.get(v.key),C=rt(void 0,g?g.data:void 0);y.fetchers.set(v.key,C)}),new Map(y.fetchers)}async function ia(c,v,g,C){_e(c);let T=(C&&C.flushSync)===!0,k=u||l,O=qt(y.location,y.matches,i,g,v,C?.relative),D=Te(k,O,i),I=ft(D,k,O);if(I.active&&I.matches&&(D=I.matches),!D){Pe(c,v,Ee(404,{pathname:O}),{flushSync:T});return}let{path:H,submission:A,error:F}=Yr(!0,O,C);if(F){Pe(c,v,F,{flushSync:T});return}let G=new Br(e.unstable_getContext?await e.unstable_getContext():void 0),te=(C&&C.preventScrollReset)===!0;if(A&&ve(A.formMethod)){await la(c,v,H,D,G,I.active,T,te,A);return}x.set(c,{routeId:v,path:H}),await sa(c,v,H,D,G,I.active,T,te,A)}async function la(c,v,g,C,T,k,O,D,I){It(),x.delete(c);let H=y.fetchers.get(c);Me(c,Ro(I,H),{flushSync:O});let A=new AbortController,F=Ve(e.history,g,A.signal,I);if(k){let ie=await ht(C,new URL(F.url).pathname,F.signal,c);if(ie.type==="aborted")return;if(ie.type==="error"){Pe(c,v,ie.error,{flushSync:O});return}else if(ie.matches)C=ie.matches;else{Pe(c,v,Ee(404,{pathname:g}),{flushSync:O});return}}let G=xt(C,g);if(!G.route.action&&!G.route.lazy){let ie=Ee(405,{method:I.formMethod,pathname:g,routeId:v});Pe(c,v,ie,{flushSync:O});return}Y.set(c,A);let te=ye,ce=Je(a,o,F,C,G,n,T),re=(await qe(F,ce,T,c))[G.route.id];if(F.signal.aborted){Y.get(c)===A&&Y.delete(c);return}if($.has(c)){if(He(re)||we(re)){Me(c,ke(void 0));return}}else{if(He(re))if(Y.delete(c),se>te){Me(c,ke(void 0));return}else return h.add(c),Me(c,rt(I)),$e(F,re,!1,{fetcherSubmission:I,preventScrollReset:D});if(we(re)){Pe(c,v,re.error);return}}let ee=y.navigation.location||y.location,Ie=Ve(e.history,ee,A.signal),Qe=u||l,De=y.navigation.state!=="idle"?Te(Qe,y.navigation.location,i):y.matches;V(De,"Didn't find any matches after fetcher action");let xe=++ye;ge.set(c,xe);let Ht=rt(I,re.data);y.fetchers.set(c,Ht);let{dsMatches:Ze,revalidatingFetchers:Fe}=Vr(Ie,T,a,o,e.history,y,De,I,ee,n,!1,Q,ae,$,x,h,Qe,i,e.patchRoutesOnNavigation!=null,[G.route.id,re]);Fe.filter(ie=>ie.key!==c).forEach(ie=>{let vt=ie.key,$r=y.fetchers.get(vt),pa=rt(void 0,$r?$r.data:void 0);y.fetchers.set(vt,pa),_e(vt),ie.controller&&Y.set(vt,ie.controller)}),ue({fetchers:new Map(y.fetchers)});let mt=()=>Fe.forEach(ie=>_e(ie.key));A.signal.addEventListener("abort",mt);let{loaderResults:pt,fetcherResults:K}=await Pr(Ze,Fe,Ie,T);if(A.signal.aborted)return;if(A.signal.removeEventListener("abort",mt),ge.delete(c),Y.delete(c),Fe.forEach(ie=>Y.delete(ie.key)),y.fetchers.has(c)){let ie=ke(re.data);y.fetchers.set(c,ie)}let de=gt(pt);if(de)return $e(Ie,de.result,!1,{preventScrollReset:D});if(de=gt(K),de)return h.add(de.key),$e(Ie,de.result,!1,{preventScrollReset:D});let{loaderData:yt,errors:et}=Zr(y,De,pt,void 0,Fe,K);Dr(xe),y.navigation.state==="loading"&&xe>se?(V(j,"Expected pending action"),U&&U.abort(),We(y.navigation.location,{matches:De,loaderData:yt,errors:et,fetchers:new Map(y.fetchers)})):(ue({errors:et,loaderData:en(y.loaderData,yt,De,et),fetchers:new Map(y.fetchers)}),Q=!1)}async function sa(c,v,g,C,T,k,O,D,I){let H=y.fetchers.get(c);Me(c,rt(I,H?H.data:void 0),{flushSync:O});let A=new AbortController,F=Ve(e.history,g,A.signal);if(k){let ee=await ht(C,new URL(F.url).pathname,F.signal,c);if(ee.type==="aborted")return;if(ee.type==="error"){Pe(c,v,ee.error,{flushSync:O});return}else if(ee.matches)C=ee.matches;else{Pe(c,v,Ee(404,{pathname:g}),{flushSync:O});return}}let G=xt(C,g);Y.set(c,A);let te=ye,ce=Je(a,o,F,C,G,n,T),re=(await qe(F,ce,T,c))[G.route.id];if(Y.get(c)===A&&Y.delete(c),!F.signal.aborted){if($.has(c)){Me(c,ke(void 0));return}if(He(re))if(se>te){Me(c,ke(void 0));return}else{h.add(c),await $e(F,re,!1,{preventScrollReset:D});return}if(we(re)){Pe(c,v,re.error);return}Me(c,ke(re.data))}}async function $e(c,v,g,{submission:C,fetcherSubmission:T,preventScrollReset:k,replace:O}={}){v.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let D=v.response.headers.get("Location");V(D,"Expected a Location header on the redirect Response"),D=qr(D,new URL(c.url),i);let I=ot(y.location,D,{_isRedirect:!0});if(r){let ce=!1;if(v.response.headers.has("X-Remix-Reload-Document"))ce=!0;else if(cr(D)){const fe=mn(D,!0);ce=fe.origin!==t.location.origin||me(fe.pathname,i)==null}if(ce){O?t.location.replace(D):t.location.assign(D);return}}U=null;let H=O===!0||v.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:A,formAction:F,formEncType:G}=y.navigation;!C&&!T&&A&&F&&G&&(C=nn(y.navigation));let te=C||T;if(ro.has(v.response.status)&&te&&ve(te.formMethod))await Ne(H,I,{submission:{...te,formAction:D},preventScrollReset:k||J,enableViewTransition:g?q:void 0});else{let ce=Vt(I,C);await Ne(H,I,{overrideNavigation:ce,fetcherSubmission:T,preventScrollReset:k||J,enableViewTransition:g?q:void 0})}}async function qe(c,v,g,C){let T,k={};try{T=await fo(s,c,v,C,g,!1)}catch(O){return v.filter(D=>D.shouldLoad).forEach(D=>{k[D.route.id]={type:"error",error:O}}),k}if(c.signal.aborted)return k;for(let[O,D]of Object.entries(T))if(go(D)){let I=D.result;k[O]={type:"redirect",response:po(I,c,O,v,i)}}else k[O]=await mo(D);return k}async function Pr(c,v,g,C){let T=qe(g,c,C,null),k=Promise.all(v.map(async I=>{if(I.matches&&I.match&&I.request&&I.controller){let A=(await qe(I.request,I.matches,C,I.key))[I.match.route.id];return{[I.key]:A}}else return Promise.resolve({[I.key]:{type:"error",error:Ee(404,{pathname:I.path})}})})),O=await T,D=(await k).reduce((I,H)=>Object.assign(I,H),{});return{loaderResults:O,fetcherResults:D}}function It(){Q=!0,x.forEach((c,v)=>{Y.has(v)&&ae.add(v),_e(v)})}function Me(c,v,g={}){y.fetchers.set(c,v),ue({fetchers:new Map(y.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function Pe(c,v,g,C={}){let T=je(y.matches,v);Ft(c),ue({errors:{[T.route.id]:g},fetchers:new Map(y.fetchers)},{flushSync:(C&&C.flushSync)===!0})}function Tr(c){return N.set(c,(N.get(c)||0)+1),$.has(c)&&$.delete(c),y.fetchers.get(c)||no}function Ft(c){let v=y.fetchers.get(c);Y.has(c)&&!(v&&v.state==="loading"&&ge.has(c))&&_e(c),x.delete(c),ge.delete(c),h.delete(c),$.delete(c),ae.delete(c),y.fetchers.delete(c)}function ua(c){let v=(N.get(c)||0)-1;v<=0?(N.delete(c),$.add(c)):N.set(c,v),ue({fetchers:new Map(y.fetchers)})}function _e(c){let v=Y.get(c);v&&(v.abort(),Y.delete(c))}function Mr(c){for(let v of c){let g=Tr(v),C=ke(g.data);y.fetchers.set(v,C)}}function _r(){let c=[],v=!1;for(let g of h){let C=y.fetchers.get(g);V(C,`Expected fetcher: ${g}`),C.state==="loading"&&(h.delete(g),c.push(g),v=!0)}return Mr(c),v}function Dr(c){let v=[];for(let[g,C]of ge)if(C<c){let T=y.fetchers.get(g);V(T,`Expected fetcher: ${g}`),T.state==="loading"&&(_e(g),ge.delete(g),v.push(g))}return Mr(v),v.length>0}function ca(c,v){let g=y.blockers.get(c)||Ye;return W.get(c)!==v&&W.set(c,v),g}function kr(c){y.blockers.delete(c),W.delete(c)}function dt(c,v){let g=y.blockers.get(c)||Ye;V(g.state==="unblocked"&&v.state==="blocked"||g.state==="blocked"&&v.state==="blocked"||g.state==="blocked"&&v.state==="proceeding"||g.state==="blocked"&&v.state==="unblocked"||g.state==="proceeding"&&v.state==="unblocked",`Invalid blocker state transition: ${g.state} -> ${v.state}`);let C=new Map(y.blockers);C.set(c,v),ue({blockers:C})}function Or({currentLocation:c,nextLocation:v,historyAction:g}){if(W.size===0)return;W.size>1&&ne(!1,"A router only supports one blocker at a time");let C=Array.from(W.entries()),[T,k]=C[C.length-1],O=y.blockers.get(T);if(!(O&&O.state==="proceeding")&&k({currentLocation:c,nextLocation:v,historyAction:g}))return T}function jt(c){let v=Ee(404,{pathname:c}),g=u||l,{matches:C,route:T}=rn(g);return{notFoundMatches:C,route:T,error:v}}function da(c,v,g){if(w=c,b=v,R=g||null,!S&&y.navigation===Yt){S=!0;let C=Nr(y.location,y.matches);C!=null&&ue({restoreScrollPosition:C})}return()=>{w=null,b=null,R=null}}function Ar(c,v){return R&&R(c,v.map(C=>pn(C,y.loaderData)))||c.key}function fa(c,v){if(w&&b){let g=Ar(c,v);w[g]=b()}}function Nr(c,v){if(w){let g=Ar(c,v),C=w[g];if(typeof C=="number")return C}return null}function ft(c,v,g){if(e.patchRoutesOnNavigation)if(c){if(Object.keys(c[0].params).length>0)return{active:!0,matches:St(v,g,i,!0)}}else return{active:!0,matches:St(v,g,i,!0)||[]};return{active:!1,matches:null}}async function ht(c,v,g,C){if(!e.patchRoutesOnNavigation)return{type:"success",matches:c};let T=c;for(;;){let k=u==null,O=u||l,D=o;try{await e.patchRoutesOnNavigation({signal:g,path:v,matches:T,fetcherKey:C,patch:(A,F)=>{g.aborted||Jr(A,F,O,D,a,!1)}})}catch(A){return{type:"error",error:A,partialMatches:T}}finally{k&&!g.aborted&&(l=[...l])}if(g.aborted)return{type:"aborted"};let I=Te(O,v,i);if(I)return{type:"success",matches:I};let H=St(O,v,i,!0);if(!H||T.length===H.length&&T.every((A,F)=>A.route.id===H[F].route.id))return{type:"success",matches:null};T=H}}function ha(c){o={},u=it(c,a,void 0,o)}function ma(c,v,g=!1){let C=u==null;Jr(c,v,u||l,o,a,g),C&&(l=[...l],ue({}))}return L={get basename(){return i},get future(){return f},get state(){return y},get routes(){return l},get window(){return t},initialize:Se,subscribe:$t,enableScrollRestoration:da,navigate:Cr,fetch:ia,revalidate:ra,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:Tr,deleteFetcher:ua,dispose:oe,getBlocker:ca,deleteBlocker:kr,patchRoutes:ma,_internalFetchControllers:Y,_internalSetRoutes:ha,_internalSetStateDoNotUseOrYouWillBreakYourApp(c){ue(c)}},L}function io(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qt(e,t,r,n,a,o){let l,u;if(a){l=[];for(let s of t)if(l.push(s),s.route.id===a){u=s;break}}else l=t,u=t[t.length-1];let i=ur(n||".",sr(l),me(e.pathname,r)||e.pathname,o==="path");if(n==null&&(i.search=e.search,i.hash=e.hash),(n==null||n===""||n===".")&&u){let s=fr(i.search);if(u.route.index&&!s)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&s){let f=new URLSearchParams(i.search),m=f.getAll("index");f.delete("index"),m.filter(w=>w).forEach(w=>f.append("index",w));let p=f.toString();i.search=p?`?${p}`:""}}return r!=="/"&&(i.pathname=Ba({basename:r,pathname:i.pathname})),Oe(i)}function Yr(e,t,r){if(!r||!io(r))return{path:t};if(r.formMethod&&!wo(r.formMethod))return{path:t,error:Ee(405,{method:r.formMethod})};let n=()=>({path:t,error:Ee(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=Tn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return n();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[w,R])=>`${p}${w}=${R}
27
+ `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:m}}}else if(r.formEncType==="application/json"){if(!ve(o))return n();try{let m=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:m,text:void 0}}}catch{return n()}}}V(typeof FormData=="function","FormData is not available in this environment");let u,i;if(r.formData)u=er(r.formData),i=r.formData;else if(r.body instanceof FormData)u=er(r.body),i=r.body;else if(r.body instanceof URLSearchParams)u=r.body,i=Qr(u);else if(r.body==null)u=new URLSearchParams,i=new FormData;else try{u=new URLSearchParams(r.body),i=Qr(u)}catch{return n()}let s={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ve(s.formMethod))return{path:t,submission:s};let f=Ae(t);return e&&f.search&&fr(f.search)&&u.append("index",""),f.search=`?${u}`,{path:Oe(f),submission:s}}function Vr(e,t,r,n,a,o,l,u,i,s,f,m,p,w,R,b,S,E,_,P){let M=P?we(P[1])?P[1].error:P[1].data:void 0,L=a.createURL(o.location),y=a.createURL(i),j;if(f&&o.errors){let X=Object.keys(o.errors)[0];j=l.findIndex(Q=>Q.route.id===X)}else if(P&&we(P[1])){let X=P[0];j=l.findIndex(Q=>Q.route.id===X)-1}let J=P?P[1].statusCode:void 0,U=J&&J>=400,q={currentUrl:L,currentParams:o.matches[0]?.params||{},nextUrl:y,nextParams:l[0].params,...u,actionResult:M,actionStatus:J},le=l.map((X,Q)=>{let{route:ae}=X,Y=null;if(j!=null&&Q>j?Y=!1:ae.lazy?Y=!0:ae.loader==null?Y=!1:f?Y=Qt(ae,o.loaderData,o.errors):lo(o.loaderData,o.matches[Q],X)&&(Y=!0),Y!==null)return Zt(r,n,e,X,s,t,Y);let ye=U?!1:m||L.pathname+L.search===y.pathname+y.search||L.search!==y.search||so(o.matches[Q],X),se={...q,defaultShouldRevalidate:ye},ge=_t(X,se);return Zt(r,n,e,X,s,t,ge,se)}),pe=[];return R.forEach((X,Q)=>{if(f||!l.some(N=>N.route.id===X.routeId)||w.has(Q))return;let ae=o.fetchers.get(Q),Y=ae&&ae.state!=="idle"&&ae.data===void 0,ye=Te(S,X.path,E);if(!ye){if(_&&Y)return;pe.push({key:Q,routeId:X.routeId,path:X.path,matches:null,match:null,request:null,controller:null});return}if(b.has(Q))return;let se=xt(ye,X.path),ge=new AbortController,h=Ve(a,X.path,ge.signal),x=null;if(p.has(Q))p.delete(Q),x=Je(r,n,h,ye,se,s,t);else if(Y)m&&(x=Je(r,n,h,ye,se,s,t));else{let N={...q,defaultShouldRevalidate:U?!1:m};_t(se,N)&&(x=Je(r,n,h,ye,se,s,t,N))}x&&pe.push({key:Q,routeId:X.routeId,path:X.path,matches:x,match:se,request:h,controller:ge})}),{dsMatches:le,revalidatingFetchers:pe}}function Qt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function lo(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function so(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function _t(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Jr(e,t,r,n,a,o){let l;if(e){let s=n[e];V(s,`No route found to patch children into: routeId = ${e}`),s.children||(s.children=[]),l=s.children}else l=r;let u=[],i=[];if(t.forEach(s=>{let f=l.find(m=>Sn(s,m));f?i.push({existingRoute:f,newRoute:s}):u.push(s)}),u.length>0){let s=it(u,a,[e||"_","patch",String(l?.length||"0")],n);l.push(...s)}if(o&&i.length>0)for(let s=0;s<i.length;s++){let{existingRoute:f,newRoute:m}=i[s],p=f,[w]=it([m],a,[],{},!0);Object.assign(p,{element:w.element?w.element:p.element,errorElement:w.errorElement?w.errorElement:p.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:p.hydrateFallbackElement})}}function Sn(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>t.children?.some(a=>Sn(r,a))):!1}var Gr=new WeakMap,xn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(V(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let l=Gr.get(a);l||(l={},Gr.set(a,l));let u=l[e];if(u)return u;let i=(async()=>{let s=Ta(e),m=a[e]!==void 0&&e!=="hasErrorBoundary";if(s)ne(!s,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(m)ne(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await o();p!=null&&(Object.assign(a,{[e]:p}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(p=>p===void 0)&&(a.lazy=void 0))})();return l[e]=i,i},Xr=new WeakMap;function uo(e,t,r,n,a){let o=r[e.id];if(V(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=Xr.get(o);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let m=(async()=>{V(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),w={};for(let R in p){let b=p[R];if(b===void 0)continue;let S=_a(R),_=o[R]!==void 0&&R!=="hasErrorBoundary";S?ne(!S,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?ne(!_,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):w[R]=b}Object.assign(o,w),Object.assign(o,{...n(o),lazy:void 0})})();return Xr.set(o,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let l=Object.keys(e.lazy),u=[],i;for(let f of l){if(a&&a.includes(f))continue;let m=xn({key:f,route:e,manifest:r,mapRouteProperties:n});m&&(u.push(m),f===t&&(i=m))}let s=u.length>0?Promise.all(u).then(()=>{}):void 0;return s?.catch(()=>{}),i?.catch(()=>{}),{lazyRoutePromise:s,lazyHandlerPromise:i}}async function Kr(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function co(e){return e.matches.some(t=>t.route.unstable_middleware)?Cn(e,!1,()=>Kr(e),(t,r)=>({[r]:{type:"error",result:t}})):Kr(e)}async function Cn(e,t,r,n){let{matches:a,request:o,params:l,context:u}=e,i={handlerResult:void 0};try{let s=a.flatMap(m=>m.route.unstable_middleware?m.route.unstable_middleware.map(p=>[m.route.id,p]):[]),f=await Ln({request:o,params:l,context:u},s,t,i,r);return t?f:i.handlerResult}catch(s){if(!i.middlewareError)throw s;let f=await n(i.middlewareError.error,i.middlewareError.routeId);return i.handlerResult?Object.assign(i.handlerResult,f):f}}async function Ln(e,t,r,n,a,o=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason?l.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${l.method} ${l.url}`);let u=t[o];if(!u)return n.handlerResult=await a(),n.handlerResult;let[i,s]=u,f=!1,m,p=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");f=!0,await Ln(e,t,r,n,a,o+1)};try{let w=await s({request:e.request,params:e.params,context:e.context},p);return f?w===void 0?m:w:p()}catch(w){throw n.middlewareError?n.middlewareError.error!==w&&(n.middlewareError={routeId:i,error:w}):n.middlewareError={routeId:i,error:w},w}}function Pn(e,t,r,n,a){let o=xn({key:"unstable_middleware",route:n.route,manifest:t,mapRouteProperties:e}),l=uo(n.route,ve(r.method)?"action":"loader",t,e,a);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Zt(e,t,r,n,a,o,l,u=null){let i=!1,s=Pn(e,t,r,n,a);return{...n,_lazyPromises:s,shouldLoad:l,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(f){return i=!0,u?typeof f=="boolean"?_t(n,{...u,defaultShouldRevalidate:f}):_t(n,u):l},resolve(f){return i||l||f&&!ve(r.method)&&(n.route.lazy||n.route.loader)?ho({request:r,match:n,lazyHandlerPromise:s?.handler,lazyRoutePromise:s?.route,handlerOverride:f,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function Je(e,t,r,n,a,o,l,u=null){return n.map(i=>i.route.id!==a.route.id?{...i,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:Pn(e,t,r,i,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Zt(e,t,r,i,o,l,!0,u))}async function fo(e,t,r,n,a,o){r.some(s=>s._lazyPromises?.middleware)&&await Promise.all(r.map(s=>s._lazyPromises?.middleware));let l={request:t,params:r[0].params,context:a,matches:r},i=await e({...l,fetcherKey:n,unstable_runClientMiddleware:s=>{let f=l;return Cn(f,!1,()=>s({...f,fetcherKey:n,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(m,p)=>({[p]:{type:"error",result:m}}))}});try{await Promise.all(r.flatMap(s=>[s._lazyPromises?.handler,s._lazyPromises?.route]))}catch{}return i}async function ho({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:n,handlerOverride:a,scopedContext:o}){let l,u,i=ve(e.method),s=i?"action":"loader",f=m=>{let p,w=new Promise((S,E)=>p=E);u=()=>p(),e.signal.addEventListener("abort",u);let R=S=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${s}" [routeId: ${t.route.id}]`)):m({request:e,params:t.params,context:o},...S!==void 0?[S]:[]),b=(async()=>{try{return{type:"data",result:await(a?a(E=>R(E)):R())}}catch(S){return{type:"error",result:S}}})();return Promise.race([b,w])};try{let m=i?t.route.action:t.route.loader;if(r||n)if(m){let p,[w]=await Promise.all([f(m).catch(R=>{p=R}),r,n]);if(p!==void 0)throw p;l=w}else{await r;let p=i?t.route.action:t.route.loader;if(p)[l]=await Promise.all([f(p),n]);else if(s==="action"){let w=new URL(e.url),R=w.pathname+w.search;throw Ee(405,{method:e.method,pathname:R,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(m)l=await f(m);else{let p=new URL(e.url),w=p.pathname+p.search;throw Ee(404,{pathname:w})}}catch(m){return{type:"error",result:m}}finally{u&&e.signal.removeEventListener("abort",u)}return l}async function mo(e){let{result:t,type:r}=e;if(dr(t)){let n;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?n=null:n=await t.json():n=await t.text()}catch(a){return{type:"error",error:a}}return r==="error"?{type:"error",error:new Ue(t.status,t.statusText,n),statusCode:t.status,headers:t.headers}:{type:"data",data:n,statusCode:t.status,headers:t.headers}}return r==="error"?tr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Ue(t.init?.status||500,void 0,t.data),statusCode:ze(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ze(t)?t.status:void 0}:tr(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function po(e,t,r,n,a){let o=e.headers.get("Location");if(V(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!cr(o)){let l=n.slice(0,n.findIndex(u=>u.route.id===r)+1);o=qt(new URL(t.url),l,a,o),e.headers.set("Location",o)}return e}function qr(e,t,r){if(cr(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=me(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Ve(e,t,r,n){let a=e.createURL(Tn(t)).toString(),o={signal:r};if(n&&ve(n.formMethod)){let{formMethod:l,formEncType:u}=n;o.method=l.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(n.json)):u==="text/plain"?o.body=n.text:u==="application/x-www-form-urlencoded"&&n.formData?o.body=er(n.formData):o.body=n.formData}return new Request(a,o)}function er(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Qr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function yo(e,t,r,n=!1,a=!1){let o={},l=null,u,i=!1,s={},f=r&&we(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let p=m.route.id,w=t[p];if(V(!He(w),"Cannot handle redirect results in processLoaderData"),we(w)){let R=w.error;if(f!==void 0&&(R=f,f=void 0),l=l||{},a)l[p]=R;else{let b=je(e,p);l[b.route.id]==null&&(l[b.route.id]=R)}n||(o[p]=bn),i||(i=!0,u=ze(w.error)?w.error.status:500),w.headers&&(s[p]=w.headers)}else o[p]=w.data,w.statusCode&&w.statusCode!==200&&!i&&(u=w.statusCode),w.headers&&(s[p]=w.headers)}),f!==void 0&&r&&(l={[r[0]]:f},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:l,statusCode:u||200,loaderHeaders:s}}function Zr(e,t,r,n,a,o){let{loaderData:l,errors:u}=yo(t,r,n);return a.filter(i=>!i.matches||i.matches.some(s=>s.shouldLoad)).forEach(i=>{let{key:s,match:f,controller:m}=i,p=o[s];if(V(p,"Did not find corresponding fetcher result"),!(m&&m.signal.aborted))if(we(p)){let w=je(e.matches,f?.route.id);u&&u[w.route.id]||(u={...u,[w.route.id]:p.error}),e.fetchers.delete(s)}else if(He(p))V(!1,"Unhandled fetcher revalidation redirect");else{let w=ke(p.data);e.fetchers.set(s,w)}}),{loaderData:l,errors:u}}function en(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==bn).reduce((o,[l,u])=>(o[l]=u,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(a[l]=e[l]),n&&n.hasOwnProperty(l))break}return a}function tn(e){return e?we(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function je(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function rn(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ee(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(l="Bad Request",n&&t&&r?u=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(l="Forbidden",u=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",u=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",n&&t&&r?u=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(u=`Invalid request method "${n.toUpperCase()}"`)),new Ue(e||500,l,new Error(u),!0)}function gt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(He(a))return{key:n,result:a}}}function Tn(e){let t=typeof e=="string"?Ae(e):e;return Oe({...t,hash:""})}function vo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function go(e){return dr(e.result)&&to.has(e.result.status)}function we(e){return e.type==="error"}function He(e){return(e&&e.type)==="redirect"}function tr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function dr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function wo(e){return eo.has(e.toUpperCase())}function ve(e){return Qa.has(e.toUpperCase())}function fr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function xt(e,t){let r=typeof t=="string"?Ae(t).search:t.search;if(e[e.length-1].route.index&&fr(r||""))return e[e.length-1];let n=wn(e);return n[n.length-1]}function nn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:l}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:l,text:void 0}}}function Vt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Eo(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function rt(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ro(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ke(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bo(e,t){try{let r=e.sessionStorage.getItem(Rn);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function So(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Rn,JSON.stringify(r))}catch(n){ne(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function xo(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Be=d.createContext(null);Be.displayName="DataRouter";var Ge=d.createContext(null);Ge.displayName="DataRouterState";var Co=d.createContext(!1);function Lo(){return d.useContext(Co)}var hr=d.createContext({isTransitioning:!1});hr.displayName="ViewTransition";var Mn=d.createContext(new Map);Mn.displayName="Fetchers";var Po=d.createContext(null);Po.displayName="Await";var Re=d.createContext(null);Re.displayName="Navigation";var kt=d.createContext(null);kt.displayName="Location";var be=d.createContext({outlet:null,matches:[],isDataRoute:!1});be.displayName="Route";var mr=d.createContext(null);mr.displayName="RouteError";function To(e,{relative:t}={}){V(st(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=d.useContext(Re),{hash:a,pathname:o,search:l}=ut(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:Ce([r,o])),n.createHref({pathname:u,search:l,hash:a})}function st(){return d.useContext(kt)!=null}function Le(){return V(st(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(kt).location}var _n="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Dn(e){d.useContext(Re).static||d.useLayoutEffect(e)}function Mo(){let{isDataRoute:e}=d.useContext(be);return e?Bo():_o()}function _o(){V(st(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(Be),{basename:t,navigator:r}=d.useContext(Re),{matches:n}=d.useContext(be),{pathname:a}=Le(),o=JSON.stringify(sr(n)),l=d.useRef(!1);return Dn(()=>{l.current=!0}),d.useCallback((i,s={})=>{if(ne(l.current,_n),!l.current)return;if(typeof i=="number"){r.go(i);return}let f=ur(i,JSON.parse(o),a,s.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ce([t,f.pathname])),(s.replace?r.replace:r.push)(f,s.state,s)},[t,r,o,a,e])}var Do=d.createContext(null);function ko(e){let t=d.useContext(be).outlet;return t&&d.createElement(Do.Provider,{value:e},t)}function kn(){let{matches:e}=d.useContext(be),t=e[e.length-1];return t?t.params:{}}function ut(e,{relative:t}={}){let{matches:r}=d.useContext(be),{pathname:n}=Le(),a=JSON.stringify(sr(r));return d.useMemo(()=>ur(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function Oo(e,t,r,n){V(st(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=d.useContext(Re),{matches:o}=d.useContext(be),l=o[o.length-1],u=l?l.params:{},i=l?l.pathname:"/",s=l?l.pathnameBase:"/",f=l&&l.route;{let E=f&&f.path||"";$n(i,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${i}" (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.
28
+
29
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=Le(),p;p=m;let w=p.pathname||"/",R=w;if(s!=="/"){let E=s.replace(/^\//,"").split("/");R="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=Te(e,{pathname:R});return ne(f||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),ne(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.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.`),Fo(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:Ce([s,a.encodeLocation?a.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?s:Ce([s,a.encodeLocation?a.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),o,r,n)}function Ao(){let e=vr(),t=ze(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:a},r):null,l)}var No=d.createElement(Ao,null),$o=class extends d.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?d.createElement(be.Provider,{value:this.props.routeContext},d.createElement(mr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Io({routeContext:e,match:t,children:r}){let n=d.useContext(Be);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(be.Provider,{value:e},r)}function Fo(e,t=[],r=null,n=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 a=e,o=r?.errors;if(o!=null){let i=a.findIndex(s=>s.route.id&&o?.[s.route.id]!==void 0);V(i>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,i+1))}let l=!1,u=-1;if(r)for(let i=0;i<a.length;i++){let s=a[i];if((s.route.HydrateFallback||s.route.hydrateFallbackElement)&&(u=i),s.route.id){let{loaderData:f,errors:m}=r,p=s.route.loader&&!f.hasOwnProperty(s.route.id)&&(!m||m[s.route.id]===void 0);if(s.route.lazy||p){l=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((i,s,f)=>{let m,p=!1,w=null,R=null;r&&(m=o&&s.route.id?o[s.route.id]:void 0,w=s.route.errorElement||No,l&&(u<0&&f===0?($n("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,R=null):u===f&&(p=!0,R=s.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,f+1)),S=()=>{let E;return m?E=w:p?E=R:s.route.Component?E=d.createElement(s.route.Component,null):s.route.element?E=s.route.element:E=i,d.createElement(Io,{match:s,routeContext:{outlet:i,matches:b,isDataRoute:r!=null},children:E})};return r&&(s.route.ErrorBoundary||s.route.errorElement||f===0)?d.createElement($o,{location:r.location,revalidation:r.revalidation,component:w,error:m,children:S(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):S()},null)}function pr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function On(e){let t=d.useContext(Be);return V(t,pr(e)),t}function Xe(e){let t=d.useContext(Ge);return V(t,pr(e)),t}function jo(e){let t=d.useContext(be);return V(t,pr(e)),t}function ct(e){let t=jo(e),r=t.matches[t.matches.length-1];return V(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ho(){return ct("useRouteId")}function Uo(){return Xe("useNavigation").navigation}function yr(){let{matches:e,loaderData:t}=Xe("useMatches");return d.useMemo(()=>e.map(r=>pn(r,t)),[e,t])}function An(){let e=Xe("useLoaderData"),t=ct("useLoaderData");return e.loaderData[t]}function Nn(){let e=Xe("useActionData"),t=ct("useLoaderData");return e.actionData?e.actionData[t]:void 0}function vr(){let e=d.useContext(mr),t=Xe("useRouteError"),r=ct("useRouteError");return e!==void 0?e:t.errors?.[r]}var zo=0;function xl(e){let{router:t,basename:r}=On("useBlocker"),n=Xe("useBlocker"),[a,o]=d.useState(""),l=d.useCallback(u=>{if(typeof e!="function")return!!e;if(r==="/")return e(u);let{currentLocation:i,nextLocation:s,historyAction:f}=u;return e({currentLocation:{...i,pathname:me(i.pathname,r)||i.pathname},nextLocation:{...s,pathname:me(s.pathname,r)||s.pathname},historyAction:f})},[r,e]);return d.useEffect(()=>{let u=String(++zo);return o(u),()=>t.deleteBlocker(u)},[t]),d.useEffect(()=>{a!==""&&t.getBlocker(a,l)},[t,a,l]),a&&n.blockers.has(a)?n.blockers.get(a):Ye}function Bo(){let{router:e}=On("useNavigate"),t=ct("useNavigate"),r=d.useRef(!1);return Dn(()=>{r.current=!0}),d.useCallback(async(a,o={})=>{ne(r.current,_n),r.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var an={};function $n(e,t,r){!t&&!an[e]&&(an[e]=!0,ne(!1,r))}var on={};function rr(e,t){!e&&!on[t]&&(on[t]=!0,console.warn(t))}function Cl(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ne(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ne(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ne(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ll=["HydrateFallback","hydrateFallbackElement"],Wo=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function Pl({router:e,flushSync:t}){let[r,n]=d.useState(e.state),[a,o]=d.useState(),[l,u]=d.useState({isTransitioning:!1}),[i,s]=d.useState(),[f,m]=d.useState(),[p,w]=d.useState(),R=d.useRef(new Map),b=d.useCallback((P,{deletedFetchers:M,flushSync:L,viewTransitionOpts:y})=>{P.fetchers.forEach((J,U)=>{J.data!==void 0&&R.current.set(U,J.data)}),M.forEach(J=>R.current.delete(J)),rr(L===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let j=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(rr(y==null||j,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!y||!j){t&&L?t(()=>n(P)):d.startTransition(()=>n(P));return}if(t&&L){t(()=>{f&&(i&&i.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:y.currentLocation,nextLocation:y.nextLocation})});let J=e.window.document.startViewTransition(()=>{t(()=>n(P))});J.finished.finally(()=>{t(()=>{s(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),t(()=>m(J));return}f?(i&&i.resolve(),f.skipTransition(),w({state:P,currentLocation:y.currentLocation,nextLocation:y.nextLocation})):(o(P),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}))},[e.window,t,f,i]);d.useLayoutEffect(()=>e.subscribe(b),[e,b]),d.useEffect(()=>{l.isTransitioning&&!l.flushSync&&s(new Wo)},[l]),d.useEffect(()=>{if(i&&a&&e.window){let P=a,M=i.promise,L=e.window.document.startViewTransition(async()=>{d.startTransition(()=>n(P)),await M});L.finished.finally(()=>{s(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(L)}},[a,i,e.window]),d.useEffect(()=>{i&&a&&r.location.key===a.location.key&&i.resolve()},[i,f,r.location,a]),d.useEffect(()=>{!l.isTransitioning&&p&&(o(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),w(void 0))},[l.isTransitioning,p]);let S=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,M,L)=>e.navigate(P,{state:M,preventScrollReset:L?.preventScrollReset}),replace:(P,M,L)=>e.navigate(P,{replace:!0,state:M,preventScrollReset:L?.preventScrollReset})}),[e]),E=e.basename||"/",_=d.useMemo(()=>({router:e,navigator:S,static:!1,basename:E}),[e,S,E]);return d.createElement(d.Fragment,null,d.createElement(Be.Provider,{value:_},d.createElement(Ge.Provider,{value:r},d.createElement(Mn.Provider,{value:R.current},d.createElement(hr.Provider,{value:l},d.createElement(Jo,{basename:E,location:r.location,navigationType:r.historyAction,navigator:S},d.createElement(Yo,{routes:e.routes,future:e.future,state:r})))))),null)}var Yo=d.memo(Vo);function Vo({routes:e,future:t,state:r}){return Oo(e,void 0,r,t)}function Tl(e){return ko(e.context)}function Jo({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1}){V(!st(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=d.useMemo(()=>({basename:l,navigator:a,static:o,future:{}}),[l,a,o]);typeof r=="string"&&(r=Ae(r));let{pathname:i="/",search:s="",hash:f="",state:m=null,key:p="default"}=r,w=d.useMemo(()=>{let R=me(i,l);return R==null?null:{location:{pathname:R,search:s,hash:f,state:m,key:p},navigationType:n}},[l,i,s,f,m,p,n]);return ne(w!=null,`<Router basename="${l}"> is not able to match the URL "${i}${s}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:d.createElement(Re.Provider,{value:u},d.createElement(kt.Provider,{children:t,value:w}))}function Go(){return{params:kn(),loaderData:An(),actionData:Nn(),matches:yr()}}function Ml(e){return function(){const r=Go();return d.createElement(e,r)}}function Xo(){return{params:kn(),loaderData:An(),actionData:Nn(),error:vr()}}function _l(e){return function(){const r=Xo();return d.createElement(e,r)}}var Ct="get",Lt="application/x-www-form-urlencoded";function Ot(e){return e!=null&&typeof e.tagName=="string"}function Ko(e){return Ot(e)&&e.tagName.toLowerCase()==="button"}function qo(e){return Ot(e)&&e.tagName.toLowerCase()==="form"}function Qo(e){return Ot(e)&&e.tagName.toLowerCase()==="input"}function Zo(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ei(e,t){return e.button===0&&(!t||t==="_self")&&!Zo(e)}var wt=null;function ti(){if(wt===null)try{new FormData(document.createElement("form"),0),wt=!1}catch{wt=!0}return wt}var ri=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jt(e){return e!=null&&!ri.has(e)?(ne(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lt}"`),null):e}function ni(e,t){let r,n,a,o,l;if(qo(e)){let u=e.getAttribute("action");n=u?me(u,t):null,r=e.getAttribute("method")||Ct,a=Jt(e.getAttribute("enctype"))||Lt,o=new FormData(e)}else if(Ko(e)||Qo(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 i=e.getAttribute("formaction")||u.getAttribute("action");if(n=i?me(i,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||Ct,a=Jt(e.getAttribute("formenctype"))||Jt(u.getAttribute("enctype"))||Lt,o=new FormData(u,e),!ti()){let{name:s,type:f,value:m}=e;if(f==="image"){let p=s?`${s}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else s&&o.append(s,m)}}else{if(Ot(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ct,n=null,a=Lt,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:l}}var ai=-1,oi=-2,ii=-3,li=-4,si=-5,ui=-6,ci=-7,di="B",fi="D",In="E",hi="M",mi="N",Fn="P",pi="R",yi="S",vi="Y",gi="U",wi="Z",jn=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Ei(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
30
+ `);t=o.pop()||"";for(const l of o)n.enqueue(l)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Gt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function nr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return ln.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,ln.call(this,n)}function ln(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const l=[[e,i=>{o=i}]];let u=[];for(;l.length>0;){const[i,s]=l.pop();switch(i){case ci:s(void 0);continue;case si:s(null);continue;case oi:s(NaN);continue;case ui:s(1/0);continue;case ii:s(-1/0);continue;case li:s(-0);continue}if(t[i]){s(t[i]);continue}const f=r[i];if(!f||typeof f!="object"){t[i]=f,s(f);continue}if(Array.isArray(f))if(typeof f[0]=="string"){const[m,p,w]=f;switch(m){case fi:s(t[i]=new Date(p));continue;case gi:s(t[i]=new URL(p));continue;case di:s(t[i]=BigInt(p));continue;case pi:s(t[i]=new RegExp(p,w));continue;case vi:s(t[i]=Symbol.for(p));continue;case yi:const R=new Set;t[i]=R;for(let M=f.length-1;M>0;M--)l.push([f[M],L=>{R.add(L)}]);s(R);continue;case hi:const b=new Map;t[i]=b;for(let M=f.length-2;M>0;M-=2){const L=[];l.push([f[M+1],y=>{L[1]=y}]),l.push([f[M],y=>{L[0]=y}]),u.push(()=>{b.set(L[0],L[1])})}s(b);continue;case mi:const S=Object.create(null);t[i]=S;for(const M of Object.keys(p).reverse()){const L=[];l.push([p[M],y=>{L[1]=y}]),l.push([Number(M.slice(1)),y=>{L[0]=y}]),u.push(()=>{S[L[0]]=L[1]})}s(S);continue;case Fn:if(t[p])s(t[i]=t[p]);else{const M=new jn;n[p]=M,s(t[i]=M.promise)}continue;case In:const[,E,_]=f;let P=_&&Gt&&Gt[_]?new Gt[_](E):new Error(E);t[i]=P,s(P);continue;case wi:s(t[i]=t[p]);continue;default:if(Array.isArray(a)){const M=[],L=f.slice(1);for(let y=0;y<L.length;y++){const j=L[y];l.push([j,J=>{M[y]=J}])}u.push(()=>{for(const y of a){const j=y(f[0],...M);if(j){s(t[i]=j.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const m=[];t[i]=m;for(let p=0;p<f.length;p++){const w=f[p];w!==ai&&l.push([w,R=>{m[p]=R}])}s(m);continue}else{const m={};t[i]=m;for(const p of Object.keys(f).reverse()){const w=[];l.push([f[p],R=>{w[1]=R}]),l.push([Number(p.slice(1)),R=>{w[0]=R}]),u.push(()=>{m[w[0]]=w[1]})}s(m);continue}}for(;u.length>0;)u.pop()();return o}async function Ri(e,t){const{plugins:r}=t??{},n=new jn,a=e.pipeThrough(Ei()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await bi.call(o,a);let u=n.promise;return l.done?n.resolve():u=Si.call(o,a).then(n.resolve).catch(i=>{for(const s of Object.values(o.deferred))s.reject(i);n.reject(i)}),{done:u.then(()=>a.closed),value:l.value}}async function bi(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:nr.call(this,r)}}async function Si(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case Fn:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const l=r.slice(n+1);let u;try{u=JSON.parse(l)}catch{throw new SyntaxError}const i=nr.call(this,u);o.resolve(i);break}case In:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const l=r.slice(n+1);let u;try{u=JSON.parse(l)}catch{throw new SyntaxError}const i=nr.call(this,u);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}async function xi(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}function sn(e){return{__html:e}}function he(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var ar=Symbol("SingleFetchRedirect"),Hn=class extends Error{},Ci=202,Li=new Set([100,101,204,205]);function Dl(e,t,r,n,a){let o=Pi(e,l=>{let u=t.routes[l.route.id];he(u,"Route not found in manifest");let i=r[l.route.id];return{hasLoader:u.hasLoader,hasClientLoader:u.hasClientLoader,hasShouldRevalidate:!!i?.shouldRevalidate}},Ai,n,a);return async l=>l.unstable_runClientMiddleware(o)}function Pi(e,t,r,n,a,o=()=>!0){return async l=>{let{request:u,matches:i,fetcherKey:s}=l,f=e();if(u.method!=="GET")return Ti(l,r,a);let m=i.some(p=>{let{hasLoader:w,hasClientLoader:R}=t(p);return p.unstable_shouldCallHandler()&&w&&!R});return!n&&!m?Mi(l,t,r,a):s?ki(l,r,a):_i(l,f,t,r,n,a,o)}}async function Ti(e,t,r){let n=e.matches.find(l=>l.unstable_shouldCallHandler());he(n,"No action match found");let a,o=await n.resolve(async l=>await l(async()=>{let{data:i,status:s}=await t(e,r,[n.route.id]);return a=s,lt(i,n.route.id)}));return dr(o.result)||ze(o.result)||tr(o.result)?{[n.route.id]:o}:{[n.route.id]:{type:o.type,result:Ka(o.result,a)}}}async function Mi(e,t,r,n){let a=e.matches.filter(l=>l.unstable_shouldCallHandler()),o={};return await Promise.all(a.map(l=>l.resolve(async u=>{try{let{hasClientLoader:i}=t(l),s=l.route.id,f=i?await u(async()=>{let{data:m}=await r(e,n,[s]);return lt(m,s)}):await u();o[l.route.id]={type:"data",result:f}}catch(i){o[l.route.id]={type:"error",result:i}}}))),o}async function _i(e,t,r,n,a,o,l=()=>!0){let u=new Set,i=!1,s=e.matches.map(()=>un()),f=un(),m={},p=Promise.all(e.matches.map(async(R,b)=>R.resolve(async S=>{s[b].resolve();let E=R.route.id,{hasLoader:_,hasClientLoader:P,hasShouldRevalidate:M}=r(R),L=!R.unstable_shouldRevalidateArgs||R.unstable_shouldRevalidateArgs.actionStatus==null||R.unstable_shouldRevalidateArgs.actionStatus<400;if(!R.unstable_shouldCallHandler(L)){i||(i=R.unstable_shouldRevalidateArgs!=null&&_&&M===!0);return}if(l(R)&&P){_&&(i=!0);try{let j=await S(async()=>{let{data:J}=await n(e,o,[E]);return lt(J,E)});m[E]={type:"data",result:j}}catch(j){m[E]={type:"error",result:j}}return}_&&u.add(E);try{let j=await S(async()=>{let J=await f.promise;return lt(J,E)});m[E]={type:"data",result:j}}catch(j){m[E]={type:"error",result:j}}})));if(await Promise.all(s.map(R=>R.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||u.size===0)&&!window.__reactRouterHdrActive)f.resolve({routes:{}});else{let R=a&&i&&u.size>0?[...u.keys()]:void 0;try{let b=await n(e,o,R);f.resolve(b.data)}catch(b){f.reject(b)}}return await p,await Di(f.promise,e.matches,u,m),m}async function Di(e,t,r,n){try{let a,o=await e;if("routes"in o){for(let l of t)if(l.route.id in o.routes){let u=o.routes[l.route.id];if("error"in u){a=u.error;break}}}a!==void 0&&Array.from(r.values()).forEach(l=>{n[l].result instanceof Hn&&(n[l].result=a)})}catch{}}async function ki(e,t,r){let n=e.matches.find(l=>l.unstable_shouldCallHandler());he(n,"No fetcher match found");let a=n.route.id,o=await n.resolve(async l=>l(async()=>{let{data:u}=await t(e,r,[a]);return lt(u,a)}));return{[n.route.id]:o}}function Oi(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}function Un(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&me(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function Ai(e,t,r){let{request:n}=e,a=Un(n.url,t,"data");n.method==="GET"&&(a=Oi(a),r&&a.searchParams.set("_routes",r.join(",")));let o=await fetch(a,await xi(n));if(o.status===404&&!o.headers.has("X-Remix-Response"))throw new Ue(404,"Not Found",!0);if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:Ci,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(Li.has(o.status)){let l={};return r&&n.method!=="GET"&&(l[r[0]]={data:void 0}),{status:o.status,data:{routes:l}}}he(o.body,"No response body to decode");try{let l=await Ni(o.body,window),u;if(n.method==="GET"){let i=l.value;ar in i?u={redirect:i[ar]}:u={routes:i}}else{let i=l.value,s=r?.[0];he(s,"No routeId found for single fetch call decoding"),"redirect"in i?u={redirect:i}:u={routes:{[s]:i}}}return{status:o.status,data:u}}catch{throw new Error("Unable to decode turbo-stream response")}}function Ni(e,t){return Ri(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,l]=n,u=Error;a&&a in t&&typeof t[a]=="function"&&(u=t[a]);let i=new u(o);return i.stack=l,{value:i}}if(r==="ErrorResponse"){let[a,o,l]=n;return{value:new Ue(o,l,a)}}if(r==="SingleFetchRedirect")return{value:{[ar]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function lt(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:l,status:u}=e.redirect;throw qa(n,{status:u,headers:{...a?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...l?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new Hn(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function un(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function zn(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 $i(e,t,r){let n=e.map(o=>{let l=t[o.route.id],u=r.routes[o.route.id];return[u&&u.css?u.css.map(i=>({rel:"stylesheet",href:i})):[],l?.links?.()||[]]}).flat(2),a=wr(e,r);return Vn(n,a)}function Bn(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Ii(e){if(!e.css)return;let t=Bn(e);await Promise.all(t.map(Yn))}async function Wn(e,t){if(!e.css&&!t.links||!zi())return;let r=[];if(e.css&&r.push(...Bn(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!gr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(Yn))}async function Yn(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function gr(e){return e!=null&&typeof e.page=="string"}function Fi(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 ji(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await zn(o,r);return l.links?l.links():[]}return[]}));return Vn(n.flat(1).filter(Fi).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function cn(e,t,r,n,a,o){let l=(i,s)=>r[s]?i.route.id!==r[s].route.id:!0,u=(i,s)=>r[s].pathname!==i.pathname||r[s].route.path?.endsWith("*")&&r[s].params["*"]!==i.params["*"];return o==="assets"?t.filter((i,s)=>l(i,s)||u(i,s)):o==="data"?t.filter((i,s)=>{let f=n.routes[i.route.id];if(!f||!f.hasLoader)return!1;if(l(i,s)||u(i,s))return!0;if(i.route.shouldRevalidate){let m=i.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:i.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function wr(e,t,{includeHydrateFallback:r}={}){return Hi(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function Hi(e){return[...new Set(e)]}function Ui(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Vn(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!gr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let u=JSON.stringify(Ui(o));return r.has(u)||(r.add(u),a.push({key:u,link:o})),a},[])}var Et;function zi(){if(Et!==void 0)return Et;let e=document.createElement("link");return Et=e.relList.supports("preload"),e=null,Et}function Bi(){return d.createElement(or,{title:"Loading...",renderScripts:!0},d.createElement("script",{dangerouslySetInnerHTML:{__html:`
31
+ console.log(
32
+ "💿 Hey developer 👋. You can provide a way better UX than this " +
33
+ "when your app is loading JS modules and/or running \`clientLoader\` " +
34
+ "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
35
+ "for more information."
36
+ );
37
+ `}}))}function Jn(e){let t={};return Object.values(e).forEach(r=>{if(r){let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}}),t}function Wi(e,t,r){let n=Gn(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Bi:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(qn,{error:vr()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:d.createElement(t.Layout,null,d.createElement(n,null))}:{Component:n},...o?{errorElement:d.createElement(t.Layout,null,d.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function kl(e,t,r,n,a,o){return Er(t,r,n,a,o,"",Jn(t),e)}function Rt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let n=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new Ue(400,"Bad Request",new Error(n),!0)}}function Xt(e,t){let r=e==="clientAction"?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new Ue(405,"Method Not Allowed",new Error(n),!0)}function Er(e,t,r,n,a,o="",l=Jn(e),u){return(l[o]||[]).map(i=>{let s=t[i.id];function f(_){return he(typeof _=="function","No single fetch function available for route handler"),_()}function m(_){return i.hasLoader?f(_):Promise.resolve(null)}function p(_){if(!i.hasAction)throw Xt("action",i.id);return f(_)}function w(_){import(_)}function R(_){_.clientActionModule&&w(_.clientActionModule),_.clientLoaderModule&&w(_.clientLoaderModule)}async function b(_){let P=t[i.id],M=P?Wn(i,P):Promise.resolve();try{return _()}finally{await M}}let S={id:i.id,index:i.index,path:i.path};if(s){Object.assign(S,{...S,...Wi(i,s,a),unstable_middleware:s.unstable_clientMiddleware,handle:s.handle,shouldRevalidate:dn(S.path,s,i,n,u)});let _=r&&r.loaderData&&i.id in r.loaderData,P=_?r?.loaderData?.[i.id]:void 0,M=r&&r.errors&&i.id in r.errors,L=M?r?.errors?.[i.id]:void 0,y=u==null&&(s.clientLoader?.hydrate===!0||!i.hasLoader);S.loader=async({request:j,params:J,context:U},q)=>{try{return await b(async()=>(he(s,"No `routeModule` available for critical-route loader"),s.clientLoader?s.clientLoader({request:j,params:J,context:U,async serverLoader(){if(Rt("loader",i),y){if(_)return P;if(M)throw L}return m(q)}}):m(q)))}finally{y=!1}},S.loader.hydrate=Ji(i.id,s.clientLoader,i.hasLoader,a),S.action=({request:j,params:J,context:U},q)=>b(async()=>{if(he(s,"No `routeModule` available for critical-route action"),!s.clientAction){if(a)throw Xt("clientAction",i.id);return p(q)}return s.clientAction({request:j,params:J,context:U,async serverAction(){return Rt("action",i),p(q)}})})}else{i.hasClientLoader||(S.loader=(M,L)=>b(()=>m(L))),i.hasClientAction||(S.action=(M,L)=>b(()=>{if(a)throw Xt("clientAction",i.id);return p(L)}));let _;async function P(){return _?await _:(_=(async()=>{(i.clientLoaderModule||i.clientActionModule)&&await new Promise(L=>setTimeout(L,0));let M=Vi(i,t);return R(i),await M})(),await _)}S.lazy={loader:i.hasClientLoader?async()=>{let{clientLoader:M}=i.clientLoaderModule?await import(i.clientLoaderModule):await P();return he(M,"No `clientLoader` export found"),(L,y)=>M({...L,async serverLoader(){return Rt("loader",i),m(y)}})}:void 0,action:i.hasClientAction?async()=>{let M=i.clientActionModule?import(i.clientActionModule):P();R(i);let{clientAction:L}=await M;return he(L,"No `clientAction` export found"),(y,j)=>L({...y,async serverAction(){return Rt("action",i),p(j)}})}:void 0,unstable_middleware:i.hasClientMiddleware?async()=>{let{unstable_clientMiddleware:M}=i.clientMiddlewareModule?await import(i.clientMiddlewareModule):await P();return he(M,"No `unstable_clientMiddleware` export found"),M}:void 0,shouldRevalidate:async()=>{let M=await P();return dn(S.path,M,i,n,u)},handle:async()=>(await P()).handle,Component:async()=>(await P()).Component,ErrorBoundary:i.hasErrorBoundary?async()=>(await P()).ErrorBoundary:void 0}}let E=Er(e,t,r,n,a,i.id,l,u);return E.length>0&&(S.children=E),S})}function dn(e,t,r,n,a){if(a)return Yi(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?gn(e)[1].map(u=>u.paramName):[];const l=u=>o.some(i=>u.currentParams[i]!==u.nextParams[i]);if(t.shouldRevalidate){let u=t.shouldRevalidate;return i=>u({...i,defaultShouldRevalidate:l(i)})}else return u=>l(u)}if(n&&t.shouldRevalidate){let o=t.shouldRevalidate;return l=>o({...l,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function Yi(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function Vi(e,t){let r=zn(e,t),n=Ii(e),a=await r;return await Promise.all([n,Wn(e,a)]),{Component:Gn(a),ErrorBoundary:a.ErrorBoundary,unstable_clientMiddleware:a.unstable_clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}function Gn(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Ji(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Pt=new Set,Gi=1e3,Dt=new Set,Xi=7680;function Rr(e,t){return e.mode==="lazy"&&t===!0}function Ki({sri:e,...t},r){let n=new Set(r.state.matches.map(u=>u.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(u=>{let i=Te(r.routes,u,r.basename);i&&i.forEach(s=>n.add(s.route.id))});let l=[...n].reduce((u,i)=>Object.assign(u,{[i]:t.routes[i]}),{});return{...t,routes:l,sri:e?!0:void 0}}function Ol(e,t,r,n,a,o){if(Rr(n,r))return async({path:l,patch:u,signal:i,fetcherKey:s})=>{Dt.has(l)||await Xn([l],s?window.location.href:l,e,t,r,a,o,n.manifestPath,u,i)}}function Al(e,t,r,n,a,o){d.useEffect(()=>{if(!Rr(a,n)||window.navigator?.connection?.saveData===!0)return;function l(f){let m=f.tagName==="FORM"?f.getAttribute("action"):f.getAttribute("href");if(!m)return;let p=f.tagName==="A"?f.pathname:new URL(m,window.location.origin).pathname;Dt.has(p)||Pt.add(p)}async function u(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(l);let f=Array.from(Pt.keys()).filter(m=>Dt.has(m)?(Pt.delete(m),!1):!0);if(f.length!==0)try{await Xn(f,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(m){console.error("Failed to fetch manifest patches",m)}}let i=Zi(u,100);u();let s=new MutationObserver(()=>i());return s.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>s.disconnect()},[n,o,t,r,e,a])}function qi(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var Kt="react-router-manifest-version";async function Xn(e,t,r,n,a,o,l,u,i,s){let f=new URL(qi(u,l),window.location.origin);if(e.sort().forEach(b=>f.searchParams.append("p",b)),f.searchParams.set("version",r.version),f.toString().length>Xi){Pt.clear();return}let m;try{let b=await fetch(f,{signal:s});if(b.ok){if(b.status===204&&b.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}if(sessionStorage.getItem(Kt)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(Kt,r.version),window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(b.status>=400)throw new Error(await b.text())}else throw new Error(`${b.status} ${b.statusText}`);sessionStorage.removeItem(Kt),m=await b.json()}catch(b){if(s?.aborted)return;throw b}let p=new Set(Object.keys(r.routes)),w=Object.values(m).reduce((b,S)=>(S&&!p.has(S.id)&&(b[S.id]=S),b),{});Object.assign(r.routes,w),e.forEach(b=>Qi(b,Dt));let R=new Set;Object.values(w).forEach(b=>{b&&(!b.parentId||!w[b.parentId])&&R.add(b.parentId)}),R.forEach(b=>i(b||null,Er(w,n,null,a,o,b)))}function Qi(e,t){if(t.size>=Gi){let r=t.values().next().value;t.delete(r)}t.add(e)}function Zi(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function br(){let e=d.useContext(Be);return he(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function At(){let e=d.useContext(Ge);return he(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Nt=d.createContext(void 0);Nt.displayName="FrameworkContext";function Ke(){let e=d.useContext(Nt);return he(e,"You must render this element inside a <HydratedRouter> element"),e}function el(e,t){let r=d.useContext(Nt),[n,a]=d.useState(!1),[o,l]=d.useState(!1),{onFocus:u,onBlur:i,onMouseEnter:s,onMouseLeave:f,onTouchStart:m}=t,p=d.useRef(null);d.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=E=>{E.forEach(_=>{l(_.isIntersecting)})},S=new IntersectionObserver(b,{threshold:.5});return p.current&&S.observe(p.current),()=>{S.disconnect()}}},[e]),d.useEffect(()=>{if(n){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[n]);let w=()=>{a(!0)},R=()=>{a(!1),l(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:nt(u,w),onBlur:nt(i,R),onMouseEnter:nt(s,w),onMouseLeave:nt(f,R),onTouchStart:nt(m,w)}]:[!1,p,{}]}function nt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Sr(e,t,r){if(r&&!Tt)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}var fn="data-react-router-critical-css";function Nl(){let{isSpaMode:e,manifest:t,routeModules:r,criticalCss:n}=Ke(),{errors:a,matches:o}=At(),l=Sr(o,a,e),u=d.useMemo(()=>$i(l,r,t),[l,r,t]);return d.createElement(d.Fragment,null,typeof n=="string"?d.createElement("style",{[fn]:"",dangerouslySetInnerHTML:{__html:n}}):null,typeof n=="object"?d.createElement("link",{[fn]:"",rel:"stylesheet",href:n.href}):null,u.map(({key:i,link:s})=>gr(s)?d.createElement(Kn,{key:i,...s}):d.createElement("link",{key:i,...s})))}function Kn({page:e,...t}){let{router:r}=br(),n=d.useMemo(()=>Te(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?d.createElement(rl,{page:e,matches:n,...t}):null}function tl(e){let{manifest:t,routeModules:r}=Ke(),[n,a]=d.useState([]);return d.useEffect(()=>{let o=!1;return ji(e,t,r).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,r]),n}function rl({page:e,matches:t,...r}){let n=Le(),{manifest:a,routeModules:o}=Ke(),{basename:l}=br(),{loaderData:u,matches:i}=At(),s=d.useMemo(()=>cn(e,t,i,a,n,"data"),[e,t,i,a,n]),f=d.useMemo(()=>cn(e,t,i,a,n,"assets"),[e,t,i,a,n]),m=d.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let R=new Set,b=!1;if(t.forEach(E=>{let _=a.routes[E.route.id];!_||!_.hasLoader||(!s.some(P=>P.route.id===E.route.id)&&E.route.id in u&&o[E.route.id]?.shouldRevalidate||_.hasClientLoader?b=!0:R.add(E.route.id))}),R.size===0)return[];let S=Un(e,l,"data");return b&&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,u,n,a,s,t,e,o]),p=d.useMemo(()=>wr(f,a),[f,a]),w=tl(f);return d.createElement(d.Fragment,null,m.map(R=>d.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...r})),p.map(R=>d.createElement("link",{key:R,rel:"modulepreload",href:R,...r})),w.map(({key:R,link:b})=>d.createElement("link",{key:R,...b})))}function $l(){let{isSpaMode:e,routeModules:t}=Ke(),{errors:r,matches:n,loaderData:a}=At(),o=Le(),l=Sr(n,r,e),u=null;r&&(u=r[l[l.length-1].route.id]);let i=[],s=null,f=[];for(let m=0;m<l.length;m++){let p=l[m],w=p.route.id,R=a[w],b=p.params,S=t[w],E=[],_={id:w,data:R,meta:[],params:p.params,pathname:p.pathname,handle:p.route.handle,error:u};if(f[m]=_,S?.meta?E=typeof S.meta=="function"?S.meta({data:R,params:b,location:o,matches:f,error:u}):Array.isArray(S.meta)?[...S.meta]:S.meta:s&&(E=[...s]),E=E||[],!Array.isArray(E))throw new Error("The route at "+p.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
38
+
39
+ To reference the meta function API, see https://remix.run/route/meta`);_.meta=E,f[m]=_,i=[...E],s=i}return d.createElement(d.Fragment,null,i.flat().map(m=>{if(!m)return null;if("tagName"in m){let{tagName:p,...w}=m;if(!nl(p))return console.warn(`A meta object uses an invalid tagName: ${p}. Expected either 'link' or 'meta'`),null;let R=p;return d.createElement(R,{key:JSON.stringify(w),...w})}if("title"in m)return d.createElement("title",{key:"title"},String(m.title));if("charset"in m&&(m.charSet??(m.charSet=m.charset),delete m.charset),"charSet"in m&&m.charSet!=null)return typeof m.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:m.charSet}):null;if("script:ld+json"in m)try{let p=JSON.stringify(m["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${p}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:p}})}catch{return null}return d.createElement("meta",{key:JSON.stringify(m),...m})}))}function nl(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Tt=!1;function al(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:l}=Ke(),{router:u,static:i,staticContext:s}=br(),{matches:f}=At(),m=Lo(),p=Rr(o,l);a&&(a.didRenderScripts=!0);let w=Sr(f,null,n);d.useEffect(()=>{Tt=!0},[]);let R=d.useMemo(()=>{if(m)return null;let _=s?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",P=i?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(t.url)}`};
40
+ ${w.map((M,L)=>{let y=`route${L}`,j=t.routes[M.route.id];he(j,`Route ${M.route.id} not found in manifest`);let{clientActionModule:J,clientLoaderModule:U,clientMiddlewareModule:q,hydrateFallbackModule:le,module:pe}=j,X=[...J?[{module:J,varName:`${y}_clientAction`}]:[],...U?[{module:U,varName:`${y}_clientLoader`}]:[],...q?[{module:q,varName:`${y}_clientMiddleware`}]:[],...le?[{module:le,varName:`${y}_HydrateFallback`}]:[],{module:pe,varName:`${y}_main`}];if(X.length===1)return`import * as ${y} from ${JSON.stringify(pe)};`;let Q=X.map(Y=>`import * as ${Y.varName} from "${Y.module}";`).join(`
41
+ `),ae=`const ${y} = {${X.map(Y=>`...${Y.varName}`).join(",")}};`;return[Q,ae].join(`
42
+ `)}).join(`
43
+ `)}
44
+ ${p?`window.__reactRouterManifest = ${JSON.stringify(Ki(t,u),null,2)};`:""}
45
+ window.__reactRouterRouteModules = {${w.map((M,L)=>`${JSON.stringify(M.route.id)}:route${L}`).join(",")}};
46
+
47
+ import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:sn(_),type:void 0}),d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:sn(P),type:"module",async:!0}))},[]),b=Tt||m?[]:ol(t.entry.imports.concat(wr(w,t,{includeHydrateFallback:!0}))),S=typeof t.sri=="object"?t.sri:{};return rr(!m,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Tt||m?null:d.createElement(d.Fragment,null,typeof t.sri=="object"?d.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:S})}}):null,p?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:S[t.url],suppressHydrationWarning:!0}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:S[t.entry.module],suppressHydrationWarning:!0}),b.map(E=>d.createElement("link",{key:E,rel:"modulepreload",href:E,crossOrigin:e.crossOrigin,integrity:S[E],suppressHydrationWarning:!0})),R)}function ol(e){return[...new Set(e)]}function il(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Il=class extends d.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?d.createElement(qn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function qn({error:e,isOutsideRemixApp:t}){console.error(e);let r=d.createElement("script",{dangerouslySetInnerHTML:{__html:`
48
+ console.log(
49
+ "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
50
+ );
51
+ `}});if(ze(e))return d.createElement(or,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return d.createElement(or,{title:"Application Error!",isOutsideRemixApp:t},d.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),d.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function or({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=Ke();return a.root?.Layout&&!r?n:d.createElement("html",{lang:"en"},d.createElement("head",null,d.createElement("meta",{charSet:"utf-8"}),d.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),d.createElement("title",null,e)),d.createElement("body",null,d.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?d.createElement(al,null):null)))}var Qn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qn&&(window.__reactRouterVersion="7.7.0")}catch{}var Zn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ea=d.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:l,state:u,target:i,to:s,preventScrollReset:f,viewTransition:m,...p},w){let{basename:R}=d.useContext(Re),b=typeof s=="string"&&Zn.test(s),S,E=!1;if(typeof s=="string"&&b&&(S=s,Qn))try{let U=new URL(window.location.href),q=s.startsWith("//")?new URL(U.protocol+s):new URL(s),le=me(q.pathname,R);q.origin===U.origin&&le!=null?s=le+q.search+q.hash:E=!0}catch{ne(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=To(s,{relative:a}),[P,M,L]=el(n,p),y=dl(s,{replace:l,state:u,target:i,preventScrollReset:f,relative:a,viewTransition:m});function j(U){t&&t(U),U.defaultPrevented||y(U)}let J=d.createElement("a",{...p,...L,href:S||_,onClick:E||o?t:j,ref:il(w,M),target:i,"data-discover":!b&&r==="render"?"true":void 0});return P&&!b?d.createElement(d.Fragment,null,J,d.createElement(Kn,{page:_})):J});ea.displayName="Link";var ll=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:l,viewTransition:u,children:i,...s},f){let m=ut(l,{relative:s.relative}),p=Le(),w=d.useContext(Ge),{navigator:R,basename:b}=d.useContext(Re),S=w!=null&&gl(m)&&u===!0,E=R.encodeLocation?R.encodeLocation(m).pathname:m.pathname,_=p.pathname,P=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(_=_.toLowerCase(),P=P?P.toLowerCase():null,E=E.toLowerCase()),P&&b&&(P=me(P,b)||P);const M=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let L=_===E||!a&&_.startsWith(E)&&_.charAt(M)==="/",y=P!=null&&(P===E||!a&&P.startsWith(E)&&P.charAt(E.length)==="/"),j={isActive:L,isPending:y,isTransitioning:S},J=L?t:void 0,U;typeof n=="function"?U=n(j):U=[n,L?"active":null,y?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o(j):o;return d.createElement(ea,{...s,"aria-current":J,className:U,ref:f,style:q,to:l,viewTransition:u},typeof i=="function"?i(j):i)});ll.displayName="NavLink";var sl=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:l=Ct,action:u,onSubmit:i,relative:s,preventScrollReset:f,viewTransition:m,...p},w)=>{let R=ml(),b=pl(u,{relative:s}),S=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&Zn.test(u),_=P=>{if(i&&i(P),P.defaultPrevented)return;P.preventDefault();let M=P.nativeEvent.submitter,L=M?.getAttribute("formmethod")||l;R(M||P.currentTarget,{fetcherKey:t,method:L,navigate:r,replace:a,state:o,relative:s,preventScrollReset:f,viewTransition:m})};return d.createElement("form",{ref:w,method:S,action:b,onSubmit:n?i:_,...p,"data-discover":!E&&e==="render"?"true":void 0})});sl.displayName="Form";function ul({getKey:e,storageKey:t,...r}){let n=d.useContext(Nt),{basename:a}=d.useContext(Re),o=Le(),l=yr();yl({getKey:e,storageKey:t});let u=d.useMemo(()=>{if(!n||!e)return null;let s=lr(o,l,a,e);return s!==o.key?s:null},[]);if(!n||n.isSpaMode)return null;let i=((s,f)=>{if(!window.history.state||!window.history.state.key){let m=Math.random().toString(32).slice(2);window.history.replaceState({key:m},"")}try{let p=JSON.parse(sessionStorage.getItem(s)||"{}")[f||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(m){console.error(m),sessionStorage.removeItem(s)}}).toString();return d.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${i})(${JSON.stringify(t||ir)}, ${JSON.stringify(u)})`}})}ul.displayName="ScrollRestoration";function ta(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xr(e){let t=d.useContext(Be);return V(t,ta(e)),t}function cl(e){let t=d.useContext(Ge);return V(t,ta(e)),t}function dl(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:l}={}){let u=Mo(),i=Le(),s=ut(e,{relative:o});return d.useCallback(f=>{if(ei(f,t)){f.preventDefault();let m=r!==void 0?r:Oe(i)===Oe(s);u(e,{replace:m,state:n,preventScrollReset:a,relative:o,viewTransition:l})}},[i,u,s,r,n,t,e,a,o,l])}var fl=0,hl=()=>`__${String(++fl)}__`;function ml(){let{router:e}=xr("useSubmit"),{basename:t}=d.useContext(Re),r=Ho();return d.useCallback(async(n,a={})=>{let{action:o,method:l,encType:u,formData:i,body:s}=ni(n,t);if(a.navigate===!1){let f=a.fetcherKey||hl();await e.fetch(f,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:i,body:s,formMethod:a.method||l,formEncType:a.encType||u,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:i,body:s,formMethod:a.method||l,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function pl(e,{relative:t}={}){let{basename:r}=d.useContext(Re),n=d.useContext(be);V(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...ut(e||".",{relative:t})},l=Le();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),i=u.getAll("index");if(i.some(f=>f==="")){u.delete("index"),i.filter(m=>m).forEach(m=>u.append("index",m));let f=u.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ce([r,o.pathname])),Oe(o)}var ir="react-router-scroll-positions",bt={};function lr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:me(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function yl({getKey:e,storageKey:t}={}){let{router:r}=xr("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=cl("useScrollRestoration"),{basename:o}=d.useContext(Re),l=Le(),u=yr(),i=Uo();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),vl(d.useCallback(()=>{if(i.state==="idle"){let s=lr(l,u,o,e);bt[s]=window.scrollY}try{sessionStorage.setItem(t||ir,JSON.stringify(bt))}catch(s){ne(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${s}).`)}window.history.scrollRestoration="auto"},[i.state,e,o,l,u,t])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let s=sessionStorage.getItem(t||ir);s&&(bt=JSON.parse(s))}catch{}},[t]),d.useLayoutEffect(()=>{let s=r?.enableScrollRestoration(bt,()=>window.scrollY,e?(f,m)=>lr(f,m,o,e):void 0);return()=>s&&s()},[r,o,e]),d.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(l.hash){let s=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(s){s.scrollIntoView();return}}}catch{ne(!1,`"${l.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[l,n,a]))}function vl(e,t){let{capture:r}={};d.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function gl(e,t={}){let r=d.useContext(hr);V(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=xr("useViewTransitionState"),a=ut(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=me(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=me(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Mt(a.pathname,l)!=null||Mt(a.pathname,o)!=null}export{xl as A,va as B,wl as C,Rl as D,Ue as E,Nt as F,Nl as L,$l as M,Li as N,Tl as O,ba as R,ul as S,d as a,V as b,Il as c,Pl as d,Ni as e,Er as f,Sl as g,Ol as h,ze as i,Dl as j,bl as k,kl as l,Te as m,Cl as n,Ll as o,El as p,_l as q,Ra as r,Ji as s,al as t,Al as u,Mo as v,Ml as w,ea as x,ll as y,Le as z};
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-EF7DTUVF-CZaHNoTs.js";/**
1
+ import{a as s}from"./chunk-EF7DTUVF-MlADC7xe.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{p as e,a as j,x as b,w}from"./chunk-EF7DTUVF-MlADC7xe.js";import{a as m,j as u,d as C,b as N,k as v,l as T}from"./utils-DN8wQ0jG.js";import{c as y,u as D,T as R,a as L,b as x,d as k,f as p,e as A,g as H,h as I}from"./index-BkW3jRP3.js";function G({className:a,...t}){return e.jsx("div",{"data-slot":"skeleton",className:m("bg-accent animate-pulse rounded-md",a),...t})}function f({className:a,title:t,value:r,isLoading:n,...s}){return e.jsxs("div",{className:m("border border-border rounded-xl p-6",a),...s,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:t}),n?e.jsx(G,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:r})]})}const i=y(),c=[i.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(a){const t=a.getValue();return e.jsx("span",{title:t,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:t})}}),i.accessor("createdAt",{header:"Created",cell(a){return u(new Date(a.getValue()))}}),i.accessor("updatedAt",{header:"Updated",cell(a){return u(new Date(a.getValue()))}})];function M(){const{data:a}=C(),{data:t}=N(),r=j.useMemo(()=>!a||!t?[]:Object.entries(a).filter(([o])=>o in t).reduce((o,[d,h])=>o.concat(Object.values(h).map(g=>({...g,type:d}))),[]).toSorted((o,d)=>o.updatedAt>d.updatedAt?-1:1).slice(0,6),[a,t]),n=D({data:r,columns:c,getCoreRowModel:I()});return e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(L,{children:n.getHeaderGroups().map(s=>e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.headers.map(l=>e.jsx(k,{children:l.isPlaceholder?null:p(l.column.columnDef.header,l.getContext())},l.id))},s.id))}),e.jsx(A,{children:n.getRowModel().rows.map(s=>e.jsx(b,{to:`/admin/dashboard/${s.original.type}/${s.original.id}`,children:e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.getVisibleCells().map(l=>e.jsx(H,{className:m("p-2"),children:p(l.column.columnDef.cell,l.getContext())},l.id))},s.id)},s.original.id))})]})})}const S=w(function(){const{data:t,isLoading:r}=v(),{data:n,isLoading:s}=T();return e.jsx("div",{className:"flex flex-1 h-full p-4 gap-4",children:e.jsxs("div",{className:"flex flex-col overflow-hidden flex-1 gap-4",children:[e.jsxs("div",{className:"flex flex-row gap-2 grid-cols-12",children:[e.jsx(f,{className:"w-full sm:w-44",title:"Items",value:t,isLoading:r}),e.jsx(f,{className:"w-full sm:w-44",title:"Files",value:n,isLoading:s})]}),e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Recently Updated"}),e.jsx(M,{})]})]})})});export{S as default};
@@ -0,0 +1,26 @@
1
+ import{p as e,a as u,x as p,R as V,w as $}from"./chunk-EF7DTUVF-MlADC7xe.js";import{B as L}from"./button-D_tNOZW3.js";import{j as C,m as v,d as R,n as D,o as F,a as I}from"./utils-DN8wQ0jG.js";import{c as E,u as H,T as P,a as S,b as N,d as B,f as b,e as O,g as G,h as Q}from"./index-BkW3jRP3.js";import{c as o}from"./createLucideIcon-BJQzFwzJ.js";import{C as f}from"./calendar-6ih_JEvR.js";import{T as q,F as A}from"./trash-CN5HT_ZJ.js";import{E as U}from"./external-link-D1If5twJ.js";import"./index-b67bZzAe.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],M=o("circle-check",J);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T=o("circle",K);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const W=[["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"m3 13 3.553-7.724a.5.5 0 0 1 .894 0L11 13",key:"blevx4"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M4 11h6",key:"olkgv1"}]],k=o("letter-text",W);/**
17
+ * @license lucide-react v0.487.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const X=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Y=o("list",X);/**
22
+ * @license lucide-react v0.487.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Z=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ee=o("plus",Z),ae={boolean:M,date:f,datetime:f,markdown:k,select:Y,string:k,url:U},m=E(),w=[m.accessor("id",{header(){return e.jsxs("span",{className:"flex items-center w-48 max-w-48",children:[e.jsx(T,{className:"text-gray-500 h-4"})," ID"]})},cell(s){const n=s.getValue();return e.jsx("span",{title:n,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:n})}})],se=[m.accessor("updatedAt",{header(){return e.jsxs("div",{className:"flex items-center w-48 max-w-48",children:[e.jsx(f,{className:"text-gray-500 h-4"})," Last updated"]})},cell(s){return C(new Date(s.getValue()))}})];function te({itemType:s}){const{data:n}=v(s),{data:c}=R(),[r]=D(),i=u.useMemo(()=>m.display({id:"actions",header:()=>e.jsx("span",{className:"flex justify-end ml-auto"}),cell(t){return e.jsx("div",{className:"flex gap-2 justify-end",children:e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:a=>{a.stopPropagation(),r({type:s,id:t.row.original.id})},children:[e.jsx(q,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})}}),[s,r]),h=u.useMemo(()=>{if(!n)return w;const t=Object.entries(n.fields);return[...w,...t.filter(([,a])=>a.showInSummary).map(([a,d])=>m.accessor(l=>l[a],{id:a,header(){const l=d.isUploadedFile?A:ae[d.type]??V.Fragment;return e.jsxs("div",{className:"flex items-center",children:[e.jsx(l,{className:"text-gray-500 h-4"}),d.displayName]})},cell(l){const x=l.getValue();switch(d.type){case"boolean":const _=l.getValue()?M:T;return e.jsx("span",{className:"flex justify-center items-center h-full text-nowrap",children:e.jsx(_,{className:F("mx-auto",l.getValue()?"text-green-600":"text-gray-300"),size:14})});case"url":return x?e.jsx(p,{to:x,className:"flex items-center hover:text-blue-500",children:x}):"--";case"datetime":case"date":const j=l.getValue();return j?e.jsx("span",{className:"text-nowrap",children:C(new Date(j))}):"--";case"markdown":case"string":const y=l.getValue();return e.jsx("span",{title:y,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:y});default:return l.getValue()}}})),...se,i]},[i,n]),z=u.useMemo(()=>c?.[s]?Object.values(c[s]):[],[s,c]),g=H({data:z,columns:h,getCoreRowModel:Q()});return!n||!c?null:e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(P,{children:[e.jsx(S,{className:"sticky top-0 z-50",children:g.getHeaderGroups().map(t=>e.jsx(N,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:t.headers.map(a=>e.jsx(B,{className:"bg-background",children:a.isPlaceholder?null:b(a.column.columnDef.header,a.getContext())},a.id))},t.id))}),e.jsx(O,{children:g.getRowModel().rows.map(t=>e.jsx(p,{to:`/admin/dashboard/${s}/${t.original.id}`,children:e.jsx(N,{className:"grid",style:{gridTemplateColumns:`repeat(${h.length}, minmax(200px, 1fr))`},children:t.getVisibleCells().map(a=>e.jsx(G,{className:I("h-10"),children:b(a.column.columnDef.cell,a.getContext())},a.id))})},t.id))})]})})}const xe=$(function({params:n}){const{collectionId:c}=n,{data:r,isFetching:i}=v(c);return i||!r?null:e.jsx("div",{className:"overflow-hidden flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col overflow-hidden flex-1 gap-8",children:e.jsxs("div",{className:"flex flex-col h-full gap-4 last:mb-20",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",id:r.displayName,children:r.displayName}),e.jsx(L,{asChild:!0,variant:"default",size:"sm",className:"ml-auto",children:e.jsxs(p,{to:`/admin/dashboard/${c}/new`,children:[e.jsx(ee,{}),"Create"]})})]}),e.jsx(te,{itemType:c},c)]})})})});export{xe as default};
@@ -0,0 +1 @@
1
+ import{w as c,p as e}from"./chunk-EF7DTUVF-MlADC7xe.js";import{I as p}from"./itemForm-GgzEy97l.js";import{m as n,p as d}from"./utils-DN8wQ0jG.js";import"./button-D_tNOZW3.js";import"./index-b67bZzAe.js";import"./types-DI1nugUt.js";import"./index-BKOWzfnu.js";import"./index-xBXWoUIa.js";import"./createLucideIcon-BJQzFwzJ.js";import"./index-BCIQh_1v.js";import"./authSlice-Ck6mjgyY.js";import"./upload-CopmcV94.js";import"./calendar-6ih_JEvR.js";import"./files-JeyUc7x_.js";import"./trash-CN5HT_ZJ.js";import"./external-link-D1If5twJ.js";const N=c(function({params:r}){const{collectionId:t,documentId:i}=r,{data:o,isFetching:s}=n(t),{data:m,isFetching:a}=d({itemType:t,id:i});return!o||!m||(s||a)?null:e.jsx("div",{className:"overflow-auto",children:e.jsx("div",{className:"flex p-4 gap-4",children:e.jsx(p,{itemType:t,fields:o.fields,data:m},`${t}-${i}`)})})});export{N as default};
@@ -0,0 +1 @@
1
+ import{w as e,p as o}from"./chunk-EF7DTUVF-MlADC7xe.js";import{I as m}from"./itemForm-GgzEy97l.js";import{m as p}from"./utils-DN8wQ0jG.js";import"./button-D_tNOZW3.js";import"./index-b67bZzAe.js";import"./types-DI1nugUt.js";import"./index-BKOWzfnu.js";import"./index-xBXWoUIa.js";import"./createLucideIcon-BJQzFwzJ.js";import"./index-BCIQh_1v.js";import"./authSlice-Ck6mjgyY.js";import"./upload-CopmcV94.js";import"./calendar-6ih_JEvR.js";import"./files-JeyUc7x_.js";import"./trash-CN5HT_ZJ.js";import"./external-link-D1If5twJ.js";const P=e(function({params:i}){const{collectionId:t}=i,{data:r}=p(t);return r?o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(m,{itemType:t,fields:r.fields,isNew:!0})})}):null});export{P as default};
@@ -0,0 +1,46 @@
1
+ import{p as e,a as d,x as y,y as U,v as le,z as ce,R as ue,w as he,O as pe}from"./chunk-EF7DTUVF-MlADC7xe.js";import{u as xe,e as D,h as fe}from"./authSlice-Ck6mjgyY.js";import{a as r,b as W,d as be,f as ge,g as me,h as je,u as ve,i as we}from"./utils-DN8wQ0jG.js";import{R as Q,C as X,a as Z,X as Y,T as J,D as ee,P as te,O as ae,b as ye,c as Ne,d as Ce,e as Se,f as ke,g as _e,A as Me,u as ze,h as De}from"./index-BCIQh_1v.js";import{B as _}from"./button-D_tNOZW3.js";import{c as b}from"./createLucideIcon-BJQzFwzJ.js";import{S as E,c as Ee,u as Oe}from"./index-b67bZzAe.js";import{u as Re,c as Ae,P as O,a as Pe,b as Ie,d as Te}from"./index-BKOWzfnu.js";import{C as L,U as Le}from"./upload-CopmcV94.js";import{E as $e}from"./external-link-D1If5twJ.js";import"./index-xBXWoUIa.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Be=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ge=b("arrow-down",Be);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const He=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Fe=b("arrow-up",He);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const qe=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],Ve=b("blocks",qe);/**
17
+ * @license lucide-react v0.487.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Ke=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Ue=b("files",Ke);/**
22
+ * @license lucide-react v0.487.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const We=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Qe=b("grid-3x3",We);/**
27
+ * @license lucide-react v0.487.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Xe=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],Ze=b("heart",Xe);/**
32
+ * @license lucide-react v0.487.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Ye=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Je=b("log-out",Ye);/**
37
+ * @license lucide-react v0.487.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tt=b("panel-left",et);/**
42
+ * @license lucide-react v0.487.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const at=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],st=b("square",at);function nt({...t}){return e.jsx(Q,{"data-slot":"dialog",...t})}function ot({...t}){return e.jsx(te,{"data-slot":"dialog-portal",...t})}function it({className:t,...a}){return e.jsx(ae,{"data-slot":"dialog-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function rt({className:t,children:a,...n}){return e.jsxs(ot,{"data-slot":"dialog-portal",children:[e.jsx(it,{}),e.jsxs(X,{"data-slot":"dialog-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(Y,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function dt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2 text-center sm:text-left",t),...a})}function lt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ct({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function ut({className:t,...a}){return e.jsx(ee,{"data-slot":"dialog-description",className:r("text-muted-foreground text-sm",t),...a})}const ht="#181717",pt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ht),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),xt="#85EA2D",$=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=xt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function ft({isOpen:t,setOpen:a}){return e.jsx(nt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(rt,{children:[e.jsxs(dt,{children:[e.jsx(ct,{children:"Editorial"}),e.jsx(ut,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx($,{size:14}),"Documentation"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"/doc",children:[e.jsx($,{size:14}),"Swagger API UI"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(pt,{size:14}),"GitHub repository"]})})]}),e.jsx(lt,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ze,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(y,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function bt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(ye,{"data-slot":"separator-root",decorative:n,orientation:a,className:r("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function gt({...t}){return e.jsx(Q,{"data-slot":"sheet",...t})}function mt({...t}){return e.jsx(te,{"data-slot":"sheet-portal",...t})}function jt({className:t,...a}){return e.jsx(ae,{"data-slot":"sheet-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function vt({className:t,children:a,side:n="right",...s}){return e.jsxs(mt,{children:[e.jsx(jt,{}),e.jsxs(X,{"data-slot":"sheet-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(Y,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:r("flex flex-col gap-1.5 p-4",t),...a})}function yt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Nt({className:t,...a}){return e.jsx(ee,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function se({delayDuration:t=0,...a}){return e.jsx(Ne,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function Ct({...t}){return e.jsx(se,{children:e.jsx(Ce,{"data-slot":"tooltip",...t})})}function St({...t}){return e.jsx(Se,{"data-slot":"tooltip-trigger",...t})}function kt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(ke,{children:e.jsxs(_e,{"data-slot":"tooltip-content",sideOffset:a,className:r("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(Me,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const z=768;function _t(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${z-1}px)`),s=()=>{a(window.innerWidth<z)};return n.addEventListener("change",s),a(window.innerWidth<z),()=>n.removeEventListener("change",s)},[]),!!t}const Mt="sidebar_state",zt=3600*24*7,Dt="16rem",Et="18rem",Ot="3rem",Rt="b",ne=d.createContext(null);function R(){const t=d.useContext(ne);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function At({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...l}){const u=_t(),[x,h]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(p=>{const c=typeof p=="function"?p(m):p;n?n(c):C(c),document.cookie=`${Mt}=${c}; path=/; max-age=${zt}`},[n,m]),v=d.useCallback(()=>u?h(p=>!p):j(p=>!p),[u,j,h]);d.useEffect(()=>{const p=c=>{c.key===Rt&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),v())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[v]);const N=m?"expanded":"collapsed",S=d.useMemo(()=>({state:N,open:m,setOpen:j,isMobile:u,openMobile:x,setOpenMobile:h,toggleSidebar:v}),[N,m,j,u,x,h,v]);return e.jsx(ne.Provider,{value:S,children:e.jsx(se,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Dt,"--sidebar-width-icon":Ot,...o},className:r("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:i})})})}function Pt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:l,state:u,openMobile:x,setOpenMobile:h}=R();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:r("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...i,children:o}):l?e.jsx(gt,{open:x,onOpenChange:h,...i,children:e.jsxs(vt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Et},side:t,children:[e.jsxs(wt,{className:"sr-only",children:[e.jsx(yt,{children:"Sidebar"}),e.jsx(Nt,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:r("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:r("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...i,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function It({className:t,onClick:a,...n}){const{toggleSidebar:s}=R();return e.jsxs(_,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:r("size-7",t),onClick:o=>{a?.(o),s()},...n,children:[e.jsx(tt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Tt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r("flex flex-col gap-2 p-2",t),...a})}function Lt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r("flex flex-col gap-2 p-2",t),...a})}function $t({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function k({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r("relative flex w-full min-w-0 flex-col p-2",t),...a})}function B({className:t,asChild:a=!1,...n}){const s=a?E:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:r("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function G({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r("w-full text-sm",t),...a})}function H({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r("group/menu-item relative",t),...a})}const Bt=Ee("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function f({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:i,...l}){const u=t?E:"button",{isMobile:x,state:h}=R(),g=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:r(Bt({variant:n,size:s}),i),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(Ct,{children:[e.jsx(St,{asChild:!0,children:g}),e.jsx(kt,{side:"right",align:"center",hidden:h!=="collapsed"||x,...o})]})):g}function Gt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:r("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Ht({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?E:"a";return e.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:r("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function F({singleton:t}){const{data:a}=W(),{data:n}=be();return a?(d.useMemo(()=>Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton),[a]),e.jsx(e.Fragment,{children:Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton).map(([s,o])=>e.jsx(Gt,{children:e.jsx(U,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:i,isPending:l})=>l?"pending":i?"active":"",children:({isActive:i})=>e.jsx(Ht,{isActive:i,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap",children:o.displayName}),!t&&n?.[s]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[s]).length})]})})})},o.displayName))})):null}var M="Collapsible",[Ft,ra]=Ae(M),[qt,A]=Ft(M),oe=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:l,...u}=t,[x,h]=Re({prop:s,defaultProp:o??!1,onChange:l,caller:M});return e.jsx(qt,{scope:n,disabled:i,contentId:ze(),open:x,onOpenToggle:d.useCallback(()=>h(g=>!g),[h]),children:e.jsx(O.div,{"data-state":I(x),"data-disabled":i?"":void 0,...u,ref:a})})});oe.displayName=M;var ie="CollapsibleTrigger",re=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=A(ie,n);return e.jsx(O.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Pe(t.onClick,o.onOpenToggle)})});re.displayName=ie;var P="CollapsibleContent",de=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=A(P,t.__scopeCollapsible);return e.jsx(Ie,{present:n||o.open,children:({present:i})=>e.jsx(Vt,{...s,ref:a,present:i})})});de.displayName=P;var Vt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,l=A(P,n),[u,x]=d.useState(s),h=d.useRef(null),g=Oe(a,h),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,N=l.open||u,S=d.useRef(N),p=d.useRef(void 0);return d.useEffect(()=>{const c=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(c)},[]),Te(()=>{const c=h.current;if(c){p.current=p.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const T=c.getBoundingClientRect();C.current=T.height,j.current=T.width,S.current||(c.style.transitionDuration=p.current.transitionDuration,c.style.animationName=p.current.animationName),x(s)}},[l.open,s]),e.jsx(O.div,{"data-state":I(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!N,...i,ref:g,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:N&&o})});function I(t){return t?"open":"closed"}var Kt=oe;function q({...t}){return e.jsx(Kt,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(re,{"data-slot":"collapsible-trigger",...t})}function K({...t}){return e.jsx(de,{"data-slot":"collapsible-content",...t})}function Ut(){const t=xe(),[a,n]=d.useState(!1),[s]=ge(),[o]=me(),[i]=je(),{data:l}=ve(),{data:u}=we(),x=D(h=>h.auth.role);return e.jsxs(Pt,{className:"z-50",children:[e.jsx(ft,{isOpen:a,setOpen:n}),e.jsx(Tt,{className:"h-14 justify-center",children:e.jsx(k,{children:e.jsx(y,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:l?.name})})}),e.jsxs($t,{children:[e.jsxs(k,{children:[e.jsx(B,{children:"Content"}),e.jsx(G,{children:e.jsxs(H,{children:[e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{className:"group",children:[e.jsx(Qe,{}),e.jsx("span",{children:"Collections"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{})})]})}),e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{className:"group",children:[e.jsx(st,{}),e.jsx("span",{children:"Singles"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:"/admin/dashboard/files",children:[e.jsx(Ue,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(f,{disabled:!0,children:[e.jsx(Ve,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(k,{children:[e.jsx(B,{children:"Actions"}),e.jsx(G,{children:e.jsxs(H,{children:[x==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx(Ge,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>i(),children:[e.jsx(Fe,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>s(),children:[e.jsx(Le,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(k,{})]}),e.jsxs(Lt,{children:[e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:l?.previewUrl,children:["Preview",e.jsx($e,{className:"ml-auto"})]})}),e.jsx(f,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(f,{className:"cursor-pointer",onClick:()=>t(fe()),children:[e.jsx(Je,{}),"Log out"]})]})]})}function Wt({children:t}){const a=le(),n=D(o=>o.auth.user),s=D(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?null:t}function Qt(){const{pathname:t}=ce(),{data:a}=W(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(ue.Fragment,{children:[i.length>1&&o>=1&&e.jsx(De,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsxs("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:[o<i.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),o<i.length-1&&a[s]&&!a[s].singleton&&e.jsx(U,{to:`/admin/dashboard/${s}`,className:({isActive:l,isPending:u})=>u?"pending":l?"active":"",children:a[s]?a[s].displayName:s}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const da=he(function(){return e.jsx(Wt,{children:e.jsxs(At,{className:"flex h-full",children:[e.jsx(Ut,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(It,{}),e.jsx(bt,{orientation:"vertical",className:"h-4"}),e.jsx(Qt,{})]})}),e.jsx(pe,{})]})]})})});export{da as default};
@@ -0,0 +1 @@
1
+ import{w as e,p as o}from"./chunk-EF7DTUVF-MlADC7xe.js";import{F as r}from"./files-JeyUc7x_.js";import"./authSlice-Ck6mjgyY.js";import"./utils-DN8wQ0jG.js";import"./index-b67bZzAe.js";import"./upload-CopmcV94.js";import"./createLucideIcon-BJQzFwzJ.js";import"./trash-CN5HT_ZJ.js";const n=e(function(){return o.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:o.jsx("div",{className:"flex flex-col flex-1 gap-8",children:o.jsx(r,{})})})});export{n as default};